]> Dogcows Code - chaz/openbox/blob - openbox/window.h
fix a warning
[chaz/openbox] / openbox / window.h
1 #ifndef __window_h
2 #define __window_h
3
4 #include <X11/Xlib.h>
5 #include <glib.h>
6
7 typedef enum {
8 Window_Menu,
9 Window_Dock,
10 Window_DockApp, /* used for events but not stacking */
11 Window_Client,
12 Window_Internal /* used for stacking but not events */
13 } Window_InternalType;
14
15 typedef struct ObWindow {
16 Window_InternalType type;
17 } ObWindow;
18
19 /* Wrapper for internal stuff. If its struct matches this then it can be used
20 as an ObWindow */
21 typedef struct InternalWindow {
22 ObWindow obwin;
23 Window win;
24 } InternalWindow;
25
26 #define WINDOW_IS_MENU(win) (((ObWindow*)win)->type == Window_Menu)
27 #define WINDOW_IS_DOCK(win) (((ObWindow*)win)->type == Window_Dock)
28 #define WINDOW_IS_DOCKAPP(win) (((ObWindow*)win)->type == Window_DockApp)
29 #define WINDOW_IS_CLIENT(win) (((ObWindow*)win)->type == Window_Client)
30 #define WINDOW_IS_INTERNAL(win) (((ObWindow*)win)->type == Window_Internal)
31
32 struct Menu;
33 struct Dock;
34 struct DockApp;
35 struct Client;
36
37 #define WINDOW_AS_MENU(win) ((struct Menu*)win)
38 #define WINDOW_AS_DOCK(win) ((struct Dock*)win)
39 #define WINDOW_AS_DOCKAPP(win) ((struct DockApp*)win)
40 #define WINDOW_AS_CLIENT(win) ((struct Client*)win)
41 #define WINDOW_AS_INTERNAL(win) ((struct InternalWindow*)win)
42
43 #define MENU_AS_WINDOW(menu) ((ObWindow*)menu)
44 #define DOCK_AS_WINDOW(dock) ((ObWindow*)dock)
45 #define DOCKAPP_AS_WINDOW(dockapp) ((ObWindow*)dockapp)
46 #define CLIENT_AS_WINDOW(client) ((ObWindow*)client)
47 #define INTERNAL_AS_WINDOW(intern) ((ObWindow*)intern)
48
49 extern GHashTable *window_map;
50
51 void window_startup();
52 void window_shutdown();
53
54 Window window_top(ObWindow *self);
55 Window window_layer(ObWindow *self);
56
57 #endif
This page took 0.033594 seconds and 4 git commands to generate.