]> git.decadent.org.uk Git - ion3.git/blob - ioncore/clientwin.h
[svn-upgrade] Integrating new upstream version, ion3 (20070506)
[ion3.git] / ioncore / clientwin.h
1 /*
2  * ion/ioncore/clientwin.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_IONCORE_CLIENTWIN_H
10 #define ION_IONCORE_CLIENTWIN_H
11
12 #include <libextl/extl.h>
13 #include <libtu/ptrlist.h>
14 #include <libmainloop/hooks.h>
15 #include "common.h"
16 #include "region.h"
17 #include "window.h"
18 #include "rectangle.h"
19 #include "attach.h"
20 #include "manage.h"
21 #include "pholder.h"
22 #include "sizepolicy.h"
23
24
25 #define CLIENTWIN_P_WM_DELETE        0x00001
26 #define CLIENTWIN_P_WM_TAKE_FOCUS    0x00002
27 #define CLIENTWIN_PROP_ACROBATIC     0x00010
28 #define CLIENTWIN_PROP_TRANSPARENT   0x00020
29 #define CLIENTWIN_PROP_IGNORE_CFGRQ  0x00040
30 #define CLIENTWIN_PROP_MINSIZE       0x00100
31 #define CLIENTWIN_PROP_MAXSIZE       0x00200
32 #define CLIENTWIN_PROP_ASPECT        0x00400
33 #define CLIENTWIN_PROP_RSZINC        0x00800
34 #define CLIENTWIN_PROP_I_MINSIZE     0x01000
35 #define CLIENTWIN_PROP_I_MAXSIZE     0x02000
36 #define CLIENTWIN_PROP_I_ASPECT      0x04000
37 #define CLIENTWIN_PROP_I_RSZINC      0x08000
38 #define CLIENTWIN_USE_NET_WM_NAME    0x10000
39 #define CLIENTWIN_FS_RQ              0x20000
40 #define CLIENTWIN_UNMAP_RQ           0x40000
41 #define CLIENTWIN_NEED_CFGNTFY       0x80000
42
43
44 DECLCLASS(WClientWin){
45     WRegion region;
46     
47     int flags;
48     int state;
49     int event_mask;
50     Window win;
51     
52     int orig_bw;
53
54     Colormap cmap;
55     Colormap *cmaps;
56     Window *cmapwins;
57     int n_cmapwins;
58
59     XSizeHints size_hints;
60     
61     ExtlTab proptab;
62 };
63
64
65 extern void clientwin_get_protocols(WClientWin *cwin);
66 extern void clientwin_get_size_hints(WClientWin *cwin);
67 extern void clientwin_unmapped(WClientWin *cwin);
68 extern void clientwin_destroyed(WClientWin *cwin);
69 extern void clientwin_kill(WClientWin *cwin);
70 extern void clientwin_rqclose(WClientWin *cwin, bool relocate_ignored);
71
72 extern void clientwin_tfor_changed(WClientWin *cwin);
73
74 extern void clientwin_get_set_name(WClientWin *cwin);
75
76 extern void clientwin_handle_configure_request(WClientWin *cwin,
77                                                XConfigureRequestEvent *ev);
78
79 extern void clientwin_broken_app_resize_kludge(WClientWin *cwin);
80
81 extern WRegion *clientwin_load(WWindow *par, const WFitParams *fp,
82                                ExtlTab tab);
83
84 /* Some standard winprops */
85
86 enum{
87     TRANSIENT_MODE_NORMAL,
88     TRANSIENT_MODE_CURRENT,
89     TRANSIENT_MODE_OFF
90 };
91
92 extern bool clientwin_get_switchto(const WClientWin *cwin);
93 extern int clientwin_get_transient_mode(const WClientWin *cwin);
94 extern WClientWin *clientwin_get_transient_for(const WClientWin *cwin);
95
96 /* Hooks */
97
98 /* This hook has parameters (WClientWin*, WManageParams*). */
99 extern WHook *clientwin_do_manage_alt;
100 /* This hook has just WClientWin* as parameter. */
101 extern WHook *clientwin_mapped_hook;
102 /* This hook has an X Window id as parameter. */
103 extern WHook *clientwin_unmapped_hook;
104 /* This hook has (WClientWin*, const XPropertyEvent *) as parameters on
105  * C side, and (WClientWin*, int atom) on Lua side.
106  */
107 extern WHook *clientwin_property_change_hook;
108
109 /* Manage */
110
111 extern WClientWin *ioncore_manage_clientwin(Window win, bool maprq);
112
113 #endif /* ION_IONCORE_CLIENTWIN_H */