💾 Archived View for gemini.rmf-dev.com › repo › Vaati › cwm › files › 7c428f60078988deabe6df2e054d78… captured on 2023-01-29 at 04:31:21. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
0 /*
1 * calmwm - the calm window manager
2 *
3 * Copyright (c) 2004 Marius Aamodt Eriksen <marius@monkey.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 *
17 * $OpenBSD$
18 */
19
20 #ifndef _CALMWM_H_
21 #define _CALMWM_H_
22
23 #include <X11/XKBlib.h>
24 #include <X11/Xatom.h>
25 #include <X11/Xft/Xft.h>
26 #include <X11/Xlib.h>
27 #include <X11/Xproto.h>
28 #include <X11/Xutil.h>
29 #include <X11/cursorfont.h>
30 #include <X11/extensions/Xrandr.h>
31 #include <X11/keysym.h>
32
33 #define LOG_DEBUG0(...) log_debug(0, __func__, __VA_ARGS__)
34 #define LOG_DEBUG1(...) log_debug(1, __func__, __VA_ARGS__)
35 #define LOG_DEBUG2(...) log_debug(2, __func__, __VA_ARGS__)
36 #define LOG_DEBUG3(...) log_debug(3, __func__, __VA_ARGS__)
37
38 #undef MIN
39 #undef MAX
40 #define MIN(x, y) ((x) < (y) ? (x) : (y))
41 #define MAX(x, y) ((x) > (y) ? (x) : (y))
42
43 #ifndef nitems
44 #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
45 #endif
46
47 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
48 #define MOUSEMASK (BUTTONMASK | PointerMotionMask)
49 #define IGNOREMODMASK (LockMask | Mod2Mask | 0x2000)
50
51 /* direction/amount */
52 #define CWM_UP 0x0001
53 #define CWM_DOWN 0x0002
54 #define CWM_LEFT 0x0004
55 #define CWM_RIGHT 0x0008
56 #define CWM_BIGAMOUNT 0x0010
57 #define CWM_UP_BIG (CWM_UP | CWM_BIGAMOUNT)
58 #define CWM_DOWN_BIG (CWM_DOWN | CWM_BIGAMOUNT)
59 #define CWM_LEFT_BIG (CWM_LEFT | CWM_BIGAMOUNT)
60 #define CWM_RIGHT_BIG (CWM_RIGHT | CWM_BIGAMOUNT)
61 #define CWM_UP_RIGHT (CWM_UP | CWM_RIGHT)
62 #define CWM_UP_LEFT (CWM_UP | CWM_LEFT)
63 #define CWM_DOWN_RIGHT (CWM_DOWN | CWM_RIGHT)
64 #define CWM_DOWN_LEFT (CWM_DOWN | CWM_LEFT)
65
66 #define CWM_CYCLE_FORWARD 0x0001
67 #define CWM_CYCLE_REVERSE 0x0002
68 #define CWM_CYCLE_INGROUP 0x0004
69
70 enum cwm_status {
71 CWM_QUIT,
72 CWM_RUNNING,
73 CWM_EXEC_WM
74 };
75 enum cursor_font {
76 CF_NORMAL,
77 CF_MOVE,
78 CF_RESIZE,
79 CF_QUESTION,
80 CF_NITEMS
81 };
82 enum color {
83 CWM_COLOR_BORDER_ACTIVE,
84 CWM_COLOR_BORDER_INACTIVE,
85 CWM_COLOR_BORDER_URGENCY,
86 CWM_COLOR_BORDER_GROUP,
87 CWM_COLOR_BORDER_UNGROUP,
88 CWM_COLOR_MENU_FG,
89 CWM_COLOR_MENU_BG,
90 CWM_COLOR_MENU_FONT,
91 CWM_COLOR_MENU_FONT_SEL,
92 CWM_COLOR_NITEMS
93 };
94
95 struct geom {
96 int x;
97 int y;
98 int w;
99 int h;
100 };
101 struct gap {
102 int top;
103 int bottom;
104 int left;
105 int right;
106 };
107
108 struct winname {
109 TAILQ_ENTRY(winname) entry;
110 char *name;
111 };
112 TAILQ_HEAD(name_q, winname);
113 TAILQ_HEAD(ignore_q, winname);
114
115 struct client_ctx {
116 TAILQ_ENTRY(client_ctx) entry;
117 struct screen_ctx *sc;
118 struct group_ctx *gc;
119 Window win;
120 Colormap colormap;
121 int bwidth; /* border width */
122 int obwidth; /* original border width */
123 struct geom geom, savegeom, fullgeom;
124 struct {
125 long flags; /* defined hints */
126 int basew; /* desired width */
127 int baseh; /* desired height */
128 int minw; /* minimum width */
129 int minh; /* minimum height */
130 int maxw; /* maximum width */
131 int maxh; /* maximum height */
132 int incw; /* width increment progression */
133 int inch; /* height increment progression */
134 float mina; /* minimum aspect ratio */
135 float maxa; /* maximum aspect ratio */
136 } hint;
137 struct {
138 int x; /* x position */
139 int y; /* y position */
140 } ptr;
141 struct {
142 int h; /* height */
143 int w; /* width */
144 } dim;
145 #define CLIENT_HIDDEN 0x0001
146 #define CLIENT_IGNORE 0x0002
147 #define CLIENT_VMAXIMIZED 0x0004
148 #define CLIENT_HMAXIMIZED 0x0008
149 #define CLIENT_FREEZE 0x0010
150 #define CLIENT_GROUP 0x0020
151 #define CLIENT_UNGROUP 0x0040
152 #define CLIENT_INPUT 0x0080
153 #define CLIENT_WM_DELETE_WINDOW 0x0100
154 #define CLIENT_WM_TAKE_FOCUS 0x0200
155 #define CLIENT_URGENCY 0x0400
156 #define CLIENT_FULLSCREEN 0x0800
157 #define CLIENT_STICKY 0x1000
158 #define CLIENT_ACTIVE 0x2000
159 #define CLIENT_SKIP_PAGER 0x4000
160 #define CLIENT_SKIP_TASKBAR 0x8000
161
162 #define CLIENT_SKIP_CYCLE (CLIENT_HIDDEN | CLIENT_IGNORE | \
163 CLIENT_SKIP_TASKBAR | CLIENT_SKIP_PAGER)
164 #define CLIENT_HIGHLIGHT (CLIENT_GROUP | CLIENT_UNGROUP)
165 #define CLIENT_MAXFLAGS (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
166 #define CLIENT_MAXIMIZED (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
167 int flags;
168 int stackingorder;
169 struct name_q nameq;
170 char *name;
171 char *label;
172 char *res_class; /* class hint */
173 char *res_name; /* class hint */
174 int initial_state; /* wm hint */
175 };
176 TAILQ_HEAD(client_q, client_ctx);
177
178 struct group_ctx {
179 TAILQ_ENTRY(group_ctx) entry;
180 struct screen_ctx *sc;
181 char *name;
182 int num;
183 };
184 TAILQ_HEAD(group_q, group_ctx);
185
186 struct autogroup {
187 TAILQ_ENTRY(autogroup) entry;
188 char *class;
189 char *name;
190 int num;
191 };
192 TAILQ_HEAD(autogroup_q, autogroup);
193
194 struct region_ctx {
195 TAILQ_ENTRY(region_ctx) entry;
196 int num;
197 struct geom view; /* viewable area */
198 struct geom work; /* workable area, gap-applied */
199 };
200 TAILQ_HEAD(region_q, region_ctx);
201
202 struct screen_ctx {
203 TAILQ_ENTRY(screen_ctx) entry;
204 int which;
205 Window rootwin;
206 int cycling;
207 int hideall;
208 int snapdist;
209 struct geom view; /* viewable area */
210 struct geom work; /* workable area, gap-applied */
211 struct gap gap;
212 struct client_q clientq;
213 struct region_q regionq;
214 struct group_q groupq;
215 struct group_ctx *group_active;
216 struct group_ctx *group_last;
217 Colormap colormap;
218 Visual *visual;
219 struct {
220 Window win;
221 XftDraw *xftdraw;
222 } prop;
223 XftColor xftcolor[CWM_COLOR_NITEMS];
224 XftFont *xftfont;
225 };
226 TAILQ_HEAD(screen_q, screen_ctx);
227
228 struct cargs {
229 char *cmd;
230 int flag;
231 enum {
232 CWM_XEV_KEY,
233 CWM_XEV_BTN
234 } xev;
235 };
236 enum context {
237 CWM_CONTEXT_NONE = 0,
238 CWM_CONTEXT_CC,
239 CWM_CONTEXT_SC
240 };
241 struct bind_ctx {
242 TAILQ_ENTRY(bind_ctx) entry;
243 void (*callback)(void *, struct cargs *);
244 struct cargs *cargs;
245 enum context context;
246 unsigned int modmask;
247 union {
248 KeySym keysym;
249 unsigned int button;
250 } press;
251 };
252 TAILQ_HEAD(keybind_q, bind_ctx);
253 TAILQ_HEAD(mousebind_q, bind_ctx);
254
255 struct cmd_ctx {
256 TAILQ_ENTRY(cmd_ctx) entry;
257 char *name;
258 char *path;
259 };
260 TAILQ_HEAD(cmd_q, cmd_ctx);
261 TAILQ_HEAD(wm_q, cmd_ctx);
262
263 #define CWM_MENU_DUMMY 0x0001
264 #define CWM_MENU_FILE 0x0002
265 #define CWM_MENU_LIST 0x0004
266 #define CWM_MENU_WINDOW_ALL 0x0008
267 #define CWM_MENU_WINDOW_HIDDEN 0x0010
268
269 struct menu {
270 TAILQ_ENTRY(menu) entry;
271 TAILQ_ENTRY(menu) resultentry;
272 #define MENU_MAXENTRY 200
273 char text[MENU_MAXENTRY + 1];
274 char print[MENU_MAXENTRY + 1];
275 void *ctx;
276 short dummy;
277 short abort;
278 };
279 TAILQ_HEAD(menu_q, menu);
280
281 struct conf {
282 struct keybind_q keybindq;
283 struct mousebind_q mousebindq;
284 struct autogroup_q autogroupq;
285 struct ignore_q ignoreq;
286 struct cmd_q cmdq;
287 struct wm_q wmq;
288 int ngroups;
289 int stickygroups;
290 int nameqlen;
291 int bwidth;
292 int mamount;
293 int snapdist;
294 int htile;
295 int vtile;
296 struct gap gap;
297 char *color[CWM_COLOR_NITEMS];
298 char *font;
299 char *wmname;
300 Cursor cursor[CF_NITEMS];
301 int xrandr;
302 int xrandr_event_base;
303 char *conf_file;
304 char *known_hosts;
305 char *wm_argv;
306 int debug;
307 };
308
309 /* MWM hints */
310 struct mwm_hints {
311 #define MWM_HINTS_ELEMENTS 5L
312
313 #define MWM_HINTS_FUNCTIONS (1L << 0)
314 #define MWM_HINTS_DECORATIONS (1L << 1)
315 #define MWM_HINTS_INPUT_MODE (1L << 2)
316 #define MWM_HINTS_STATUS (1L << 3)
317 unsigned long flags;
318
319 #define MWM_FUNC_ALL (1L << 0)
320 #define MWM_FUNC_RESIZE (1L << 1)
321 #define MWM_FUNC_MOVE (1L << 2)
322 #define MWM_FUNC_MINIMIZE (1L << 3)
323 #define MWM_FUNC_MAXIMIZE (1L << 4)
324 #define MWM_FUNC_CLOSE (1L << 5)
325 unsigned long functions;
326
327 #define MWM_DECOR_ALL (1L << 0)
328 #define MWM_DECOR_BORDER (1L << 1)
329 #define MWM_DECOR_RESIZEH (1L << 2)
330 #define MWM_DECOR_TITLE (1L << 3)
331 #define MWM_DECOR_MENU (1L << 4)
332 #define MWM_DECOR_MINIMIZE (1L << 5)
333 #define MWM_DECOR_MAXIMIZE (1L << 6)
334 unsigned long decorations;
335
336 #define MWM_INPUT_MODELESS 0
337 #define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
338 #define MWM_INPUT_SYSTEM_MODAL 2
339 #define MWM_INPUT_FULL_APPLICATION_MODAL 3
340 long inputMode;
341
342 #define MWM_TEAROFF_WINDOW (1L << 0)
343 unsigned long status;
344 };
345
346 enum cwmh {
347 WM_STATE,
348 WM_DELETE_WINDOW,
349 WM_TAKE_FOCUS,
350 WM_PROTOCOLS,
351 _MOTIF_WM_HINTS,
352 UTF8_STRING,
353 WM_CHANGE_STATE,
354 CWMH_NITEMS
355 };
356 enum ewmh {
357 _NET_SUPPORTED,
358 _NET_SUPPORTING_WM_CHECK,
359 _NET_ACTIVE_WINDOW,
360 _NET_CLIENT_LIST,
361 _NET_CLIENT_LIST_STACKING,
362 _NET_NUMBER_OF_DESKTOPS,
363 _NET_CURRENT_DESKTOP,
364 _NET_DESKTOP_VIEWPORT,
365 _NET_DESKTOP_GEOMETRY,
366 _NET_VIRTUAL_ROOTS,
367 _NET_SHOWING_DESKTOP,
368 _NET_DESKTOP_NAMES,
369 _NET_WORKAREA,
370 _NET_WM_NAME,
371 _NET_WM_DESKTOP,
372 _NET_CLOSE_WINDOW,
373 _NET_WM_STATE,
374 #define _NET_WM_STATES_NITEMS 9
375 _NET_WM_STATE_STICKY,
376 _NET_WM_STATE_MAXIMIZED_VERT,
377 _NET_WM_STATE_MAXIMIZED_HORZ,
378 _NET_WM_STATE_HIDDEN,
379 _NET_WM_STATE_FULLSCREEN,
380 _NET_WM_STATE_DEMANDS_ATTENTION,
381 _NET_WM_STATE_SKIP_PAGER,
382 _NET_WM_STATE_SKIP_TASKBAR,
383 _CWM_WM_STATE_FREEZE,
384 EWMH_NITEMS
385 };
386 enum net_wm_state {
387 _NET_WM_STATE_REMOVE,
388 _NET_WM_STATE_ADD,
389 _NET_WM_STATE_TOGGLE
390 };
391
392 extern Display *X_Dpy;
393 extern Time Last_Event_Time;
394 extern Atom cwmh[CWMH_NITEMS];
395 extern Atom ewmh[EWMH_NITEMS];
396 extern struct screen_q Screenq;
397 extern struct conf Conf;
398
399 void client_apply_sizehints(struct client_ctx *);
400 void client_close(struct client_ctx *);
401 void client_config(struct client_ctx *);
402 struct client_ctx *client_current(struct screen_ctx *);
403 void client_draw_border(struct client_ctx *);
404 struct client_ctx *client_find(Window);
405 void client_get_sizehints(struct client_ctx *);
406 void client_hide(struct client_ctx *);
407 void client_htile(struct client_ctx *);
408 int client_inbound(struct client_ctx *, int, int);
409 struct client_ctx *client_init(Window, struct screen_ctx *);
410 void client_lower(struct client_ctx *);
411 void client_move(struct client_ctx *);
412 void client_mtf(struct client_ctx *);
413 struct client_ctx *client_next(struct client_ctx *);
414 struct client_ctx *client_prev(struct client_ctx *);
415 void client_ptr_inbound(struct client_ctx *, int);
416 void client_ptr_save(struct client_ctx *);
417 void client_ptr_warp(struct client_ctx *);
418 void client_raise(struct client_ctx *);
419 void client_remove(struct client_ctx *);
420 void client_resize(struct client_ctx *, int);
421 void client_set_active(struct client_ctx *);
422 void client_set_name(struct client_ctx *);
423 void client_show(struct client_ctx *);
424 int client_snapcalc(int, int, int, int, int);
425 void client_toggle_hidden(struct client_ctx *);
426 void client_toggle_hmaximize(struct client_ctx *);
427 void client_toggle_fullscreen(struct client_ctx *);
428 void client_toggle_freeze(struct client_ctx *);
429 void client_toggle_maximize(struct client_ctx *);
430 void client_toggle_skip_pager(struct client_ctx *);
431 void client_toggle_skip_taskbar(struct client_ctx *);
432 void client_toggle_sticky(struct client_ctx *);
433 void client_toggle_vmaximize(struct client_ctx *);
434 void client_transient(struct client_ctx *);
435 void client_urgency(struct client_ctx *);
436 void client_vtile(struct client_ctx *);
437 void client_wm_hints(struct client_ctx *);
438
439 void group_assign(struct group_ctx *, struct client_ctx *);
440 int group_autogroup(struct client_ctx *);
441 void group_cycle(struct screen_ctx *, int);
442 void group_hide(struct group_ctx *);
443 int group_holds_only_hidden(struct group_ctx *);
444 int group_holds_only_sticky(struct group_ctx *);
445 void group_init(struct screen_ctx *, int, const char *);
446 void group_movetogroup(struct client_ctx *, int);
447 void group_only(struct screen_ctx *, int);
448 void group_close(struct screen_ctx *, int);
449 int group_restore(struct client_ctx *);
450 void group_show(struct group_ctx *);
451 void group_toggle(struct screen_ctx *, int);
452 void group_toggle_all(struct screen_ctx *);
453 void group_toggle_membership(struct client_ctx *);
454 void group_update_names(struct screen_ctx *);
455
456 void search_match_client(struct menu_q *, struct menu_q *,
457 char *);
458 void search_match_cmd(struct menu_q *, struct menu_q *,
459 char *);
460 void search_match_exec(struct menu_q *, struct menu_q *,
461 char *);
462 void search_match_group(struct menu_q *, struct menu_q *,
463 char *);
464 void search_match_path(struct menu_q *, struct menu_q *,
465 char *);
466 void search_match_text(struct menu_q *, struct menu_q *,
467 char *);
468 void search_match_wm(struct menu_q *, struct menu_q *,
469 char *);
470 void search_print_client(struct menu *, int);
471 void search_print_cmd(struct menu *, int);
472 void search_print_group(struct menu *, int);
473 void search_print_text(struct menu *, int);
474 void search_print_wm(struct menu *, int);
475
476 struct region_ctx *region_find(struct screen_ctx *, int, int);
477 void screen_assert_clients_within(struct screen_ctx *);
478 struct geom screen_area(struct screen_ctx *, int, int, int);
479 struct screen_ctx *screen_find(Window);
480 void screen_init(int);
481 void screen_prop_win_create(struct screen_ctx *, Window);
482 void screen_prop_win_destroy(struct screen_ctx *);
483 void screen_prop_win_draw(struct screen_ctx *,
484 const char *, ...)
485 __attribute__((__format__ (printf, 2, 3)))
486 __attribute__((__nonnull__ (2)));
487 void screen_update_geometry(struct screen_ctx *);
488 void screen_updatestackingorder(struct screen_ctx *);
489
490 void kbfunc_cwm_status(void *, struct cargs *);
491 void kbfunc_ptrmove(void *, struct cargs *);
492 void kbfunc_client_snap(void *, struct cargs *);
493 void kbfunc_client_move(void *, struct cargs *);
494 void kbfunc_client_resize(void *, struct cargs *);
495 void kbfunc_client_close(void *, struct cargs *);
496 void kbfunc_client_lower(void *, struct cargs *);
497 void kbfunc_client_raise(void *, struct cargs *);
498 void kbfunc_client_hide(void *, struct cargs *);
499 void kbfunc_client_toggle_freeze(void *, struct cargs *);
500 void kbfunc_client_toggle_sticky(void *, struct cargs *);
501 void kbfunc_client_toggle_fullscreen(void *,
502 struct cargs *);
503 void kbfunc_client_toggle_maximize(void *, struct cargs *);
504 void kbfunc_client_toggle_hmaximize(void *, struct cargs *);
505 void kbfunc_client_toggle_vmaximize(void *, struct cargs *);
506 void kbfunc_client_htile(void *, struct cargs *);
507 void kbfunc_client_vtile(void *, struct cargs *);
508 void kbfunc_client_cycle(void *, struct cargs *);
509 void kbfunc_client_toggle_group(void *, struct cargs *);
510 void kbfunc_client_movetogroup(void *, struct cargs *);
511 void kbfunc_group_toggle(void *, struct cargs *);
512 void kbfunc_group_only(void *, struct cargs *);
513 void kbfunc_group_last(void *, struct cargs *);
514 void kbfunc_group_close(void *, struct cargs *);
515 void kbfunc_group_cycle(void *, struct cargs *);
516 void kbfunc_group_toggle_all(void *, struct cargs *);
517 void kbfunc_menu_client(void *, struct cargs *);
518 void kbfunc_menu_cmd(void *, struct cargs *);
519 void kbfunc_menu_group(void *, struct cargs *);
520 void kbfunc_menu_wm(void *, struct cargs *);
521 void kbfunc_menu_exec(void *, struct cargs *);
522 void kbfunc_menu_ssh(void *, struct cargs *);
523 void kbfunc_client_menu_label(void *, struct cargs *);
524 void kbfunc_exec_cmd(void *, struct cargs *);
525 void kbfunc_exec_lock(void *, struct cargs *);
526 void kbfunc_exec_term(void *, struct cargs *);
527
528 struct menu *menu_filter(struct screen_ctx *, struct menu_q *,
529 const char *, const char *, int,
530 void (*)(struct menu_q *, struct menu_q *, char *),
531 void (*)(struct menu *, int));
532 void menuq_add(struct menu_q *, void *, const char *, ...)
533 __attribute__((__format__ (printf, 3, 4)));
534 void menuq_clear(struct menu_q *);
535
536 int parse_config(const char *, struct conf *);
537
538 void conf_autogroup(struct conf *, int, const char *,
539 const char *);
540 int conf_bind_key(struct conf *, const char *,
541 const char *);
542 int conf_bind_mouse(struct conf *, const char *,
543 const char *);
544 void conf_clear(struct conf *);
545 void conf_client(struct client_ctx *);
546 void conf_cmd_add(struct conf *, const char *,
547 const char *);
548 void conf_wm_add(struct conf *, const char *,
549 const char *);
550 void conf_cursor(struct conf *);
551 void conf_grab_kbd(Window);
552 void conf_grab_mouse(Window);
553 void conf_init(struct conf *);
554 void conf_ignore(struct conf *, const char *);
555 void conf_screen(struct screen_ctx *);
556 void conf_group(struct screen_ctx *);
557
558 void xev_process(void);
559
560 int xu_get_prop(Window, Atom, Atom, long, unsigned char **);
561 int xu_get_strprop(Window, Atom, char **);
562 void xu_ptr_get(Window, int *, int *);
563 void xu_ptr_set(Window, int, int);
564 void xu_get_wm_state(Window, long *);
565 void xu_set_wm_state(Window, long);
566 void xu_send_clientmsg(Window, Atom, Time);
567 void xu_xorcolor(XftColor, XftColor, XftColor *);
568
569 void xu_atom_init(void);
570 void xu_ewmh_net_supported(struct screen_ctx *);
571 void xu_ewmh_net_supported_wm_check(struct screen_ctx *);
572 void xu_ewmh_net_desktop_geometry(struct screen_ctx *);
573 void xu_ewmh_net_desktop_viewport(struct screen_ctx *);
574 void xu_ewmh_net_workarea(struct screen_ctx *);
575 void xu_ewmh_net_client_list(struct screen_ctx *);
576 void xu_ewmh_net_client_list_stacking(struct screen_ctx *);
577 void xu_ewmh_net_active_window(struct screen_ctx *, Window);
578 void xu_ewmh_net_number_of_desktops(struct screen_ctx *);
579 void xu_ewmh_net_showing_desktop(struct screen_ctx *);
580 void xu_ewmh_net_virtual_roots(struct screen_ctx *);
581 void xu_ewmh_net_current_desktop(struct screen_ctx *);
582 void xu_ewmh_net_desktop_names(struct screen_ctx *);
583 int xu_ewmh_get_net_wm_desktop(struct client_ctx *, long *);
584 void xu_ewmh_set_net_wm_desktop(struct client_ctx *);
585 Atom *xu_ewmh_get_net_wm_state(struct client_ctx *, int *);
586 void xu_ewmh_handle_net_wm_state_msg(struct client_ctx *,
587 int, Atom, Atom);
588 void xu_ewmh_set_net_wm_state(struct client_ctx *);
589 void xu_ewmh_restore_net_wm_state(struct client_ctx *);
590
591 char *u_argv(char * const *);
592 void u_exec(char *);
593 void u_spawn(char *);
594 void log_debug(int, const char *, const char *, ...)
595 __attribute__((__format__ (printf, 3, 4)))
596 __attribute__((__nonnull__ (3)));
597
598 void *xcalloc(size_t, size_t);
599 void *xmalloc(size_t);
600 void *xreallocarray(void *, size_t, size_t);
601 char *xstrdup(const char *);
602 int xasprintf(char **, const char *, ...)
603 __attribute__((__format__ (printf, 2, 3)))
604 __attribute__((__nonnull__ (2)));
605 int xvasprintf(char **, const char *, va_list)
606 __attribute__((__nonnull__ (2)));
607
608 #endif /* _CALMWM_H_ */
609