openbox/openbox/window.h
Dana Jansens b77e40e1c7 rename "Slit" to "Dock".
add config options to the rc3 for the dock.
create a window_map, add DockApps to the ObWindow types, use the window_map for translating windows into objects for event handling (only one lookup now) and remove the old maps (client_map, menu_map).
2003-05-16 18:10:10 +00:00

57 lines
1.6 KiB
C

#ifndef __window_h
#define __window_h
#include <X11/Xlib.h>
#include <glib.h>
typedef enum {
Window_Menu,
Window_Dock,
Window_DockApp, /* used for events but not stacking */
Window_Client,
Window_Internal /* used for stacking but not events */
} Window_InternalType;
typedef struct ObWindow {
Window_InternalType type;
} ObWindow;
/* Wrapper for internal stuff. If its struct matches this then it can be used
as an ObWindow */
typedef struct InternalWindow {
ObWindow obwin;
Window win;
} InternalWindow;
#define WINDOW_IS_MENU(win) (((ObWindow*)win)->type == Window_Menu)
#define WINDOW_IS_DOCK(win) (((ObWindow*)win)->type == Window_Dock)
#define WINDOW_IS_DOCKAPP(win) (((ObWindow*)win)->type == Window_DockApp)
#define WINDOW_IS_CLIENT(win) (((ObWindow*)win)->type == Window_Client)
#define WINDOW_IS_INTERNAL(win) (((ObWindow*)win)->type == Window_Internal)
struct Menu;
struct Dock;
struct DockApp;
struct Client;
#define WINDOW_AS_MENU(win) ((struct Menu*)win)
#define WINDOW_AS_DOCK(win) ((struct Dock*)win)
#define WINDOW_AS_DOCKAPP(win) ((struct DockApp*)win)
#define WINDOW_AS_CLIENT(win) ((struct Client*)win)
#define WINDOW_AS_INTERNAL(win) ((struct InternalWindow*)win)
#define MENU_AS_WINDOW(menu) ((ObWindow*)menu)
#define DOCK_AS_WINDOW(dock) ((ObWindow*)dock)
#define DOCKAPP_AS_WINDOW(dockapp) ((ObWindow*)dockapp)
#define CLIENT_AS_WINDOW(client) ((ObWindow*)client)
#define INTERNAL_AS_WINDOW(intern) ((ObWindow*)intern)
extern GHashTable *window_map;
void window_startup();
void window_shutdown();
Window window_top(ObWindow *self);
Window window_layer(ObWindow *self);
#endif