]>
Dogcows Code - chaz/openbox/blob - openbox/client.h
6 #include "render/color.h"
14 /* The value in client.transient_for indicating it is a transient for its
15 group instead of for a single window */
16 #define TRAN_GROUP ((void*)~0l)
18 /*! Holds an icon in ARGB format */
24 /*! The MWM Hints as retrieved from the window property
25 This structure only contains 3 elements, even though the Motif 2.0
26 structure contains 5. We only use the first 3, so that is all gets
29 typedef struct MwmHints
{
30 /*! A bitmask of Client::MwmFlags values */
32 /*! A bitmask of Client::MwmFunctions values */
33 unsigned long functions
;
34 /*! A bitmask of Client::MwmDecorations values */
35 unsigned long decorations
;
37 /*! The number of elements in the Client::MwmHints struct */
38 #define MWM_ELEMENTS 3
40 /*! Possible flags for MWM Hints (defined by Motif 2.0) */
42 MwmFlag_Functions
= 1 << 0, /*!< The MMW Hints define funcs */
43 MwmFlag_Decorations
= 1 << 1 /*!< The MWM Hints define decor */
46 /*! Possible functions for MWM Hints (defined by Motif 2.0) */
48 MwmFunc_All
= 1 << 0, /*!< All functions */
49 MwmFunc_Resize
= 1 << 1, /*!< Allow resizing */
50 MwmFunc_Move
= 1 << 2, /*!< Allow moving */
51 MwmFunc_Iconify
= 1 << 3, /*!< Allow to be iconfied */
52 MwmFunc_Maximize
= 1 << 4 /*!< Allow to be maximized */
53 /*MwmFunc_Close = 1 << 5 /!< Allow to be closed */
56 /*! Possible decorations for MWM Hints (defined by Motif 2.0) */
58 MwmDecor_All
= 1 << 0, /*!< All decorations */
59 MwmDecor_Border
= 1 << 1, /*!< Show a border */
60 MwmDecor_Handle
= 1 << 2, /*!< Show a handle (bottom) */
61 MwmDecor_Title
= 1 << 3, /*!< Show a titlebar */
62 /*MwmDecor_Menu = 1 << 4, /!< Show a menu */
63 MwmDecor_Iconify
= 1 << 5, /*!< Show an iconify button */
64 MwmDecor_Maximize
= 1 << 6 /*!< Show a maximize button */
67 /*! Corners of the client window, used for anchor positions */
75 /*! Possible window types */
77 Type_Desktop
, /*!< A desktop (bottom-most window) */
78 Type_Dock
, /*!< A dock bar/panel window */
79 Type_Toolbar
, /*!< A toolbar window, pulled off an app */
80 Type_Menu
, /*!< An unpinned menu from an app */
81 Type_Utility
, /*!< A small utility window such as a palette */
82 Type_Splash
, /*!< A splash screen window */
83 Type_Dialog
, /*!< A dialog window */
84 Type_Normal
/*!< A normal application window */
87 /*! The things the user can do to the client window */
89 Func_Resize
= 1 << 0, /*!< Allow resizing */
90 Func_Move
= 1 << 1, /*!< Allow moving */
91 Func_Iconify
= 1 << 2, /*!< Allow to be iconified */
92 Func_Maximize
= 1 << 3, /*!< Allow to be maximized */
93 Func_Shade
= 1 << 4, /*!< Allow to be shaded */
94 Func_Fullscreen
= 1 << 5, /*!< Allow to be made fullscreen */
95 Func_Close
= 1 << 6 /*!< Allow to be closed */
98 /*! The decorations the client window wants to be displayed on it */
100 Decor_Titlebar
= 1 << 0, /*!< Display a titlebar */
101 Decor_Handle
= 1 << 1, /*!< Display a handle (bottom) */
102 Decor_Border
= 1 << 2, /*!< Display a border */
103 Decor_Icon
= 1 << 3, /*!< Display the window's icon */
104 Decor_Iconify
= 1 << 4, /*!< Display an iconify button */
105 Decor_Maximize
= 1 << 5, /*!< Display a maximize button */
106 /*! Display a button to toggle the window's placement on
108 Decor_AllDesktops
= 1 << 6,
109 Decor_Shade
= 1 << 7, /*!< Displays a shade button */
110 Decor_Close
= 1 << 8 /*!< Display a close button */
113 /*! The directions used by client_find_directional */
125 typedef struct Client
{
130 /*! The window's decorations. NULL while the window is being managed! */
133 /*! The number of unmap events to ignore on the window */
136 /*! The id of the group the window belongs to */
138 /*! Whether or not the client is a transient window. This is guaranteed to
139 be TRUE if transient_for != NULL, but not guaranteed to be FALSE if
140 transient_for == NULL. */
142 /*! The client which this client is a transient (child) for.
143 A value of TRAN_GROUP signifies that the window is a transient for all
144 members of its Group, and is not a valid pointer to be followed in this
147 struct Client
*transient_for
;
148 /*! The clients which are transients (children) of this client */
150 /*! The desktop on which the window resides (0xffffffff for all
154 /*! Normal window title */
156 /*! The count for the title. When another window with the same title
157 exists, a count will be appended to it. */
159 /*! Window title when iconified */
162 /*! The application that created the window */
164 /*! The class of the window, can used for grouping */
166 /*! The specified role of the window, used for identification */
169 /*! The type of window (what its function is) */
172 /*! Position and size of the window
173 This will not always be the actual position of the window on screen, it
174 is, rather, the position requested by the client, to which the window's
179 /*! The window's strut
180 The strut defines areas of the screen that are marked off-bounds for
181 window placement. In theory, where this window exists.
185 /*! The logical size of the window
186 The "logical" size of the window is refers to the user's perception of
187 the size of the window, and is the value that should be displayed to the
188 user. For example, with xterms, this value it the number of characters
189 being displayed in the terminal, instead of the number of pixels.
193 /*! Width of the border on the window.
194 The window manager will set this to 0 while the window is being managed,
195 but needs to restore it afterwards, so it is saved here.
199 /*! The minimum aspect ratio the client window can be sized to.
200 A value of 0 means this is ignored.
203 /*! The maximum aspect ratio the client window can be sized to.
204 A value of 0 means this is ignored.
208 /*! The minimum size of the client window
209 If the min is > the max, then the window is not resizable
212 /*! The maximum size of the client window
213 If the min is > the max, then the window is not resizable
216 /*! The size of increments to resize the client window by */
218 /*! The base size of the client window
219 This value should be subtracted from the window's actual size when
220 displaying its size to the user, or working with its min/max size
224 /*! Window decoration and functionality hints */
227 /*! Where to place the decorated window in relation to the undecorated
231 /*! The state of the window, one of WithdrawnState, IconicState, or
235 /*! True if the client supports the delete_window protocol */
236 gboolean delete_window
;
238 /*! Was the window's position requested by the application? if not, we
239 should place the window ourselves when it first appears */
242 /*! Can the window receive input focus? */
246 /*! Notify the window when it receives focus? */
247 gboolean focus_notify
;
249 /*! The window uses shape extension to be non-rectangular? */
252 /*! The window is modal, so it must be processed before any windows it is
253 related to can be focused */
255 /*! Only the window's titlebar is displayed */
257 /*! The window is iconified */
259 /*! The window is maximized to fill the screen vertically */
261 /*! The window is maximized to fill the screen horizontally */
263 /*! The window should not be displayed by pagers */
265 /*! The window should not be displayed by taskbars */
266 gboolean skip_taskbar
;
267 /*! The window is a 'fullscreen' window, and should be on top of all
270 /*! The window should be on top of other windows of the same type.
271 above takes priority over below. */
273 /*! The window should be underneath other windows of the same type.
274 above takes priority over below. */
277 /*! The layer in which the window will be stacked, windows in lower layers
278 are always below windows in higher layers. */
281 /*! A bitmask of values in the Decoration enum
282 The values in the variable are the decorations that the client wants to
283 be displayed around it.
287 /*! A bitmask of values in the Decoration enum.
288 Specifies the decorations that should NOT be displayed on the client.
290 int disabled_decorations
;
292 /*! A bitmask of values in the Function enum
293 The values in the variable specify the ways in which the user is allowed
294 to modify this window.
298 /*! Icons for the client as specified on the client window */
300 /*! The number of icons in icons */
304 extern GList
*client_list
;
306 void client_startup();
307 void client_shutdown();
309 /*! Manages all existing windows */
310 void client_manage_all();
311 /*! Manages a given window */
312 void client_manage(Window win
);
313 /*! Unmanages all managed windows */
314 void client_unmanage_all();
315 /*! Unmanages a given client */
316 void client_unmanage(Client
*client
);
318 /*! Sets the client list on the root window from the client_list */
319 void client_set_list();
321 /*! Determines if the client should be shown or hidden currently.
322 @return TRUE if it should be visible; otherwise, FALSE.
324 gboolean
client_should_show(Client
*self
);
326 /*! Returns if the window should be treated as a normal window.
327 Some windows (desktops, docks, splash screens) have special rules applied
328 to them in a number of places regarding focus or user interaction. */
329 gboolean
client_normal(Client
*self
);
331 /* Returns if the window is focused */
332 gboolean
client_focused(Client
*self
);
334 /*! Move and/or resize the window.
335 This also maintains things like the client's minsize, and size increments.
336 @param anchor The corner to keep in the same position when resizing.
337 @param x The x coordiante of the new position for the client.
338 @param y The y coordiante of the new position for the client.
339 @param w The width component of the new size for the client.
340 @param h The height component of the new size for the client.
341 @param user Specifies whether this is a user-requested change or a
342 program requested change. For program requested changes, the
343 constraints are not checked.
344 @param final If user is true, then this should specify if this is a final
345 configuration. e.g. Final should be FALSE if doing an
346 interactive move/resize, and then be TRUE for the last call
349 void client_configure(Client
*self
, Corner anchor
, int x
, int y
, int w
, int h
,
350 gboolean user
, gboolean final
);
352 void client_reconfigure(Client
*self
);
354 /*! Moves a client so that it is on screen if it is entirely out of the
357 void client_move_onscreen(Client
*self
);
359 /*! Fullscreen's or unfullscreen's the client window
360 @param fs true if the window should be made fullscreen; false if it should
361 be returned to normal state.
362 @param savearea true to have the client's current size and position saved;
363 otherwise, they are not. You should not save when mapping a
364 new window that is set to fullscreen. This has no effect
365 when restoring a window from fullscreen.
367 void client_fullscreen(Client
*self
, gboolean fs
, gboolean savearea
);
369 /*! Iconifies or uniconifies the client window
370 @param iconic true if the window should be iconified; false if it should be
372 @param curdesk If iconic is FALSE, then this determines if the window will
373 be uniconified to the current viewable desktop (true) or to
374 its previous desktop (false)
376 void client_iconify(Client
*self
, gboolean iconic
, gboolean curdesk
);
378 /*! Maximize or unmaximize the client window
379 @param max true if the window should be maximized; false if it should be
380 returned to normal size.
381 @param dir 0 to set both horz and vert, 1 to set horz, 2 to set vert.
382 @param savearea true to have the client's current size and position saved;
383 otherwise, they are not. You should not save when mapping a
384 new window that is set to fullscreen. This has no effect
385 when unmaximizing a window.
387 void client_maximize(Client
*self
, gboolean max
, int dir
,
390 /*! Shades or unshades the client window
391 @param shade true if the window should be shaded; false if it should be
394 void client_shade(Client
*self
, gboolean shade
);
396 /*! Request the client to close its window */
397 void client_close(Client
*self
);
399 /*! Kill the client off violently */
400 void client_kill(Client
*self
);
402 /*! Sends the window to the specified desktop
403 @param donthide If TRUE, the window will not be shown/hidden after its
404 desktop has been changed. Generally this should be FALSE. */
405 void client_set_desktop(Client
*self
, guint target
, gboolean donthide
);
407 /*! Validate client, by making sure no Destroy or Unmap events exist in
408 the event queue for the window.
409 @return true if the client is valid; false if the client has already
410 been unmapped/destroyed, and so is invalid.
412 gboolean
client_validate(Client
*self
);
414 /*! Sets the wm_state to the specified value */
415 void client_set_wm_state(Client
*self
, long state
);
417 /*! Adjusts the window's net_state
418 This should not be called as part of the window mapping process! It is for
419 use when updating the state post-mapping.<br>
420 client_apply_startup_state is used to do the same things during the mapping
423 void client_set_state(Client
*self
, Atom action
, long data1
, long data2
);
425 /* Given a Client, find the client that focus would actually be sent to if
426 you wanted to give focus to the specified Client. Will return the same
427 Client passed to it or another Client if appropriate. */
428 Client
*client_focus_target(Client
*self
);
430 /*! Returns what client_focus would return if passed the same client, but
431 without focusing it or modifying the focus order lists. */
432 gboolean
client_can_focus(Client
*self
);
434 /*! Attempt to focus the client window */
435 gboolean
client_focus(Client
*self
);
437 /*! Remove focus from the client window */
438 void client_unfocus(Client
*self
);
440 /*! Activates the client for use, focusing, uniconifying it, etc. To be used
441 when the user deliberately selects a window for use. */
442 void client_activate(Client
*self
);
444 /*! Calculates the stacking layer for the client window */
445 void client_calc_layer(Client
*self
);
447 /*! Updates the window's transient status, and any parents of it */
448 void client_update_transient_for(Client
*self
);
449 /*! Update the protocols that the window supports and adjusts things if they
451 void client_update_protocols(Client
*self
);
452 /*! Updates the WMNormalHints and adjusts things if they change */
453 void client_update_normal_hints(Client
*self
);
455 /*! Updates the WMHints and adjusts things if they change
456 @param initstate Whether to read the initial_state property from the
457 WMHints. This should only be used during the mapping
460 void client_update_wmhints(Client
*self
);
461 /*! Updates the window's title and icon title */
462 void client_update_title(Client
*self
);
463 /*! Updates the window's application name and class */
464 void client_update_class(Client
*self
);
465 /*! Updates the strut for the client */
466 void client_update_strut(Client
*self
);
467 /*! Updates the window's icons */
468 void client_update_icons(Client
*self
);
470 /*! Set up what decor should be shown on the window and what functions should
471 be allowed (Client::decorations and Client::functions).
472 This also updates the NET_WM_ALLOWED_ACTIONS hint.
474 void client_setup_decor_and_functions(Client
*self
);
476 /*! Retrieves the window's type and sets Client->type */
477 void client_get_type(Client
*self
);
479 Icon
*client_icon(Client
*self
, int w
, int h
);
481 /*! Searches a client's transients for a focused window. The function does not
482 check for the passed client, only for its transients.
483 If no focused transient is found, NULL is returned.
485 Client
*client_search_focus_tree(Client
*self
);
487 /*! Searches a client's transient tree for a focused window. The function
488 searches up the tree and down other branches as well as the passed client's.
489 If no focused client is found, NULL is returned.
491 Client
*client_search_focus_tree_full(Client
*self
);
493 /*! Return a modal child of the client window that can be focused.
494 @return A modal child of the client window that can be focused, or 0 if
497 Client
*client_search_modal_child(Client
*self
);
499 /*! Return the "closest" client in the given direction */
500 Client
*client_find_directional(Client
*c
, Direction dir
);
502 /*! Set a client window to be above/below other clients.
503 @layer < 0 indicates the client should be placed below other clients.<br>
504 = 0 indicates the client should be placed with other clients.<br>
505 > 0 indicates the client should be placed above other clients.
507 void client_set_layer(Client
*self
, int layer
);
509 guint
client_xinerama_area(Client
*self
);
This page took 0.059542 seconds and 4 git commands to generate.