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
|
#ifndef _CLIENT_H_
#define _CLIENT_H_
#include "General.h"
#include "Manager.h"
#include "Border.h"
class Client {
public:
Client(WindowManager *const, Window);
void release();
/* for call from WindowManager: */
void activate(); /* active() */
void deactivate(); /* setactive(0) */
void gravitate(Boolean invert);
void installColormap();
void unreparent();
void withdraw(Boolean = True);
void hide();
void unhide(Boolean map);
void rename();
void kill();
void mapRaised(); // without activating
void lower();
void move(XButtonEvent *); // event for grab timestamp & coords
void resize(XButtonEvent *, Boolean, Boolean);
void moveOrResize(XButtonEvent *);
void ensureVisible(); // make sure x, y are on-screen
void manage(Boolean mapped);
Boolean hasWindow(Window w) {
return ((m_window == w) || m_border->hasWindow(w));
}
Client *revertTo() { return m_revert; }
void setRevertTo(Client *c) { m_revert = c; }
Boolean isHidden() { return (m_state == IconicState); }
Boolean isWithdrawn() { return (m_state == WithdrawnState); }
Boolean isNormal() { return (m_state == NormalState); }
Boolean isTransient() { return (m_transient != None); }
Window transientFor() { return m_transient; }
Boolean isFixedSize() { return m_fixedSize; }
const char *label() { return m_label; }
const char *name() { return m_name; }
const char *iconName() { return m_iconName; }
void sendMessage(Atom, long);
void sendConfigureNotify();
void activateAndWarp();
void focusIfAppropriate(Boolean);
void selectOnMotion(Window, Boolean);
/* for call from within: */
void fatal(char *m) { m_windowManager->fatal(m); }
Display *display() { return m_windowManager->display(); }
Window parent() { return m_border->parent(); }
Window root() { return m_windowManager->root(); }
Client *activeClient() { return m_windowManager->activeClient(); }
Boolean isActive() { return (activeClient() == this); }
WindowManager *windowManager() { return m_windowManager; }
// for call from equivalent wm functions in Events.C:
void eventButton(XButtonEvent *);
void eventMapRequest(XMapRequestEvent *);
void eventConfigureRequest(XConfigureRequestEvent *);
void eventUnmap(XUnmapEvent *);
void eventColormap(XColormapEvent *);
void eventProperty(XPropertyEvent *);
void eventEnter(XCrossingEvent *);
void eventFocusIn(XFocusInEvent *);
void eventExposure(XExposeEvent *);
protected: // cravenly submitting to gcc's warnings
~Client();
private:
Window m_window;
Window m_transient;
Border *m_border;
Client *m_revert;
int m_x;
int m_y;
int m_w;
int m_h;
int m_bw;
XSizeHints m_sizeHints;
Boolean m_fixedSize;
int m_minWidth;
int m_minHeight;
void fixResizeDimensions(int &, int &, int &, int &);
Boolean coordsInHole(int, int);
int m_state;
int m_protocol;
Boolean m_managed;
Boolean m_reparenting;
Boolean m_stubborn; // keeps popping itself to the front
Time m_lastPopTime;
char *m_name;
char *m_iconName;
const char *m_label; // alias: one of (instance,class,name,iconName)
static const char *const m_defaultLabel;
Colormap m_colormap;
int m_colormapWinCount;
Window *m_colormapWindows;
Colormap *m_windowColormaps;
WindowManager *const m_windowManager;
char *getProperty(Atom);
int getAtomProperty(Atom, Atom);
int getIntegerProperty(Atom);
// accessors
Boolean getState(int *);
void setState(int);
// internal instantiation requests
Boolean setLabel(void); // returns True if changed
void getColormaps(void);
void getProtocols(void);
void getTransient(void);
void decorate(Boolean active);
};
#define Pdelete 1
#define PtakeFocus 2
#endif
|