1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

wmaker: Converted #define to an Enum for the Program State tracking variables

This commit is contained in:
Christophe CURIS
2013-09-29 13:22:48 +02:00
committed by Carlos R. Mafra
parent 3957f01293
commit 28bbf705eb
2 changed files with 14 additions and 12 deletions

View File

@@ -227,13 +227,15 @@ typedef struct WObjDescriptor {
/* program states */
#define WSTATE_NORMAL 0
#define WSTATE_NEED_EXIT 1
#define WSTATE_NEED_RESTART 2
#define WSTATE_EXITING 3
#define WSTATE_RESTARTING 4
#define WSTATE_MODAL 5
#define WSTATE_NEED_REREAD 6
typedef enum {
WSTATE_NORMAL = 0,
WSTATE_NEED_EXIT = 1,
WSTATE_NEED_RESTART = 2,
WSTATE_EXITING = 3,
WSTATE_RESTARTING = 4,
WSTATE_MODAL = 5,
WSTATE_NEED_REREAD = 6
} wprog_state;
#define WCHECK_STATE(state) (state == WProgramState)
@@ -241,7 +243,7 @@ typedef struct WObjDescriptor {
#define WCHANGE_STATE(nstate) {\
if (WProgramState == WSTATE_NORMAL\
|| nstate != WSTATE_MODAL)\
|| (nstate) != WSTATE_MODAL)\
WProgramState = (nstate); \
if (WProgramSigState != 0)\
WProgramState = WProgramSigState;\
@@ -452,8 +454,8 @@ extern struct WPreferences {
/****** Global Variables ******/
extern Display *dpy;
extern unsigned int ValidModMask;
extern char WProgramState;
extern char WProgramSigState;
extern wprog_state WProgramState;
extern wprog_state WProgramSigState;
/****** Notifications ******/
extern const char WMNManaged[];

View File

@@ -145,8 +145,8 @@ int wXkbEventBase;
#endif
/* special flags */
char WProgramSigState = 0;
char WProgramState = WSTATE_NORMAL;
wprog_state WProgramSigState = 0;
wprog_state WProgramState = WSTATE_NORMAL;
char WDelayedActionSet = 0;
/* notifications */