On Sun, 29 Sep 2013 at 13:22:54 +0200, Christophe wrote: > From: Christophe CURIS <[email protected]> > > As the cursor choice for each action is actually a user choice, > it is logical to put this into the structure, instead of a poorly > defined 'extern' in every file. > --- > src/WindowMaker.h | 46 +++++++++++++++++++++++++++------------------- > src/appicon.c | 3 +-- > src/defaults.c | 7 +++---- > src/dock.c | 3 +-- > src/event.c | 2 -- > src/icon.c | 6 ++---- > src/main.c | 3 --- > src/menu.c | 4 +--- > src/moveres.c | 26 ++++++++++++-------------- > src/rootmenu.c | 3 +-- > src/screen.c | 5 ++--- > src/startup.c | 35 ++++++++++++++++------------------- > src/wcore.c | 6 ++---- > src/winspector.c | 3 +-- > 14 files changed, 69 insertions(+), 83 deletions(-) > > diff --git a/src/WindowMaker.h b/src/WindowMaker.h > index 7211181..f27b2a8 100644 > --- a/src/WindowMaker.h > +++ b/src/WindowMaker.h > @@ -102,25 +102,29 @@ typedef struct WObjDescriptor { > #define PRED_BPIXMAPS 4 /* count of WBUT icons */ > #endif /* XKB_BUTTON_HINT */ > > -/* cursors */ > -#define WCUR_DEFAULT 0 > -#define WCUR_NORMAL 0 > -#define WCUR_MOVE 1 > -#define WCUR_RESIZE 2 > -#define WCUR_TOPLEFTRESIZE 3 > -#define WCUR_TOPRIGHTRESIZE 4 > -#define WCUR_BOTTOMLEFTRESIZE 5 > -#define WCUR_BOTTOMRIGHTRESIZE 6 > -#define WCUR_VERTICALRESIZE 7 > -#define WCUR_HORIZONRESIZE 8 > -#define WCUR_WAIT 9 > -#define WCUR_ARROW 10 > -#define WCUR_QUESTION 11 > -#define WCUR_TEXT 12 > -#define WCUR_SELECT 13 > -#define WCUR_ROOT 14 > -#define WCUR_EMPTY 15 > -#define WCUR_LAST 16 > +/* Mouse cursors */ > +typedef enum { > + WCUR_DEFAULT = 0, > + WCUR_NORMAL = 0, > + WCUR_MOVE = 1, > + WCUR_RESIZE = 2, > + WCUR_TOPLEFTRESIZE = 3, > + WCUR_TOPRIGHTRESIZE = 4, > + WCUR_BOTTOMLEFTRESIZE = 5, > + WCUR_BOTTOMRIGHTRESIZE = 6, > + WCUR_VERTICALRESIZE = 7, > + WCUR_HORIZONRESIZE = 8, > + WCUR_WAIT = 9, > + WCUR_ARROW = 10, > + WCUR_QUESTION = 11, > + WCUR_TEXT = 12, > + WCUR_SELECT = 13, > + WCUR_ROOT = 14, > + WCUR_EMPTY = 15, > + > + /* Count of the number of cursors defined */ > + WCUR_LAST = 16 > +} w_cursor;
Is it really necessary to add the explicit numbers too? I'm remembering the patch below which used 'enum' in order to avoid having the explicit numbers being #define'd. If one wants to add something in the middle then it's much better without the explicit numbers. What am I missing? commit b37e065252a396020642f854797753071036c4d8 Author: Tamas TEVESZ <[email protected]> Date: Mon Aug 31 20:50:30 2009 +0200 Clean up #ifdef mess -- To unsubscribe, send mail to [email protected].
