View | Details | Raw Unified
Collapse All | Expand All

(-) openmotif-2.3.0-orig/lib/Xm/XmI.h (-39 / +70 lines)
 Lines 2086-2092    Link Here 
    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);
 Lines 2117-2122    Link Here 
    	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))
 Lines 1836-1842    Link Here 
    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;
 Lines 1844-1849    Link Here 
    }
    }
    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);
    /*
    /*
 Lines 3134-3142    Link Here 
    /** 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);
 Lines 688-695    Link Here 
  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);
 Lines 1557-1574    Link Here 
		       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) 
 Lines 1247-1254    Link Here 
    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;
 Lines 2435-2453    Link Here 
            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)
 Lines 2758-2766    Link Here 
  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);
 Lines 1960-1967    Link Here 
    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;
  }
  }
 Lines 625-632    Link Here 
    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;
  }
  }
 Lines 426-428    Link Here 
    _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;
}
 Lines 276-280    Link Here 
}  /* 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 */