Remove more unused code. - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 1f5fc0950bb08cb37a2c290dee7bef704a338d8e | |
parent 912aa48f90f2c9b807957d2bf5c646c39d704cd3 | |
Author: Rob King <[email protected]> | |
Date: Tue, 6 Sep 2016 21:10:10 -0500 | |
Remove more unused code. | |
Diffstat: | |
include/libg.h | 19 ++++++------------- | |
libXg/Makefile | 2 +- | |
libXg/menuhit.c | 4 ++-- | |
libXg/xtbinit.c | 83 ------------------------------- | |
4 files changed, 9 insertions(+), 99 deletions(-) | |
--- | |
diff --git a/include/libg.h b/include/libg.h | |
@@ -157,16 +157,9 @@ extern void bclose(void); | |
extern void berror(char*); | |
extern void bitblt2(Bitmap*, Point, Bitmap*, Rectangle, Fcode, unsigned long,… | |
extern void bitblt(Bitmap*, Point, Bitmap*, Rectangle, Fcode); | |
-extern void copymasked(Bitmap*, Point, Bitmap*, Bitmap*, Rectangle); | |
-extern int bitbltclip(void*); | |
+ | |
+ | |
extern Point string(Bitmap*, Point, XftFont*, char*, Fcode); | |
-extern void segment(Bitmap*, Point, Point, int, Fcode); | |
-extern void point(Bitmap*, Point, int, Fcode); | |
-extern void arc(Bitmap*, Point, Point, Point, int, Fcode); | |
-extern void circle(Bitmap*, Point, int, int, Fcode); | |
-extern void disc(Bitmap*, Point, int, int, Fcode); | |
-extern void ellipse(Bitmap*, Point, int, int, int, Fcode); | |
-extern void polysegment(Bitmap *, int, Point *, int, Fcode); | |
extern long strwidth(XftFont*, char*); | |
extern Point strsize(XftFont*, char*); | |
extern long charwidth(XftFont*, Rune); | |
@@ -184,14 +177,14 @@ extern void cursorswitch(unsigned int); | |
extern void cursorset(Point); | |
extern Rectangle bscreenrect(Rectangle*); | |
extern void bflush(void); | |
-extern int clipline(Rectangle, Point*, Point*); | |
+ | |
extern int clipr(Bitmap*, Rectangle); | |
extern int scrpix(int*,int*); | |
extern unsigned long getbg(void); | |
extern void einit(unsigned long); | |
extern unsigned long estart(unsigned long, int, int); | |
-extern unsigned long etimer(unsigned long, long); | |
+ | |
extern unsigned long event(Event*); | |
extern unsigned long eread(unsigned long, Event*); | |
extern Mouse emouse(void); | |
@@ -201,10 +194,10 @@ extern int ecanread(unsigned long); | |
extern int ecanmouse(void); | |
extern int ecankbd(void); | |
extern void ereshaped(Rectangle); /* supplied by user */ | |
-extern void eflush(unsigned long); | |
+ | |
extern int menuhit(int, Mouse*, Menu*); | |
extern Rectangle getrect(int, Mouse*); | |
-extern unsigned long rgbpix(Bitmap*, RGB); | |
+ | |
extern void rdcolmap(Bitmap*, RGB*); | |
extern void wrcolmap(Bitmap*, RGB*); | |
extern void raisewindow(void); | |
diff --git a/libXg/Makefile b/libXg/Makefile | |
@@ -26,7 +26,7 @@ CC?=c99 | |
OBJS= arith.o balloc.o bitblt.o border.o bscreenrect.o\ | |
clipr.o cursorset.o cursorswitch.o\ | |
font.o gcs.o getrect.o gwin.o ldconvert.o latin1.o\ | |
- menuhit.o point.o rdbitmap.o \ | |
+ menuhit.o rdbitmap.o \ | |
rectclip.o rune.o string.o strwidth.o texture.o\ | |
wrbitmap.o xtbinit.o | |
diff --git a/libXg/menuhit.c b/libXg/menuhit.c | |
@@ -123,8 +123,8 @@ menuscrollpaint(Rectangle scrollr, int off, int nitem, int … | |
if(menutxt) | |
wrbitmap(menutxt, 0, 16, menutxtbits); | |
} | |
- if(menutxt) | |
- texture(&screen, inset(r, 1), menutxt, S); | |
+ /* XXX if(menutxt) | |
+ texture(&screen, inset(r, 1), menutxt, S); */ | |
} | |
int | |
diff --git a/libXg/xtbinit.c b/libXg/xtbinit.c | |
@@ -424,45 +424,6 @@ pixtocolor(Pixel p, XColor *pc) | |
#endif | |
} | |
-unsigned long | |
-rgbpix(Bitmap *b, RGB col) | |
-{ | |
- XColor c; | |
- Colormap cmap; | |
- Arg args[2]; | |
- int n, depth, dr, dg, db; | |
- RGB map[256], *m; | |
- unsigned long d, max, pixel; | |
- | |
- if (!_cmap_installed) { | |
- n = 0; | |
- XtSetArg(args[n], XtNcolormap, &cmap); n++; | |
- XtGetValues(_toplevel, args, n); | |
- c.red = col.red>>16; | |
- c.green = col.green>>16; | |
- c.blue = col.blue>>16; | |
- c.flags = DoRed|DoGreen|DoBlue; | |
- if(XAllocColor(_dpy, cmap, &c)) | |
- return (unsigned long)(c.pixel); | |
- } | |
- depth = _ld2d[screen.ldepth]; | |
- rdcolmap(&screen, map); | |
- max = -1; | |
- for (n = 0, m = map; n < (1 << depth); n++, m++) | |
- { | |
- dr = m->red - col.red; | |
- dg = m->green - col.green; | |
- db = m->blue - col.blue; | |
- d = dr*dr+dg*dg+db*db; | |
- if (d < max || max == -1) | |
- { | |
- max = d; | |
- pixel = n; | |
- } | |
- } | |
- return pixel; | |
-} | |
- | |
void | |
rdcolmap(Bitmap *b, RGB *map) | |
{ | |
@@ -602,29 +563,6 @@ estart(unsigned long key, int fd, int n) | |
} | |
unsigned long | |
-etimer(unsigned long key, long n) | |
-{ | |
- int i; | |
- | |
- if(Stimer != -1) | |
- berror("timer started twice"); | |
- if(n <= 0) | |
- n = 1000; | |
- for(i=0; i<MAXSRC; i++) | |
- if((key & ~(1<<i)) == 0 && !esrc[i].inuse){ | |
- if(nsrc <= i) | |
- nsrc = i+1; | |
- esrc[i].inuse = 1; | |
- esrc[i].size = 0; | |
- esrc[i].count = 0; | |
- XtAppAddTimeOut(app, n, gottimeout, (XtPointer)n); | |
- Stimer = i; | |
- return 1<<i; | |
- } | |
- return 0; | |
-} | |
- | |
-unsigned long | |
event(Event *e) | |
{ | |
return eread(~0L, e); | |
@@ -665,27 +603,6 @@ eread(unsigned long keys, Event *e) | |
} | |
} | |
-void | |
-eflush(unsigned long keys) | |
-{ | |
- int i; | |
- Ebuf *eb, *enext; | |
- | |
- if(keys == 0) | |
- return; | |
- | |
- for(i=0; i<nsrc; i++) | |
- if((keys & (1<<i))){ | |
- for (eb = esrc[i].head; eb; eb = enext) { | |
- enext = eb->next; | |
- free(eb); | |
- } | |
- esrc[i].count = 0; | |
- esrc[i].head = 0; | |
- esrc[i].tail = 0; | |
- } | |
-} | |
- | |
Mouse | |
emouse(void) | |
{ |