Make window stacking level changes to match GNUstep.
[wmaker-crm.git] / wmlib / WMaker.h
blob8a45e0069c6bc0d2a7f57649e7e062fc400f0c89
1 /*
2 * WindowMaker interface definitions
3 *
4 * Copyright (C) 1997 Alfredo K. Kojima
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef _WMLIB_H_
22 #define _WMLIB_H_
24 /* the definitions in this file can change at any time. WINGs has more
25 * stable definitions */
27 #undef BOOL
29 #include <X11/Xlib.h>
30 #include <X11/Xmd.h>
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
36 typedef struct {
37 CARD32 flags;
38 CARD32 window_style;
39 CARD32 window_level;
40 CARD32 reserved;
41 Pixmap miniaturize_pixmap; /* pixmap for miniaturize button */
42 Pixmap close_pixmap; /* pixmap for close button */
43 Pixmap miniaturize_mask; /* miniaturize pixmap mask */
44 Pixmap close_mask; /* close pixmap mask */
45 CARD32 extra_flags;
46 } GNUstepWMAttributes;
48 #define GSWindowStyleAttr (1<<0)
49 #define GSWindowLevelAttr (1<<1)
50 #define GSMiniaturizePixmapAttr (1<<3)
51 #define GSClosePixmapAttr (1<<4)
52 #define GSMiniaturizeMaskAttr (1<<5)
53 #define GSCloseMaskAttr (1<<6)
54 #define GSExtraFlagsAttr (1<<7)
58 #define GSClientResizeFlag (1<<0)
59 #define GSFullKeyboardEventsFlag (1<<1)
60 #define GSMenuWindowFlag (1<<2)
61 #define GSIconWindowFlag (1<<3)
62 #define GSSkipWindowListFlag (1<<4)
63 #define GSNoApplicationIconFlag (1<<5)
64 #define GSDarkGrayTitlebarFlag (1<<8)
67 #define WMFHideOtherApplications 10
68 #define WMFHideApplication 12
71 #if !defined(_NSWindow_h_) && !defined(_GNUstep_H_GUITypes)
73 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
74 * NSDesktopWindowLevel intended to be the level at which things
75 * on the desktop sit ... so you should be able
76 * to put a desktop background just below it.
78 * Applications are actually permitted to use any value in the
79 * range INT_MIN+1 to INT_MAX
81 enum {
82 WMDesktopWindowLevel = -1000, /* GNUstep addition */
83 WMNormalWindowLevel = 0,
84 WMFloatingWindowLevel = 3,
85 WMSubmenuWindowLevel = 3,
86 WMTornOffMenuWindowLevel = 3,
87 WMMainMenuWindowLevel = 20,
88 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
89 WMStatusWindowLevel = 21,
90 WMModalPanelWindowLevel = 100,
91 WMPopUpMenuWindowLevel = 101,
92 WMScreenSaverWindowLevel = 1000
96 /* window attributes */
97 enum {
98 WMBorderlessWindowMask = 0,
99 WMTitledWindowMask = 1,
100 WMClosableWindowMask = 2,
101 WMMiniaturizableWindowMask = 4,
102 WMResizableWindowMask = 8,
103 WMIconWindowMask = 64,
104 WMMiniWindowMask = 128
106 #endif
108 typedef struct _wmAppContext WMAppContext;
110 typedef struct _wmMenu WMMenu;
112 typedef void (*WMMenuAction)(void *clientdata, int code, Time timestamp);
114 typedef void (*WMFreeFunction)(void *clientdata);
116 int WMProcessEvent(WMAppContext *app, XEvent *event);
119 WMAppContext *WMAppCreateWithMain(Display *display, int screen_number,
120 Window main_window);
122 WMAppContext *WMAppCreate(Display *display, int screen_number);
124 int WMAppAddWindow(WMAppContext *app, Window window);
126 int WMAppSetMainMenu(WMAppContext *app, WMMenu *menu);
129 int WMRealizeMenus(WMAppContext *app);
132 void WMSetWindowAttributes(Display *dpy, Window window,
133 GNUstepWMAttributes *attributes);
136 void WMHideApplication(WMAppContext *app);
137 void WMHideOthers(WMAppContext *app);
140 * WARNING: the menu related functions might be removed in the future.
142 WMMenu *WMMenuCreate(WMAppContext *app, char *title);
144 int WMMenuAddItem(WMMenu *menu, char *text, WMMenuAction action,
145 void *clientData, WMFreeFunction freedata, char *rtext);
147 int WMMenuInsertItem(WMMenu *menu, int index, char *text,
148 WMMenuAction *action, char *rtext);
150 int WMMenuRemoveItem(WMMenu *menu, int index);
152 int WMMenuAddSubmenu(WMMenu *menu, char *title, WMMenu *submenu);
154 void WMMenuSetEnabled(WMMenu *menu, int index, int enabled);
156 void WMMenuDestroy(WMMenu *menu, int submenus);
158 #ifdef __cplusplus
160 #endif /* __cplusplus */
162 #endif