Mercurial > mplayer.hg
annotate gui/wm/ws.h @ 35695:f1d1404c3828
Use Bool type.
It's a boolean property.
author | ib |
---|---|
date | Sat, 19 Jan 2013 12:12:34 +0000 |
parents | af387a83e557 |
children | 2d3b65e5ae1a |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
35666
01ac3cd2f101
Cosmetic: Relocate and revise comments on code origin.
ib
parents:
35665
diff
changeset
|
17 * |
01ac3cd2f101
Cosmetic: Relocate and revise comments on code origin.
ib
parents:
35665
diff
changeset
|
18 * based on: AutoSpace Window System for Linux/Win32, |
01ac3cd2f101
Cosmetic: Relocate and revise comments on code origin.
ib
parents:
35665
diff
changeset
|
19 * written by pontscho/fresh!mindworkz |
26458 | 20 */ |
23077 | 21 |
26029 | 22 #ifndef MPLAYER_GUI_WS_H |
23 #define MPLAYER_GUI_WS_H | |
23077 | 24 |
35529 | 25 #include "gui/dialog/dialog.h" |
35689 | 26 |
35450 | 27 #include "config.h" |
33529 | 28 |
23077 | 29 #include <X11/Xlib.h> |
30 #include <X11/Xutil.h> | |
34465 | 31 #ifdef HAVE_SHM |
23077 | 32 #include <X11/extensions/XShm.h> |
34465 | 33 #endif |
23077 | 34 |
35 #define wsKeyReleased 0 | |
36 #define wsKeyPressed 1 | |
37 | |
38 #define wsPLMouseButton 1 | |
39 #define wsPMMouseButton 2 | |
40 #define wsPRMouseButton 3 | |
41 #define wsP4MouseButton 4 | |
42 #define wsP5MouseButton 5 | |
43 #define wsRLMouseButton (1 + 128) | |
44 #define wsRMMouseButton (2 + 128) | |
45 #define wsRRMouseButton (3 + 128) | |
46 #define wsR4MouseButton (4 + 128) | |
47 #define wsR5MouseButton (5 + 128) | |
48 #define wsEnterWindow 253 | |
49 #define wsLeaveWindow 254 | |
50 #define wsMoveMouse 255 | |
51 | |
52 #define wsShowMouseCursor 1 | |
53 #define wsHideMouseCursor 0 | |
54 #define wsHandleMouseButton 2 | |
55 #define wsHandleMouseMove 4 | |
56 | |
57 #define wsHideFrame 0 | |
58 #define wsShowFrame 1 | |
59 #define wsMaxSize 2 | |
60 #define wsMinSize 4 | |
61 #define wsShowWindow 8 | |
62 #define wsHideWindow 16 | |
63 #define wsOverredirect 32 | |
35652 | 64 #define wsWaitMap 64 |
35657 | 65 #define wsAspect 128 |
23077 | 66 |
67 #define wsRGB32 1 | |
68 #define wsBGR32 2 | |
69 #define wsRGB24 3 | |
70 #define wsBGR24 4 | |
71 #define wsRGB16 5 | |
72 #define wsBGR16 6 | |
73 #define wsRGB15 7 | |
74 #define wsBGR15 8 | |
75 | |
35499
af72f85b6f44
Define symbolic constant wsNone for "no window state".
ib
parents:
35498
diff
changeset
|
76 #define wsNone 0 |
23077 | 77 #define wsWindowVisible 1 |
78 #define wsWindowPartialVisible 2 | |
79 #define wsWindowNotVisible 4 | |
80 #define wsWindowMapped 8 | |
81 #define wsWindowUnmapped 16 | |
82 #define wsWindowFocusIn 32 | |
83 #define wsWindowFocusOut 64 | |
84 #define wsWindowExpose 128 | |
85 #define wsWindowRolled 256 | |
86 #define wsWindowClosed 512 | |
87 | |
35498
c505a4aa9582
Rename wsNone wsNo and use it instead of a numeric constant.
ib
parents:
35497
diff
changeset
|
88 #define wsNo 0 |
23077 | 89 #define wsMapped 1 |
90 #define wsFocused 2 | |
91 #define wsVisible 3 | |
92 #define wsNotVisible 4 | |
93 #define wsPVisible 5 | |
94 #define wsRolled 6 | |
95 | |
33539 | 96 typedef void (*wsTReDraw)(void); |
97 typedef void (*wsTKeyHandler)(int KeyCode, int Type, int Key); | |
98 typedef void (*wsTMouseHandler)(int Button, int X, int Y, int RX, int RY); | |
99 typedef void (*wsTDNDHandler)(int num, char **str); | |
23077 | 100 |
33539 | 101 typedef struct { |
102 Window WindowID; | |
103 Window Parent; | |
104 int X, Y, Width, Height; | |
105 int OldX, OldY, OldWidth, OldHeight; | |
35695 | 106 Bool isFullScreen; |
33539 | 107 int Property; |
108 unsigned char *bImage; | |
109 XImage *xImage; | |
110 Pixmap Mask; | |
35692 | 111 Bool Decorations; |
23077 | 112 |
33539 | 113 int State; |
114 int Visible; | |
115 int Mapped; | |
116 int Focused; | |
117 int Rolled; | |
23077 | 118 |
33539 | 119 wsTReDraw ReDraw; |
120 wsTKeyHandler KeyHandler; | |
121 wsTMouseHandler MouseHandler; | |
122 wsTDNDHandler DandDHandler; | |
23077 | 123 |
33539 | 124 int Alt; |
125 int Shift; | |
126 int Control; | |
127 int NumLock; | |
128 int CapsLock; | |
34684 | 129 /* Misc ------------------------------------------------------------------------------------- */ |
23077 | 130 |
33539 | 131 Atom AtomDeleteWindow; |
132 Atom AtomTakeFocus; | |
133 Atom AtomRolle; | |
134 Atom AtomProtocols; | |
135 Atom AtomsProtocols[3]; | |
136 Atom AtomLeaderClient; | |
137 Atom AtomWMSizeHint; | |
138 Atom AtomWMNormalHint; | |
23077 | 139 |
34465 | 140 #ifdef HAVE_SHM |
33539 | 141 XShmSegmentInfo Shminfo; |
34465 | 142 #endif |
33539 | 143 unsigned char *ImageData; |
144 unsigned short int *ImageDataw; | |
145 unsigned int *ImageDatadw; | |
146 GC wGC; | |
147 unsigned long WindowMask; | |
148 XVisualInfo VisualInfo; | |
149 XSetWindowAttributes WindowAttrib; | |
150 XWMHints WMHints; | |
23077 | 151 |
33539 | 152 Cursor wsCursor; |
153 char wsCursorData[1]; | |
154 Pixmap wsCursorPixmap; | |
155 int wsMouseEventType; | |
156 XColor wsColor; | |
35656 | 157 } wsWindow; |
23077 | 158 |
33539 | 159 extern int wsMaxX; |
160 extern int wsMaxY; | |
161 extern int wsOrgX; | |
162 extern int wsOrgY; | |
23077 | 163 |
33539 | 164 extern Display *wsDisplay; |
23077 | 165 |
166 // ---------------------------------------------------------------------------------------------- | |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
167 void wsDone(void); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
168 void wsInit(Display *display); |
35636 | 169 void wsSetErrorHandler(void); |
23077 | 170 |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
171 void wsMouseAutohide(void); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
172 void wsEvent(XEvent *event); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
173 void wsEvents(void); |
23077 | 174 |
35687 | 175 void wsWindowCreate(wsWindow *win, int x, int y, int w, int h, int p, int c, char *label); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
176 void wsWindowDestroy(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
177 void wsWindowMove(wsWindow *win, Bool abs, int x, int y); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
178 void wsWindowMoveWithin(wsWindow *win, Bool abs, int x, int y); |
35682 | 179 void wsWindowResize(wsWindow *win, int w, int h); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
180 void wsWindowIconify(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
181 void wsWindowRaiseTop(Display *display, Window Win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
182 void wsWindowBackground(wsWindow *win, int r, int g, int b); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
183 void wsWindowClear(wsWindow *win); |
35682 | 184 void wsWindowVisibility(wsWindow *win, int vis); |
35656 | 185 void wsWindowDecoration(wsWindow *win, Bool decor); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
186 void wsWindowLayer(Display *display, Window Win, Bool fullscreen); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
187 void wsWindowFullscreen(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
188 void wsWindowRedraw(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
189 void wsWindowShape(wsWindow *win, char *data); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
190 void wsWindowIcon(Display *display, Window Win, guiIcon_t *icon); |
23077 | 191 |
192 // ---------------------------------------------------------------------------------------------- | |
193 // Show / hide mouse cursor. | |
194 // ---------------------------------------------------------------------------------------------- | |
35682 | 195 void wsMouseVisibility(wsWindow *win, int vis); |
23077 | 196 |
197 // ---------------------------------------------------------------------------------------------- | |
198 // Image handling | |
199 // ---------------------------------------------------------------------------------------------- | |
35682 | 200 void wsImageCreate(wsWindow *win, int w, int h); |
201 void wsImageConvert(wsWindow *win, unsigned char *img); | |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
202 void wsImageDraw(wsWindow *win); |
35682 | 203 void wsImageResize(wsWindow *win, int w, int h); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
204 void wsImageDestroy(wsWindow *win); |
23077 | 205 |
26029 | 206 #endif /* MPLAYER_GUI_WS_H */ |