]> git.decadent.org.uk Git - ion3.git/blob - ioncore/screen.h
Update cfg_kludge_flash for Flash 10
[ion3.git] / ioncore / screen.h
1 /*
2  * ion/ioncore/screen.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2009. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_IONCORE_SCREEN_H
10 #define ION_IONCORE_SCREEN_H
11
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"
18
19 #define FOR_ALL_SCREENS(SCR)   \
20     for((SCR)=ioncore_g.screens; \
21         (SCR)!=NULL;           \
22         (SCR)=(SCR)->next_scr)
23
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))
28
29 enum{
30     SCREEN_ROTATION_0,
31     SCREEN_ROTATION_90,
32     SCREEN_ROTATION_180,
33     SCREEN_ROTATION_270
34 };
35
36
37 DECLCLASS(WScreen){
38     WMPlex mplex;
39     int id;
40     Atom atom_workspace;
41     bool uses_root;
42     WRectangle managed_off;
43     WScreen *next_scr, *prev_scr;
44     Watch notifywin_watch;
45     Watch infowin_watch;
46 };
47
48 /* rootwin should only be set if parent is NULL, and this WScreen is
49  * actually a root window.
50  */
51 extern bool screen_init(WScreen *scr, WRootWin *parent, 
52                         const WFitParams *fp, int id, Window rootwin);
53
54 extern WScreen *create_screen(WRootWin *parent, const WFitParams *fp, int id);
55
56 extern void screen_deinit(WScreen *scr);
57
58 extern int screen_id(WScreen *scr);
59
60 extern void screen_set_managed_offset(WScreen *scr, const WRectangle *off);
61
62 extern bool screen_init_layout(WScreen *scr, ExtlTab tab);
63
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();
68
69 /* Handlers of this hook receive a WScreen* as the sole parameter. */
70 extern WHook *screen_managed_changed_hook;
71
72 #endif /* ION_IONCORE_SCREEN_H */