wmaker: replaced macro 'store_modifier' by an inline function, in X Modifier initiali...
[wmaker-crm.git] / wmlib / WMaker.h
blob724b32655e48ef13ed243a215c710379cfbbc651
1 /*
2 * WindowMaker interface definitions
4 * Copyright (C) 1997-2003 Alfredo K. Kojima
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., 51 Franklin St, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
22 #ifndef _WMLIB_H_
23 #define _WMLIB_H_
25 /* the definitions in this file can change at any time. WINGs has more
26 * stable definitions */
28 #include <X11/Xlib.h>
29 #include <X11/Xmd.h>
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
35 typedef struct {
36 CARD32 flags;
37 CARD32 window_style;
38 CARD32 window_level;
39 CARD32 reserved;
40 Pixmap miniaturize_pixmap; /* pixmap for miniaturize button */
41 Pixmap close_pixmap; /* pixmap for close button */
42 Pixmap miniaturize_mask; /* miniaturize pixmap mask */
43 Pixmap close_mask; /* close pixmap mask */
44 CARD32 extra_flags;
45 } GNUstepWMAttributes;
47 #define GSWindowStyleAttr (1<<0)
48 #define GSWindowLevelAttr (1<<1)
49 #define GSMiniaturizePixmapAttr (1<<3)
50 #define GSClosePixmapAttr (1<<4)
51 #define GSMiniaturizeMaskAttr (1<<5)
52 #define GSCloseMaskAttr (1<<6)
53 #define GSExtraFlagsAttr (1<<7)
57 #define GSClientResizeFlag (1<<0)
58 #define GSFullKeyboardEventsFlag (1<<1)
59 #define GSMenuWindowFlag (1<<2)
60 #define GSIconWindowFlag (1<<3)
61 #define GSSkipWindowListFlag (1<<4)
62 #define GSNoApplicationIconFlag (1<<5)
63 #define GSDarkGrayTitlebarFlag (1<<8)
66 #define WMFHideOtherApplications 10
67 #define WMFHideApplication 12
70 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
71 #define _DEFINED_GNUSTEP_WINDOW_INFO
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