edelib/Netwm.h

00001 /*
00002  * $Id: StrUtil.h 2504 2009-02-23 13:16:02Z 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 <X11/Xlib.h>
00026 
00027 EDELIB_NS_BEGIN
00028 
00037 enum {
00038         NETWM_CHANGED_WORKSPACE_COUNT,       
00039         NETWM_CHANGED_WORKSPACE_NAMES,       
00040         NETWM_CHANGED_CURRENT_WORKSPACE,     
00041         NETWM_CHANGED_CURRENT_WORKAREA,      
00042         NETWM_CHANGED_ACTIVE_WINDOW,         
00043         NETWM_CHANGED_WINDOW_NAME,           
00044         NETWM_CHANGED_WINDOW_VISIBLE_NAME,   
00045         NETWM_CHANGED_WINDOW_DESKTOP,        
00046         NETWM_CHANGED_WINDOW_LIST            
00047 };
00048 
00054 enum {
00055         NETWM_WINDOW_TYPE_NORMAL,            
00056         NETWM_WINDOW_TYPE_DESKTOP,           
00057         NETWM_WINDOW_TYPE_DOCK,              
00058         NETWM_WINDOW_TYPE_TOOLBAR,           
00059         NETWM_WINDOW_TYPE_MENU,              
00060         NETWM_WINDOW_TYPE_UTILITY,           
00061         NETWM_WINDOW_TYPE_SPLASH,            
00062         NETWM_WINDOW_TYPE_DIALOG,            
00063 
00064         NETWM_WINDOW_TYPE_DROPDOWN_MENU,     
00065         NETWM_WINDOW_TYPE_POPUP_MENU,        
00066         NETWM_WINDOW_TYPE_TOOLTIP,           
00067         NETWM_WINDOW_TYPE_NOTIFICATION,      
00068         NETWM_WINDOW_TYPE_COMBO,             
00069         NETWM_WINDOW_TYPE_DND                
00070 };
00071 
00076 enum WmStateValue {
00077         WM_WINDOW_STATE_NONE      = -1,   
00078         WM_WINDOW_STATE_WITHDRAW  = 0,    
00079         WM_WINDOW_STATE_NORMAL    = 1,    
00080         WM_WINDOW_STATE_ICONIC    = 3     
00081 };
00082 
00087 typedef void (*NetwmCallback)(int action, Window xid, void *data);
00088 
00098 void netwm_callback_add(NetwmCallback cb, void *data = 0);
00099 
00104 void netwm_callback_remove(NetwmCallback cb);
00105 
00110 bool netwm_workarea_get_size(int& x, int& y, int& w, int &h);
00111 
00116 int netwm_workspace_get_count(void);
00117 
00122 void netwm_workspace_change(int n);
00123 
00128 int netwm_workspace_get_current(void);
00129 
00135 int netwm_workspace_get_names(char**& names);
00136 
00141 void netwm_workspace_free_names(char** names);
00142 
00148 void netwm_window_set_type(Window win, int t);
00149 
00154 int netwm_window_get_type(Window win);
00155 
00160 void netwm_window_set_strut(Window win, int left, int right, int top, int bottom);
00161 
00166 int netwm_window_get_all_mapped(Window **windows);
00167 
00172 int netwm_window_get_workspace(Window win);
00173 
00179 int netwm_window_is_manageable(Window win);
00180 
00185 char *netwm_window_get_title(Window win);
00186 
00191 Window netwm_window_get_active(void);
00192 
00197 void netwm_window_set_active(Window win);
00198 
00203 void netwm_window_maximize(Window win);
00204 
00209 void netwm_window_close(Window win);
00210 
00215 void wm_window_ede_restore(Window win);
00216 
00221 WmStateValue wm_window_get_state(Window win);
00222 
00227 void wm_window_set_state(Window win, WmStateValue state);
00228 
00229 EDELIB_NS_END
00230 #endif

Generated on Wed Dec 16 14:31:52 2009 for edelib by  doxygen 1.5.2