Released version 3-2015061300
[notion.git] / ioncore / screen.h
blobbbb1d6be2174476ffbd9c59837d7748397e4a2b5
1 /*
2 * ion/ioncore/screen.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
9 #ifndef ION_IONCORE_SCREEN_H
10 #define ION_IONCORE_SCREEN_H
12 #include <libextl/extl.h>
13 #include <libmainloop/hooks.h>
14 #include "common.h"
15 #include "mplex.h"
16 #include "rectangle.h"
17 #include "pholder.h"
19 #define FOR_ALL_SCREENS(SCR) \
20 for((SCR)=ioncore_g.screens; \
21 (SCR)!=NULL; \
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); \
26 (SCR)!=NULL; \
27 (SCR)=(NXT), NXT=((SCR) ? (SCR)->next_scr : NULL))
29 enum{
30 SCREEN_ROTATION_0,
31 SCREEN_ROTATION_90,
32 SCREEN_ROTATION_180,
33 SCREEN_ROTATION_270
37 DECLCLASS(WScreen){
38 WMPlex mplex;
39 int id;
40 Atom atom_workspace;
41 /** Deprecated field, but kept to keep our ABI stable */
42 bool dep;
43 WRectangle managed_off;
44 WScreen *next_scr, *prev_scr;
45 Watch notifywin_watch;
46 Watch infowin_watch;
47 Watch workspace_indicatorwin_watch;
50 extern bool screen_init(WScreen *scr, WRootWin *parent, const WFitParams *fp,
51 int id);
53 extern WScreen *create_screen(WRootWin *parent, const WFitParams *fp, int id);
55 extern void screen_deinit(WScreen *scr);
57 extern int screen_id(WScreen *scr);
59 extern void screen_set_managed_offset(WScreen *scr, const WRectangle *off);
61 extern bool screen_init_layout(WScreen *scr, ExtlTab tab);
63 extern WScreen *ioncore_find_screen_id(int id);
64 extern WScreen *ioncore_goto_screen_id(int id);
65 extern WScreen *ioncore_goto_next_screen();
66 extern WScreen *ioncore_goto_prev_screen();
68 /* Handlers of this hook receive a WScreen* as the sole parameter. */
69 extern WHook *screen_managed_changed_hook;
71 #endif /* ION_IONCORE_SCREEN_H */