diff options
author | jenglish <jenglish@flightlab.com> | 2007-01-11 19:59:26 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2007-01-11 19:59:26 (GMT) |
commit | c48f4f5bf3717299252cba2e4faa31f395ce1689 (patch) | |
tree | 8277dd861a947f2adb0b4634f031f9c651f7e8d0 /generic/ttk/ttkClamTheme.c | |
parent | 72b0a491e8d2e18f644d6698540fbe79918d17ea (diff) | |
download | tk-c48f4f5bf3717299252cba2e4faa31f395ce1689.zip tk-c48f4f5bf3717299252cba2e4faa31f395ce1689.tar.gz tk-c48f4f5bf3717299252cba2e4faa31f395ce1689.tar.bz2 |
Revert previous change to keep in sync with Tile codebase.
The minor warnings from GCC fixed in the previous revision
were false positives due to improper use of "-Wconversion".
Still compiles cleanly with "gcc -Wall -Werror" (gcc 3.3.5).
Diffstat (limited to 'generic/ttk/ttkClamTheme.c')
-rw-r--r-- | generic/ttk/ttkClamTheme.c | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 0638e52..f64b138 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkClamTheme.c,v 1.4 2007/01/11 15:35:39 dkf Exp $ + * $Id: ttkClamTheme.c,v 1.5 2007/01/11 19:59:26 jenglish Exp $ * * Copyright (C) 2004 Joe English * @@ -324,22 +324,16 @@ RadioIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); - XFillArc(Tk_Display(tkwin),d,gcb, - b.x,b.y,(unsigned)b.width,(unsigned)b.height, 0,360*64); - XDrawArc(Tk_Display(tkwin),d,gcl, - b.x,b.y,(unsigned)b.width,(unsigned)b.height, 225*64,180*64); - XDrawArc(Tk_Display(tkwin),d,gcu, - b.x,b.y,(unsigned)b.width,(unsigned)b.height, 45*64,180*64); + XFillArc(Tk_Display(tkwin),d,gcb, b.x,b.y,b.width,b.height, 0,360*64); + XDrawArc(Tk_Display(tkwin),d,gcl, b.x,b.y,b.width,b.height, 225*64,180*64); + XDrawArc(Tk_Display(tkwin),d,gcu, b.x,b.y,b.width,b.height, 45*64,180*64); if (state & TTK_STATE_SELECTED) { b = Ttk_PadBox(b,Ttk_UniformPadding(3)); - XFillArc(Tk_Display(tkwin),d,gcf, - b.x,b.y,(unsigned)b.width,(unsigned)b.height, 0,360*64); - XDrawArc(Tk_Display(tkwin),d,gcf, - b.x,b.y,(unsigned)b.width,(unsigned)b.height, 0,360*64); + XFillArc(Tk_Display(tkwin),d,gcf, b.x,b.y,b.width,b.height, 0,360*64); + XDrawArc(Tk_Display(tkwin),d,gcf, b.x,b.y,b.width,b.height, 0,360*64); #if WIN32_XDRAWLINE_HACK - XDrawArc(Tk_Display(tkwin),d,gcf, - b.x,b.y,(unsigned)b.width,(unsigned)b.height, 300*64,360*64); + XDrawArc(Tk_Display(tkwin),d,gcf, b.x,b.y,b.width,b.height, 300*64,360*64); #endif } } @@ -361,10 +355,9 @@ CheckIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); - XFillRectangle(display,d,gcb, b.x,b.y, - (unsigned)b.width,(unsigned)b.height); - XDrawLine(display,d,gcl, b.x,b.y+b.height,b.x+b.width+w,b.y+b.height);/*S*/ - XDrawLine(display,d,gcl, b.x+b.width,b.y,b.x+b.width,b.y+b.height+w); /*E*/ + XFillRectangle(display,d,gcb, b.x,b.y,b.width,b.height); + XDrawLine(display,d,gcl,b.x,b.y+b.height,b.x+b.width+w,b.y+b.height);/*S*/ + XDrawLine(display,d,gcl,b.x+b.width,b.y,b.x+b.width,b.y+b.height+w); /*E*/ XDrawLine(display,d,gcu,b.x,b.y, b.x,b.y+b.height+w); /*W*/ XDrawLine(display,d,gcu,b.x,b.y, b.x+b.width+w,b.y); /*N*/ @@ -593,10 +586,8 @@ static void TroughElementDraw( ScrollbarElement *sb = elementRecord; GC gcb = Ttk_GCForColor(tkwin,sb->borderColorObj,d); GC gct = Ttk_GCForColor(tkwin,sb->troughColorObj,d); - XFillRectangle(Tk_Display(tkwin), d, gct, b.x, b.y, - (unsigned)b.width-1, (unsigned)b.height-1); - XDrawRectangle(Tk_Display(tkwin), d, gcb, b.x, b.y, - (unsigned)b.width-1, (unsigned)b.height-1); + XFillRectangle(Tk_Display(tkwin), d, gct, b.x, b.y, b.width-1, b.height-1); + XDrawRectangle(Tk_Display(tkwin), d, gcb, b.x, b.y, b.width-1, b.height-1); } static Ttk_ElementSpec TroughElementSpec = { @@ -628,10 +619,10 @@ static void ThumbElementDraw( const int w = WIN32_XDRAWLINE_HACK; DrawSmoothBorder(tkwin, d, b, - sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); - XFillRectangle(Tk_Display(tkwin), d, - BackgroundGC(tkwin, sb->backgroundObj), b.x+2, b.y+2, - (unsigned)b.width-4, (unsigned)b.height-4); + sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); + XFillRectangle( + Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), + b.x+2, b.y+2, b.width-4, b.height-4); /* * Draw grip: @@ -640,7 +631,7 @@ static void ThumbElementDraw( Tcl_GetIntFromObj(NULL, sb->gripCountObj, &gripCount); lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d); darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d); - + if (orient == TTK_ORIENT_HORIZONTAL) { dx = 1; dy = 0; x1 = x2 = b.x + b.width / 2 - gripCount; @@ -718,14 +709,14 @@ static void PbarElementDraw( Drawable d, Ttk_Box b, unsigned state) { ScrollbarElement *sb = elementRecord; - + b = Ttk_PadBox(b, Ttk_UniformPadding(2)); if (b.width > 4 && b.height > 4) { DrawSmoothBorder(tkwin, d, b, - sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); - XFillRectangle(Tk_Display(tkwin), d, - BackgroundGC(tkwin, sb->backgroundObj), - b.x+2, b.y+2, (unsigned)b.width-4, (unsigned)b.height-4); + sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); + XFillRectangle(Tk_Display(tkwin), d, + BackgroundGC(tkwin, sb->backgroundObj), + b.x+2, b.y+2, b.width-4, b.height-4); } } @@ -763,11 +754,11 @@ static void ArrowElementDraw( int h, cx, cy; DrawSmoothBorder(tkwin, d, b, - sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); + sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); XFillRectangle( - Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), - b.x+2, b.y+2, (unsigned)b.width-4, (unsigned)b.height-4); + Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), + b.x+2, b.y+2, b.width-4, b.height-4); b = Ttk_PadBox(b, Ttk_UniformPadding(3)); h = b.width < b.height ? b.width : b.height; |