diff lwlib/lwlib-Xlw.c @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 23a1cea22d13
children
line wrap: on
line diff
--- a/lwlib/lwlib-Xlw.c	Sun Jan 15 23:02:10 2006 +0000
+++ b/lwlib/lwlib-Xlw.c	Mon Jan 16 00:03:54 2006 +0000
@@ -1,5 +1,7 @@
 /* The lwlib interface to "xlwmenu" menus.
    Copyright (C) 1992 Lucid, Inc.
+   Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004,
+                 2005 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
@@ -15,14 +17,14 @@
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include "../src/lisp.h"
+#include "lisp.h"
 
 #include "lwlib-Xlw.h"
 #include <X11/StringDefs.h>
@@ -179,6 +181,7 @@
   XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
   XtAddCallback (widget, XtNhighlightCallback, highlight_hook,
 		 (XtPointer)instance);
+
   return popup_shell;
 }
 
@@ -205,20 +208,19 @@
 }
 
 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
 {
-  XlwMenuWidget mw;
   Arg al[1];
 
-  if (XtIsShell (widget))
-    mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
-  else
-    mw = (XlwMenuWidget)widget;
-
   /* This used to use XtVaSetValues, but some old Xt versions
      that have a bug in XtVaCreateWidget might have it here too.  */
   XtSetArg (al[0], XtNmenu, instance->info->val);
@@ -236,9 +238,13 @@
 }
 
 void
+#ifdef PROTOTYPES
+xlw_pop_instance (widget_instance* instance, Boolean up)
+#else
 xlw_pop_instance (instance, up)
      widget_instance* instance;
      Boolean up;
+#endif
 {
 }
 
@@ -247,7 +253,6 @@
      Widget widget;
      XEvent *event;
 {
-  XButtonPressedEvent dummy;
   XlwMenuWidget mw;
 
   if (!XtIsShell (widget))
@@ -256,21 +261,24 @@
   mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
 
   if (event)
-    pop_up_menu (mw, (XButtonPressedEvent*) event);
+    XtCallActionProc ((Widget) mw, "start", event, NULL, 0);
   else
     {
-      dummy.type = ButtonPress;
-      dummy.serial = 0;
-      dummy.send_event = 0;
-      dummy.display = XtDisplay (widget);
-      dummy.window = XtWindow (XtParent (widget));
-      dummy.time = CurrentTime;
-      dummy.button = 0;
-      XQueryPointer (dummy.display, dummy.window, &dummy.root,
-		     &dummy.subwindow, &dummy.x_root, &dummy.y_root,
-		     &dummy.x, &dummy.y, &dummy.state);
+      XEvent dummy;
+      XButtonPressedEvent *bd = &dummy.xbutton;
 
-      pop_up_menu (mw, &dummy);
+      bd->type = ButtonPress;
+      bd->serial = 0;
+      bd->send_event = 0;
+      bd->display = XtDisplay (widget);
+      bd->window = XtWindow (XtParent (widget));
+      bd->time = CurrentTime;
+      bd->button = 0;
+      XQueryPointer (bd->display, bd->window, &bd->root,
+		     &bd->subwindow, &bd->x_root, &bd->y_root,
+		     &bd->x, &bd->y, &bd->state);
+
+      XtCallActionProc ((Widget) mw, "start", &dummy, NULL, 0);
     }
 }
 
@@ -283,3 +291,5 @@
     XtDestroyWidget (instance->widget);
 }
 
+/* arch-tag: 541e3912-477d-406e-9bf2-dbf2b7ff8c3b
+   (do not change this comment) */