4 * Copyright (c) Tuomo Valkonen 1999-2007.
6 * Ion is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
12 #ifndef ION_IONCORE_SCREEN_H
13 #define ION_IONCORE_SCREEN_H
15 #include <libextl/extl.h>
16 #include <libmainloop/hooks.h>
19 #include "rectangle.h"
22 #define FOR_ALL_SCREENS(SCR) \
23 for((SCR)=ioncore_g.screens; \
25 (SCR)=(SCR)->next_scr)
27 #define FOR_ALL_SCREENS_W_NEXT(SCR, NXT) \
28 for((SCR)=ioncore_g.screens, NXT=((SCR) ? (SCR)->next_scr : NULL); \
30 (SCR)=(NXT), NXT=((SCR) ? (SCR)->next_scr : NULL))
45 WRectangle managed_off;
46 WScreen *next_scr, *prev_scr;
47 Watch notifywin_watch;
51 /* rootwin should only be set if parent is NULL, and this WScreen is
52 * actually a root window.
54 extern bool screen_init(WScreen *scr, WRootWin *parent,
55 const WFitParams *fp, int id, Window rootwin);
57 extern WScreen *create_screen(WRootWin *parent, const WFitParams *fp, int id);
59 extern void screen_deinit(WScreen *scr);
61 extern int screen_id(WScreen *scr);
63 extern void screen_set_managed_offset(WScreen *scr, const WRectangle *off);
65 extern bool screen_init_layout(WScreen *scr, ExtlTab tab);
67 extern WScreen *ioncore_find_screen_id(int id);
68 extern WScreen *ioncore_goto_screen_id(int id);
69 extern WScreen *ioncore_goto_next_screen();
70 extern WScreen *ioncore_goto_prev_screen();
72 /* Handlers of this hook receive a WScreen* as the sole parameter. */
73 extern WHook *screen_managed_changed_hook;
75 #endif /* ION_IONCORE_SCREEN_H */