Netwm.h
/*
* $Id: Netwm.h 3533 2013-03-04 23:20:19Z karijes $
*
* Functions for easier communication with window manager
* Copyright (c) 2009 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_NETWM_H__
#define __EDELIB_NETWM_H__
#include "edelib-global.h"
#include <FL/Fl_Image.H>
#include <FL/x.H>
#include "List.h"
EDELIB_NS_BEGIN
enum {
NETWM_CHANGED_WORKSPACE_COUNT,
NETWM_CHANGED_WORKSPACE_NAMES,
NETWM_CHANGED_CURRENT_WORKSPACE,
NETWM_CHANGED_CURRENT_WORKAREA,
NETWM_CHANGED_ACTIVE_WINDOW,
NETWM_CHANGED_WINDOW_NAME,
NETWM_CHANGED_WINDOW_VISIBLE_NAME,
NETWM_CHANGED_WINDOW_DESKTOP,
NETWM_CHANGED_WINDOW_ICON,
NETWM_CHANGED_WINDOW_LIST
};
enum {
NETWM_WINDOW_TYPE_NORMAL,
NETWM_WINDOW_TYPE_DESKTOP,
NETWM_WINDOW_TYPE_DOCK,
NETWM_WINDOW_TYPE_TOOLBAR,
NETWM_WINDOW_TYPE_MENU,
NETWM_WINDOW_TYPE_UTILITY,
NETWM_WINDOW_TYPE_SPLASH,
NETWM_WINDOW_TYPE_DIALOG,
NETWM_WINDOW_TYPE_DROPDOWN_MENU,
NETWM_WINDOW_TYPE_POPUP_MENU,
NETWM_WINDOW_TYPE_TOOLTIP,
NETWM_WINDOW_TYPE_NOTIFICATION,
NETWM_WINDOW_TYPE_COMBO,
NETWM_WINDOW_TYPE_DND
};
enum WmStateValue {
WM_WINDOW_STATE_NONE = -1,
WM_WINDOW_STATE_WITHDRAW = 0,
WM_WINDOW_STATE_NORMAL = 1,
WM_WINDOW_STATE_ICONIC = 3
};
enum NetwmStateValue {
NETWM_STATE_NONE = -1,
NETWM_STATE_MODAL,
NETWM_STATE_STICKY,
NETWM_STATE_MAXIMIZED_VERT,
NETWM_STATE_MAXIMIZED_HORZ,
NETWM_STATE_MAXIMIZED,
NETWM_STATE_SHADED,
NETWM_STATE_SKIP_TASKBAR,
NETWM_STATE_SKIP_PAGER,
NETWM_STATE_HIDDEN,
NETWM_STATE_FULLSCREEN,
NETWM_STATE_ABOVE,
NETWM_STATE_BELOW,
NETWM_STATE_DEMANDS_ATTENTION
};
enum NetwmStateAction {
NETWM_STATE_ACTION_REMOVE,
NETWM_STATE_ACTION_ADD,
NETWM_STATE_ACTION_TOGGLE
};
typedef void (*NetwmCallback)(int action, Window xid, void *data);
void netwm_callback_add(NetwmCallback cb, void *data = 0);
void netwm_callback_remove(NetwmCallback cb);
bool netwm_workarea_get_size(int& x, int& y, int& w, int &h);
int netwm_workspace_get_count(void);
void netwm_workspace_change(int n);
int netwm_workspace_get_current(void);
int netwm_workspace_get_names(char**& names);
void netwm_workspace_free_names(char** names);
void netwm_window_set_type(Window win, int t);
int netwm_window_get_type(Window win);
void netwm_window_set_strut(Window win, int left, int right, int top, int bottom);
void netwm_window_set_strut_partial(Window win, int sizes[12]);
void netwm_window_remove_strut(Window win);
void netwm_window_remove_strut_partial(Window win);
int netwm_window_get_all_mapped(Window **windows);
int netwm_window_get_workspace(Window win);
int netwm_window_is_manageable(Window win);
char *netwm_window_get_title(Window win);
Fl_RGB_Image *netwm_window_get_icon(Window win, unsigned int requested_width = 0);
Window netwm_window_get_active(void);
void netwm_window_set_active(Window win, int source = 0);
void netwm_window_maximize(Window win) EDELIB_DEPRECATED;
void netwm_window_close(Window win);
void wm_window_ede_restore(Window win);
void netwm_window_set_state(Window win, NetwmStateValue val, NetwmStateAction action);
bool netwm_window_get_all_states(Window win, list<NetwmStateValue> &ret);
bool netwm_window_have_state(Window win, NetwmStateValue val);
WmStateValue wm_window_get_state(Window win);
void wm_window_set_state(Window win, WmStateValue state);
EDELIB_NS_END
#endif
edelib::NETWM_CHANGED_WORKSPACE_NAMES
workspace names gets changed
Definition: Netwm.h:42
edelib::NETWM_WINDOW_TYPE_TOOLTIP
tooltip (part of 1.4)
Definition: Netwm.h:69
edelib::netwm_window_get_active
Window netwm_window_get_active(void)
edelib::NETWM_STATE_FULLSCREEN
window should go in fullscreen mode
Definition: Netwm.h:101
edelib::WmStateValue
WmStateValue
Definition: Netwm.h:79
edelib::NETWM_CHANGED_WINDOW_VISIBLE_NAME
window visible name was changed
Definition: Netwm.h:47
edelib::netwm_window_set_strut
void netwm_window_set_strut(Window win, int left, int right, int top, int bottom)
edelib::NETWM_CHANGED_CURRENT_WORKSPACE
different workspace was activated
Definition: Netwm.h:43
edelib::netwm_window_set_strut_partial
void netwm_window_set_strut_partial(Window win, int sizes[12])
edelib::wm_window_get_state
WmStateValue wm_window_get_state(Window win)
edelib::netwm_window_get_workspace
int netwm_window_get_workspace(Window win)
edelib::NETWM_WINDOW_TYPE_DROPDOWN_MENU
dropdown menu window (part of 1.4)
Definition: Netwm.h:67
edelib::netwm_workspace_free_names
void netwm_workspace_free_names(char **names)
edelib::netwm_window_get_icon
Fl_RGB_Image * netwm_window_get_icon(Window win, unsigned int requested_width=0)
edelib::netwm_workarea_get_size
bool netwm_workarea_get_size(int &x, int &y, int &w, int &h)
edelib::NETWM_STATE_ABOVE
window should go on top of all windows
Definition: Netwm.h:102
edelib::list
Linked list class.
Definition: List.h:160
edelib::NETWM_STATE_HIDDEN
window should be hidden (or minimized)
Definition: Netwm.h:100
edelib::NETWM_STATE_SKIP_PAGER
window should skip pager
Definition: Netwm.h:99
edelib::netwm_workspace_get_names
int netwm_workspace_get_names(char **&names)
edelib::NETWM_STATE_NONE
window state couldn&#39;t be determined
Definition: Netwm.h:91
edelib::NETWM_WINDOW_TYPE_DND
window is being dragged (part of 1.4)
Definition: Netwm.h:72
edelib::WM_WINDOW_STATE_NONE
window state couldn&#39;t be determined
Definition: Netwm.h:80
edelib::NETWM_WINDOW_TYPE_MENU
window as menu
Definition: Netwm.h:63
edelib::NETWM_CHANGED_WINDOW_NAME
window name was changed
Definition: Netwm.h:46
edelib::netwm_window_remove_strut_partial
void netwm_window_remove_strut_partial(Window win)
edelib::netwm_window_set_type
void netwm_window_set_type(Window win, int t)
edelib::netwm_window_set_active
void netwm_window_set_active(Window win, int source=0)
edelib::NETWM_STATE_BELOW
window should go below all windows
Definition: Netwm.h:103
edelib::netwm_window_is_manageable
int netwm_window_is_manageable(Window win)
edelib::NETWM_WINDOW_TYPE_NORMAL
ordinary window
Definition: Netwm.h:59
edelib::WM_WINDOW_STATE_WITHDRAW
withdraw state
Definition: Netwm.h:81
edelib::NETWM_STATE_MAXIMIZED_HORZ
maximized horizontally
Definition: Netwm.h:95
edelib::NETWM_CHANGED_WORKSPACE_COUNT
workspace count was changed
Definition: Netwm.h:41
edelib::NETWM_CHANGED_WINDOW_ICON
window icon was changed
Definition: Netwm.h:49
edelib::wm_window_set_state
void wm_window_set_state(Window win, WmStateValue state)
edelib::wm_window_ede_restore
void wm_window_ede_restore(Window win)
edelib::netwm_window_get_all_mapped
int netwm_window_get_all_mapped(Window **windows)
edelib::netwm_window_get_type
int netwm_window_get_type(Window win)
edelib::NETWM_WINDOW_TYPE_SPLASH
splash window
Definition: Netwm.h:65
edelib::Window
Window class.
Definition: Window.h:73
edelib::netwm_workspace_change
void netwm_workspace_change(int n)
edelib::NETWM_WINDOW_TYPE_DIALOG
dialog window
Definition: Netwm.h:66
edelib::NETWM_CHANGED_WINDOW_DESKTOP
window is moved to another workspace
Definition: Netwm.h:48
edelib::NETWM_CHANGED_ACTIVE_WINDOW
different window was selected
Definition: Netwm.h:45
edelib::NETWM_WINDOW_TYPE_POPUP_MENU
popup window (part of 1.4)
Definition: Netwm.h:68
edelib::netwm_window_maximize
void netwm_window_maximize(Window win)
edelib::NETWM_WINDOW_TYPE_UTILITY
window as utility window
Definition: Netwm.h:64
edelib::netwm_window_have_state
bool netwm_window_have_state(Window win, NetwmStateValue val)
edelib::netwm_workspace_get_count
int netwm_workspace_get_count(void)
edelib::NETWM_STATE_MAXIMIZED
fully maximized
Definition: Netwm.h:96
edelib::netwm_window_set_state
void netwm_window_set_state(Window win, NetwmStateValue val, NetwmStateAction action)
edelib::NETWM_STATE_ACTION_REMOVE
remove state
Definition: Netwm.h:112
edelib::NETWM_STATE_SHADED
shaded window
Definition: Netwm.h:97
edelib::NETWM_STATE_ACTION_ADD
add state
Definition: Netwm.h:113
edelib::NETWM_STATE_MODAL
modal dialog box
Definition: Netwm.h:92
edelib::NETWM_WINDOW_TYPE_TOOLBAR
window as toolbar
Definition: Netwm.h:62
edelib::NETWM_WINDOW_TYPE_COMBO
window popped up by combo boxes (part of 1.4)
Definition: Netwm.h:71
edelib::netwm_callback_add
void netwm_callback_add(NetwmCallback cb, void *data=0)
edelib::WM_WINDOW_STATE_NORMAL
window is visible
Definition: Netwm.h:82
edelib::NETWM_WINDOW_TYPE_DOCK
docked window, like pager or panel
Definition: Netwm.h:61
edelib::NETWM_STATE_STICKY
sticky window
Definition: Netwm.h:93
edelib::NetwmStateAction
NetwmStateAction
Definition: Netwm.h:111
edelib::WM_WINDOW_STATE_ICONIC
window is hidden
Definition: Netwm.h:83
edelib::netwm_window_close
void netwm_window_close(Window win)
edelib::netwm_window_get_all_states
bool netwm_window_get_all_states(Window win, list< NetwmStateValue > &ret)
edelib::netwm_window_remove_strut
void netwm_window_remove_strut(Window win)
edelib::NETWM_STATE_DEMANDS_ATTENTION
some action in or with the window happened
Definition: Netwm.h:104
edelib::netwm_callback_remove
void netwm_callback_remove(NetwmCallback cb)
edelib::NETWM_STATE_MAXIMIZED_VERT
maximized vertically
Definition: Netwm.h:94
edelib::NETWM_CHANGED_CURRENT_WORKAREA
workarea was changed
Definition: Netwm.h:44
edelib::NETWM_CHANGED_WINDOW_LIST
window list was changed (another window is created or existing was closed)
Definition: Netwm.h:50
edelib::NetwmStateValue
NetwmStateValue
Definition: Netwm.h:90
edelib::NETWM_WINDOW_TYPE_DESKTOP
window placed as desktop
Definition: Netwm.h:60
edelib::NETWM_STATE_ACTION_TOGGLE
toggle state
Definition: Netwm.h:114
edelib::NetwmCallback
void(* NetwmCallback)(int action, Window xid, void *data)
Definition: Netwm.h:122
edelib::NETWM_STATE_SKIP_TASKBAR
window should skip taskbar
Definition: Netwm.h:98
edelib::NETWM_WINDOW_TYPE_NOTIFICATION
notification (part of 1.4)
Definition: Netwm.h:70
edelib::netwm_window_get_title
char * netwm_window_get_title(Window win)
edelib::netwm_workspace_get_current
int netwm_workspace_get_current(void)