From: root Date: Mon, 16 Jan 2006 17:11:12 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=e337eb1f38b28fb23d36889bea972371c7a81dbf;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/src/Makefile.in b/src/Makefile.in index 537fabc0..793fd7ec 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -21,7 +21,7 @@ dummy: COMMON = \ command.o rxvtfont.o init.o logging.o main.o misc.o netdisp.o \ - ptytty.o screen.o \ scrollbar.o scrollbar-next.o scrollbar-rxvt.o \ + ptytty.o screen.o scrollbar.o scrollbar-next.o scrollbar-rxvt.o \ scrollbar-xterm.o scrollbar-plain.o xdefaults.o xpm.o encoding.o \ rxvttoolkit.o rxvtutil.o iom.o keyboard.o @PERL_O@ diff --git a/src/misc.C b/src/misc.C index 97c4215a..0cb20126 100644 --- a/src/misc.C +++ b/src/misc.C @@ -538,32 +538,6 @@ rxvt_File_find (const char *file, const char *ext, const char *path) } #endif -/*----------------------------------------------------------------------* - * miscellaneous drawing routines - */ - -/* - * Draw top/left and bottom/right border shadows around windows - */ -#ifdef RXVT_SCROLLBAR -void -rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) -{ - int shadow; - - shadow = (w == 0 || h == 0) ? 1 : 2; - w += x - 1; - h += y - 1; - for (; shadow-- > 0; x++, y++, w--, h--) - { - XDrawLine (display, win, topShadow, x, y, w, y); - XDrawLine (display, win, topShadow, x, y, x, h); - XDrawLine (display, win, botShadow, w, h, w, y + 1); - XDrawLine (display, win, botShadow, w, h, x + 1, h); - } -} -#endif - // should not be used in interactive programs, for obvious reasons void rxvt_usleep (int usecs) { diff --git a/src/rxvt.h b/src/rxvt.h index 4fbeb019..daf0b2d5 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -131,8 +131,6 @@ int rxvt_Str_escaped (char *str); char ** rxvt_splitcommastring (const char *cs); void rxvt_freecommastring (char **cs); char * rxvt_File_find (const char *file, const char *ext, const char *path); -void rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h); -void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type); void rxvt_usleep (int usecs); ///////////////////////////////////////////////////////////////////////////// diff --git a/src/scrollbar-rxvt.C b/src/scrollbar-rxvt.C index 9e1bcf58..87a7c882 100644 --- a/src/scrollbar-rxvt.C +++ b/src/scrollbar-rxvt.C @@ -27,7 +27,24 @@ /*----------------------------------------------------------------------*/ #if defined(RXVT_SCROLLBAR) -#define DOUBLED 1 +#define SHADOW_WIDTH 1 + +static void +rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) +{ + int shadow; + + shadow = (w == 0 || h == 0) ? 1 : SHADOW_WIDTH; + w += x - 1; + h += y - 1; + for (; shadow-- > 0; x++, y++, w--, h--) + { + XDrawLine (display, win, topShadow, x, y, w, y); + XDrawLine (display, win, topShadow, x, y, x, h); + XDrawLine (display, win, botShadow, w, h, w, y + 1); + XDrawLine (display, win, botShadow, w, h, x + 1, h); + } +} /* draw triangular button with a shadow of 2 pixels */ void @@ -82,7 +99,7 @@ rxvt_term::Draw_button (int x, int y, int state, int dirn) XDrawLine (display->display, scrollBar.win, top, pt[0].x, pt[0].y, pt[1].x, pt[1].y); -#if DOUBLED +#if SHADOW_WIDTH > 1 /* doubled */ pt[0].x++; @@ -109,7 +126,7 @@ rxvt_term::Draw_button (int x, int y, int state, int dirn) XDrawLine (display->display, scrollBar.win, bot, pt[2].x, pt[2].y, pt[1].x, pt[1].y); -#if DOUBLED +#if SHADOW_WIDTH > 1 /* doubled */ pt[1].x--; if (dirn == UP)