Mercurial > hg > xemacs-beta
comparison lwlib/xlwscrollbar.c @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | 2f8bb876ab1d |
children |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
483 { | 483 { |
484 return w->sb.arrowPosition && w->sb.arrowPosition[0] == 's' ? True : False; | 484 return w->sb.arrowPosition && w->sb.arrowPosition[0] == 's' ? True : False; |
485 } | 485 } |
486 | 486 |
487 /*-------------------------- GC and Pixel allocation --------------------*/ | 487 /*-------------------------- GC and Pixel allocation --------------------*/ |
488 #ifdef NEED_MOTIF | |
488 #ifndef XmUNSPECIFIED_PIXMAP | 489 #ifndef XmUNSPECIFIED_PIXMAP |
489 #define XmUNSPECIFIED_PIXMAP 2 | 490 #define XmUNSPECIFIED_PIXMAP 2 |
490 #endif | 491 #endif |
492 #endif /* NEED_MOTIF */ | |
491 | 493 |
492 static GC | 494 static GC |
493 get_gc (XlwScrollBarWidget w, Pixel fg, Pixel bg, Pixmap pm) | 495 get_gc (XlwScrollBarWidget w, Pixel fg, Pixel bg, Pixmap pm) |
494 { | 496 { |
495 XGCValues values; | 497 XGCValues values; |
510 values.background = bg; | 512 values.background = bg; |
511 values.fill_style = FillOpaqueStippled; | 513 values.fill_style = FillOpaqueStippled; |
512 values.stipple = pm; | 514 values.stipple = pm; |
513 /* mask = GCForeground | GCBackground | | 515 /* mask = GCForeground | GCBackground | |
514 (pm == None ? 0 : GCStipple | GCFillStyle); gtb */ | 516 (pm == None ? 0 : GCStipple | GCFillStyle); gtb */ |
517 #ifdef NEED_MOTIF | |
515 if (pm != None && pm != 0 && pm != XmUNSPECIFIED_PIXMAP) | 518 if (pm != None && pm != 0 && pm != XmUNSPECIFIED_PIXMAP) |
516 values.stipple = pm; | 519 values.stipple = pm; |
517 else | 520 else |
518 values.stipple = None; | 521 values.stipple = None; |
522 #else | |
523 values.stipple = pm; | |
524 #endif /* NEED_MOTIF */ | |
519 mask = GCForeground | GCBackground | | 525 mask = GCForeground | GCBackground | |
520 (values.stipple == None ? 0 : GCStipple | GCFillStyle); | 526 (values.stipple == None ? 0 : GCStipple | GCFillStyle); |
521 | 527 |
522 return XtGetGC((Widget) w, mask, &values); | 528 return XtGetGC((Widget) w, mask, &values); |
523 } | 529 } |
971 | 977 |
972 /* Don't let slider get smaller than SS_MIN */ | 978 /* Don't let slider get smaller than SS_MIN */ |
973 if (ss < SS_MIN) | 979 if (ss < SS_MIN) |
974 { | 980 { |
975 /* add a percent amount for integer rounding */ | 981 /* add a percent amount for integer rounding */ |
976 float tmp = (((float) (SS_MIN - ss) * (float) value) / total) + 0.5; | 982 float tmp = ((((float) (SS_MIN - ss) * (float) value)) / total) + 0.5; |
977 | 983 |
978 above -= (int) tmp; | 984 above -= (int) tmp; |
979 ss = SS_MIN; | 985 ss = SS_MIN; |
980 below = (int) ((height) - (ss + above)); | 986 below = (int) ((height) - (ss + above)); |
981 | 987 |