1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 window.h 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.
27 typedef struct _ObWindow ObWindow
;
28 typedef struct _ObInternalWindow ObInternalWindow
;
33 Window_DockApp
, /* used for events but not stacking */
35 Window_Internal
,/* used for stacking but not events (except to filter
36 events on the root window) */
38 } Window_InternalType
;
42 Window_InternalType type
;
45 /* Wrapper for internal stuff. If its struct matches this then it can be used
47 typedef struct InternalWindow
{
48 Window_InternalType type
;
52 #define WINDOW_IS_MENU(win) (((ObWindow*)win)->type == Window_Menu)
53 #define WINDOW_IS_DOCK(win) (((ObWindow*)win)->type == Window_Dock)
54 #define WINDOW_IS_DOCKAPP(win) (((ObWindow*)win)->type == Window_DockApp)
55 #define WINDOW_IS_CLIENT(win) (((ObWindow*)win)->type == Window_Client)
56 #define WINDOW_IS_INTERNAL(win) (((ObWindow*)win)->type == Window_Internal)
57 #define WINDOW_IS_PROMPT(win) (((ObWindow*)win)->type == Window_Prompt)
65 #define WINDOW_AS_MENU(win) ((struct _ObMenuFrame*)win)
66 #define WINDOW_AS_DOCK(win) ((struct _ObDock*)win)
67 #define WINDOW_AS_DOCKAPP(win) ((struct _ObDockApp*)win)
68 #define WINDOW_AS_CLIENT(win) ((struct _ObClient*)win)
69 #define WINDOW_AS_INTERNAL(win) ((struct InternalWindow*)win)
70 #define WINDOW_AS_PROMPT(win) ((struct _ObPrompt*)win)
72 #define MENU_AS_WINDOW(menu) ((ObWindow*)menu)
73 #define DOCK_AS_WINDOW(dock) ((ObWindow*)dock)
74 #define DOCKAPP_AS_WINDOW(dockapp) ((ObWindow*)dockapp)
75 #define CLIENT_AS_WINDOW(client) ((ObWindow*)client)
76 #define INTERNAL_AS_WINDOW(intern) ((ObWindow*)intern)
77 #define PROMPT_AS_WINDOW(prompt) ((ObWindow*)prompt)
79 extern GHashTable
*window_map
;
81 void window_startup(gboolean reconfig
);
82 void window_shutdown(gboolean reconfig
);
84 Window
window_top(ObWindow
*self
);
85 ObStackingLayer
window_layer(ObWindow
*self
);