4 * Copyright (c) Tuomo Valkonen 1999-2007.
6 * See the included file LICENSE for details.
9 #ifndef ION_IONCORE_SCREEN_H
10 #define ION_IONCORE_SCREEN_H
12 #include <libextl/extl.h>
13 #include <libmainloop/hooks.h>
16 #include "rectangle.h"
19 #define FOR_ALL_SCREENS(SCR) \
20 for((SCR)=ioncore_g.screens; \
22 (SCR)=(SCR)->next_scr)
24 #define FOR_ALL_SCREENS_W_NEXT(SCR, NXT) \
25 for((SCR)=ioncore_g.screens, NXT=((SCR) ? (SCR)->next_scr : NULL); \
27 (SCR)=(NXT), NXT=((SCR) ? (SCR)->next_scr : NULL))
42 WRectangle managed_off;
43 WScreen *next_scr, *prev_scr;
44 Watch notifywin_watch;
48 /* rootwin should only be set if parent is NULL, and this WScreen is
49 * actually a root window.
51 extern bool screen_init(WScreen *scr, WRootWin *parent,
52 const WFitParams *fp, int id, Window rootwin);
54 extern WScreen *create_screen(WRootWin *parent, const WFitParams *fp, int id);
56 extern void screen_deinit(WScreen *scr);
58 extern int screen_id(WScreen *scr);
60 extern void screen_set_managed_offset(WScreen *scr, const WRectangle *off);
62 extern bool screen_init_layout(WScreen *scr, ExtlTab tab);
64 extern WScreen *ioncore_find_screen_id(int id);
65 extern WScreen *ioncore_goto_screen_id(int id);
66 extern WScreen *ioncore_goto_next_screen();
67 extern WScreen *ioncore_goto_prev_screen();
69 /* Handlers of this hook receive a WScreen* as the sole parameter. */
70 extern WHook *screen_managed_changed_hook;
72 #endif /* ION_IONCORE_SCREEN_H */