Clients Menus and Slits are all 'ObWindow's now.
[mikachu/openbox.git] / openbox / window.c
1 #include "window.h"
2 #include "menu.h"
3 #include "slit.h"
4 #include "client.h"
5 #include "frame.h"
6
7 Window window_top(ObWindow *self)
8 {
9     switch (self->type) {
10     case Window_Menu:
11         return ((Menu*)self)->frame;
12     case Window_Slit:
13         return ((Slit*)self)->frame;
14     case Window_Client:
15         return ((Client*)self)->frame->window;
16     }
17     g_assert_not_reached();
18     return None;
19 }
20
21 Window window_layer(ObWindow *self)
22 {
23     switch (self->type) {
24     case Window_Menu:
25         return Layer_Internal;
26     case Window_Slit:
27         return ((Slit*)self)->layer;
28     case Window_Client:
29         return ((Client*)self)->layer;
30     }
31     g_assert_not_reached();
32     return None;
33 }