|
|
values.graphics_exposures = False; | values.graphics_exposures = False; |
| |
mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; | mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; |
smask = mask | GCStipple | GCFillStyle; |
smask = mask | GCFillStyle; |
| |
XmI18List_gc(ilist) = XtGetGC(w, mask, &values); | XmI18List_gc(ilist) = XtGetGC(w, mask, &values); |
| |
|
|
XmI18List_entry_background_gc(ilist) = XtGetGC(w, mask, &values); | XmI18List_entry_background_gc(ilist) = XtGetGC(w, mask, &values); |
} | } |
| |
|
/*added for gray insensitive foreground (instead stipple)*/ |
|
values.foreground=_XmAssignInsensitiveColor(w); |
XmI18List_stippled_gc(ilist) = XtGetGC(w, smask, &values); | XmI18List_stippled_gc(ilist) = XtGetGC(w, smask, &values); |
| |
if (XmI18List_entry_background_use(ilist)) | if (XmI18List_entry_background_use(ilist)) |
|
|
values.fill_style = FillStippled; | values.fill_style = FillStippled; |
| |
mask = GCForeground | GCBackground | GCGraphicsExposures; | mask = GCForeground | GCBackground | GCGraphicsExposures; |
smask = mask | GCStipple | GCFillStyle; |
smask = mask | GCFillStyle; |
| |
if (fs) { | if (fs) { |
values.font = fs->fid; | values.font = fs->fid; |
|
|
} | } |
| |
XmIconButton_gc(iw) = XtGetGC(w, mask, &values); | XmIconButton_gc(iw) = XtGetGC(w, mask, &values); |
|
|
|
/*added for gray insensitive foreground (instead stipple)*/ |
|
values.foreground = _XmAssignInsensitiveColor(w); |
XmIconButton_stippled_text_gc(iw) = XtGetGC(w, smask, &values); | XmIconButton_stippled_text_gc(iw) = XtGetGC(w, smask, &values); |
| |
/* | /* |
|
|
| |
| |
/** insensitive gc **/ | /** insensitive gc **/ |
values.foreground = IG_Foreground(wid) ; |
|
|
/*added for gray insensitive foreground (instead stipple)*/ |
|
values.foreground = _XmAssignInsensitiveColor( XtParent(wid)); |
values.background = IG_Background(wid) ; | values.background = IG_Background(wid) ; |
valueMask |= GCFillStyle | GCStipple; |
valueMask |= GCFillStyle; |
values.fill_style = FillOpaqueStippled; | values.fill_style = FillOpaqueStippled; |
values.stipple = _XmGetInsensitiveStippleBitmap(wid); | values.stipple = _XmGetInsensitiveStippleBitmap(wid); |
| |
|
|
lw->label.normal_GC = XtAllocateGC((Widget) lw, 0, valueMask, &values, | lw->label.normal_GC = XtAllocateGC((Widget) lw, 0, valueMask, &values, |
dynamicMask, 0); | dynamicMask, 0); |
| |
valueMask |= GCFillStyle | GCStipple; |
/*added for gray insensitive foreground (instead stipple)*/ |
values.foreground = lw->core.background_pixel; |
valueMask |= GCFillStyle; |
|
values.foreground = _XmAssignInsensitiveColor((Widget)lw); |
values.background = lw->primitive.foreground; | values.background = lw->primitive.foreground; |
values.fill_style = FillOpaqueStippled; | values.fill_style = FillOpaqueStippled; |
values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw); | values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw); |
|
|
lp->StringRect.width, | lp->StringRect.width, |
lp->alignment, | lp->alignment, |
XmPrim_layout_direction(lw), NULL); | XmPrim_layout_direction(lw), NULL); |
#ifdef USE_XFT |
|
if (!XtIsSensitive(wid)) |
|
{ |
|
XSetFillStyle(XtDisplay(lw), lp->insensitive_GC, FillStippled); |
|
XFillRectangle(XtDisplay(lw), XtWindow(lw), lp->insensitive_GC, |
|
lp->TextRect.x + lp->StringRect.x, |
|
lp->TextRect.y + lp->StringRect.y, |
|
lp->StringRect.width, |
|
lp->StringRect.height); |
|
XSetFillStyle(XtDisplay(lw), lp->insensitive_GC, FillOpaqueStippled); |
|
} |
|
#endif |
|
} | } |
| |
if (lp->_acc_text != NULL) | if (lp->_acc_text != NULL) |
|
|
LabG_NormalGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values, | LabG_NormalGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values, |
dynamicMask, 0); | dynamicMask, 0); |
| |
valueMask |= GCFillStyle | GCStipple; |
/*added for gray insensitive foreground (instead stipple)*/ |
values.foreground = LabG_Background(lw); |
valueMask |= GCFillStyle; |
|
values.foreground = _XmAssignInsensitiveColor((Widget)mw); |
values.background = LabG_Foreground(lw); | values.background = LabG_Foreground(lw); |
values.fill_style = FillOpaqueStippled; | values.fill_style = FillOpaqueStippled; |
| |
|
|
lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, | lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, |
LabG_StringRect(lw).width, | LabG_StringRect(lw).width, |
LabG_Alignment(lw), LayoutG(lw), NULL); | LabG_Alignment(lw), LayoutG(lw), NULL); |
#ifdef USE_XFT |
|
if (!XtIsSensitive(wid)) { |
|
XSetFillStyle(XtDisplay(lw), LabG_InsensitiveGC(lw), FillStippled); |
|
XFillRectangle(XtDisplay(lw), XtWindow(lw), LabG_InsensitiveGC(lw), |
|
lw->rectangle.x + LabG_TextRect(lw).x + |
|
LabG_StringRect(lw).x, |
|
lw->rectangle.y + LabG_TextRect(lw).y + |
|
LabG_StringRect(lw).y, |
|
LabG_StringRect(lw).width, |
|
LabG_StringRect(lw).height); |
|
XSetFillStyle(XtDisplay(lw), LabG_InsensitiveGC(lw), FillOpaqueStippled); |
|
} |
|
#endif |
|
} | } |
| |
if (LabG__acceleratorText(lw) != NULL) | if (LabG__acceleratorText(lw) != NULL) |
|
|
lw->list.InverseGC = XtAllocateGC((Widget) lw, lw->core.depth, | lw->list.InverseGC = XtAllocateGC((Widget) lw, lw->core.depth, |
valueMask, &values, modifyMask, 0); | valueMask, &values, modifyMask, 0); |
| |
values.foreground = lw->primitive.foreground; |
/*added for gray insensitive foreground (instead stipple)*/ |
|
values.foreground = _XmAssignInsensitiveColor(lw); |
values.background = lw->core.background_pixel; | values.background = lw->core.background_pixel; |
valueMask |= GCStipple | GCFillStyle; |
valueMask |= GCFillStyle; |
values.fill_style = FillOpaqueStippled; | values.fill_style = FillOpaqueStippled; |
values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw); | values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw); |
| |
|
|
valueMask |= GCFillStyle; | valueMask |= GCFillStyle; |
if (stipple) { | if (stipple) { |
values.fill_style = FillStippled; | values.fill_style = FillStippled; |
valueMask |= GCStipple; |
/*added for gray insensitive foreground (instead stipple)*/ |
values.stipple = tf->text.stipple_tile; |
values.foreground = _XmAssignInsensitiveColor((Widget)tf); |
} else | } else |
values.fill_style = FillSolid; | values.fill_style = FillSolid; |
} | } |
|
|
valueMask |= GCFillStyle; | valueMask |= GCFillStyle; |
if (stipple) { | if (stipple) { |
values.fill_style = FillStippled; | values.fill_style = FillStippled; |
valueMask |= GCStipple; |
/*added for gray insensitive foreground (instead stipple)*/ |
values.stipple = data->stipple_tile; |
values.foreground = _XmAssignInsensitiveColor((Widget)tw); |
} else | } else |
values.fill_style = FillSolid; | values.fill_style = FillSolid; |
} | } |
|
|
_XmAppUnlock(app); | _XmAppUnlock(app); |
return return_wid; | return return_wid; |
} | } |
|
|
|
/************************************************************************ |
|
* |
|
* _XmAssignInsensitiveColor |
|
* Allocate the Gray color for display widget like insensitive. |
|
* |
|
* |
|
************************************************************************/ |
|
|
|
Pixel |
|
_XmAssignInsensitiveColor(Widget w) |
|
{ |
|
static XColor screen_in_out; |
|
int status; |
|
Pixel p; |
|
|
|
p = w->core.background_pixel; |
|
XQueryColor(XtDisplay(w), w->core.colormap, &screen_in_out); |
|
if ((abs(screen_in_out.red-RGB_GREY_VALUE)<RGB_GREY_PRESISE) |
|
&& (abs(screen_in_out.green-RGB_GREY_VALUE)<RGB_GREY_PRESISE) |
|
&& (abs(screen_in_out.blue-RGB_GREY_VALUE)<RGB_GREY_PRESISE)) { |
|
/*text color have to be more light for wosn't be invisible*/ |
|
screen_in_out.red=(RGB_GREY_VALUE+RGB_GREY_VALUE/2)<<8; |
|
screen_in_out.green=(RGB_GREY_VALUE+RGB_GREY_VALUE/2)<<8; |
|
screen_in_out.blue=(RGB_GREY_VALUE+RGB_GREY_VALUE/2)<<8; |
|
|
|
status = XAllocColor(XtDisplay(w), w->core.colormap, &screen_in_out); |
|
if (status) |
|
p = screen_in_out.pixel; |
|
} else { |
|
/*gray color*/ |
|
screen_in_out.red=RGB_GREY_VALUE<<8; |
|
screen_in_out.green=RGB_GREY_VALUE<<8; |
|
screen_in_out.blue=RGB_GREY_VALUE<<8; |
|
|
|
status = XAllocColor(XtDisplay(w), w->core.colormap, &screen_in_out); |
|
if (status) |
|
p = screen_in_out.pixel; |
|
} |
|
|
|
return p; |
|
} |
|
|
} /* Close scope of 'extern "C"' declaration which encloses file. */ | } /* Close scope of 'extern "C"' declaration which encloses file. */ |
#endif | #endif |
| |
|
#define RGB_GREY_VALUE 128 |
|
#define RGB_GREY_PRESISE 50 |
|
extern Pixel _XmAssignInsensitiveColor(Widget w); |
|
|
#endif /* _XmI_h */ | #endif /* _XmI_h */ |
/* DON'T ADD ANYTHING AFTER THIS #endif */ | /* DON'T ADD ANYTHING AFTER THIS #endif */ |