]> icculus.org git repositories - mikachu/openbox.git/blob - openbox/focus.h
prefix and capitalize the ObFocusFallbackType enum
[mikachu/openbox.git] / openbox / focus.h
1 #ifndef __focus_h
2 #define __focus_h
3
4 #include <X11/Xlib.h>
5 #include <glib.h>
6
7 struct _ObClient;
8
9 /*! The window which gets focus when nothing else will be focused */
10 extern Window focus_backup;
11
12 /*! The client which is currently focused */
13 extern struct _ObClient *focus_client;
14
15 /*! The recent focus order on each desktop */
16 extern GList **focus_order;
17
18 void focus_startup();
19 void focus_shutdown();
20
21 /*! Specify which client is currently focused, this doesn't actually
22   send focus anywhere, its called by the Focus event handlers */
23 void focus_set_client(struct _ObClient *client);
24
25 typedef enum {
26     OB_FOCUS_FALLBACK_DESKTOP,    /*!< switching desktops */
27     OB_FOCUS_FALLBACK_UNFOCUSING, /*!< forcefully remove focus from the
28                                     current window */
29     OB_FOCUS_FALLBACK_NOFOCUS     /*!< nothing has focus for some reason */
30 } ObFocusFallbackType;
31
32 /*! Call this when you need to focus something! */
33 void focus_fallback(ObFocusFallbackType type);
34
35 /*! Cycle focus amongst windows
36   Returns the _ObClient to which focus has been cycled, or NULL if none. */
37 struct _ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done,
38                            gboolean cancel);
39
40 /*! Add a new client into the focus order */
41 void focus_order_add_new(struct _ObClient *c);
42
43 /*! Remove a client from the focus order */
44 void focus_order_remove(struct _ObClient *c);
45
46 /*! Move a client to the top of the focus order */
47 void focus_order_to_top(struct _ObClient *c);
48
49 /*! Move a client to the bottom of the focus order (keeps iconic windows at the
50   very bottom always though). */
51 void focus_order_to_bottom(struct _ObClient *c);
52
53 #endif