]>
Dogcows Code - chaz/openbox/blob - openbox/client.h
12 /*! Holds an icon in ARGB format */
14 unsigned long width
, height
;
18 /*! The MWM Hints as retrieved from the window property
19 This structure only contains 3 elements, even though the Motif 2.0
20 structure contains 5. We only use the first 3, so that is all gets
23 typedef struct MwmHints
{
24 /*! A bitmask of Client::MwmFlags values */
26 /*! A bitmask of Client::MwmFunctions values */
27 unsigned long functions
;
28 /*! A bitmask of Client::MwmDecorations values */
29 unsigned long decorations
;
31 /*! The number of elements in the Client::MwmHints struct */
32 #define MWM_ELEMENTS 3
34 /*! Possible flags for MWM Hints (defined by Motif 2.0) */
36 MwmFlag_Functions
= 1 << 0, /*!< The MMW Hints define funcs */
37 MwmFlag_Decorations
= 1 << 1 /*!< The MWM Hints define decor */
40 /*! Possible functions for MWM Hints (defined by Motif 2.0) */
42 MwmFunc_All
= 1 << 0, /*!< All functions */
43 MwmFunc_Resize
= 1 << 1, /*!< Allow resizing */
44 MwmFunc_Move
= 1 << 2, /*!< Allow moving */
45 MwmFunc_Iconify
= 1 << 3, /*!< Allow to be iconfied */
46 MwmFunc_Maximize
= 1 << 4 /*!< Allow to be maximized */
47 /*MwmFunc_Close = 1 << 5 /!< Allow to be closed */
50 /*! Possible decorations for MWM Hints (defined by Motif 2.0) */
52 MwmDecor_All
= 1 << 0, /*!< All decorations */
53 MwmDecor_Border
= 1 << 1, /*!< Show a border */
54 MwmDecor_Handle
= 1 << 2, /*!< Show a handle (bottom) */
55 MwmDecor_Title
= 1 << 3, /*!< Show a titlebar */
56 /*MwmDecor_Menu = 1 << 4, /!< Show a menu */
57 MwmDecor_Iconify
= 1 << 5, /*!< Show an iconify button */
58 MwmDecor_Maximize
= 1 << 6 /*!< Show a maximize button */
61 /*! Corners of the client window, used for anchor positions */
69 /*! Possible window types */
71 Type_Desktop
, /*!< A desktop (bottom-most window) */
72 Type_Dock
, /*!< A dock bar/panel window */
73 Type_Toolbar
, /*!< A toolbar window, pulled off an app */
74 Type_Menu
, /*!< An unpinned menu from an app */
75 Type_Utility
, /*!< A small utility window such as a palette */
76 Type_Splash
, /*!< A splash screen window */
77 Type_Dialog
, /*!< A dialog window */
78 Type_Normal
/*!< A normal application window */
81 /*! The things the user can do to the client window */
83 Func_Resize
= 1 << 0, /*!< Allow resizing */
84 Func_Move
= 1 << 1, /*!< Allow moving */
85 Func_Iconify
= 1 << 2, /*!< Allow to be iconified */
86 Func_Maximize
= 1 << 3, /*!< Allow to be maximized */
87 Func_Shade
= 1 << 4, /*!< Allow to be shaded */
88 Func_Fullscreen
= 1 << 5, /*!< Allow to be made fullscreen */
89 Func_Close
= 1 << 6 /*!< Allow to be closed */
92 /*! The decorations the client window wants to be displayed on it */
94 Decor_Titlebar
= 1 << 0, /*!< Display a titlebar */
95 Decor_Handle
= 1 << 1, /*!< Display a handle (bottom) */
96 Decor_Border
= 1 << 2, /*!< Display a border */
97 Decor_Icon
= 1 << 3, /*!< Display the window's icon */
98 Decor_Iconify
= 1 << 4, /*!< Display an iconify button */
99 Decor_Maximize
= 1 << 5, /*!< Display a maximize button */
100 /*! Display a button to toggle the window's placement on
102 Decor_AllDesktops
= 1 << 6,
103 Decor_Shade
= 1 << 7, /*!< Displays a shade button */
104 Decor_Close
= 1 << 8 /*!< Display a close button */
108 typedef struct Client
{
113 /*! The number of unmap events to ignore on the window */
116 /*! The id of the group the window belongs to */
118 /*! Whether or not the client is a transient window. This is guaranteed to
119 be TRUE if transient_for != NULL, but not guaranteed to be FALSE if
120 transient_for == NULL. */
122 /*! The client which this client is a transient (child) for */
123 struct Client
*transient_for
;
124 /*! The clients which are transients (children) of this client */
126 /*! The desktop on which the window resides (0xffffffff for all
128 unsigned int desktop
;
130 /*! Normal window title */
132 /*! Window title when iconified */
135 /*! The application that created the window */
137 /*! The class of the window, can used for grouping */
139 /*! The specified role of the window, used for identification */
142 /*! The type of window (what its function is) */
145 /*! Position and size of the window
146 This will not always be the actual position of the window on screen, it
147 is, rather, the position requested by the client, to which the window's
152 /*! The window's strut
153 The strut defines areas of the screen that are marked off-bounds for
154 window placement. In theory, where this window exists.
158 /*! The logical size of the window
159 The "logical" size of the window is refers to the user's perception of
160 the size of the window, and is the value that should be displayed to the
161 user. For example, with xterms, this value it the number of characters
162 being displayed in the terminal, instead of the number of pixels.
166 /*! Width of the border on the window.
167 The window manager will set this to 0 while the window is being managed,
168 but needs to restore it afterwards, so it is saved here.
172 /*! The minimum aspect ratio the client window can be sized to.
173 A value of 0 means this is ignored.
176 /*! The maximum aspect ratio the client window can be sized to.
177 A value of 0 means this is ignored.
181 /*! The minimum size of the client window
182 If the min is > the max, then the window is not resizable
185 /*! The maximum size of the client window
186 If the min is > the max, then the window is not resizable
189 /*! The size of increments to resize the client window by */
191 /*! The base size of the client window
192 This value should be subtracted from the window's actual size when
193 displaying its size to the user, or working with its min/max size
197 /*! Window decoration and functionality hints */
200 /*! Where to place the decorated window in relation to the undecorated
204 /*! The state of the window, one of WithdrawnState, IconicState, or
208 /*! True if the client supports the delete_window protocol */
209 gboolean delete_window
;
211 /*! Was the window's position requested by the application? if not, we
212 should place the window ourselves when it first appears */
215 /*! Can the window receive input focus? */
219 /*! Notify the window when it receives focus? */
220 gboolean focus_notify
;
222 /*! The window uses shape extension to be non-rectangular? */
225 /*! The window is modal, so it must be processed before any windows it is
226 related to can be focused */
228 /*! Only the window's titlebar is displayed */
230 /*! The window is iconified */
232 /*! The window is maximized to fill the screen vertically */
234 /*! The window is maximized to fill the screen horizontally */
236 /*! The window should not be displayed by pagers */
238 /*! The window should not be displayed by taskbars */
239 gboolean skip_taskbar
;
240 /*! The window is a 'fullscreen' window, and should be on top of all
243 /*! The window should be on top of other windows of the same type.
244 above takes priority over below. */
246 /*! The window should be underneath other windows of the same type.
247 above takes priority over below. */
250 /*! The layer in which the window will be stacked, windows in lower layers
251 are always below windows in higher layers. */
254 /*! A bitmask of values in the Decoration enum
255 The values in the variable are the decorations that the client wants to
256 be displayed around it.
260 /*! A bitmask of values in the Decoration enum.
261 Specifies the decorations that should NOT be displayed on the client.
263 int disabled_decorations
;
265 /*! A bitmask of values in the Function enum
266 The values in the variable specify the ways in which the user is allowed
267 to modify this window.
271 /*! Saved decorations from before becoming fullscreen */
274 /*! Saved functions from before becoming fullscreen */
277 /*! Icons for the client as specified on the client window */
279 /*! The number of icons in icons */
282 /*! The icon for the client specified in the WMHints or the KWM hints */
284 /*! The mask for the pixmap_icon, or None if its not masked */
285 Pixmap pixmap_icon_mask
;
288 extern GSList
*client_list
;
289 extern GHashTable
*client_map
;
291 void client_startup();
292 void client_shutdown();
294 /*! Manages all existing windows */
295 void client_manage_all();
296 /*! Manages a given window */
297 void client_manage(Window win
);
298 /*! Unmanages all managed windows */
299 void client_unmanage_all();
300 /*! Unmanages a given client */
301 void client_unmanage(Client
*client
);
303 /*! Sets the client list on the root window from the client_list */
304 void client_set_list();
306 /*! Reapplies the maximized state to the window
307 Use this to make the window readjust its maximized size to new
308 surroundings (struts, etc). */
309 void client_remaximize(Client
*self
);
311 /*! Determines if the client should be shown or hidden currently.
312 @return TRUE if it should be visible; otherwise, FALSE.
314 gboolean
client_should_show(Client
*self
);
316 /*! Returns if the window should be treated as a normal window.
317 Some windows (desktops, docks, splash screens) have special rules applied
318 to them in a number of places regarding focus or user interaction. */
319 gboolean
client_normal(Client
*self
);
321 /* Returns if the window is focused */
322 gboolean
client_focused(Client
*self
);
324 /*! Move and/or resize the window.
325 This also maintains things like the client's minsize, and size increments.
326 @param anchor The corner to keep in the same position when resizing.
327 @param x The x coordiante of the new position for the client.
328 @param y The y coordiante of the new position for the client.
329 @param w The width component of the new size for the client.
330 @param h The height component of the new size for the client.
331 @param user Specifies whether this is a user-requested change or a
332 program requested change. For program requested changes, the
333 constraints are not checked.
334 @param final If user is true, then this should specify if this is a final
335 configuration. e.g. Final should be FALSE if doing an
336 interactive move/resize, and then be TRUE for the last call
339 void client_configure(Client
*self
, Corner anchor
, int x
, int y
, int w
, int h
,
340 gboolean user
, gboolean final
);
342 /*! Fullscreen's or unfullscreen's the client window
343 @param fs true if the window should be made fullscreen; false if it should
344 be returned to normal state.
345 @param savearea true to have the client's current size and position saved;
346 otherwise, they are not. You should not save when mapping a
347 new window that is set to fullscreen. This has no effect
348 when restoring a window from fullscreen.
350 void client_fullscreen(Client
*self
, gboolean fs
, gboolean savearea
);
352 /*! Iconifies or uniconifies the client window
353 @param iconic true if the window should be iconified; false if it should be
355 @param curdesk If iconic is FALSE, then this determines if the window will
356 be uniconified to the current viewable desktop (true) or to
357 its previous desktop (false)
359 void client_iconify(Client
*self
, gboolean iconic
, gboolean curdesk
);
361 /*! Maximize or unmaximize the client window
362 @param max true if the window should be maximized; false if it should be
363 returned to normal size.
364 @param dir 0 to set both horz and vert, 1 to set horz, 2 to set vert.
365 @param savearea true to have the client's current size and position saved;
366 otherwise, they are not. You should not save when mapping a
367 new window that is set to fullscreen. This has no effect
368 when unmaximizing a window.
370 void client_maximize(Client
*self
, gboolean max
, int dir
,
373 /*! Shades or unshades the client window
374 @param shade true if the window should be shaded; false if it should be
377 void client_shade(Client
*self
, gboolean shade
);
379 /*! Request the client to close its window */
380 void client_close(Client
*self
);
382 /*! Kill the client off violently */
383 void client_kill(Client
*self
);
385 /*! Sends the window to the specified desktop
386 @param donthide If TRUE, the window will not be shown/hidden after its
387 desktop has been changed. Generally this should be FALSE. */
388 void client_set_desktop(Client
*self
, guint target
, gboolean donthide
);
390 /*! Return a modal child of the client window
391 @return A modal child of the client window, or 0 if none was found.
393 Client
*client_find_modal_child(Client
*self
);
395 /*! Validate client, by making sure no Destroy or Unmap events exist in
396 the event queue for the window.
397 @return true if the client is valid; false if the client has already
398 been unmapped/destroyed, and so is invalid.
400 gboolean
client_validate(Client
*self
);
402 /*! Sets the wm_state to the specified value */
403 void client_set_wm_state(Client
*self
, long state
);
405 /*! Adjusts the window's net_state
406 This should not be called as part of the window mapping process! It is for
407 use when updating the state post-mapping.<br>
408 client_apply_startup_state is used to do the same things during the mapping
411 void client_set_state(Client
*self
, Atom action
, long data1
, long data2
);
413 /*! Attempt to focus the client window */
414 gboolean
client_focus(Client
*self
);
416 /*! Remove focus from the client window */
417 void client_unfocus(Client
*self
);
419 /*! Calculates the stacking layer for the client window */
420 void client_calc_layer(Client
*self
);
422 /*! Updates the window's transient status, and any parents of it */
423 void client_update_transient_for(Client
*self
);
424 /*! Update the protocols that the window supports and adjusts things if they
426 void client_update_protocols(Client
*self
);
427 /*! Updates the WMNormalHints and adjusts things if they change */
428 void client_update_normal_hints(Client
*self
);
430 /*! Updates the WMHints and adjusts things if they change
431 @param initstate Whether to read the initial_state property from the
432 WMHints. This should only be used during the mapping
435 void client_update_wmhints(Client
*self
);
436 /*! Updates the window's title */
437 void client_update_title(Client
*self
);
438 /*! Updates the window's icon title */
439 void client_update_icon_title(Client
*self
);
440 /*! Updates the window's application name and class */
441 void client_update_class(Client
*self
);
442 /*! Updates the strut for the client */
443 void client_update_strut(Client
*self
);
444 /*! Updates the window's icons */
445 void client_update_icons(Client
*self
);
446 /*! Updates the window's kwm icon */
447 void client_update_kwm_icon(Client
*self
);
449 /*! Set up what decor should be shown on the window and what functions should
450 be allowed (Client::decorations and Client::functions).
451 This also updates the NET_WM_ALLOWED_ACTIONS hint.
453 void client_setup_decor_and_functions(Client
*self
);
455 /*! Retrieves the window's type and sets Client->type */
456 void client_get_type(Client
*self
);
458 Icon
*client_icon(Client
*self
, int w
, int h
);
This page took 0.05967 seconds and 4 git commands to generate.