Mercurial > mplayer.hg
annotate gui/wm/ws.h @ 35495:78c44be4e671
Use symbolic constant defined for playing states.
author | ib |
---|---|
date | Tue, 04 Dec 2012 18:42:12 +0000 |
parents | 31a5320909f7 |
children | ff7cf8f1bd19 |
rev | line source |
---|---|
26458 | 1 /* |
2 * AutoSpace Window System for Linux/Win32 v0.61 | |
3 * written by pontscho/fresh!mindworkz | |
4 * | |
5 * This file is part of MPlayer. | |
6 * | |
7 * MPlayer is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
9 * the Free Software Foundation; either version 2 of the License, or | |
10 * (at your option) any later version. | |
11 * | |
12 * MPlayer is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 * GNU General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License along | |
18 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
20 */ | |
23077 | 21 |
26029 | 22 #ifndef MPLAYER_GUI_WS_H |
23 #define MPLAYER_GUI_WS_H | |
23077 | 24 |
33556 | 25 #include "gui/ui/widgets.h" |
35450 | 26 #include "config.h" |
33529 | 27 |
23077 | 28 #include <X11/Xlib.h> |
29 #include <X11/Xutil.h> | |
30 #include <X11/keysym.h> | |
31 #include <X11/Xatom.h> | |
34465 | 32 #ifdef HAVE_SHM |
23077 | 33 #include <X11/extensions/XShm.h> |
34465 | 34 #endif |
23077 | 35 |
36 #define wsKeyReleased 0 | |
37 #define wsKeyPressed 1 | |
38 | |
33539 | 39 #define wsShift (1L << 0) |
40 #define wsLock (1L << 1) | |
41 #define wsCtrl (1L << 2) | |
42 #define wsAlt (1L << 3) | |
23077 | 43 |
44 #define wsPLMouseButton 1 | |
45 #define wsPMMouseButton 2 | |
46 #define wsPRMouseButton 3 | |
47 #define wsP4MouseButton 4 | |
48 #define wsP5MouseButton 5 | |
49 #define wsRLMouseButton (1 + 128) | |
50 #define wsRMMouseButton (2 + 128) | |
51 #define wsRRMouseButton (3 + 128) | |
52 #define wsR4MouseButton (4 + 128) | |
53 #define wsR5MouseButton (5 + 128) | |
54 #define wsEnterWindow 253 | |
55 #define wsLeaveWindow 254 | |
56 #define wsMoveMouse 255 | |
57 | |
58 #define wsShowMouseCursor 1 | |
59 #define wsMouse 1 | |
60 #define wsHideMouseCursor 0 | |
61 #define wsNoMouse 0 | |
62 #define wsHandleMouseButton 2 | |
63 #define wsHandleMouseMove 4 | |
64 | |
65 #define wsHideFrame 0 | |
66 #define wsNoFrame 0 | |
67 #define wsShowFrame 1 | |
68 #define wsFrame 1 | |
69 #define wsMaxSize 2 | |
70 #define wsMinSize 4 | |
71 #define wsShowWindow 8 | |
72 #define wsHideWindow 16 | |
73 #define wsOverredirect 32 | |
74 | |
75 #define wsNoBorder 0 | |
76 | |
77 #define wsSysName "AutoSpace Window System LiTe" | |
78 | |
79 #define wsRGB32 1 | |
80 #define wsBGR32 2 | |
81 #define wsRGB24 3 | |
82 #define wsBGR24 4 | |
83 #define wsRGB16 5 | |
84 #define wsBGR16 6 | |
85 #define wsRGB15 7 | |
86 #define wsBGR15 8 | |
87 | |
88 #define wsWindowVisible 1 | |
89 #define wsWindowPartialVisible 2 | |
90 #define wsWindowNotVisible 4 | |
91 #define wsWindowMapped 8 | |
92 #define wsWindowUnmapped 16 | |
93 #define wsWindowFocusIn 32 | |
94 #define wsWindowFocusOut 64 | |
95 #define wsWindowExpose 128 | |
96 #define wsWindowRolled 256 | |
97 #define wsWindowClosed 512 | |
98 | |
99 #define wsNone 0 | |
100 #define wsMapped 1 | |
101 #define wsFocused 2 | |
102 #define wsVisible 3 | |
103 #define wsNotVisible 4 | |
104 #define wsPVisible 5 | |
105 #define wsRolled 6 | |
106 | |
107 #define wsWMUnknown 0 | |
108 #define wsWMNetWM 1 | |
109 #define wsWMKDE 2 | |
110 #define wsWMIceWM 3 | |
111 #define wsWMWMaker 4 | |
112 | |
33539 | 113 typedef void (*wsTReDraw)(void); |
114 typedef void (*wsTReSize)(unsigned int X, unsigned int Y, unsigned int width, unsigned int height); | |
115 typedef void (*wsTIdle)(void); | |
116 typedef void (*wsTKeyHandler)(int KeyCode, int Type, int Key); | |
117 typedef void (*wsTMouseHandler)(int Button, int X, int Y, int RX, int RY); | |
118 typedef void (*wsTDNDHandler)(int num, char **str); | |
23077 | 119 |
33539 | 120 typedef struct { |
121 Window WindowID; | |
122 Window Parent; | |
123 int X, Y, Width, Height; | |
124 int OldX, OldY, OldWidth, OldHeight; | |
125 int MaxX, MaxY; | |
126 int isFullScreen; | |
127 int BorderWidth; | |
128 int Property; | |
129 unsigned char *bImage; | |
130 XImage *xImage; | |
131 Pixmap Mask; | |
132 int Decorations; | |
23077 | 133 |
33539 | 134 int State; |
135 int Visible; | |
136 int Mapped; | |
137 int Focused; | |
138 int Rolled; | |
23077 | 139 |
33539 | 140 wsTReDraw ReDraw; |
141 wsTReSize ReSize; | |
142 wsTIdle Idle; | |
143 wsTKeyHandler KeyHandler; | |
144 wsTMouseHandler MouseHandler; | |
145 wsTDNDHandler DandDHandler; | |
23077 | 146 |
33539 | 147 int Alt; |
148 int Shift; | |
149 int Control; | |
150 int NumLock; | |
151 int CapsLock; | |
34684 | 152 /* Misc ------------------------------------------------------------------------------------- */ |
23077 | 153 |
33539 | 154 Atom AtomDeleteWindow; |
155 Atom AtomTakeFocus; | |
156 Atom AtomRolle; | |
157 Atom AtomProtocols; | |
158 Atom AtomsProtocols[3]; | |
159 Atom AtomLeaderClient; | |
160 Atom AtomRemote; | |
161 Atom AtomWMSizeHint; | |
162 Atom AtomWMNormalHint; | |
23077 | 163 |
34465 | 164 #ifdef HAVE_SHM |
33539 | 165 XShmSegmentInfo Shminfo; |
34465 | 166 #endif |
33539 | 167 unsigned char *ImageData; |
168 unsigned short int *ImageDataw; | |
169 unsigned int *ImageDatadw; | |
170 GC wGC; | |
171 XGCValues wGCV; | |
172 unsigned long WindowMask; | |
173 XVisualInfo VisualInfo; | |
174 XSetWindowAttributes WindowAttrib; | |
175 XSizeHints SizeHint; | |
176 XWMHints WMHints; | |
23077 | 177 |
33539 | 178 XFontStruct *Font; |
179 int FontHeight; | |
23077 | 180 |
33539 | 181 Cursor wsCursor; |
182 char wsCursorData[1]; | |
183 Pixmap wsCursorPixmap; | |
184 int wsMouseEventType; | |
185 XColor wsColor; | |
23077 | 186 } wsTWindow; |
187 | |
33539 | 188 extern int wsMaxX; |
189 extern int wsMaxY; | |
190 extern int wsOrgX; | |
191 extern int wsOrgY; | |
23077 | 192 |
33539 | 193 extern Display *wsDisplay; |
194 extern int wsScreen; | |
195 extern Window wsRootWin; | |
196 extern int wsLayer; | |
23077 | 197 |
33539 | 198 extern unsigned char *wsImageData; |
23077 | 199 |
33539 | 200 extern XEvent wsEvent; |
23077 | 201 |
33539 | 202 extern int wsDepthOnScreen; |
203 extern int wsRedMask; | |
204 extern int wsGreenMask; | |
205 extern int wsBlueMask; | |
23077 | 206 |
33539 | 207 extern int wsUseXShm; |
23077 | 208 |
209 // ---------------------------------------------------------------------------------------------- | |
210 // wsKeyTable | |
211 // ---------------------------------------------------------------------------------------------- | |
33539 | 212 extern unsigned long wsKeyTable[512]; |
23077 | 213 |
33539 | 214 void wsXDone(void); |
215 void wsXInit(Display *disp); | |
23077 | 216 |
33539 | 217 int wsGetDepthOnScreen(void); |
23077 | 218 |
33539 | 219 void wsDoExit(void); |
220 void wsMainLoop(void); | |
34083 | 221 void wsAutohideCursor(void); |
33541 | 222 Bool wsEvents(Display *display, XEvent *Event); |
33539 | 223 void wsHandleEvents(void); |
23077 | 224 |
225 // ---------------------------------------------------------------------------------------------- | |
226 // wsCrateWindow: create a new window on the screen. | |
227 // X,Y : window position | |
228 // wX,hY : window size | |
229 // bW : window frame size | |
230 // cV : mouse cursor visible | |
231 // D : "decoration", visible titlebar, etc ... | |
232 // ---------------------------------------------------------------------------------------------- | |
33539 | 233 void wsCreateWindow(wsTWindow *win, int X, int Y, int wX, int hY, int bW, int cV, unsigned char D, char *label); |
234 void wsDestroyWindow(wsTWindow *win); | |
33993 | 235 void wsMoveWindow(wsTWindow *win, Bool abs, int x, int y); |
33998
ca20e4098c1d
Preserve x and y position of a double-size window if possible.
ib
parents:
33993
diff
changeset
|
236 void wsMoveWindowWithin(wsTWindow *win, Bool abs, int x, int y); |
33539 | 237 void wsResizeWindow(wsTWindow *win, int sx, int sy); |
35355 | 238 void wsIconify(wsTWindow *win); |
33999 | 239 void wsRaiseWindowTop(Display *dpy, Window win); |
33539 | 240 void wsSetBackground(wsTWindow *win, int color); |
241 void wsSetForegroundRGB(wsTWindow *win, int r, int g, int b); | |
242 void wsSetBackgroundRGB(wsTWindow *win, int r, int g, int b); | |
35357
80fe9ad7f318
Pass guiApp's wsTWindow parameters always by reference (if possible).
ib
parents:
35356
diff
changeset
|
243 #define wsClearWindow(win) XClearWindow(wsDisplay, (win)->WindowID) |
33539 | 244 void wsSetTitle(wsTWindow *win, char *name); |
245 void wsVisibleWindow(wsTWindow *win, int show); | |
246 void wsWindowDecoration(wsTWindow *win, long d); | |
247 void wsSetLayer(Display *wsDisplay, Window win, int layer); | |
248 void wsFullScreen(wsTWindow *win); | |
249 void wsPostRedisplay(wsTWindow *win); | |
250 void wsSetShape(wsTWindow *win, char *data); | |
33999 | 251 void wsSetIcon(Display *dpy, Window win, guiIcon_t *icon); |
23077 | 252 |
253 // ---------------------------------------------------------------------------------------------- | |
254 // Show / hide mouse cursor. | |
255 // ---------------------------------------------------------------------------------------------- | |
33539 | 256 void wsVisibleMouse(wsTWindow *win, int m); |
257 void wsSetMousePosition(wsTWindow *win, int x, int y); | |
23077 | 258 |
259 // ---------------------------------------------------------------------------------------------- | |
260 // Image handling | |
261 // ---------------------------------------------------------------------------------------------- | |
33539 | 262 void wsCreateImage(wsTWindow *win, int Width, int Height); |
33548 | 263 void wsConvert(wsTWindow *win, unsigned char *Image); |
33539 | 264 void wsPutImage(wsTWindow *win); |
265 void wsResizeImage(wsTWindow *win, int Width, int Height); | |
266 void wsDestroyImage(wsTWindow *win); | |
267 int wsGetOutMask(void); | |
23077 | 268 |
33539 | 269 void wsScreenSaverOn(Display *mDisplay); |
270 void wsScreenSaverOff(Display *mDisplay); | |
23077 | 271 |
33539 | 272 #define wgIsRect(X, Y, tX, tY, bX, bY) (((X) > (tX)) && ((Y) > (tY)) && ((X) < (bX)) && ((Y) < (bY))) |
23077 | 273 |
26029 | 274 #endif /* MPLAYER_GUI_WS_H */ |