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:
committed by
Carlos R. Mafra
parent
3957f01293
commit
28bbf705eb
@@ -227,13 +227,15 @@ typedef struct WObjDescriptor {
|
|||||||
|
|
||||||
|
|
||||||
/* program states */
|
/* program states */
|
||||||
#define WSTATE_NORMAL 0
|
typedef enum {
|
||||||
#define WSTATE_NEED_EXIT 1
|
WSTATE_NORMAL = 0,
|
||||||
#define WSTATE_NEED_RESTART 2
|
WSTATE_NEED_EXIT = 1,
|
||||||
#define WSTATE_EXITING 3
|
WSTATE_NEED_RESTART = 2,
|
||||||
#define WSTATE_RESTARTING 4
|
WSTATE_EXITING = 3,
|
||||||
#define WSTATE_MODAL 5
|
WSTATE_RESTARTING = 4,
|
||||||
#define WSTATE_NEED_REREAD 6
|
WSTATE_MODAL = 5,
|
||||||
|
WSTATE_NEED_REREAD = 6
|
||||||
|
} wprog_state;
|
||||||
|
|
||||||
|
|
||||||
#define WCHECK_STATE(state) (state == WProgramState)
|
#define WCHECK_STATE(state) (state == WProgramState)
|
||||||
@@ -241,7 +243,7 @@ typedef struct WObjDescriptor {
|
|||||||
|
|
||||||
#define WCHANGE_STATE(nstate) {\
|
#define WCHANGE_STATE(nstate) {\
|
||||||
if (WProgramState == WSTATE_NORMAL\
|
if (WProgramState == WSTATE_NORMAL\
|
||||||
|| nstate != WSTATE_MODAL)\
|
|| (nstate) != WSTATE_MODAL)\
|
||||||
WProgramState = (nstate); \
|
WProgramState = (nstate); \
|
||||||
if (WProgramSigState != 0)\
|
if (WProgramSigState != 0)\
|
||||||
WProgramState = WProgramSigState;\
|
WProgramState = WProgramSigState;\
|
||||||
@@ -452,8 +454,8 @@ extern struct WPreferences {
|
|||||||
/****** Global Variables ******/
|
/****** Global Variables ******/
|
||||||
extern Display *dpy;
|
extern Display *dpy;
|
||||||
extern unsigned int ValidModMask;
|
extern unsigned int ValidModMask;
|
||||||
extern char WProgramState;
|
extern wprog_state WProgramState;
|
||||||
extern char WProgramSigState;
|
extern wprog_state WProgramSigState;
|
||||||
|
|
||||||
/****** Notifications ******/
|
/****** Notifications ******/
|
||||||
extern const char WMNManaged[];
|
extern const char WMNManaged[];
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ int wXkbEventBase;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* special flags */
|
/* special flags */
|
||||||
char WProgramSigState = 0;
|
wprog_state WProgramSigState = 0;
|
||||||
char WProgramState = WSTATE_NORMAL;
|
wprog_state WProgramState = WSTATE_NORMAL;
|
||||||
char WDelayedActionSet = 0;
|
char WDelayedActionSet = 0;
|
||||||
|
|
||||||
/* notifications */
|
/* notifications */
|
||||||
|
|||||||
Reference in New Issue
Block a user