Mercurial > mplayer.hg
annotate gui/wm/ws.h @ 33657:c92f23eac7a4
Remove guiGetEvent type guiSetDemuxer.
Directly retrieve the information from the mpcontext.
author | ib |
---|---|
date | Mon, 27 Jun 2011 19:14:45 +0000 |
parents | 520fb0f7544c |
children | 3a93b9227b01 |
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" |
33529 | 26 |
23077 | 27 #include <X11/Xlib.h> |
28 #include <X11/Xutil.h> | |
29 #include <X11/keysym.h> | |
30 #include <X11/Xatom.h> | |
31 #include <X11/extensions/XShm.h> | |
27377
d58d06eafe83
Change a bunch of X11-specific preprocessor directives.
diego
parents:
26458
diff
changeset
|
32 #ifdef CONFIG_XDPMS |
23077 | 33 #include <X11/extensions/dpms.h> |
34 #endif | |
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; | |
23077 | 152 // --- Misc ------------------------------------------------------------------------------------- |
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 |
33539 | 164 XShmSegmentInfo Shminfo; |
165 unsigned char *ImageData; | |
166 unsigned short int *ImageDataw; | |
167 unsigned int *ImageDatadw; | |
168 GC wGC; | |
169 XGCValues wGCV; | |
170 unsigned long WindowMask; | |
171 XVisualInfo VisualInfo; | |
172 XSetWindowAttributes WindowAttrib; | |
173 XSizeHints SizeHint; | |
174 XWMHints WMHints; | |
23077 | 175 |
33539 | 176 XFontStruct *Font; |
177 int FontHeight; | |
23077 | 178 |
33539 | 179 Cursor wsCursor; |
180 char wsCursorData[1]; | |
181 Pixmap wsCursorPixmap; | |
182 int wsMouseEventType; | |
183 XColor wsColor; | |
23077 | 184 } wsTWindow; |
185 | |
33539 | 186 extern int wsMaxX; |
187 extern int wsMaxY; | |
188 extern int wsOrgX; | |
189 extern int wsOrgY; | |
23077 | 190 |
33539 | 191 extern Display *wsDisplay; |
192 extern int wsScreen; | |
193 extern Window wsRootWin; | |
194 extern int wsLayer; | |
23077 | 195 |
33539 | 196 extern unsigned char *wsImageData; |
23077 | 197 |
33539 | 198 extern XEvent wsEvent; |
23077 | 199 |
33539 | 200 extern int wsDepthOnScreen; |
201 extern int wsRedMask; | |
202 extern int wsGreenMask; | |
203 extern int wsBlueMask; | |
23077 | 204 |
33539 | 205 extern int wsUseXShm; |
23077 | 206 |
207 // ---------------------------------------------------------------------------------------------- | |
208 // wsKeyTable | |
209 // ---------------------------------------------------------------------------------------------- | |
33539 | 210 extern unsigned long wsKeyTable[512]; |
23077 | 211 |
33539 | 212 void wsXDone(void); |
213 void wsXInit(Display *disp); | |
23077 | 214 |
33539 | 215 int wsGetDepthOnScreen(void); |
23077 | 216 |
33539 | 217 void wsDoExit(void); |
218 void wsMainLoop(void); | |
33541 | 219 Bool wsEvents(Display *display, XEvent *Event); |
33539 | 220 void wsHandleEvents(void); |
23077 | 221 |
222 // ---------------------------------------------------------------------------------------------- | |
223 // wsCrateWindow: create a new window on the screen. | |
224 // X,Y : window position | |
225 // wX,hY : window size | |
226 // bW : window frame size | |
227 // cV : mouse cursor visible | |
228 // D : "decoration", visible titlebar, etc ... | |
229 // ---------------------------------------------------------------------------------------------- | |
33539 | 230 void wsCreateWindow(wsTWindow *win, int X, int Y, int wX, int hY, int bW, int cV, unsigned char D, char *label); |
231 void wsDestroyWindow(wsTWindow *win); | |
232 void wsMoveWindow(wsTWindow *win, int b, int x, int y); | |
233 void wsResizeWindow(wsTWindow *win, int sx, int sy); | |
234 void wsIconify(wsTWindow win); | |
235 void wsMoveTopWindow(Display *wsDisplay, Window win); | |
236 void wsSetBackground(wsTWindow *win, int color); | |
237 void wsSetForegroundRGB(wsTWindow *win, int r, int g, int b); | |
238 void wsSetBackgroundRGB(wsTWindow *win, int r, int g, int b); | |
239 #define wsClearWindow(win) XClearWindow(wsDisplay, win.WindowID) | |
240 void wsSetTitle(wsTWindow *win, char *name); | |
241 void wsVisibleWindow(wsTWindow *win, int show); | |
242 void wsWindowDecoration(wsTWindow *win, long d); | |
243 void wsSetLayer(Display *wsDisplay, Window win, int layer); | |
244 void wsFullScreen(wsTWindow *win); | |
245 void wsPostRedisplay(wsTWindow *win); | |
246 void wsSetShape(wsTWindow *win, char *data); | |
247 void wsSetIcon(Display *dsp, Window win, guiIcon_t *icon); | |
23077 | 248 |
249 // ---------------------------------------------------------------------------------------------- | |
250 // Draw string at x,y with fc ( foreground color ) and bc ( background color ). | |
251 // ---------------------------------------------------------------------------------------------- | |
33539 | 252 void wsDrawString(wsTWindow win, int x, int y, char *str, int fc, int bc); |
253 int wsTextWidth(wsTWindow win, char *str); | |
23077 | 254 |
255 // ---------------------------------------------------------------------------------------------- | |
256 // Show / hide mouse cursor. | |
257 // ---------------------------------------------------------------------------------------------- | |
33539 | 258 void wsVisibleMouse(wsTWindow *win, int m); |
259 void wsSetMousePosition(wsTWindow *win, int x, int y); | |
23077 | 260 |
261 // ---------------------------------------------------------------------------------------------- | |
262 // Image handling | |
263 // ---------------------------------------------------------------------------------------------- | |
33539 | 264 void wsCreateImage(wsTWindow *win, int Width, int Height); |
33548 | 265 void wsConvert(wsTWindow *win, unsigned char *Image); |
33539 | 266 void wsPutImage(wsTWindow *win); |
267 void wsResizeImage(wsTWindow *win, int Width, int Height); | |
268 void wsDestroyImage(wsTWindow *win); | |
269 int wsGetOutMask(void); | |
23077 | 270 |
33539 | 271 void wsScreenSaverOn(Display *mDisplay); |
272 void wsScreenSaverOff(Display *mDisplay); | |
23077 | 273 |
33539 | 274 #define wgIsRect(X, Y, tX, tY, bX, bY) (((X) > (tX)) && ((Y) > (tY)) && ((X) < (bX)) && ((Y) < (bY))) |
23077 | 275 |
26029 | 276 #endif /* MPLAYER_GUI_WS_H */ |