~profzoom/ubuntu/quantal/wmaker/bug-1079925

« back to all changes in this revision

Viewing changes to wmlib/WMaker.h

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2004-11-10 14:05:30 UTC
  • Revision ID: james.westby@ubuntu.com-20041110140530-qpd66b5lm38x7apk
Tags: upstream-0.91.0
ImportĀ upstreamĀ versionĀ 0.91.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * WindowMaker interface definitions
 
3
 *
 
4
 * Copyright (C) 1997-2003 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.
 
10
 *
 
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.
 
15
 *
 
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.
 
19
 */
 
20
 
 
21
#ifndef _WMLIB_H_
 
22
#define _WMLIB_H_
 
23
 
 
24
/* the definitions in this file can change at any time. WINGs has more
 
25
 * stable definitions */
 
26
 
 
27
#include <X11/Xlib.h>
 
28
#include <X11/Xmd.h>
 
29
 
 
30
#ifdef __cplusplus
 
31
extern "C" {
 
32
#endif /* __cplusplus */
 
33
 
 
34
typedef struct {
 
35
    CARD32 flags;
 
36
    CARD32 window_style;
 
37
    CARD32 window_level;
 
38
    CARD32 reserved;
 
39
    Pixmap miniaturize_pixmap;         /* pixmap for miniaturize button */
 
40
    Pixmap close_pixmap;               /* pixmap for close button */
 
41
    Pixmap miniaturize_mask;           /* miniaturize pixmap mask */
 
42
    Pixmap close_mask;                 /* close pixmap mask */
 
43
    CARD32 extra_flags;
 
44
} GNUstepWMAttributes;
 
45
 
 
46
#define GSWindowStyleAttr       (1<<0)
 
47
#define GSWindowLevelAttr       (1<<1)
 
48
#define GSMiniaturizePixmapAttr (1<<3)
 
49
#define GSClosePixmapAttr       (1<<4)
 
50
#define GSMiniaturizeMaskAttr   (1<<5)
 
51
#define GSCloseMaskAttr         (1<<6)
 
52
#define GSExtraFlagsAttr        (1<<7)
 
53
 
 
54
 
 
55
 
 
56
#define GSClientResizeFlag      (1<<0)
 
57
#define GSFullKeyboardEventsFlag (1<<1)
 
58
#define GSMenuWindowFlag        (1<<2)
 
59
#define GSIconWindowFlag        (1<<3)
 
60
#define GSSkipWindowListFlag    (1<<4)
 
61
#define GSNoApplicationIconFlag (1<<5)
 
62
#define GSDarkGrayTitlebarFlag  (1<<8)
 
63
 
 
64
 
 
65
#define WMFHideOtherApplications        10
 
66
#define WMFHideApplication              12
 
67
 
 
68
 
 
69
#ifndef _DEFINED_GNUSTEP_WINDOW_INFO
 
70
#define _DEFINED_GNUSTEP_WINDOW_INFO
 
71
/*
 
72
 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
 
73
 * NSDesktopWindowLevel intended to be the level at which things
 
74
 * on the desktop sit ... so you should be able
 
75
 * to put a desktop background just below it.
 
76
 *
 
77
 * Applications are actually permitted to use any value in the
 
78
 * range INT_MIN+1 to INT_MAX
 
79
 */
 
80
enum {
 
81
    WMDesktopWindowLevel = -1000, /* GNUstep addition     */
 
82
    WMNormalWindowLevel = 0,
 
83
    WMFloatingWindowLevel = 3,
 
84
    WMSubmenuWindowLevel = 3,
 
85
    WMTornOffMenuWindowLevel = 3,
 
86
    WMMainMenuWindowLevel = 20,
 
87
    WMDockWindowLevel = 21,       /* Deprecated - use NSStatusWindowLevel */
 
88
    WMStatusWindowLevel = 21,
 
89
    WMModalPanelWindowLevel = 100,
 
90
    WMPopUpMenuWindowLevel = 101,
 
91
    WMScreenSaverWindowLevel = 1000
 
92
};
 
93
 
 
94
 
 
95
/* window attributes */
 
96
enum {
 
97
    WMBorderlessWindowMask = 0,
 
98
    WMTitledWindowMask = 1,
 
99
    WMClosableWindowMask = 2,
 
100
    WMMiniaturizableWindowMask = 4,
 
101
    WMResizableWindowMask = 8,
 
102
    WMIconWindowMask = 64,
 
103
    WMMiniWindowMask = 128
 
104
};
 
105
#endif
 
106
 
 
107
typedef struct _wmAppContext WMAppContext;
 
108
 
 
109
typedef struct _wmMenu WMMenu;
 
110
 
 
111
typedef void (*WMMenuAction)(void *clientdata, int code, Time timestamp);
 
112
 
 
113
typedef void (*WMFreeFunction)(void *clientdata);
 
114
 
 
115
int WMProcessEvent(WMAppContext *app, XEvent *event);
 
116
 
 
117
 
 
118
WMAppContext *WMAppCreateWithMain(Display *display, int screen_number,
 
119
                                  Window main_window);
 
120
 
 
121
WMAppContext *WMAppCreate(Display *display, int screen_number);
 
122
 
 
123
int WMAppAddWindow(WMAppContext *app, Window window);
 
124
 
 
125
int WMAppSetMainMenu(WMAppContext *app, WMMenu *menu);
 
126
 
 
127
 
 
128
int WMRealizeMenus(WMAppContext *app);
 
129
 
 
130
 
 
131
void WMSetWindowAttributes(Display *dpy, Window window,
 
132
                           GNUstepWMAttributes *attributes);
 
133
 
 
134
 
 
135
void WMHideApplication(WMAppContext *app);
 
136
void WMHideOthers(WMAppContext *app);
 
137
 
 
138
/*
 
139
 * WARNING: the menu related functions might be removed in the future.
 
140
 */
 
141
WMMenu *WMMenuCreate(WMAppContext *app, char *title);
 
142
 
 
143
int WMMenuAddItem(WMMenu *menu, char *text, WMMenuAction action,
 
144
                  void *clientData, WMFreeFunction freedata, char *rtext);
 
145
 
 
146
int WMMenuInsertItem(WMMenu *menu, int index, char *text,
 
147
                     WMMenuAction *action, char *rtext);
 
148
 
 
149
int WMMenuRemoveItem(WMMenu *menu, int index);
 
150
 
 
151
int WMMenuAddSubmenu(WMMenu *menu, char *title, WMMenu *submenu);
 
152
 
 
153
void WMMenuSetEnabled(WMMenu *menu, int index, int enabled);
 
154
 
 
155
void WMMenuDestroy(WMMenu *menu, int submenus);
 
156
 
 
157
#ifdef __cplusplus
 
158
}
 
159
#endif /* __cplusplus */
 
160
 
 
161
#endif