Add reminder to investigate recursive commands for 2.6
[fvwm.git] / fvwm / ewmh_intern.h
blob9b7ddf4b72c6aee871f62e8dc3516defa6485cfa
1 /* -*-c-*- */
2 /* Copyright (C) 2001 Olivier Chapuis */
4 #ifndef _EWMH_INTERN_
5 #define _EWMH_INTERN_
7 /* Extended window manager hints support */
9 /* #define EWMH_DEBUG */
10 #ifdef EWMH_DEBUG
11 #include <stdarg.h>
12 #include <sys/times.h>
13 #include "ftime.h"
14 #endif
16 #define EWMH_CMD_ARGS FvwmWindow *fw, XEvent *ev, window_style *style, \
17 unsigned long any
19 typedef struct ewmh_atom
21 char *name;
22 Atom atom;
23 Atom atom_type;
24 #ifdef __STDC__
25 int (*action)(EWMH_CMD_ARGS);
26 #else
27 int (*action)();
28 #endif
29 } ewmh_atom;
31 typedef enum
33 EWMH_ATOM_LIST_ALL,
34 EWMH_ATOM_LIST_CLIENT_ROOT,
35 EWMH_ATOM_LIST_CLIENT_WIN,
36 EWMH_ATOM_LIST_WM_STATE,
37 EWMH_ATOM_LIST_ALLOWED_ACTIONS,
38 EWMH_ATOM_LIST_WINDOW_TYPE,
39 EWMH_ATOM_LIST_FIXED_PROPERTY,
40 EWMH_ATOM_LIST_PROPERTY_NOTIFY,
41 EWMH_ATOM_LIST_FVWM_ROOT,
42 EWMH_ATOM_LIST_FVWM_WIN,
43 EWMH_ATOM_LIST_END
44 } ewmh_atom_list_name;
46 typedef struct
48 ewmh_atom_list_name name;
49 ewmh_atom *list;
50 int size;
51 } ewmh_atom_list;
53 #define NET_WM_STATE_ADD 1
54 #define NET_WM_STATE_REMOVE 0
55 #define NET_WM_STATE_TOGGLE 2
57 #define EWMH_MAXIMIZE_HORIZ 0x1
58 #define EWMH_MAXIMIZE_VERT 0x2
59 #define EWMH_MAXIMIZE_FULL 0x3
60 #define EWMH_MAXIMIZE_REMOVE 0x4
61 #define EWMH_MAXIMIZE_FULLSCREEN 0x8
62 typedef enum
64 _NET_WM_MOVERESIZE_SIZE_TOPLEFT,
65 _NET_WM_MOVERESIZE_SIZE_TOP,
66 _NET_WM_MOVERESIZE_SIZE_TOPRIGHT,
67 _NET_WM_MOVERESIZE_SIZE_RIGHT,
68 _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT,
69 _NET_WM_MOVERESIZE_SIZE_BOTTOM,
70 _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT,
71 _NET_WM_MOVERESIZE_SIZE_LEFT,
72 _NET_WM_MOVERESIZE_MOVE,
73 _NET_WM_MOVERESIZE_SIZE_KEYBOARD,
74 _NET_WM_MOVERESIZE_MOVE_KEYBOARD
75 } ewmh_move_resize;
77 typedef struct ewmh_info
79 unsigned NumberOfDesktops;
80 unsigned MaxDesktops;
81 unsigned CurrentNumberOfDesktops;
82 Bool NeedsToCheckDesk;
83 ewmh_strut BaseStrut;
84 } ewmhInfo;
86 extern ewmhInfo ewmhc;
89 ewmh_atom *ewmh_GetEwmhAtomByAtom(Atom atom, ewmh_atom_list_name list_name);
90 void ewmh_ChangeProperty(
91 Window w, const char *atom_name, ewmh_atom_list_name list,
92 unsigned char *data, int length);
93 void ewmh_DeleteProperty(
94 Window w, const char *atom_name, ewmh_atom_list_name list);
95 void *ewmh_AtomGetByName(
96 Window win, const char *atom_name, ewmh_atom_list_name list,
97 int *size);
99 int ewmh_HandleDesktop(EWMH_CMD_ARGS);
100 int ewmh_HandleDialog(EWMH_CMD_ARGS);
101 int ewmh_HandleDock(EWMH_CMD_ARGS);
102 int ewmh_HandleMenu(EWMH_CMD_ARGS);
103 int ewmh_HandleNormal(EWMH_CMD_ARGS);
104 int ewmh_HandleToolBar(EWMH_CMD_ARGS);
106 void ewmh_AddToKdeSysTray(FvwmWindow *fw);
107 void ewmh_SetWorkArea(void);
108 void ewmh_ComputeAndSetWorkArea(void);
109 void ewmh_HandleDynamicWorkArea(void);
110 void ewmh_HandleWindowType(FvwmWindow *fw, window_style *style);
112 int ewmh_CurrentDesktop(EWMH_CMD_ARGS);
113 int ewmh_DesktopGeometry(EWMH_CMD_ARGS);
114 int ewmh_DesktopViewPort(EWMH_CMD_ARGS);
115 int ewmh_NumberOfDesktops(EWMH_CMD_ARGS);
117 int ewmh_ActiveWindow(EWMH_CMD_ARGS);
118 int ewmh_CloseWindow(EWMH_CMD_ARGS);
119 int ewmh_MoveResizeWindow(EWMH_CMD_ARGS);
120 int ewmh_RestackWindow(EWMH_CMD_ARGS);
121 int ewmh_WMDesktop(EWMH_CMD_ARGS);
122 int ewmh_MoveResize(EWMH_CMD_ARGS);
124 int ewmh_WMState(EWMH_CMD_ARGS);
125 int ewmh_WMStateFullScreen(EWMH_CMD_ARGS);
126 int ewmh_WMStateHidden(EWMH_CMD_ARGS);
127 int ewmh_WMStateMaxHoriz(EWMH_CMD_ARGS);
128 int ewmh_WMStateMaxVert(EWMH_CMD_ARGS);
129 int ewmh_WMStateModal(EWMH_CMD_ARGS);
130 int ewmh_WMStateShaded(EWMH_CMD_ARGS);
131 int ewmh_WMStateSkipPager(EWMH_CMD_ARGS);
132 int ewmh_WMStateSkipTaskBar(EWMH_CMD_ARGS);
133 int ewmh_WMStateStaysOnTop(EWMH_CMD_ARGS);
134 int ewmh_WMStateStaysOnBottom(EWMH_CMD_ARGS);
135 int ewmh_WMStateSticky(EWMH_CMD_ARGS);
137 int ewmh_WMIconGeometry(EWMH_CMD_ARGS);
138 int ewmh_WMStrut(EWMH_CMD_ARGS);
140 Bool ewmh_AllowsYes(EWMH_CMD_ARGS);
141 Bool ewmh_AllowsClose(EWMH_CMD_ARGS);
142 Bool ewmh_AllowsFullScreen(EWMH_CMD_ARGS);
143 Bool ewmh_AllowsMinimize(EWMH_CMD_ARGS);
144 Bool ewmh_AllowsMaximize(EWMH_CMD_ARGS);
145 Bool ewmh_AllowsMove(EWMH_CMD_ARGS);
146 Bool ewmh_AllowsResize(EWMH_CMD_ARGS);
148 /* ewmh_icon */
149 int ewmh_WMIcon(EWMH_CMD_ARGS);
150 CARD32 *ewmh_SetWmIconFromPixmap(
151 FvwmWindow *fw, CARD32 *orig_icon, int *orig_size,
152 Bool is_mini_icon);
154 /* debugging */
155 #ifdef EWMH_DEBUG
156 void EWMH_DLOG(char *msg, ...);
157 #else
159 #endif
161 #endif /* _EWMH_INTERN_ */