]> Dogcows Code - chaz/openbox/blob - openbox/window.h
make it possible to temporarily raise a window to the top, and restore it. also...
[chaz/openbox] / openbox / window.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3 window.h for the Openbox window manager
4 Copyright (c) 2003-2007 Dana 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 #ifndef __window_h
20 #define __window_h
21
22 #include "stacking.h"
23
24 #include <X11/Xlib.h>
25 #include <glib.h>
26
27 typedef struct _ObWindow ObWindow;
28 typedef struct _ObInternalWindow ObInternalWindow;
29
30 typedef enum {
31 Window_Menu,
32 Window_Dock,
33 Window_DockApp, /* used for events but not stacking */
34 Window_Client,
35 Window_Internal /* used for stacking but not events */
36 } Window_InternalType;
37
38 struct _ObWindow
39 {
40 Window_InternalType type;
41 };
42
43 /* Wrapper for internal stuff. If its struct matches this then it can be used
44 as an ObWindow */
45 typedef struct InternalWindow {
46 ObWindow obwin;
47 Window win;
48 } InternalWindow;
49
50 #define WINDOW_IS_MENU(win) (((ObWindow*)win)->type == Window_Menu)
51 #define WINDOW_IS_DOCK(win) (((ObWindow*)win)->type == Window_Dock)
52 #define WINDOW_IS_DOCKAPP(win) (((ObWindow*)win)->type == Window_DockApp)
53 #define WINDOW_IS_CLIENT(win) (((ObWindow*)win)->type == Window_Client)
54 #define WINDOW_IS_INTERNAL(win) (((ObWindow*)win)->type == Window_Internal)
55
56 struct _ObMenu;
57 struct _ObDock;
58 struct _ObDockApp;
59 struct _ObClient;
60
61 #define WINDOW_AS_MENU(win) ((struct _ObMenuFrame*)win)
62 #define WINDOW_AS_DOCK(win) ((struct _ObDock*)win)
63 #define WINDOW_AS_DOCKAPP(win) ((struct _ObDockApp*)win)
64 #define WINDOW_AS_CLIENT(win) ((struct _ObClient*)win)
65 #define WINDOW_AS_INTERNAL(win) ((struct InternalWindow*)win)
66
67 #define MENU_AS_WINDOW(menu) ((ObWindow*)menu)
68 #define DOCK_AS_WINDOW(dock) ((ObWindow*)dock)
69 #define DOCKAPP_AS_WINDOW(dockapp) ((ObWindow*)dockapp)
70 #define CLIENT_AS_WINDOW(client) ((ObWindow*)client)
71 #define INTERNAL_AS_WINDOW(intern) ((ObWindow*)intern)
72
73 extern GHashTable *window_map;
74
75 void window_startup(gboolean reconfig);
76 void window_shutdown(gboolean reconfig);
77
78 Window window_top(ObWindow *self);
79 ObStackingLayer window_layer(ObWindow *self);
80
81 #endif
This page took 0.038076 seconds and 5 git commands to generate.