int i, j;
#ifdef NEED_MOTIF
+ chars = "";
if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
- {
- chars = "";
- }
+ chars = "";
#else
chars = string;
#endif
}
static void
-massage_resource_name (CONST char *in, char *out)
+massage_resource_name (const char *in, char *out)
{
/* Turn a random string into something suitable for using as a resource.
For example:
Boolean firstp = True;
while (*in)
{
- char ch = massaged_resource_char[(unsigned char) *in++];
- if (ch)
+ if (*in == '%' && *(in + 1) == '_')
+ in += 2;
+ else
{
- int int_ch = (int) (unsigned char) ch;
- *out++ = firstp ? tolower (int_ch) : toupper (int_ch);
- firstp = False;
- while ((ch = massaged_resource_char[(unsigned char) *in++]) != '\0')
- *out++ = ch;
- if (!*(in-1)) /* Overshot the NULL byte? */
- break;
+ char ch;
+
+ if (*in == '%' && *(in + 1) == '%')
+ in++;
+ ch = massaged_resource_char[(unsigned char) *in++];
+ if (ch)
+ {
+ int int_ch = (int) (unsigned char) ch;
+ *out++ = firstp ? tolower (int_ch) : toupper (int_ch);
+ firstp = False;
+ while ((ch = massaged_resource_char[(unsigned char) *in++])
+ != '\0')
+ *out++ = ch;
+ if (!*(in-1)) /* Overshot the NULL byte? */
+ break;
+ }
}
}
*out = 0;
* not inserted if value is a zero length string.
*/
static char*
-parameterize_string (CONST char *string, CONST char *value)
+parameterize_string (const char *string, const char *value)
{
char *percent;
char *result;
char *chars;
#ifdef NEED_MOTIF
- XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars);
+ chars = "";
+ if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
+ chars = "";
#else
chars = string;
#endif
2 * mw->menu.vertical_margin +
2 * mw->menu.shadow_thickness);
/* no left column decoration */
- *toggle_width = mw->menu.horizontal_margin + mw->menu.shadow_thickness;;
+ *toggle_width = mw->menu.horizontal_margin + mw->menu.shadow_thickness;
*label_width = string_width_u (mw, resource_widget_value (mw, val));
*bindings_width = mw->menu.horizontal_margin + mw->menu.shadow_thickness;
static struct _shadow_names
{
- CONST char * name;
+ const char * name;
shadow_type type;
} shadow_names[] =
{
xgcv.foreground = mw->menu.top_shadow_color;
xgcv.background = mw->core.background_pixel;
/* xgcv.stipple = mw->menu.top_shadow_pixmap; gtb */
-#ifdef NEED_MOTIF
if (mw->menu.top_shadow_pixmap &&
mw->menu.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)
xgcv.stipple = mw->menu.top_shadow_pixmap;
else
xgcv.stipple = 0;
-#else
- xgcv.stipple = mw->menu.top_shadow_pixmap;
-#endif /* NEED_MOTIF */
pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0);
mw->menu.shadow_top_gc =
XtGetGC((Widget)mw, GCForeground|GCBackground|pm, &xgcv);
xgcv.foreground = mw->menu.bottom_shadow_color;
/* xgcv.stipple = mw->menu.bottom_shadow_pixmap; gtb */
-#ifdef NEED_MOTIF
- if (mw->menu.top_shadow_pixmap &&
- mw->menu.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)
+ if (mw->menu.bottom_shadow_pixmap &&
+ mw->menu.bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)
xgcv.stipple = mw->menu.bottom_shadow_pixmap;
else
xgcv.stipple = 0;
-#else
- xgcv.stipple = mw->menu.bottom_shadow_pixmap;
-#endif /* NEED_MOTIF */
pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0);
mw->menu.shadow_bottom_gc =
XtGetGC ((Widget)mw, GCForeground|GCBackground|pm, &xgcv);