Fixed scrolling direction with mouse wheel for horizontal scrollers
[wmaker-crm.git] / wmlib / WMaker.h
blob891d8de69ab3c7d02c7727cb8e1ceff9e4cefea8
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 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
72 #define _DEFINED_GNUSTEP_WINDOW_INFO
74 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
75 * NSDesktopWindowLevel intended to be the level at which things
76 * on the desktop sit ... so you should be able
77 * to put a desktop background just below it.
79 * Applications are actually permitted to use any value in the
80 * range INT_MIN+1 to INT_MAX
82 enum {
83 WMDesktopWindowLevel = -1000, /* GNUstep addition */
84 WMNormalWindowLevel = 0,
85 WMFloatingWindowLevel = 3,
86 WMSubmenuWindowLevel = 3,
87 WMTornOffMenuWindowLevel = 3,
88 WMMainMenuWindowLevel = 20,
89 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
90 WMStatusWindowLevel = 21,
91 WMModalPanelWindowLevel = 100,
92 WMPopUpMenuWindowLevel = 101,
93 WMScreenSaverWindowLevel = 1000
97 /* window attributes */
98 enum {
99 WMBorderlessWindowMask = 0,
100 WMTitledWindowMask = 1,
101 WMClosableWindowMask = 2,
102 WMMiniaturizableWindowMask = 4,
103 WMResizableWindowMask = 8,
104 WMIconWindowMask = 64,
105 WMMiniWindowMask = 128
107 #endif
109 typedef struct _wmAppContext WMAppContext;
111 typedef struct _wmMenu WMMenu;
113 typedef void (*WMMenuAction)(void *clientdata, int code, Time timestamp);
115 typedef void (*WMFreeFunction)(void *clientdata);
117 int WMProcessEvent(WMAppContext *app, XEvent *event);
120 WMAppContext *WMAppCreateWithMain(Display *display, int screen_number,
121 Window main_window);
123 WMAppContext *WMAppCreate(Display *display, int screen_number);
125 int WMAppAddWindow(WMAppContext *app, Window window);
127 int WMAppSetMainMenu(WMAppContext *app, WMMenu *menu);
130 int WMRealizeMenus(WMAppContext *app);
133 void WMSetWindowAttributes(Display *dpy, Window window,
134 GNUstepWMAttributes *attributes);
137 void WMHideApplication(WMAppContext *app);
138 void WMHideOthers(WMAppContext *app);
141 * WARNING: the menu related functions might be removed in the future.
143 WMMenu *WMMenuCreate(WMAppContext *app, char *title);
145 int WMMenuAddItem(WMMenu *menu, char *text, WMMenuAction action,
146 void *clientData, WMFreeFunction freedata, char *rtext);
148 int WMMenuInsertItem(WMMenu *menu, int index, char *text,
149 WMMenuAction *action, char *rtext);
151 int WMMenuRemoveItem(WMMenu *menu, int index);
153 int WMMenuAddSubmenu(WMMenu *menu, char *title, WMMenu *submenu);
155 void WMMenuSetEnabled(WMMenu *menu, int index, int enabled);
157 void WMMenuDestroy(WMMenu *menu, int submenus);
159 #ifdef __cplusplus
161 #endif /* __cplusplus */
163 #endif