]> Dogcows Code - chaz/openbox/blob - openbox/window.c
>:| I put old code back somehow.. thanks mika. hooray peer review :)
[chaz/openbox] / openbox / window.c
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3 window.c for the Openbox window manager
4 Copyright (c) 2003 Ben Jansens
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #include "window.h"
20 #include "menuframe.h"
21 #include "config.h"
22 #include "dock.h"
23 #include "client.h"
24 #include "frame.h"
25
26 GHashTable *window_map;
27
28 void window_startup(gboolean reconfig)
29 {
30 if (reconfig) return;
31
32 window_map = g_hash_table_new(g_int_hash, g_int_equal);
33 }
34
35 void window_shutdown(gboolean reconfig)
36 {
37 if (reconfig) return;
38
39 g_hash_table_destroy(window_map);
40 }
41
42 Window window_top(ObWindow *self)
43 {
44 switch (self->type) {
45 case Window_Menu:
46 return ((ObMenuFrame*)self)->window;
47 case Window_Dock:
48 return ((ObDock*)self)->frame;
49 case Window_DockApp:
50 /* not to be used for stacking */
51 g_assert_not_reached();
52 break;
53 case Window_Client:
54 return ((ObClient*)self)->frame->window;
55 case Window_Internal:
56 return ((InternalWindow*)self)->win;
57 }
58 g_assert_not_reached();
59 return None;
60 }
61
62 Window window_layer(ObWindow *self)
63 {
64 switch (self->type) {
65 case Window_Menu:
66 return OB_STACKING_LAYER_INTERNAL;
67 case Window_Dock:
68 return config_dock_layer;
69 case Window_DockApp:
70 /* not to be used for stacking */
71 g_assert_not_reached();
72 break;
73 case Window_Client:
74 return ((ObClient*)self)->layer;
75 case Window_Internal:
76 return OB_STACKING_LAYER_INTERNAL;
77 }
78 g_assert_not_reached();
79 return None;
80 }
This page took 0.039954 seconds and 4 git commands to generate.