-/* $Header: /u/src/emacs/19.0/oldXMenu/RCS/Create.c,v 1.4 1993/03/09 18:18:01 jimb Exp $ */
+/* $Header: /cvs/emacs/oldXMenu/Create.c,v 1.1 1999/10/03 19:34:56 fx Exp $ */
/* Copyright Massachusetts Institute of Technology 1985 */
#include "copyright.h"
-static Status
+static Status
XAllocDisplayColor(display, map, colorName, color, junk)
Display *display;
Colormap map;
Pixmap stipple_pixmap; /* Stipple mask for half-tone text. */
unsigned long valuemask;
XGCValues *values;
-
+
Window root = RootWindow (display, DefaultScreen (display));
/*
_XMErrorCode = XME_CALLOC;
return(NULL);
}
-
- /*
+
+ /*
* Create the XAssocTable
*/
assoc_tab = (XAssocTable *)XCreateAssocTable(XASSOC_TABLE_SIZE);
if (strcmp(def_val, "box") == 0) menu_mode = BOX;
else if (strcmp(def_val, "invert") == 0) menu_mode = INVERT;
}
-
+
def_val = x_get_resource_string ("menuMouse", "MenuMouse");
if (
def_val != NULL &&
DisplayCells(display, DefaultScreen(display)) > 2 &&
- XAllocDisplayColor(display,
- DefaultColormap(display, DefaultScreen(display)),
- def_val,
+ XAllocDisplayColor(display,
+ DefaultColormap(display, DefaultScreen(display)),
+ def_val,
&mouse_color, &color_def)
);
else if (reverse &&
"white",
&mouse_color, &color_def)
);
-
+
else if (XAllocDisplayColor(display,
DefaultColormap(display, DefaultScreen(display)),
- "black",
+ "black",
&mouse_color, &color_def)
);
-
+
else ;
def_val = x_get_resource_string ("menuBackground", "MenuBackground");
def_val = x_get_resource_string ("paneForeground", "PaneForeground");
if (
def_val != NULL &&
- DisplayCells(display, DefaultScreen(display)) > 2
+ DisplayCells(display, DefaultScreen(display)) > 2
)
XAllocDisplayColor(display, DefaultColormap(display,
DefaultScreen(display)),
def_val,
&p_frg_color, &color_def);
-
+
else if (reverse) XAllocDisplayColor(display,
- DefaultColormap(display,
+ DefaultColormap(display,
DefaultScreen(display)),
"white",
&p_frg_color, &color_def);
&p_bdr_color, &color_def)
);
else if (reverse &&
- XAllocDisplayColor(display,
+ XAllocDisplayColor(display,
DefaultColormap(display, DefaultScreen(display)),
"white",
&p_bdr_color, &color_def)
);
- else XAllocDisplayColor(display,
+ else XAllocDisplayColor(display,
DefaultColormap(display, DefaultScreen(display)),
"black",
&p_bdr_color, &color_def);
-
+
def_val = x_get_resource_string ("paneBorderWidth", "PaneBorderWidth");
if (def_val != NULL) p_bdr_width = atoi(def_val);
-
+
def_val = x_get_resource_string ("paneSpread", "PaneSpread");
if (def_val != NULL) p_spread = atof(def_val);
DefaultColormap(display, DefaultScreen(display)),
def_val,
&s_frg_color, &color_def)
- );
+ );
else if (reverse &&
XAllocDisplayColor(display,
DefaultColormap(display, DefaultScreen(display)),
&s_frg_color, &color_def)
) ;
else ;
-
+
def_val = x_get_resource_string ("selectionBorder", "SelectionBorder");
if (
&s_bdr_color, &color_def)
) ;
else if (reverse &&
- XAllocDisplayColor(display,
+ XAllocDisplayColor(display,
DefaultColormap(display, DefaultScreen(display)),
"white",
&s_bdr_color, &color_def)
def_val = x_get_resource_string ("selectionBorderWidth", "SelectionBorderWidth");
if (def_val != NULL) s_bdr_width = atoi(def_val);
-
+
def_val = x_get_resource_string ("selectionSpread", "SelectionSpread");
if (def_val != NULL) s_spread = atof(def_val);
char *data = NULL;
int width, height;
- switch (inact_pnum)
+ switch (inact_pnum)
{
case 0:
data = (char *)dimple1_bits;
/*
* Load the mouse cursor.
*/
-
+
switch (menu_style) {
case LEFT:
cursor = XCreateBitmapFromData(display,
left_ptrmsk_height);
mouse_cursor = XCreatePixmapCursor(
display,
- cursor, cursor_mask,
+ cursor, cursor_mask,
&mouse_color, &bkgnd_color,
left_ptr_x_hot,
left_ptr_y_hot
);
XFreePixmap(display, cursor);
- XFreePixmap(display, cursor_mask);
+ XFreePixmap(display, cursor_mask);
break;
case RIGHT:
cursor = XCreateBitmapFromData(display,
right_ptr_y_hot
);
XFreePixmap(display, cursor);
- XFreePixmap(display, cursor_mask);
+ XFreePixmap(display, cursor_mask);
break;
case CENTER:
cursor = XCreateBitmapFromData(display,
cntr_ptr_y_hot
);
XFreePixmap(display, cursor);
- XFreePixmap(display, cursor_mask);
+ XFreePixmap(display, cursor_mask);
break;
default:
/* Error! Invalid style parameter. */
/*
* Open the pane and selection fonts.
*/
-
+
p_fnt_info = XLoadQueryFont(display, p_fnt_name);
if (p_fnt_info == NULL) {
_XMErrorCode = XME_OPEN_FONT;
return(NULL);
-
+
}
s_fnt_info = XLoadQueryFont(display, s_fnt_name);
* Initialize the internal pane and selection creation queues.
*/
_XMWinQueInit();
-
+
/*
* Create pane, active, and inactive GC's.
*/
values->background = bkgnd_color.pixel;
values->font = p_fnt_info->fid;
values->line_width = p_bdr_width;
-
+
pane_GC = XCreateGC(
- display,
+ display,
root,
valuemask,
values);
values->background = bkgnd_color.pixel;
values->font = s_fnt_info->fid;
values->line_width = s_bdr_width;
- normal_select_GC = XCreateGC(display,
+ normal_select_GC = XCreateGC(display,
root,
valuemask,
values);
* Inverse video selection.
*/
- values->foreground = bkgnd_color.pixel;
+ values->foreground = bkgnd_color.pixel;
values->background = s_frg_color.pixel;
values->font = s_fnt_info->fid;
values->line_width = s_bdr_width;
- inverse_select_GC = XCreateGC(display,
+ inverse_select_GC = XCreateGC(display,
root,
valuemask,
values);
stipple_pixmap = XCreateBitmapFromData(display,
root,
- stipple_bits,
- stipple_width,
- stipple_height);
-
+ stipple_bits,
+ stipple_width,
+ stipple_height);
+
/*
* Finally, inactive pane header and selections
*/
values->line_width = s_bdr_width;
values->fill_style = FillStippled;
values->stipple = stipple_pixmap;
-
- inact_GC = XCreateGC(display,
+
+ inact_GC = XCreateGC(display,
root,
valuemask,
values);
valuemask |= (GCGraphicsExposures);
values->graphics_exposures = False;
- inact_GC_noexpose = XCreateGC (display,
+ inact_GC_noexpose = XCreateGC (display,
root,
valuemask, values);