X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sys.h;h=60d705efaf03015d0816cf343dad466b1a33a4f6;hb=9c89736d5e2b165df80ae48670a74580e85513c4;hp=adc0247590c6470b74e1769607542d492b1dd748;hpb=853b20d942c746cc8ebb5e6fe33386e1ed9f3525;p=wmpus diff --git a/sys.h b/sys.h index adc0247..60d705e 100644 --- a/sys.h +++ b/sys.h @@ -23,84 +23,6 @@ * The sys also provides the API used by the wm to position * and control windows. */ - -/* Window states */ -typedef enum { - ST_HIDE, // completely hidden - ST_SHOW, // show as regular window - ST_FULL, // fullscreen (without decorations) - ST_MAX, // maximized (with decorations) - ST_SHADE, // show titlebar only - ST_ICON, // iconified/minimized - ST_CLOSE, // close the window -} state_t; - -/* Window types */ -typedef enum { - TYPE_NORMAL, - TYPE_DIALOG, - TYPE_TOOLBAR, -} type_t; - -/* Basic window type */ -typedef struct win_sys win_sys_t; -typedef struct win_wm win_wm_t; -typedef struct win { - int x, y, z; - int w, h; - state_t state; - type_t type; - struct win *parent; - win_sys_t *sys; - win_wm_t *wm; -} win_t; - -/* Generic key codes, also used for some other events - * Keys map to their Unicode value */ -typedef int event_t; -enum { - EV_ALERT = '\a', - EV_BACKSPACE = '\b', - EV_FORMFEED = '\f', - EV_NEWLINE = '\n', - EV_RETURN = '\r', - EV_TAB = '\t', - EV_VTAB = '\v', - EV_SINGLEQUOTE = '\'', - EV_DOUBLEQUOTE = '\"', - EV_BACKSLASH = '\\', - EV_QUESTION = '\?', - EV_NONE = 0xF0000, // unused Unicode space - EV_MOUSE0, EV_MOUSE1, EV_MOUSE2, EV_MOUSE3, - EV_MOUSE4, EV_MOUSE5, EV_MOUSE6, EV_MOUSE7, - EV_LEFT, EV_RIGHT, EV_UP, EV_DOWN, - EV_HOME, EV_END, EV_PAGEUP, EV_PAGEDOWN, - EV_F1, EV_F2, EV_F3, EV_F4, - EV_F5, EV_F6, EV_F7, EV_F8, - EV_F9, EV_F10, EV_F11, EV_F12, - EV_ALT, EV_CTRL, EV_SHIFT, EV_WIN, - EV_ENTER, EV_LEAVE, EV_FOCUS, EV_UNFOCUS, -}; - -/* Key modifiers, up is for button release */ -typedef struct { - unsigned char alt : 1; - unsigned char ctrl : 1; - unsigned char shift : 1; - unsigned char win : 1; - unsigned char up : 1; -} mod_t; -#define MOD(...) ((mod_t){__VA_ARGS__}) -#define mod2int(mod) (*((unsigned char*)&(mod))) - -/* Mouse movement */ -typedef struct { - int x, y; - int rx, ry; -} ptr_t; -#define PTR(...) ((ptr_t){__VA_ARGS__}) - - /* Move the window to the specified location and set it's * geometry. The position and size include borders and * window decorations. */ @@ -125,16 +47,16 @@ void sys_unwatch(win_t *win, event_t event, mod_t mod); /* Return a list of windows representing the geometry of the * physical displays attached to the computer. */ -list_t *sys_info(win_t *root); +list_t *sys_info(void); /* First call, calls wm_insert for each existing window */ -win_t *sys_init(void); +void sys_init(void); /* Starts the main loop */ -void sys_run(win_t *root); +void sys_run(void); /* Exit main loop */ void sys_exit(void); /* Free all static data, for memory debugging */ -void sys_free(win_t *root); +void sys_free(void);