-
Notifications
You must be signed in to change notification settings - Fork 0
/
fvwm.h
203 lines (170 loc) · 7.01 KB
/
fvwm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/****************************************************************************
* This module is based on Twm, but has been siginificantly modified
* by Rob Nation ([email protected])
****************************************************************************/
/*****************************************************************************/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Portions Copyright 1989 by the Massachusetts Institute of Technology **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** names of Evans & Sutherland and M.I.T. not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND AND M.I.T. DISCLAIM ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND OR **/
/** M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/***********************************************************************
* fvwm include file
***********************************************************************/
#ifndef _FVWM_
#define _FVWM_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/Xfuncs.h>
#ifndef WithdrawnState
#define WithdrawnState 0
#endif
typedef unsigned long Pixel;
#define PIXEL_ALREADY_TYPEDEFED /* for Xmu/Drawing.h */
#ifdef SIGNALRETURNSINT
#define SIGNAL_T int
#define SIGNAL_RETURN return 0
#else
#define SIGNAL_T void
#define SIGNAL_RETURN return
#endif
#define BW 1 /* border width */
#define NOFRAME_BW 2 /* border width */
#define BOUNDARY_WIDTH 7 /* border width */
#define CORNER_WIDTH 16 /* border width */
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define ICON_X_TEXT 3
#define ICON_Y_TEXT Scr.StdFont.height
#define ICON_HEIGHT (Scr.StdFont.height+4)
#define NULLSTR ((char *) NULL)
/* contexts for button presses */
#define C_NO_CONTEXT 0
#define C_WINDOW 1
#define C_TITLE 2
#define C_ICON 4
#define C_ROOT 8
#define C_FRAME 16
#define C_SIDEBAR 32
#define C_SYS 64
#define C_ICONIFY 128
#define NUM_CONTEXTS 8
typedef struct MyFont
{
char *name; /* name of the font */
XFontStruct *font; /* font structure */
int height; /* height of the font */
int y; /* Y coordinate to draw characters */
} MyFont;
typedef struct ColorPair
{
Pixel fore;
Pixel back;
} ColorPair;
/* for each window that is on the display, one of these structures
* is allocated and linked into a list
*/
typedef struct FvwmWindow
{
struct FvwmWindow *next; /* next fvwm window */
struct FvwmWindow *prev; /* prev fvwm window */
Window w; /* the child window */
int old_bw; /* border width before reparenting */
Window lead_w; /* either the frame for decorated windows,
* or the window itself, for undecorated */
Window frame; /* the frame window */
Window title_w; /* the title bar window */
Window left_side_w;
Window right_side_w;
Window bottom_w;
Window top_w;
Window sys_w;
Window iconify_w;
Window icon_w; /* the icon window */
int frame_x; /* x position of frame */
int frame_y; /* y position of frame */
int frame_width; /* width of frame */
int frame_height; /* height of frame */
int frame_bw; /* borderwidth of frame */
int boundary_width;
int corner_width;
int title_x;
int title_y;
int title_height; /* height of the title bar */
int title_width; /* width of the title bar */
int icon_x_loc; /* icon window x coordinate */
int icon_y_loc; /* icon window y coordiante */
int icon_w_width; /* width of the icon window */
int icon_t_width; /* width of the icon window */
int icon_w_height; /* width of the icon window */
int icon_p_width; /* width of the icon window */
int icon_p_height; /* width of the icon window */
Pixmap iconPixmap; /* pixmap for the icon */
char *name; /* name of the window */
char *icon_name; /* name of the icon */
XWindowAttributes attr; /* the child window attributes */
XSizeHints hints; /* normal hints */
XWMHints *wmhints; /* WM hints */
XClassHint class;
Window transientfor;
unsigned long protocols;
unsigned char flags;
char *icon_bitmap_file;
} FvwmWindow;
/***************************************************************************
* window flags definitions
***************************************************************************/
#define STICKY 1 /* Does window stick to glass? */
#define ONTOP 2 /* does window stay on top */
#define BORDER 4 /* Is this decorated */
#define MAPPED 8 /* is it mapped? */
#define ICON 16 /* is it an icon now? */
#define TRANSIENT 32 /* is it a transient window? */
#define RAISED 64 /* if its a sticky window, does it need to be raised */
#define VISIBLE 128 /* is the window fully visible */
#define DoesWmTakeFocus (1L << 0)
#define DoesWmSaveYourself (1L << 1)
#define DoesWmDeleteWindow (1L << 2)
#include <X11/Xosdefs.h>
#include <stdlib.h>
extern void Reborder();
extern SIGNAL_T Done();
extern Display *dpy;
extern Window ResizeWindow; /* the window we are resizing */
extern XClassHint NoClass;
extern XContext FvwmContext;
extern Window JunkRoot, JunkChild;
extern int JunkX, JunkY;
extern unsigned int JunkWidth, JunkHeight, JunkBW, JunkDepth, JunkMask;
extern Atom _XA_MIT_PRIORITY_COLORS;
extern Atom _XA_WM_CHANGE_STATE;
extern Atom _XA_WM_STATE;
extern Atom _XA_WM_COLORMAP_WINDOWS;
extern Atom _XA_WM_PROTOCOLS;
extern Atom _XA_WM_TAKE_FOCUS;
extern Atom _XA_WM_SAVE_YOURSELF;
extern Atom _XA_WM_DELETE_WINDOW;
#endif /* _FVWM_ */