]> git.decadent.org.uk Git - ion3.git/blob - ioncore/screen.h
[svn-upgrade] Integrating new upstream version, ion3 (20070203)
[ion3.git] / ioncore / screen.h
1 /*
2  * ion/ioncore/screen.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
5  *
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.
10  */
11
12 #ifndef ION_IONCORE_SCREEN_H
13 #define ION_IONCORE_SCREEN_H
14
15 #include <libextl/extl.h>
16 #include <libmainloop/hooks.h>
17 #include "common.h"
18 #include "mplex.h"
19 #include "rectangle.h"
20 #include "pholder.h"
21
22 #define FOR_ALL_SCREENS(SCR)   \
23     for((SCR)=ioncore_g.screens; \
24         (SCR)!=NULL;           \
25         (SCR)=(SCR)->next_scr)
26
27 #define FOR_ALL_SCREENS_W_NEXT(SCR, NXT)                               \
28     for((SCR)=ioncore_g.screens, NXT=((SCR) ? (SCR)->next_scr : NULL); \
29         (SCR)!=NULL;                                                   \
30         (SCR)=(NXT), NXT=((SCR) ? (SCR)->next_scr : NULL))
31
32 enum{
33     SCREEN_ROTATION_0,
34     SCREEN_ROTATION_90,
35     SCREEN_ROTATION_180,
36     SCREEN_ROTATION_270
37 };
38
39
40 DECLCLASS(WScreen){
41     WMPlex mplex;
42     int id;
43     Atom atom_workspace;
44     bool uses_root;
45     int rotation;
46     WRectangle managed_off;
47     WScreen *next_scr, *prev_scr;
48     Watch notifywin_watch;
49     Watch infowin_watch;
50 };
51
52 /* rootwin should only be set if parent is NULL, and this WScreen is
53  * actually a root window.
54  */
55 extern bool screen_init(WScreen *scr, WRootWin *parent, 
56                         const WFitParams *fp, int id, Window rootwin);
57
58 extern WScreen *create_screen(WRootWin *parent, const WFitParams *fp, int id);
59
60 extern void screen_deinit(WScreen *scr);
61
62 extern int screen_id(WScreen *scr);
63
64 extern void screen_set_managed_offset(WScreen *scr, const WRectangle *off);
65
66 extern bool screen_init_layout(WScreen *scr, ExtlTab tab);
67
68 extern void screen_notify(WScreen *scr, const char *notstr);
69 extern void screen_unnotify(WScreen *scr);
70 extern void screen_windowinfo(WScreen *scr, const char *name);
71 extern void screen_nowindowinfo(WScreen *scr);
72
73 extern WPHolder *screen_get_rescue_pholder_for(WScreen *scr, WRegion *mgd);
74
75 extern WScreen *ioncore_find_screen_id(int id);
76 extern WScreen *ioncore_goto_screen_id(int id);
77 extern WScreen *ioncore_goto_next_screen();
78 extern WScreen *ioncore_goto_prev_screen();
79
80 /* Handlers of this hook receive a WScreen* as the sole parameter. */
81 extern WHook *screen_managed_changed_hook;
82
83 #endif /* ION_IONCORE_SCREEN_H */