1 // OBAtom.h for Openbox
6 @brief Provides access to atoms on the display
11 #include <X11/Xatom.h>
19 #include "otk/screeninfo.hh"
50 blackbox_change_attributes
,
53 // blackbox-protocol atoms (wm -> client)
54 blackbox_structure_messages
,
55 blackbox_notify_startup
,
56 blackbox_notify_window_add
,
57 blackbox_notify_window_del
,
58 blackbox_notify_window_focus
,
59 blackbox_notify_current_workspace
,
60 blackbox_notify_workspace_count
,
61 blackbox_notify_window_raise
,
62 blackbox_notify_window_lower
,
63 // blackbox-protocol atoms (client -> wm)
64 blackbox_change_workspace
,
65 blackbox_change_window_focus
,
66 blackbox_cycle_window_focus
,
68 openbox_show_root_menu
,
69 openbox_show_workspace_menu
,
72 // root window properties
75 net_client_list_stacking
,
76 net_number_of_desktops
,
83 net_supporting_wm_check
,
85 // root window messages
88 // application window properties
93 net_wm_visible_icon_name
,
98 // net_wm_icon_geometry,
101 // net_wm_handled_icons,
102 net_wm_allowed_actions
,
103 // application protocols
106 net_wm_window_type_desktop
,
107 net_wm_window_type_dock
,
108 net_wm_window_type_toolbar
,
109 net_wm_window_type_menu
,
110 net_wm_window_type_utility
,
111 net_wm_window_type_splash
,
112 net_wm_window_type_dialog
,
113 net_wm_window_type_normal
,
115 net_wm_moveresize_size_topleft
,
116 net_wm_moveresize_size_topright
,
117 net_wm_moveresize_size_bottomleft
,
118 net_wm_moveresize_size_bottomright
,
119 net_wm_moveresize_move
,
122 net_wm_action_resize
,
124 net_wm_action_maximize_horz
,
125 net_wm_action_maximize_vert
,
126 net_wm_action_change_desktop
,
130 net_wm_state_maximized_vert
,
131 net_wm_state_maximized_horz
,
133 net_wm_state_skip_taskbar
,
134 net_wm_state_skip_pager
,
136 net_wm_state_fullscreen
,
138 kde_net_system_tray_windows
,
139 kde_net_wm_system_tray_window_for
,
140 kde_net_wm_window_type_override
,
142 // constant for how many atoms exist in the enumerator
153 typedef std::vector
<Window
> SupportWindows
;
155 // windows used to specify support for NETWM
156 SupportWindows _support_windows
;
157 Atom _atoms
[NUM_ATOMS
];
159 Atom
create(const char *name
) const;
161 void setValue(Window win
, Atom atom
, Atom type
, unsigned char *data
,
162 int size
, int nelements
, bool append
) const;
163 bool getValue(Window win
, Atom atom
, Atom type
,
164 unsigned long &nelements
, unsigned char **value
,
168 OBAtom(const OBAtom
&);
169 OBAtom
& operator=(const OBAtom
&);
172 typedef std::vector
<std::string
> StringVect
;
177 // setup support on a screen, each screen should call this once in its
179 void setSupported(const otk::ScreenInfo
*screen
);
181 void setValue(Window win
, Atoms atom
, Atoms type
, unsigned long value
) const;
182 void setValue(Window win
, Atoms atom
, Atoms type
,
183 unsigned long value
[], int elements
) const;
184 void setValue(Window win
, Atoms atom
, StringType type
,
185 const std::string
&value
) const;
186 void setValue(Window win
, Atoms atom
, StringType type
,
187 const StringVect
&strings
) const;
189 // the 'value' is allocated inside the function and
190 // delete [] value needs to be called when you are done with it.
191 // the 'value' array returned is null terminated, and has 'nelements'
192 // elements in it plus the null.
193 // nelements must be set to the maximum number of elements to read from
195 bool getValue(Window win
, Atoms atom
, Atoms type
,
196 unsigned long &nelements
, unsigned long **value
) const;
197 bool getValue(Window win
, Atoms atom
, Atoms type
, unsigned long &value
) const;
198 bool getValue(Window win
, Atoms atom
, StringType type
,
199 std::string
&value
) const;
200 bool getValue(Window win
, Atoms atom
, StringType type
,
201 unsigned long &nelements
, StringVect
&strings
) const;
203 void eraseValue(Window win
, Atoms atom
) const;
205 // sends a client message a window
206 void sendClientMessage(Window target
, Atoms type
, Window about
,
207 long data
= 0, long data1
= 0, long data2
= 0,
208 long data3
= 0, long data4
= 0) const;
210 // temporary function!! remove when not used in blackbox.hh anymore!!
211 inline Atom
getAtom(Atoms a
)
212 { assert(a
>= 0 && a
< NUM_ATOMS
); Atom ret
= _atoms
[a
];
213 assert(ret
!= 0); return ret
; }