Bump trunk version to 24.1.50.
[bpt/emacs.git] / lwlib / lwlib-Xlw.c
index 4799b1d..a446790 100644 (file)
@@ -1,7 +1,7 @@
 /* The lwlib interface to "xlwmenu" menus.
-   Copyright (C) 1992 Lucid, Inc.
-   Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006 Free Software Foundation, Inc.
+
+Copyright (C) 1992 Lucid, Inc.
+Copyright (C) 1994, 2000-2012 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
@@ -24,7 +24,8 @@ Boston, MA 02110-1301, USA.  */
 #include <config.h>
 #endif
 
-#include "lisp.h"
+#include <setjmp.h>
+#include <lisp.h>
 
 #include "lwlib-Xlw.h"
 #include <X11/StringDefs.h>
@@ -42,8 +43,7 @@ Boston, MA 02110-1301, USA.  */
    This is sometimes handy to have available.  */
 
 void
-x_print_complete_resource_name (widget)
-     Widget widget;
+x_print_complete_resource_name (Widget widget)
 {
   int i;
   String names[100];
@@ -71,10 +71,7 @@ x_print_complete_resource_name (widget)
    if there isn't any highlighted menu item.  */
 
 static void
-highlight_hook (w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+highlight_hook (Widget w, XtPointer client_data, XtPointer call_data)
 {
   widget_instance *instance = (widget_instance *) client_data;
 
@@ -84,10 +81,20 @@ highlight_hook (w, client_data, call_data)
 }
 
 static void
-pre_hook (w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+enter_hook (Widget w, XtPointer client_data, XtPointer call_data)
+{
+  highlight_hook (w, client_data, call_data);
+}
+
+static void
+leave_hook (Widget w, XtPointer client_data, XtPointer call_data)
+{
+  highlight_hook (w, client_data, NULL);
+}
+
+
+static void
+pre_hook (Widget w, XtPointer client_data, XtPointer call_data)
 {
   widget_instance* instance = (widget_instance*)client_data;
   widget_value* val;
@@ -102,10 +109,7 @@ pre_hook (w, client_data, call_data)
 }
 
 static void
-pick_hook (w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+pick_hook (Widget w, XtPointer client_data, XtPointer call_data)
 {
   widget_instance* instance = (widget_instance*)client_data;
   widget_value* contents_val = (widget_value*)call_data;
@@ -130,8 +134,7 @@ pick_hook (w, client_data, call_data)
 \f/* creation functions */
 
 static Widget
-xlw_create_menubar (instance)
-     widget_instance* instance;
+xlw_create_menubar (widget_instance *instance)
 {
   Widget widget;
   Arg al[5];
@@ -152,14 +155,13 @@ xlw_create_menubar (instance)
 
   XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
   XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
-  XtAddCallback (widget, XtNhighlightCallback, highlight_hook,
-                (XtPointer)instance);
+  XtAddCallback (widget, XtNleaveCallback, leave_hook, (XtPointer)instance);
+  XtAddCallback (widget, XtNenterCallback, enter_hook, (XtPointer)instance);
   return widget;
 }
 
 static Widget
-xlw_create_popup_menu (instance)
-     widget_instance* instance;
+xlw_create_popup_menu (widget_instance *instance)
 {
   Widget popup_shell
     = XtCreatePopupShell (instance->info->name, overrideShellWidgetClass,
@@ -179,8 +181,8 @@ xlw_create_popup_menu (instance)
                             popup_shell, al, ac);
 
   XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
-  XtAddCallback (widget, XtNhighlightCallback, highlight_hook,
-                (XtPointer)instance);
+  XtAddCallback (widget, XtNleaveCallback, leave_hook, (XtPointer)instance);
+  XtAddCallback (widget, XtNenterCallback, enter_hook, (XtPointer)instance);
 
   return popup_shell;
 }
@@ -194,8 +196,7 @@ xlw_creation_table [] =
 };
 
 Boolean
-lw_lucid_widget_p (widget)
-     Widget widget;
+lw_lucid_widget_p (Widget widget)
 {
   WidgetClass the_class = XtClass (widget);
 
@@ -208,16 +209,8 @@ lw_lucid_widget_p (widget)
 }
 
 void
-#ifdef PROTOTYPES
 xlw_update_one_widget (widget_instance* instance, Widget widget,
                       widget_value* val, Boolean deep_p)
-#else
-xlw_update_one_widget (instance, widget, val, deep_p)
-     widget_instance* instance;
-     Widget widget;
-     widget_value* val;
-     Boolean deep_p;
-#endif
 {
   Arg al[1];
 
@@ -229,29 +222,20 @@ xlw_update_one_widget (instance, widget, val, deep_p)
 }
 
 void
-xlw_update_one_value (instance, widget, val)
-     widget_instance* instance;
-     Widget widget;
-     widget_value* val;
+xlw_update_one_value (widget_instance *instance,
+                      Widget widget,
+                      widget_value *val)
 {
   return;
 }
 
 void
-#ifdef PROTOTYPES
 xlw_pop_instance (widget_instance* instance, Boolean up)
-#else
-xlw_pop_instance (instance, up)
-     widget_instance* instance;
-     Boolean up;
-#endif
 {
 }
 
 void
-xlw_popup_menu (widget, event)
-     Widget widget;
-     XEvent *event;
+xlw_popup_menu (Widget widget, XEvent *event)
 {
   XlwMenuWidget mw;
 
@@ -284,12 +268,8 @@ xlw_popup_menu (widget, event)
 
 \f/* Destruction of instances */
 void
-xlw_destroy_instance (instance)
-     widget_instance* instance;
+xlw_destroy_instance (widget_instance *instance)
 {
   if (instance->widget)
     XtDestroyWidget (instance->widget);
 }
-
-/* arch-tag: 541e3912-477d-406e-9bf2-dbf2b7ff8c3b
-   (do not change this comment) */