edelib 0.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

Netwm.h
1 /*
2 * $Id: Netwm.h 3240 2012-04-09 12:32:47Z karijes $
3 *
4 * Functions for easier communication with window manager
5 * Copyright (c) 2009 edelib authors
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef __EDELIB_NETWM_H__
22 #define __EDELIB_NETWM_H__
23
24 #include "edelib-global.h"
25 #include <FL/Fl_Image.H>
26 #include <FL/x.H>
27
28 EDELIB_NS_BEGIN
29
38 enum {
39 NETWM_CHANGED_WORKSPACE_COUNT,
40 NETWM_CHANGED_WORKSPACE_NAMES,
41 NETWM_CHANGED_CURRENT_WORKSPACE,
42 NETWM_CHANGED_CURRENT_WORKAREA,
43 NETWM_CHANGED_ACTIVE_WINDOW,
44 NETWM_CHANGED_WINDOW_NAME,
45 NETWM_CHANGED_WINDOW_VISIBLE_NAME,
46 NETWM_CHANGED_WINDOW_DESKTOP,
47 NETWM_CHANGED_WINDOW_ICON,
48 NETWM_CHANGED_WINDOW_LIST
49 };
50
56 enum {
57 NETWM_WINDOW_TYPE_NORMAL,
58 NETWM_WINDOW_TYPE_DESKTOP,
59 NETWM_WINDOW_TYPE_DOCK,
60 NETWM_WINDOW_TYPE_TOOLBAR,
61 NETWM_WINDOW_TYPE_MENU,
62 NETWM_WINDOW_TYPE_UTILITY,
63 NETWM_WINDOW_TYPE_SPLASH,
64 NETWM_WINDOW_TYPE_DIALOG,
65
66 NETWM_WINDOW_TYPE_DROPDOWN_MENU,
67 NETWM_WINDOW_TYPE_POPUP_MENU,
68 NETWM_WINDOW_TYPE_TOOLTIP,
69 NETWM_WINDOW_TYPE_NOTIFICATION,
70 NETWM_WINDOW_TYPE_COMBO,
71 NETWM_WINDOW_TYPE_DND
72 };
73
78 enum WmStateValue {
79 WM_WINDOW_STATE_NONE = -1,
80 WM_WINDOW_STATE_WITHDRAW = 0,
81 WM_WINDOW_STATE_NORMAL = 1,
82 WM_WINDOW_STATE_ICONIC = 3
83 };
84
89 enum NetwmStateValue {
90 NETWM_STATE_NONE = -1,
91 NETWM_STATE_MODAL,
92 NETWM_STATE_STICKY,
93 NETWM_STATE_MAXIMIZED_VERT,
94 NETWM_STATE_MAXIMIZED_HORZ,
95 NETWM_STATE_MAXIMIZED,
96 NETWM_STATE_SHADED,
97 NETWM_STATE_SKIP_TASKBAR,
98 NETWM_STATE_SKIP_PAGER,
99 NETWM_STATE_HIDDEN,
100 NETWM_STATE_FULLSCREEN,
101 NETWM_STATE_ABOVE,
102 NETWM_STATE_BELOW,
103 NETWM_STATE_DEMANDS_ATTENTION
104 };
105
110 enum NetwmStateAction {
111 NETWM_STATE_ACTION_REMOVE,
112 NETWM_STATE_ACTION_ADD,
113 NETWM_STATE_ACTION_TOGGLE
114 };
115
116
121 typedef void (*NetwmCallback)(int action, Window xid, void *data);
122
132 void netwm_callback_add(NetwmCallback cb, void *data = 0);
133
138 void netwm_callback_remove(NetwmCallback cb);
139
144 bool netwm_workarea_get_size(int& x, int& y, int& w, int &h);
145
150 int netwm_workspace_get_count(void);
151
156 void netwm_workspace_change(int n);
157
162 int netwm_workspace_get_current(void);
163
169 int netwm_workspace_get_names(char**& names);
170
175 void netwm_workspace_free_names(char** names);
176
182 void netwm_window_set_type(Window win, int t);
183
188 int netwm_window_get_type(Window win);
189
194 void netwm_window_set_strut(Window win, int left, int right, int top, int bottom);
195
200 void netwm_window_remove_strut(Window win);
201
206 int netwm_window_get_all_mapped(Window **windows);
207
212 int netwm_window_get_workspace(Window win);
213
219 int netwm_window_is_manageable(Window win);
220
225 char *netwm_window_get_title(Window win);
226
231 Fl_RGB_Image *netwm_window_get_icon(Window win);
232
237 Window netwm_window_get_active(void);
238
243 void netwm_window_set_active(Window win);
244
249 void netwm_window_maximize(Window win) EDELIB_DEPRECATED;
250
255 void netwm_window_close(Window win);
256
261 void wm_window_ede_restore(Window win);
262
271 void netwm_window_set_state(Window win, NetwmStateValue val, NetwmStateAction action);
272
277 WmStateValue wm_window_get_state(Window win);
278
283 void wm_window_set_state(Window win, WmStateValue state);
284
285 EDELIB_NS_END
286 #endif