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