There were three sets of #defines in winmenu.c for tracking the entries in the 
window menu itself, the new "other maximization" menu, and the options menu.  
At the suggestion of Christophe Curis, these have been changed to enums.

To facilitate this change, MC_SHORTCUT in the function updateMakeShortcutMenu 
was replaced with MC_OPTIONS.  Previously, they had both been #defined to the 
same value.
---
 src/winmenu.c | 75 ++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 41 insertions(+), 34 deletions(-)

diff --git a/src/winmenu.c b/src/winmenu.c
index 331aedf..08889eb 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -48,38 +48,45 @@
 #include "xinerama.h"
 #include "winmenu.h"
 
-#define MC_MAXIMIZE     0
-#define MC_OTHERMAX     1
-#define MC_MINIATURIZE 2
-#define MC_SHADE       3
-#define MC_HIDE                4
-#define MC_MOVERESIZE   5
-#define MC_SELECT       6
-#define MC_DUMMY_MOVETO 7
-#define MC_PROPERTIES   8
-#define MC_OPTIONS      9
-#define MC_SHORTCUT     9
-#define MC_RELAUNCH     10
-#define MC_CLOSE        11
-#define MC_KILL         12
-
-
-#define WO_KEEP_ON_TOP         0
-#define WO_KEEP_AT_BOTTOM      1
-#define WO_OMNIPRESENT         2
-#define WO_ENTRIES             3
-
-#define MAXC_V       0
-#define MAXC_H       1
-#define MAXC_LH      2
-#define MAXC_RH      3
-#define MAXC_TH      4
-#define MAXC_BH      5
-#define MAXC_LTC     6
-#define MAXC_RTC     7
-#define MAXC_LBC     8
-#define MAXC_RBC     9
-#define MAXC_MAXIMUS 10
+enum 
+{
+       MC_MAXIMIZE,
+       MC_OTHERMAX,
+       MC_MINIATURIZE,
+       MC_SHADE,
+       MC_HIDE,
+       MC_MOVERESIZE,
+       MC_SELECT,
+       MC_DUMMY_MOVETO,
+       MC_PROPERTIES,
+       MC_OPTIONS,
+       MC_RELAUNCH,
+       MC_CLOSE,
+       MC_KILL
+};
+
+enum
+{
+       WO_KEEP_ON_TOP,
+       WO_KEEP_AT_BOTTOM,
+       WO_OMNIPRESENT,
+       WO_ENTRIES
+};
+
+enum
+{
+       MAXC_V,
+       MAXC_H,
+       MAXC_LH,
+       MAXC_RH,
+       MAXC_TH,
+       MAXC_BH,
+       MAXC_LTC,
+       MAXC_RTC,
+       MAXC_LBC,
+       MAXC_RBC,
+       MAXC_MAXIMUS
+};
 
 static void updateOptionsMenu(WMenu * menu, WWindow * wwin);
 
@@ -326,7 +333,7 @@ static void updateWorkspaceMenu(WMenu * menu)
 
 static void updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
 {
-       WMenu *smenu = menu->cascades[menu->entries[MC_SHORTCUT]->cascade];
+       WMenu *smenu = menu->cascades[menu->entries[MC_OPTIONS]->cascade];
        int i;
        char *buffer;
        int buflen;
@@ -541,7 +548,7 @@ static WMenu *createWindowMenu(WScreen * scr)
        menu = wMenuCreate(scr, NULL, False);
        /*
         * Warning: If you make some change that affects the order of the
-        * entries, you must update the command #defines in the top of
+        * entries, you must update the command enum in the top of
         * this file.
         */
        entry = wMenuAddCallback(menu, _("Maximize"), execMenuCommand, NULL);
-- 
1.8.1.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to