]> icculus.org git repositories - mikachu/openbox.git/blob - openbox/window.h
add internal popups n shit to the stacking list.
[mikachu/openbox.git] / openbox / window.h
1 #ifndef __window_h
2 #define __window_h
3
4 #include <X11/Xlib.h>
5
6 typedef enum {
7     Window_Menu,
8     Window_Slit,
9     Window_Client,
10     Window_Internal
11 } Window_InternalType;
12
13 typedef struct ObWindow {
14     Window_InternalType type;
15 } ObWindow;
16
17 /* Wrapper for internal stuff. If its struct matches this then it can be used
18    as an ObWindow */
19 typedef struct InternalWindow {
20     ObWindow obwin;
21     Window win;
22 } InternalWindow;
23
24 #define WINDOW_IS_MENU(win) (((ObWindow*)win)->type == Window_Menu)
25 #define WINDOW_IS_SLIT(win) (((ObWindow*)win)->type == Window_Slit)
26 #define WINDOW_IS_CLIENT(win) (((ObWindow*)win)->type == Window_Client)
27 #define WINDOW_IS_INTERNAL(win) (((ObWindow*)win)->type == Window_Internal)
28
29 struct Menu;
30 struct Slit;
31 struct Client;
32
33 #define WINDOW_AS_MENU(win) ((struct Menu*)win)
34 #define WINDOW_AS_SLIT(win) ((struct Slit*)win)
35 #define WINDOW_AS_CLIENT(win) ((struct Client*)win)
36 #define WINDOW_AS_INTERNAL(win) ((struct InternalWindow*)win)
37
38 #define MENU_AS_WINDOW(menu) ((ObWindow*)menu)
39 #define SLIT_AS_WINDOW(slit) ((ObWindow*)slit)
40 #define CLIENT_AS_WINDOW(client) ((ObWindow*)client)
41 #define INTERNAL_AS_WINDOW(intern) ((ObWindow*)intern)
42
43 Window window_top(ObWindow *self);
44 Window window_layer(ObWindow *self);
45
46 #endif