1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 window.c for the Openbox window manager
4 Copyright (c) 2003-2007 Dana Jansens
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.
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.
16 See the COPYING file for a copy of the GNU General Public License.
20 #include "menuframe.h"
26 GHashTable
*window_map
;
28 static guint
window_hash(Window
*w
) { return *w
; }
29 static gboolean
window_comp(Window
*w1
, Window
*w2
) { return *w1
== *w2
; }
31 void window_startup(gboolean reconfig
)
35 window_map
= g_hash_table_new((GHashFunc
)window_hash
,
36 (GEqualFunc
)window_comp
);
39 void window_shutdown(gboolean reconfig
)
43 g_hash_table_destroy(window_map
);
46 Window
window_top(ObWindow
*self
)
50 return ((ObMenuFrame
*)self
)->window
;
52 return ((ObDock
*)self
)->frame
;
54 /* not to be used for stacking */
55 g_assert_not_reached();
58 return ((ObClient
*)self
)->frame
->window
;
60 return ((InternalWindow
*)self
)->win
;
62 g_assert_not_reached();
66 Window
window_layer(ObWindow
*self
)
70 return OB_STACKING_LAYER_INTERNAL
;
72 return config_dock_layer
;
74 /* not to be used for stacking */
75 g_assert_not_reached();
78 return ((ObClient
*)self
)->layer
;
80 return OB_STACKING_LAYER_INTERNAL
;
82 g_assert_not_reached();