This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathclient.h
141 lines (116 loc) · 3.83 KB
/
client.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
// aewm++ - A small C++ window manager developed from aewm 0.9.6 around 2000
// Frank Hale <[email protected]>
//
// aewm++ can be found here: https://github.com/frankhale/aewmpp
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Date: 30 May 2010
#ifndef _CLIENT_H_
#define _CLIENT_H_
#include "aewm.h"
class Client
{
private: /* Member Variables */
Display *dpy;
Window root;
XSizeHints *size;
Colormap cmap;
int screen;
char *name;
Window window, frame, title, trans;
WindowMenu *window_menu;
int border_width;
int x, y, width, height;
int old_x, old_y, old_width, old_height;
bool has_focus,
has_title,
has_border,
is_being_dragged,
is_being_resized,
do_drawoutline_once,
wire_move,
is_shaded,
is_iconified,
is_maximized,
is_visible,
has_been_shaped;
int belongs_to_desktop, ignore_unmap;
Time last_button1_time;
// For window title placement
XCharStruct overall;
int direction,
ascent,
descent,
text_width,
text_justify,
justify_style;
// Used in client move
int pointer_x, pointer_y, old_cx, old_cy;
bool button_pressed;
private: /* Member Functions */
void initialize(Display *d);
void redraw();
void drawOutline();
int getIncsize(int *, int *, int);
void initPosition();
void reparent();
int theight();
void sendConfig();
void gravitate(int);
void setShape();
public: /* Member Functions */
Client(Display *d, Window new_client);
~Client();
void getXClientName();
void makeNewClient(Window);
void removeClient();
char* getClientName() const { return name; }
char* getClientIconName() const { return name; } // for now just return application name
Window getFrameWindow() const { return frame; }
Window getAppWindow() const { return window; }
Window getTitleWindow() const { return title; }
Window getTransientWindow() const { return trans; }
bool isTransient() { if(trans) return true; else return false; }
bool hasWindowDecorations() const { return has_title; }
bool hasFocus() const { return has_focus; }
int belongsToWhichDesktop() const { return belongs_to_desktop;}
bool isIconified() const { return is_iconified; }
bool isVisible() const { return is_visible; }
void setFocus(bool focus); // (decieving name) Only paints the titlebar in the focus color
void hide();
void unhide();
void iconify();
void shade();
void maximize();
void setDesktop(int desk);
void handleButtonEvent(XButtonEvent *);
void handleConfigureRequest(XConfigureRequestEvent *);
void handleMapRequest(XMapRequestEvent *);
void handleUnmapEvent(XUnmapEvent *);
void handleDestroyEvent(XDestroyWindowEvent *);
void handleClientMessage(XClientMessageEvent *);
void handlePropertyChange(XPropertyEvent *);
void handleEnterEvent(XCrossingEvent *);
void handleColormapChange(XColormapEvent *);
void handleExposeEvent(XExposeEvent *);
void handleFocusInEvent(XFocusChangeEvent *);
void handleMotionNotifyEvent(XMotionEvent *);
void handleShapeChange(XShapeEvent *);
};
#endif