Initial revision
[wmaker-crm.git] / wmlib / WMaker.h
blob982e8869d10fcb5e3f2ccce7f4ec4f8306a6256e
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 #include <X11/Xlib.h>
28 #include <X11/Xmd.h>
30 typedef struct {
31 CARD32 flags;
32 CARD32 window_style;
33 CARD32 window_level;
34 CARD32 reserved;
35 Pixmap miniaturize_pixmap; /* pixmap for miniaturize button */
36 Pixmap close_pixmap; /* pixmap for close button */
37 Pixmap miniaturize_mask; /* miniaturize pixmap mask */
38 Pixmap close_mask; /* close pixmap mask */
39 CARD32 extra_flags;
40 } GNUstepWMAttributes;
42 #define GSWindowStyleAttr (1<<0)
43 #define GSWindowLevelAttr (1<<1)
44 #define GSMiniaturizePixmapAttr (1<<3)
45 #define GSClosePixmapAttr (1<<4)
46 #define GSMiniaturizeMaskAttr (1<<5)
47 #define GSCloseMaskAttr (1<<6)
48 #define GSExtraFlagsAttr (1<<7)
52 #define GSClientResizeFlag (1<<0)
53 #define GSFullKeyboardEventsFlag (1<<1)
54 #define GSMenuWindowFlag (1<<2)
55 #define GSIconWindowFlag (1<<3)
56 #define GSSkipWindowListFlag (1<<4)
57 #define GSNoApplicationIconFlag (1<<5)
58 #define GSDarkGrayTitlebarFlag (1<<8)
61 #define WMFHideOtherApplications 10
62 #define WMFHideApplication 12
65 #if !defined(_NSWindow_h_) && !defined(_GNUstep_H_GUITypes)
66 enum {
67 NSNormalWindowLevel = 0,
68 NSFloatingWindowLevel = 3,
69 NSDockWindowLevel = 5,
70 NSSubmenuWindowLevel = 10,
71 NSMainMenuWindowLevel = 20
74 enum {
75 NSBorderlessWindowMask = 0,
76 NSTitledWindowMask = 1,
77 NSClosableWindowMask = 2,
78 NSMiniaturizableWindowMask = 4,
79 NSResizableWindowMask = 8
81 #endif
83 typedef struct _wmAppContext WMAppContext;
85 typedef struct _wmMenu WMMenu;
87 typedef void (*WMMenuAction)(void *clientdata, int code, Time timestamp);
89 typedef void (*WMFreeFunction)(void *clientdata);
91 int WMProcessEvent(WMAppContext *app, XEvent *event);
94 WMAppContext *WMAppCreateWithMain(Display *display, int screen_number,
95 Window main_window);
97 WMAppContext *WMAppCreate(Display *display, int screen_number);
99 int WMAppAddWindow(WMAppContext *app, Window window);
101 int WMAppSetMainMenu(WMAppContext *app, WMMenu *menu);
104 int WMRealizeMenus(WMAppContext *app);
107 void WMSetWindowAttributes(Display *dpy, Window window,
108 GNUstepWMAttributes *attributes);
111 void WMHideApplication(WMAppContext *app);
112 void WMHideOthers(WMAppContext *app);
115 * WARNING: the menu related functions might be removed in the future.
117 WMMenu *WMMenuCreate(WMAppContext *app, char *title);
119 int WMMenuAddItem(WMMenu *menu, char *text, WMMenuAction action,
120 void *clientData, WMFreeFunction freedata, char *rtext);
122 int WMMenuInsertItem(WMMenu *menu, int index, char *text,
123 WMMenuAction *action, char *rtext);
125 int WMMenuRemoveItem(WMMenu *menu, int index);
127 int WMMenuAddSubmenu(WMMenu *menu, char *title, WMMenu *submenu);
129 void WMMenuSetEnabled(WMMenu *menu, int index, int enabled);
131 void WMMenuDestroy(WMMenu *menu, int submenus);
134 #endif