(A-compU+758B): New abstract node.
[chise/xemacs-chise.git.1] / lwlib / xlwmenu.c
index b903917..eff3d24 100644 (file)
@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA.  */
 #include <dmalloc.h>
 #endif
 
-/* simple, naieve integer maximum */
+/* simple, naive integer maximum */
 #ifndef max
 #define max(a,b) ((a)>(b)?(a):(b))
 #endif
@@ -88,6 +88,8 @@ xlwMenuResources[] =
   {XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
      offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"},
 # ifdef USE_XFONTSET
+  /* #### Consider using the same method as for Motif; see the comment in
+     XlwMenuInitialize(). */
   {XtNfontSet,  XtCFontSet, XtRFontSet, sizeof(XFontSet),
      offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"},
 # endif
@@ -195,7 +197,7 @@ XlwMenuClassRec xlwMenuClassRec =
     XtNumber(xlwMenuResources),                /* resource_count         */
     NULLQUARK,                         /* xrm_class              */
     TRUE,                              /* compress_motion        */
-    TRUE,                              /* compress_exposure      */
+    XtExposeCompressMaximal,           /* compress_exposure      */
     TRUE,                              /* compress_enterleave    */
     FALSE,                             /* visible_interest       */
     XlwMenuDestroy,                    /* destroy                */
@@ -346,7 +348,8 @@ close_to_reference_time (Widget w, Time reference_time, XEvent *ev)
 {
   return
     reference_time &&
-    (ev->xbutton.time - reference_time < XtGetMultiClickTime (XtDisplay (w)));
+    (ev->xbutton.time - reference_time
+     < (Time) XtGetMultiClickTime (XtDisplay (w)));
 }
 
 \f/* Size code */
@@ -688,7 +691,7 @@ resource_widget_value (XlwMenuWidget mw, widget_value *val)
 
 /* Unused */
 #if 0
-/* These two routines should be a seperate file..djw */
+/* These two routines should be a separate file..djw */
 static char *
 xlw_create_localized_string (Widget w,
                             char *name,
@@ -1519,7 +1522,7 @@ menu_item_type (widget_value *val)
   else
     return TEXT_TYPE;
 #else
-  else 
+  else
     abort();
   return UNSPECIFIED_TYPE; /* Not reached */
 #endif
@@ -2323,7 +2326,7 @@ make_windows_if_needed (XlwMenuWidget mw, int n)
   int start_at;
   XSetWindowAttributes xswa;
   Widget p;
-  int mask;
+  unsigned long mask;
   int depth;
   Visual *visual;
   window_state *windows;
@@ -2491,7 +2494,7 @@ remap_menubar (XlwMenuWidget mw)
 
   mw->menu.old_depth = new_depth;
 
-  /* refresh the last seletion */
+  /* refresh the last selection */
   selection_position.x = 0;
   selection_position.y = 0;
   display_menu (mw, last_same, new_selection == old_selection,
@@ -3002,10 +3005,6 @@ XlwMenuInitialize (Widget request, Widget new, ArgList args,
 {
   /* Get the GCs and the widget size */
   XlwMenuWidget mw = (XlwMenuWidget)new;
-
-  XSetWindowAttributes xswa;
-  int mask;
-
   Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw)));
   Display *display = XtDisplay (mw);
 
@@ -3017,10 +3016,12 @@ XlwMenuInitialize (Widget request, Widget new, ArgList args,
                                 gray_width, gray_height, 1, 0, 1);
 
 #ifdef NEED_MOTIF
+  /* #### Even if it's a kludge!!!, we should consider doing the same for
+     X Font Sets. */
   /* The menu.font_list slot came from the *fontList resource (Motif standard.)
      The menu.font_list_2 slot came from the *font resource, for backward
      compatibility with older versions of this code, and consistency with the
-     rest of emacs.  If both font and fontList are specified, we use font.
+     rest of emacs.  If both font and fontList are specified, we use fontList.
      If only one is specified, we use that.  If neither are specified, we
      use the "fallback" value.  What a kludge!!!
 
@@ -3040,10 +3041,6 @@ XlwMenuInitialize (Widget request, Widget new, ArgList args,
   make_shadow_gcs      (mw);
   extract_font_extents (mw);
 
-  xswa.background_pixel = mw->core.background_pixel;
-  xswa.border_pixel     = mw->core.border_pixel;
-  mask = CWBackPixel | CWBorderPixel;
-
   mw->menu.popped_up              = False;
   mw->menu.pointer_grabbed        = False;
   mw->menu.next_release_must_exit = False;
@@ -3081,7 +3078,7 @@ XlwMenuRealize (Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
 {
   XlwMenuWidget mw = (XlwMenuWidget)w;
   XSetWindowAttributes xswa;
-  int mask;
+  unsigned long mask;
 
   (*xlwMenuWidgetClass->core_class.superclass->core_class.realize)
     (w, valueMask, attributes);
@@ -3415,8 +3412,8 @@ xlw_map_menu (Time t)
   if (!mw->menu.pointer_grabbed)
     {
       XWindowAttributes ret;
-      Window parent,root;
-      Window *waste;
+      Window parent,root = 0UL;
+      Window *waste = NULL;
       unsigned int num_waste;
 
       lw_menu_active = True;