]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix MS-Windows build broken by menu changes on 2014-06-02.
authorEli Zaretskii <eliz@gnu.org>
Tue, 3 Jun 2014 06:51:18 +0000 (09:51 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 3 Jun 2014 06:51:18 +0000 (09:51 +0300)
 src/w32menu.c (w32_menu_show): Fix a typo that broke compilation.
 src/menu.h (enum button_type, struct _widget_value) [HAVE_NTGUI]:
 Define instead of including ../lwlib/lwlib.h, which causes
 compilation errors due to missing X11 headers.

src/ChangeLog
src/menu.h
src/w32menu.c

index ded001073ae1fedb22e3291881b47e4c30b01e63..0a31818070fe4f58be81ecafe36de53795e5f592 100644 (file)
@@ -1,3 +1,12 @@
+2014-06-03  Eli Zaretskii  <eliz@gnu.org>
+
+       Fix MS-Windows build broken by menu changes on 2014-06-02.
+       * w32menu.c (w32_menu_show): Fix a typo that broke compilation.
+
+       * menu.h (enum button_type, struct _widget_value) [HAVE_NTGUI]:
+       Define instead of including ../lwlib/lwlib.h, which causes
+       compilation errors due to missing X11 headers.
+
 2014-06-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        * process.c (wait_reading_process_output): Omit incorrect test
index 89a8729fd43d5072cc1dcfb12490f6cdc621ded7..d71989ea1ef07cf89db6c0f948aa661800465d93 100644 (file)
@@ -20,12 +20,52 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define MENU_H
 
 #include "systime.h" /* for Time */
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \
-  || defined (HAVE_NS)
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
 #include "../lwlib/lwlib.h" /* for widget_value */
 #endif
 
 #ifdef HAVE_NTGUI
+/* This is based on the one in ../lwlib/lwlib.h, with unused portions
+   removed.  HAVE_NTGUI cannot include lwlib.h, as that pulls in X11
+   headers.  */
+
+enum button_type
+{
+  BUTTON_TYPE_NONE,
+  BUTTON_TYPE_TOGGLE,
+  BUTTON_TYPE_RADIO
+};
+
+typedef struct _widget_value
+{
+  /* name of widget */
+  Lisp_Object   lname;
+  const char*   name;
+  /* value (meaning depend on widget type) */
+  const char*   value;
+  /* keyboard equivalent. no implications for XtTranslations */
+  Lisp_Object   lkey;
+  const char*   key;
+  /* Help string or nil if none.
+     GC finds this string through the frame's menu_bar_vector
+     or through menu_items.  */
+  Lisp_Object   help;
+  /* true if enabled */
+  unsigned char enabled;
+  /* true if selected */
+  unsigned char selected;
+  /* The type of a button.  */
+  enum button_type button_type;
+  /* true if menu title */
+  unsigned char title;
+  /* Contents of the sub-widgets, also selected slot for checkbox */
+  struct _widget_value* contents;
+  /* data passed to callback */
+  void  *call_data;
+  /* next one in the list */
+  struct _widget_value* next;
+} widget_value;
+
 extern Lisp_Object Qunsupported__w32_dialog;
 #endif
 
index 36b06bafad2b82c2137fea12861965d0e4b911f3..467eb7a5710ec2993f33d2f791541dc66418265b 100644 (file)
@@ -697,7 +697,7 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
              ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip);
            }
 
-         wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enabled),
+         wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enable),
                                  STRINGP (help) ? help : Qnil);
          if (prev_wv)
            prev_wv->next = wv;