]>
Dogcows Code - chaz/openbox/blob - c/client.h
d0f5266b68b879b2a38dd12735609626e2c10493
13 /*! Holds an icon in ARGB format */
19 /*! The MWM Hints as retrieved from the window property
20 This structure only contains 3 elements, even though the Motif 2.0
21 structure contains 5. We only use the first 3, so that is all gets
24 typedef struct MwmHints
{
25 /*! A bitmask of Client::MwmFlags values */
27 /*! A bitmask of Client::MwmFunctions values */
28 unsigned long functions
;
29 /*! A bitmask of Client::MwmDecorations values */
30 unsigned long decorations
;
32 /*! The number of elements in the Client::MwmHints struct */
33 #define MWM_ELEMENTS 3
35 /*! Possible flags for MWM Hints (defined by Motif 2.0) */
37 MwmFlag_Functions
= 1 << 0, /*!< The MMW Hints define funcs */
38 MwmFlag_Decorations
= 1 << 1 /*!< The MWM Hints define decor */
41 /*! Possible functions for MWM Hints (defined by Motif 2.0) */
43 MwmFunc_All
= 1 << 0, /*!< All functions */
44 MwmFunc_Resize
= 1 << 1, /*!< Allow resizing */
45 MwmFunc_Move
= 1 << 2, /*!< Allow moving */
46 MwmFunc_Iconify
= 1 << 3, /*!< Allow to be iconfied */
47 MwmFunc_Maximize
= 1 << 4 /*!< Allow to be maximized */
48 /*MwmFunc_Close = 1 << 5 /!< Allow to be closed */
51 /*! Possible decorations for MWM Hints (defined by Motif 2.0) */
53 MwmDecor_All
= 1 << 0, /*!< All decorations */
54 MwmDecor_Border
= 1 << 1, /*!< Show a border */
55 MwmDecor_Handle
= 1 << 2, /*!< Show a handle (bottom) */
56 MwmDecor_Title
= 1 << 3, /*!< Show a titlebar */
57 /*MwmDecor_Menu = 1 << 4, /!< Show a menu */
58 MwmDecor_Iconify
= 1 << 5, /*!< Show an iconify button */
59 MwmDecor_Maximize
= 1 << 6 /*!< Show a maximize button */
63 typedef struct Client
{
68 /*! The number of unmap events to ignore on the window */
71 /*! The id of the group the window belongs to */
73 /*! Whether or not the client is a transient window. This is guaranteed to
74 be TRUE if transient_for != NULL, but not guaranteed to be FALSE if
75 transient_for == NULL. */
77 /*! The client which this client is a transient (child) for */
78 struct Client
*transient_for
;
79 /*! The clients which are transients (children) of this client */
81 /*! The desktop on which the window resides (0xffffffff for all
85 /*! Normal window title */
87 /*! Window title when iconified */
90 /*! The application that created the window */
92 /*! The class of the window, can used for grouping */
94 /*! The specified role of the window, used for identification */
97 /*! The type of window (what its function is) */
100 /*! Position and size of the window
101 This will not always be the actual position of the window on screen, it
102 is, rather, the position requested by the client, to which the window's
107 /*! The window's strut
108 The strut defines areas of the screen that are marked off-bounds for
109 window placement. In theory, where this window exists.
113 /*! The logical size of the window
114 The "logical" size of the window is refers to the user's perception of
115 the size of the window, and is the value that should be displayed to the
116 user. For example, with xterms, this value it the number of characters
117 being displayed in the terminal, instead of the number of pixels.
121 /*! Width of the border on the window.
122 The window manager will set this to 0 while the window is being managed,
123 but needs to restore it afterwards, so it is saved here.
127 /*! The minimum aspect ratio the client window can be sized to.
128 A value of 0 means this is ignored.
131 /*! The maximum aspect ratio the client window can be sized to.
132 A value of 0 means this is ignored.
136 /*! The minimum size of the client window
137 If the min is > the max, then the window is not resizable
140 /*! The maximum size of the client window
141 If the min is > the max, then the window is not resizable
144 /*! The size of increments to resize the client window by */
146 /*! The base size of the client window
147 This value should be subtracted from the window's actual size when
148 displaying its size to the user, or working with its min/max size
152 /*! Window decoration and functionality hints */
155 /*! Where to place the decorated window in relation to the undecorated
159 /*! The state of the window, one of WithdrawnState, IconicState, or
163 /*! True if the client supports the delete_window protocol */
164 gboolean delete_window
;
166 /*! Was the window's position requested by the application? if not, we
167 should place the window ourselves when it first appears */
170 /*! Can the window receive input focus? */
174 /*! Notify the window when it receives focus? */
175 gboolean focus_notify
;
176 /*! Does the client window have the input focus? */
179 /*! The window uses shape extension to be non-rectangular? */
182 /*! The window is modal, so it must be processed before any windows it is
183 related to can be focused */
185 /*! Only the window's titlebar is displayed */
187 /*! The window is iconified */
189 /*! The window is maximized to fill the screen vertically */
191 /*! The window is maximized to fill the screen horizontally */
193 /*! The window should not be displayed by pagers */
195 /*! The window should not be displayed by taskbars */
196 gboolean skip_taskbar
;
197 /*! The window is a 'fullscreen' window, and should be on top of all
200 /*! The window should be on top of other windows of the same type */
202 /*! The window should be underneath other windows of the same type */
205 /*! The layer in which the window will be stacked, windows in lower layers
206 are always below windows in higher layers. */
209 /*! A bitmask of values in the Decoration enum
210 The values in the variable are the decorations that the client wants to
211 be displayed around it.
215 /*! A bitmask of values in the Decoration enum.
216 Specifies the decorations that should NOT be displayed on the client.
218 int disabled_decorations
;
220 /*! A bitmask of values in the Function enum
221 The values in the variable specify the ways in which the user is allowed
222 to modify this window.
226 /*! Icons for the client as specified on the client window */
228 /*! The number of icons in icons */
231 /*! The icon for the client specified in the WMHints or the KWM hints */
233 /*! The mask for the pixmap_icon, or None if its not masked */
234 Pixmap pixmap_icon_mask
;
236 /* The instance of the wrapper class if one exists */
237 struct ClientWrap
*wrap
;
240 extern GSList
*client_list
;
241 extern GHashTable
*client_map
;
243 void client_startup();
244 void client_shutdown();
246 /*! Manages all existing windows */
247 void client_manage_all();
248 /*! Manages a given window */
249 void client_manage(Window win
);
250 /*! Unmanages all managed windows */
251 void client_unmanage_all();
252 /*! Unmanages a given client */
253 void client_unmanage(Client
*client
);
255 /*! Sets the client list on the root window from the client_list */
256 void client_set_list();
258 /*! Reapplies the maximized state to the window
259 Use this to make the window readjust its maximized size to new
260 surroundings (struts, etc). */
261 void client_remaximize(Client
*self
);
263 /*! Shows the window if it should be shown, or hides it
264 Used when changing desktops, the window's state, etc. */
265 void client_showhide(Client
*self
);
267 /*! Returns if the window should be treated as a normal window.
268 Some windows (desktops, docks, splash screens) have special rules applied
269 to them in a number of places regarding focus or user interaction. */
270 gboolean
client_normal(Client
*self
);
272 /*! Internal version of the Client::resize function
273 This also maintains things like the client's minsize, and size increments.
274 @param anchor The corner to keep in the same position when resizing.
275 @param x The x coordiante of the new position for the client.
276 @param y The y coordiante of the new position for the client.
277 @param w The width component of the new size for the client.
278 @param h The height component of the new size for the client.
279 @param user Specifies whether this is a user-requested change or a
280 program requested change. For program requested changes, the
281 constraints are not checked.
282 @param final If user is true, then this should specify if this is a final
283 configuration. e.g. Final should be FALSE if doing an
284 interactive move/resize, and then be TRUE for the last call
287 void client_configure(Client
*self
, Corner anchor
, int x
, int y
, int w
, int h
,
288 gboolean user
, gboolean final
);
290 /*! Fullscreen's or unfullscreen's the client window
291 @param fs true if the window should be made fullscreen; false if it should
292 be returned to normal state.
293 @param savearea true to have the client's current size and position saved;
294 otherwise, they are not. You should not save when mapping a
295 new window that is set to fullscreen. This has no effect
296 when restoring a window from fullscreen.
298 void client_fullscreen(Client
*self
, gboolean fs
, gboolean savearea
);
300 /*! Iconifies or uniconifies the client window
301 @param iconic true if the window should be iconified; false if it should be
303 @param curdesk If iconic is FALSE, then this determines if the window will
304 be uniconified to the current viewable desktop (true) or to
305 its previous desktop (false)
307 void client_iconify(Client
*self
, gboolean iconic
, gboolean curdesk
);
309 /*! Maximize or unmaximize the client window
310 @param max true if the window should be maximized; false if it should be
311 returned to normal size.
312 @param dir 0 to set both horz and vert, 1 to set horz, 2 to set vert.
313 @param savearea true to have the client's current size and position saved;
314 otherwise, they are not. You should not save when mapping a
315 new window that is set to fullscreen. This has no effect
316 when unmaximizing a window.
318 void client_maximize(Client
*self
, gboolean max
, int dir
,
321 /*! Shades or unshades the client window
322 @param shade true if the window should be shaded; false if it should be
325 void client_shade(Client
*self
, gboolean shade
);
327 /*! Request the client to close its window. */
328 void client_close(Client
*self
);
330 /*! Sends the window to the specified desktop */
331 void client_set_desktop(Client
*self
, unsigned int target
);
333 /*! Return a modal child of the client window
334 @return A modal child of the client window, or 0 if none was found.
336 Client
*client_find_modal_child(Client
*self
);
338 /*! Validate client, by making sure no Destroy or Unmap events exist in
339 the event queue for the window.
340 @return true if the client is valid; false if the client has already
341 been unmapped/destroyed, and so is invalid.
343 gboolean
client_validate(Client
*self
);
345 /*! Sets the wm_state to the specified value */
346 void client_set_wm_state(Client
*self
, long state
);
348 /*! Adjusts the window's net_state
349 This should not be called as part of the window mapping process! It is for
350 use when updating the state post-mapping.<br>
351 client_apply_startup_state is used to do the same things during the mapping
354 void client_set_state(Client
*self
, Atom action
, long data1
, long data2
);
356 /*! Attempt to focus the client window */
357 gboolean
client_focus(Client
*self
);
359 /*! Remove focus from the client window */
360 void client_unfocus(Client
*self
);
362 /*! Calculates the stacking layer for the client window */
363 void client_calc_layer(Client
*self
);
365 /*! Updates the window's transient status, and any parents of it */
366 void client_update_transient_for(Client
*self
);
367 /*! Update the protocols that the window supports and adjusts things if they
369 void client_update_protocols(Client
*self
);
370 /*! Updates the WMNormalHints and adjusts things if they change */
371 void client_update_normal_hints(Client
*self
);
373 /*! Updates the WMHints and adjusts things if they change
374 @param initstate Whether to read the initial_state property from the
375 WMHints. This should only be used during the mapping
378 void client_update_wmhints(Client
*self
);
379 /*! Updates the window's title */
380 void client_update_title(Client
*self
);
381 /*! Updates the window's icon title */
382 void client_update_icon_title(Client
*self
);
383 /*! Updates the window's application name and class */
384 void client_update_class(Client
*self
);
385 /*! Updates the strut for the client */
386 void client_update_strut(Client
*self
);
387 /*! Updates the window's icons */
388 void client_update_icons(Client
*self
);
389 /*! Updates the window's kwm icon */
390 void client_update_kwm_icon(Client
*self
);
392 /*! Set up what decor should be shown on the window and what functions should
393 be allowed (Client::_decorations and Client::_functions).
394 This also updates the NET_WM_ALLOWED_ACTIONS hint.
396 void client_setup_decor_and_functions(Client
*self
);
398 /*! Retrieves the window's type and sets Client->type */
399 void client_get_type(Client
*self
);
This page took 0.056385 seconds and 4 git commands to generate.