]>
Dogcows Code - chaz/openbox/blob - openbox/client.h
7 #include "render/color.h"
15 /* The value in client.transient_for indicating it is a transient for its
16 group instead of for a single window */
17 #define TRAN_GROUP ((void*)~0l)
19 /*! Holds an icon in ARGB format */
25 /*! The MWM Hints as retrieved from the window property
26 This structure only contains 3 elements, even though the Motif 2.0
27 structure contains 5. We only use the first 3, so that is all gets
30 typedef struct MwmHints
{
31 /*! A bitmask of Client::MwmFlags values */
33 /*! A bitmask of Client::MwmFunctions values */
34 unsigned long functions
;
35 /*! A bitmask of Client::MwmDecorations values */
36 unsigned long decorations
;
38 /*! The number of elements in the Client::MwmHints struct */
39 #define MWM_ELEMENTS 3
41 /*! Possible flags for MWM Hints (defined by Motif 2.0) */
43 MwmFlag_Functions
= 1 << 0, /*!< The MMW Hints define funcs */
44 MwmFlag_Decorations
= 1 << 1 /*!< The MWM Hints define decor */
47 /*! Possible functions for MWM Hints (defined by Motif 2.0) */
49 MwmFunc_All
= 1 << 0, /*!< All functions */
50 MwmFunc_Resize
= 1 << 1, /*!< Allow resizing */
51 MwmFunc_Move
= 1 << 2, /*!< Allow moving */
52 MwmFunc_Iconify
= 1 << 3, /*!< Allow to be iconfied */
53 MwmFunc_Maximize
= 1 << 4 /*!< Allow to be maximized */
54 /*MwmFunc_Close = 1 << 5 /!< Allow to be closed */
57 /*! Possible decorations for MWM Hints (defined by Motif 2.0) */
59 MwmDecor_All
= 1 << 0, /*!< All decorations */
60 MwmDecor_Border
= 1 << 1, /*!< Show a border */
61 MwmDecor_Handle
= 1 << 2, /*!< Show a handle (bottom) */
62 MwmDecor_Title
= 1 << 3, /*!< Show a titlebar */
63 /*MwmDecor_Menu = 1 << 4, /!< Show a menu */
64 MwmDecor_Iconify
= 1 << 5, /*!< Show an iconify button */
65 MwmDecor_Maximize
= 1 << 6 /*!< Show a maximize button */
68 /*! Possible window types */
70 Type_Desktop
, /*!< A desktop (bottom-most window) */
71 Type_Dock
, /*!< A dock bar/panel window */
72 Type_Toolbar
, /*!< A toolbar window, pulled off an app */
73 Type_Menu
, /*!< An unpinned menu from an app */
74 Type_Utility
, /*!< A small utility window such as a palette */
75 Type_Splash
, /*!< A splash screen window */
76 Type_Dialog
, /*!< A dialog window */
77 Type_Normal
/*!< A normal application window */
80 /*! The things the user can do to the client window */
82 Func_Resize
= 1 << 0, /*!< Allow resizing */
83 Func_Move
= 1 << 1, /*!< Allow moving */
84 Func_Iconify
= 1 << 2, /*!< Allow to be iconified */
85 Func_Maximize
= 1 << 3, /*!< Allow to be maximized */
86 Func_Shade
= 1 << 4, /*!< Allow to be shaded */
87 Func_Fullscreen
= 1 << 5, /*!< Allow to be made fullscreen */
88 Func_Close
= 1 << 6 /*!< Allow to be closed */
91 /*! The decorations the client window wants to be displayed on it */
93 Decor_Titlebar
= 1 << 0, /*!< Display a titlebar */
94 Decor_Handle
= 1 << 1, /*!< Display a handle (bottom) */
95 Decor_Border
= 1 << 2, /*!< Display a border */
96 Decor_Icon
= 1 << 3, /*!< Display the window's icon */
97 Decor_Iconify
= 1 << 4, /*!< Display an iconify button */
98 Decor_Maximize
= 1 << 5, /*!< Display a maximize button */
99 /*! Display a button to toggle the window's placement on
101 Decor_AllDesktops
= 1 << 6,
102 Decor_Shade
= 1 << 7, /*!< Displays a shade button */
103 Decor_Close
= 1 << 8 /*!< Display a close button */
106 typedef struct Client
{
111 /*! The window's decorations. NULL while the window is being managed! */
114 /*! The number of unmap events to ignore on the window */
117 /*! The id of the group the window belongs to */
119 /*! Whether or not the client is a transient window. This is guaranteed to
120 be TRUE if transient_for != NULL, but not guaranteed to be FALSE if
121 transient_for == NULL. */
123 /*! The client which this client is a transient (child) for.
124 A value of TRAN_GROUP signifies that the window is a transient for all
125 members of its Group, and is not a valid pointer to be followed in this
128 struct Client
*transient_for
;
129 /*! The clients which are transients (children) of this client */
131 /*! The desktop on which the window resides (0xffffffff for all
135 /*! Normal window title */
137 /*! The count for the title. When another window with the same title
138 exists, a count will be appended to it. */
140 /*! Window title when iconified */
143 /*! The application that created the window */
145 /*! The class of the window, can used for grouping */
147 /*! The specified role of the window, used for identification */
150 /*! The type of window (what its function is) */
153 /*! Position and size of the window
154 This will not always be the actual position of the window on screen, it
155 is, rather, the position requested by the client, to which the window's
160 /*! The window's strut
161 The strut defines areas of the screen that are marked off-bounds for
162 window placement. In theory, where this window exists.
166 /*! The logical size of the window
167 The "logical" size of the window is refers to the user's perception of
168 the size of the window, and is the value that should be displayed to the
169 user. For example, with xterms, this value it the number of characters
170 being displayed in the terminal, instead of the number of pixels.
174 /*! Width of the border on the window.
175 The window manager will set this to 0 while the window is being managed,
176 but needs to restore it afterwards, so it is saved here.
180 /*! The minimum aspect ratio the client window can be sized to.
181 A value of 0 means this is ignored.
184 /*! The maximum aspect ratio the client window can be sized to.
185 A value of 0 means this is ignored.
189 /*! The minimum size of the client window
190 If the min is > the max, then the window is not resizable
193 /*! The maximum size of the client window
194 If the min is > the max, then the window is not resizable
197 /*! The size of increments to resize the client window by */
199 /*! The base size of the client window
200 This value should be subtracted from the window's actual size when
201 displaying its size to the user, or working with its min/max size
205 /*! Window decoration and functionality hints */
208 /*! Where to place the decorated window in relation to the undecorated
212 /*! The state of the window, one of WithdrawnState, IconicState, or
216 /*! True if the client supports the delete_window protocol */
217 gboolean delete_window
;
219 /*! Was the window's position requested by the application? if not, we
220 should place the window ourselves when it first appears */
223 /*! Can the window receive input focus? */
227 /*! Notify the window when it receives focus? */
228 gboolean focus_notify
;
230 /*! The window uses shape extension to be non-rectangular? */
233 /*! The window is modal, so it must be processed before any windows it is
234 related to can be focused */
236 /*! Only the window's titlebar is displayed */
238 /*! The window is iconified */
240 /*! The window is maximized to fill the screen vertically */
242 /*! The window is maximized to fill the screen horizontally */
244 /*! The window should not be displayed by pagers */
246 /*! The window should not be displayed by taskbars */
247 gboolean skip_taskbar
;
248 /*! The window is a 'fullscreen' window, and should be on top of all
251 /*! The window should be on top of other windows of the same type.
252 above takes priority over below. */
254 /*! The window should be underneath other windows of the same type.
255 above takes priority over below. */
258 /*! The layer in which the window will be stacked, windows in lower layers
259 are always below windows in higher layers. */
262 /*! A bitmask of values in the Decoration enum
263 The values in the variable are the decorations that the client wants to
264 be displayed around it.
268 /*! A bitmask of values in the Decoration enum.
269 Specifies the decorations that should NOT be displayed on the client.
271 int disabled_decorations
;
273 /*! A bitmask of values in the Function enum
274 The values in the variable specify the ways in which the user is allowed
275 to modify this window.
279 /*! Icons for the client as specified on the client window */
281 /*! The number of icons in icons */
285 extern GList
*client_list
;
287 void client_startup();
288 void client_shutdown();
290 /*! Manages all existing windows */
291 void client_manage_all();
292 /*! Manages a given window */
293 void client_manage(Window win
);
294 /*! Unmanages all managed windows */
295 void client_unmanage_all();
296 /*! Unmanages a given client */
297 void client_unmanage(Client
*client
);
299 /*! Sets the client list on the root window from the client_list */
300 void client_set_list();
302 /*! Determines if the client should be shown or hidden currently.
303 @return TRUE if it should be visible; otherwise, FALSE.
305 gboolean
client_should_show(Client
*self
);
307 /*! Returns if the window should be treated as a normal window.
308 Some windows (desktops, docks, splash screens) have special rules applied
309 to them in a number of places regarding focus or user interaction. */
310 gboolean
client_normal(Client
*self
);
312 /* Returns if the window is focused */
313 gboolean
client_focused(Client
*self
);
315 /*! Move and/or resize the window.
316 This also maintains things like the client's minsize, and size increments.
317 @param anchor The corner to keep in the same position when resizing.
318 @param x The x coordiante of the new position for the client.
319 @param y The y coordiante of the new position for the client.
320 @param w The width component of the new size for the client.
321 @param h The height component of the new size for the client.
322 @param user Specifies whether this is a user-requested change or a
323 program requested change. For program requested changes, the
324 constraints are not checked.
325 @param final If user is true, then this should specify if this is a final
326 configuration. e.g. Final should be FALSE if doing an
327 interactive move/resize, and then be TRUE for the last call
330 void client_configure(Client
*self
, ObCorner anchor
,
331 int x
, int y
, int w
, int h
,
332 gboolean user
, gboolean final
);
334 void client_reconfigure(Client
*self
);
336 /*! Moves a client so that it is on screen if it is entirely out of the
339 void client_move_onscreen(Client
*self
);
341 /*! Fullscreen's or unfullscreen's the client window
342 @param fs true if the window should be made fullscreen; false if it should
343 be returned to normal state.
344 @param savearea true to have the client's current size and position saved;
345 otherwise, they are not. You should not save when mapping a
346 new window that is set to fullscreen. This has no effect
347 when restoring a window from fullscreen.
349 void client_fullscreen(Client
*self
, gboolean fs
, gboolean savearea
);
351 /*! Iconifies or uniconifies the client window
352 @param iconic true if the window should be iconified; false if it should be
354 @param curdesk If iconic is FALSE, then this determines if the window will
355 be uniconified to the current viewable desktop (true) or to
356 its previous desktop (false)
358 void client_iconify(Client
*self
, gboolean iconic
, gboolean curdesk
);
360 /*! Maximize or unmaximize the client window
361 @param max true if the window should be maximized; false if it should be
362 returned to normal size.
363 @param dir 0 to set both horz and vert, 1 to set horz, 2 to set vert.
364 @param savearea true to have the client's current size and position saved;
365 otherwise, they are not. You should not save when mapping a
366 new window that is set to fullscreen. This has no effect
367 when unmaximizing a window.
369 void client_maximize(Client
*self
, gboolean max
, int dir
,
372 /*! Shades or unshades the client window
373 @param shade true if the window should be shaded; false if it should be
376 void client_shade(Client
*self
, gboolean shade
);
378 /*! Request the client to close its window */
379 void client_close(Client
*self
);
381 /*! Kill the client off violently */
382 void client_kill(Client
*self
);
384 /*! Sends the window to the specified desktop
385 @param donthide If TRUE, the window will not be shown/hidden after its
386 desktop has been changed. Generally this should be FALSE. */
387 void client_set_desktop(Client
*self
, guint target
, gboolean donthide
);
389 /*! Validate client, by making sure no Destroy or Unmap events exist in
390 the event queue for the window.
391 @return true if the client is valid; false if the client has already
392 been unmapped/destroyed, and so is invalid.
394 gboolean
client_validate(Client
*self
);
396 /*! Sets the wm_state to the specified value */
397 void client_set_wm_state(Client
*self
, long state
);
399 /*! Adjusts the window's net_state
400 This should not be called as part of the window mapping process! It is for
401 use when updating the state post-mapping.<br>
402 client_apply_startup_state is used to do the same things during the mapping
405 void client_set_state(Client
*self
, Atom action
, long data1
, long data2
);
407 /* Given a Client, find the client that focus would actually be sent to if
408 you wanted to give focus to the specified Client. Will return the same
409 Client passed to it or another Client if appropriate. */
410 Client
*client_focus_target(Client
*self
);
412 /*! Returns what client_focus would return if passed the same client, but
413 without focusing it or modifying the focus order lists. */
414 gboolean
client_can_focus(Client
*self
);
416 /*! Attempt to focus the client window */
417 gboolean
client_focus(Client
*self
);
419 /*! Remove focus from the client window */
420 void client_unfocus(Client
*self
);
422 /*! Activates the client for use, focusing, uniconifying it, etc. To be used
423 when the user deliberately selects a window for use. */
424 void client_activate(Client
*self
);
426 /*! Calculates the stacking layer for the client window */
427 void client_calc_layer(Client
*self
);
429 /*! Updates the window's transient status, and any parents of it */
430 void client_update_transient_for(Client
*self
);
431 /*! Update the protocols that the window supports and adjusts things if they
433 void client_update_protocols(Client
*self
);
434 /*! Updates the WMNormalHints and adjusts things if they change */
435 void client_update_normal_hints(Client
*self
);
437 /*! Updates the WMHints and adjusts things if they change
438 @param initstate Whether to read the initial_state property from the
439 WMHints. This should only be used during the mapping
442 void client_update_wmhints(Client
*self
);
443 /*! Updates the window's title and icon title */
444 void client_update_title(Client
*self
);
445 /*! Updates the window's application name and class */
446 void client_update_class(Client
*self
);
447 /*! Updates the strut for the client */
448 void client_update_strut(Client
*self
);
449 /*! Updates the window's icons */
450 void client_update_icons(Client
*self
);
452 /*! Set up what decor should be shown on the window and what functions should
453 be allowed (Client::decorations and Client::functions).
454 This also updates the NET_WM_ALLOWED_ACTIONS hint.
456 void client_setup_decor_and_functions(Client
*self
);
458 /*! Retrieves the window's type and sets Client->type */
459 void client_get_type(Client
*self
);
461 Icon
*client_icon(Client
*self
, int w
, int h
);
463 /*! Searches a client's transients for a focused window. The function does not
464 check for the passed client, only for its transients.
465 If no focused transient is found, NULL is returned.
467 Client
*client_search_focus_tree(Client
*self
);
469 /*! Searches a client's transient tree for a focused window. The function
470 searches up the tree and down other branches as well as the passed client's.
471 If no focused client is found, NULL is returned.
473 Client
*client_search_focus_tree_full(Client
*self
);
475 /*! Return a modal child of the client window that can be focused.
476 @return A modal child of the client window that can be focused, or 0 if
479 Client
*client_search_modal_child(Client
*self
);
481 Client
*client_search_top_transient(Client
*self
);
483 /*! Return the "closest" client in the given direction */
484 Client
*client_find_directional(Client
*c
, ObDirection dir
);
486 /*! Set a client window to be above/below other clients.
487 @layer < 0 indicates the client should be placed below other clients.<br>
488 = 0 indicates the client should be placed with other clients.<br>
489 > 0 indicates the client should be placed above other clients.
491 void client_set_layer(Client
*self
, int layer
);
493 guint
client_monitor(Client
*self
);
This page took 0.055306 seconds and 4 git commands to generate.