1 /* 2 * Copyright 2014 Olaf Seibert 3 */ 4 5 #ifndef _CTWM_EWMH_H 6 #define _CTWM_EWMH_H 7 8 /* 9 * Switch for experimental code to treat a Desktop window as a Root 10 * window for the purposes of key and button bindings. 11 * It doesn't work as nicely as I hoped though; maybe I'll get some 12 * better idea. 13 */ 14 /* #define EWMH_DESKTOP_ROOT */ 15 16 typedef enum EwmhWindowType { 17 wt_Normal, 18 wt_Desktop, 19 wt_Dock, 20 } EwmhWindowType; 21 22 /* 23 * The window is to reserve space at the edge of the screen. 24 */ 25 typedef struct EwmhStrut { 26 struct EwmhStrut *next; 27 struct TwmWindow *win; 28 29 int left; 30 int right; 31 int top; 32 int bottom; 33 } EwmhStrut; 34 35 #define EWMH_HAS_STRUT 0x0001 36 37 #define EWMH_STATE_MAXIMIZED_VERT 0x0010 /* for _NET_WM_STATE */ 38 #define EWMH_STATE_MAXIMIZED_HORZ 0x0020 /* for _NET_WM_STATE */ 39 #define EWMH_STATE_FULLSCREEN 0x0040 /* for _NET_WM_STATE */ 40 #define EWMH_STATE_SHADED 0x0080 /* for _NET_WM_STATE */ 41 #define EWMH_STATE_ABOVE 0x0100 /* for _NET_WM_STATE */ 42 #define EWMH_STATE_BELOW 0x0200 /* for _NET_WM_STATE */ 43 #define EWMH_STATE_ALL 0xFFF0 44 45 /* 46 * OTP priorities of the window types we recognize 47 */ 48 /* Initial vals for these types, if the user hasn't set something else */ 49 #define EWMH_PRI_DESKTOP -8 50 #define EWMH_PRI_DOCK 4 51 52 /* STATE_FULLSCREEN windows with focus get jammed here */ 53 #define EWMH_PRI_FULLSCREEN 6 54 55 /* STATE_ABOVE/BELOW get +/- this to what they would be otherwise */ 56 #define EWMH_PRI_ABOVE 2 57 58 void EwmhInit(void); 59 bool EwmhInitScreenEarly(ScreenInfo *scr); 60 void EwmhInitScreenLate(ScreenInfo *scr); 61 #ifdef VSCREEN 62 void EwmhInitVirtualRoots(ScreenInfo *scr); 63 #endif 64 void EwmhTerminate(void); 65 void EwmhSelectionClear(XSelectionClearEvent *sev); 66 bool EwmhClientMessage(XClientMessageEvent *msg); 67 Image *EwmhGetIcon(ScreenInfo *scr, TwmWindow *twm_win); 68 int EwmhHandlePropertyNotify(XPropertyEvent *event, TwmWindow *twm_win); 69 void EwmhSet_NET_WM_DESKTOP(TwmWindow *twm_win); 70 void EwmhSet_NET_WM_DESKTOP_ws(TwmWindow *twm_win, WorkSpace *ws); 71 int EwmhGetOccupation(TwmWindow *twm_win); 72 void EwmhUnmapNotify(TwmWindow *twm_win); 73 void EwmhAddClientWindow(TwmWindow *new_win); 74 void EwmhDeleteClientWindow(TwmWindow *old_win); 75 void EwmhSet_NET_CLIENT_LIST_STACKING(void); 76 void EwmhSet_NET_ACTIVE_WINDOW(Window w); 77 void EwmhGetProperties(TwmWindow *twm_win); 78 int EwmhGetInitPriority(TwmWindow *twm_win); 79 bool EwmhHasBorder(TwmWindow *twm_win); 80 bool EwmhHasTitle(TwmWindow *twm_win); 81 bool EwmhOnWindowRing(TwmWindow *twm_win); 82 void EwmhSet_NET_FRAME_EXTENTS(TwmWindow *twm_win); 83 void EwmhSet_NET_SHOWING_DESKTOP(int state); 84 void EwmhSet_NET_WM_STATE(TwmWindow *twm_win, int changes); 85 86 #endif /* _CTWM_EWMH_H */ 87