10bbfda8aSnia/*
20bbfda8aSnia * Copyright 2014 Olaf Seibert
30bbfda8aSnia */
40bbfda8aSnia
50bbfda8aSnia#ifndef _CTWM_EWMH_H
60bbfda8aSnia#define _CTWM_EWMH_H
70bbfda8aSnia
80bbfda8aSnia/*
90bbfda8aSnia * Switch for experimental code to treat a Desktop window as a Root
100bbfda8aSnia * window for the purposes of key and button bindings.
110bbfda8aSnia * It doesn't work as nicely as I hoped though; maybe I'll get some
120bbfda8aSnia * better idea.
130bbfda8aSnia */
140bbfda8aSnia/* #define EWMH_DESKTOP_ROOT */
150bbfda8aSnia
160bbfda8aSniatypedef enum EwmhWindowType {
170bbfda8aSnia	wt_Normal,
180bbfda8aSnia	wt_Desktop,
190bbfda8aSnia	wt_Dock,
200bbfda8aSnia} EwmhWindowType;
210bbfda8aSnia
220bbfda8aSnia/*
230bbfda8aSnia * The window is to reserve space at the edge of the screen.
240bbfda8aSnia */
250bbfda8aSniatypedef struct EwmhStrut {
260bbfda8aSnia	struct EwmhStrut *next;
270bbfda8aSnia	struct TwmWindow *win;
280bbfda8aSnia
290bbfda8aSnia	int left;
300bbfda8aSnia	int right;
310bbfda8aSnia	int top;
320bbfda8aSnia	int bottom;
330bbfda8aSnia} EwmhStrut;
340bbfda8aSnia
350bbfda8aSnia#define EWMH_HAS_STRUT                  0x0001
360bbfda8aSnia
370bbfda8aSnia#define EWMH_STATE_MAXIMIZED_VERT       0x0010  /* for _NET_WM_STATE */
380bbfda8aSnia#define EWMH_STATE_MAXIMIZED_HORZ       0x0020  /* for _NET_WM_STATE */
390bbfda8aSnia#define EWMH_STATE_FULLSCREEN           0x0040  /* for _NET_WM_STATE */
400bbfda8aSnia#define EWMH_STATE_SHADED               0x0080  /* for _NET_WM_STATE */
410bbfda8aSnia#define EWMH_STATE_ABOVE                0x0100  /* for _NET_WM_STATE */
420bbfda8aSnia#define EWMH_STATE_BELOW                0x0200  /* for _NET_WM_STATE */
430bbfda8aSnia#define EWMH_STATE_ALL                  0xFFF0
440bbfda8aSnia
450bbfda8aSnia/*
460bbfda8aSnia * OTP priorities of the window types we recognize
470bbfda8aSnia */
480bbfda8aSnia/* Initial vals for these types, if the user hasn't set something else */
490bbfda8aSnia#define EWMH_PRI_DESKTOP                -8
500bbfda8aSnia#define EWMH_PRI_DOCK                    4
510bbfda8aSnia
520bbfda8aSnia/* STATE_FULLSCREEN windows with focus get jammed here */
530bbfda8aSnia#define EWMH_PRI_FULLSCREEN              6
540bbfda8aSnia
550bbfda8aSnia/* STATE_ABOVE/BELOW get +/- this to what they would be otherwise */
560bbfda8aSnia#define EWMH_PRI_ABOVE                   2
570bbfda8aSnia
580bbfda8aSniavoid EwmhInit(void);
590bbfda8aSniabool EwmhInitScreenEarly(ScreenInfo *scr);
600bbfda8aSniavoid EwmhInitScreenLate(ScreenInfo *scr);
61b18c2d1eSnia#ifdef VSCREEN
620bbfda8aSniavoid EwmhInitVirtualRoots(ScreenInfo *scr);
63b18c2d1eSnia#endif
640bbfda8aSniavoid EwmhTerminate(void);
650bbfda8aSniavoid EwmhSelectionClear(XSelectionClearEvent *sev);
660bbfda8aSniabool EwmhClientMessage(XClientMessageEvent *msg);
670bbfda8aSniaImage *EwmhGetIcon(ScreenInfo *scr, TwmWindow *twm_win);
680bbfda8aSniaint EwmhHandlePropertyNotify(XPropertyEvent *event, TwmWindow *twm_win);
690bbfda8aSniavoid EwmhSet_NET_WM_DESKTOP(TwmWindow *twm_win);
700bbfda8aSniavoid EwmhSet_NET_WM_DESKTOP_ws(TwmWindow *twm_win, WorkSpace *ws);
710bbfda8aSniaint EwmhGetOccupation(TwmWindow *twm_win);
720bbfda8aSniavoid EwmhUnmapNotify(TwmWindow *twm_win);
730bbfda8aSniavoid EwmhAddClientWindow(TwmWindow *new_win);
740bbfda8aSniavoid EwmhDeleteClientWindow(TwmWindow *old_win);
750bbfda8aSniavoid EwmhSet_NET_CLIENT_LIST_STACKING(void);
760bbfda8aSniavoid EwmhSet_NET_ACTIVE_WINDOW(Window w);
770bbfda8aSniavoid EwmhGetProperties(TwmWindow *twm_win);
780bbfda8aSniaint EwmhGetInitPriority(TwmWindow *twm_win);
790bbfda8aSniabool EwmhHasBorder(TwmWindow *twm_win);
800bbfda8aSniabool EwmhHasTitle(TwmWindow *twm_win);
810bbfda8aSniabool EwmhOnWindowRing(TwmWindow *twm_win);
82b18c2d1eSniavoid EwmhSet_NET_FRAME_EXTENTS(TwmWindow *twm_win);
830bbfda8aSniavoid EwmhSet_NET_SHOWING_DESKTOP(int state);
840bbfda8aSniavoid EwmhSet_NET_WM_STATE(TwmWindow *twm_win, int changes);
850bbfda8aSnia
860bbfda8aSnia#endif /* _CTWM_EWMH_H */
87