Small fix
[wmaker-crm.git] / wmlib / WMaker.h
blob9e4009e0891c7ab579f8ba9cf17dc4f199508db7
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)
72 enum {
73 NSNormalWindowLevel = 0,
74 NSFloatingWindowLevel = 3,
75 NSDockWindowLevel = 5,
76 NSSubmenuWindowLevel = 10,
77 NSMainMenuWindowLevel = 20
80 enum {
81 NSBorderlessWindowMask = 0,
82 NSTitledWindowMask = 1,
83 NSClosableWindowMask = 2,
84 NSMiniaturizableWindowMask = 4,
85 NSResizableWindowMask = 8
87 #endif
89 typedef struct _wmAppContext WMAppContext;
91 typedef struct _wmMenu WMMenu;
93 typedef void (*WMMenuAction)(void *clientdata, int code, Time timestamp);
95 typedef void (*WMFreeFunction)(void *clientdata);
97 int WMProcessEvent(WMAppContext *app, XEvent *event);
100 WMAppContext *WMAppCreateWithMain(Display *display, int screen_number,
101 Window main_window);
103 WMAppContext *WMAppCreate(Display *display, int screen_number);
105 int WMAppAddWindow(WMAppContext *app, Window window);
107 int WMAppSetMainMenu(WMAppContext *app, WMMenu *menu);
110 int WMRealizeMenus(WMAppContext *app);
113 void WMSetWindowAttributes(Display *dpy, Window window,
114 GNUstepWMAttributes *attributes);
117 void WMHideApplication(WMAppContext *app);
118 void WMHideOthers(WMAppContext *app);
121 * WARNING: the menu related functions might be removed in the future.
123 WMMenu *WMMenuCreate(WMAppContext *app, char *title);
125 int WMMenuAddItem(WMMenu *menu, char *text, WMMenuAction action,
126 void *clientData, WMFreeFunction freedata, char *rtext);
128 int WMMenuInsertItem(WMMenu *menu, int index, char *text,
129 WMMenuAction *action, char *rtext);
131 int WMMenuRemoveItem(WMMenu *menu, int index);
133 int WMMenuAddSubmenu(WMMenu *menu, char *title, WMMenu *submenu);
135 void WMMenuSetEnabled(WMMenu *menu, int index, int enabled);
137 void WMMenuDestroy(WMMenu *menu, int submenus);
139 #ifdef __cplusplus
141 #endif /* __cplusplus */
143 #endif