edelib 2.0.0
|
00001 /* 00002 * $Id: Netwm.h 3240 2012-04-09 12:32:47Z karijes $ 00003 * 00004 * Functions for easier communication with window manager 00005 * Copyright (c) 2009 edelib authors 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with this library. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef __EDELIB_NETWM_H__ 00022 #define __EDELIB_NETWM_H__ 00023 00024 #include "edelib-global.h" 00025 #include <FL/Fl_Image.H> 00026 #include <FL/x.H> 00027 00028 EDELIB_NS_BEGIN 00029 00038 enum { 00039 NETWM_CHANGED_WORKSPACE_COUNT, 00040 NETWM_CHANGED_WORKSPACE_NAMES, 00041 NETWM_CHANGED_CURRENT_WORKSPACE, 00042 NETWM_CHANGED_CURRENT_WORKAREA, 00043 NETWM_CHANGED_ACTIVE_WINDOW, 00044 NETWM_CHANGED_WINDOW_NAME, 00045 NETWM_CHANGED_WINDOW_VISIBLE_NAME, 00046 NETWM_CHANGED_WINDOW_DESKTOP, 00047 NETWM_CHANGED_WINDOW_ICON, 00048 NETWM_CHANGED_WINDOW_LIST 00049 }; 00050 00056 enum { 00057 NETWM_WINDOW_TYPE_NORMAL, 00058 NETWM_WINDOW_TYPE_DESKTOP, 00059 NETWM_WINDOW_TYPE_DOCK, 00060 NETWM_WINDOW_TYPE_TOOLBAR, 00061 NETWM_WINDOW_TYPE_MENU, 00062 NETWM_WINDOW_TYPE_UTILITY, 00063 NETWM_WINDOW_TYPE_SPLASH, 00064 NETWM_WINDOW_TYPE_DIALOG, 00065 00066 NETWM_WINDOW_TYPE_DROPDOWN_MENU, 00067 NETWM_WINDOW_TYPE_POPUP_MENU, 00068 NETWM_WINDOW_TYPE_TOOLTIP, 00069 NETWM_WINDOW_TYPE_NOTIFICATION, 00070 NETWM_WINDOW_TYPE_COMBO, 00071 NETWM_WINDOW_TYPE_DND 00072 }; 00073 00078 enum WmStateValue { 00079 WM_WINDOW_STATE_NONE = -1, 00080 WM_WINDOW_STATE_WITHDRAW = 0, 00081 WM_WINDOW_STATE_NORMAL = 1, 00082 WM_WINDOW_STATE_ICONIC = 3 00083 }; 00084 00089 enum NetwmStateValue { 00090 NETWM_STATE_NONE = -1, 00091 NETWM_STATE_MODAL, 00092 NETWM_STATE_STICKY, 00093 NETWM_STATE_MAXIMIZED_VERT, 00094 NETWM_STATE_MAXIMIZED_HORZ, 00095 NETWM_STATE_MAXIMIZED, 00096 NETWM_STATE_SHADED, 00097 NETWM_STATE_SKIP_TASKBAR, 00098 NETWM_STATE_SKIP_PAGER, 00099 NETWM_STATE_HIDDEN, 00100 NETWM_STATE_FULLSCREEN, 00101 NETWM_STATE_ABOVE, 00102 NETWM_STATE_BELOW, 00103 NETWM_STATE_DEMANDS_ATTENTION 00104 }; 00105 00110 enum NetwmStateAction { 00111 NETWM_STATE_ACTION_REMOVE, 00112 NETWM_STATE_ACTION_ADD, 00113 NETWM_STATE_ACTION_TOGGLE 00114 }; 00115 00116 00121 typedef void (*NetwmCallback)(int action, Window xid, void *data); 00122 00132 void netwm_callback_add(NetwmCallback cb, void *data = 0); 00133 00138 void netwm_callback_remove(NetwmCallback cb); 00139 00144 bool netwm_workarea_get_size(int& x, int& y, int& w, int &h); 00145 00150 int netwm_workspace_get_count(void); 00151 00156 void netwm_workspace_change(int n); 00157 00162 int netwm_workspace_get_current(void); 00163 00169 int netwm_workspace_get_names(char**& names); 00170 00175 void netwm_workspace_free_names(char** names); 00176 00182 void netwm_window_set_type(Window win, int t); 00183 00188 int netwm_window_get_type(Window win); 00189 00194 void netwm_window_set_strut(Window win, int left, int right, int top, int bottom); 00195 00200 void netwm_window_remove_strut(Window win); 00201 00206 int netwm_window_get_all_mapped(Window **windows); 00207 00212 int netwm_window_get_workspace(Window win); 00213 00219 int netwm_window_is_manageable(Window win); 00220 00225 char *netwm_window_get_title(Window win); 00226 00231 Fl_RGB_Image *netwm_window_get_icon(Window win); 00232 00237 Window netwm_window_get_active(void); 00238 00243 void netwm_window_set_active(Window win); 00244 00249 void netwm_window_maximize(Window win) EDELIB_DEPRECATED; 00250 00255 void netwm_window_close(Window win); 00256 00261 void wm_window_ede_restore(Window win); 00262 00271 void netwm_window_set_state(Window win, NetwmStateValue val, NetwmStateAction action); 00272 00277 WmStateValue wm_window_get_state(Window win); 00278 00283 void wm_window_set_state(Window win, WmStateValue state); 00284 00285 EDELIB_NS_END 00286 #endif