Mercurial > mplayer.hg
annotate gui/wm/ws.h @ 35369:dac86d3464e2
Also free the noauth_url entry in the URL struct.
author | reimar |
---|---|
date | Fri, 23 Nov 2012 19:26:01 +0000 |
parents | 80fe9ad7f318 |
children | 31a5320909f7 |
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> | |
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 | |
33539 | 38 #define wsShift (1L << 0) |
39 #define wsLock (1L << 1) | |
40 #define wsCtrl (1L << 2) | |
41 #define wsAlt (1L << 3) | |
23077 | 42 |
43 #define wsPLMouseButton 1 | |
44 #define wsPMMouseButton 2 | |
45 #define wsPRMouseButton 3 | |
46 #define wsP4MouseButton 4 | |
47 #define wsP5MouseButton 5 | |
48 #define wsRLMouseButton (1 + 128) | |
49 #define wsRMMouseButton (2 + 128) | |
50 #define wsRRMouseButton (3 + 128) | |
51 #define wsR4MouseButton (4 + 128) | |
52 #define wsR5MouseButton (5 + 128) | |
53 #define wsEnterWindow 253 | |
54 #define wsLeaveWindow 254 | |
55 #define wsMoveMouse 255 | |
56 | |
57 #define wsShowMouseCursor 1 | |
58 #define wsMouse 1 | |
59 #define wsHideMouseCursor 0 | |
60 #define wsNoMouse 0 | |
61 #define wsHandleMouseButton 2 | |
62 #define wsHandleMouseMove 4 | |
63 | |
64 #define wsHideFrame 0 | |
65 #define wsNoFrame 0 | |
66 #define wsShowFrame 1 | |
67 #define wsFrame 1 | |
68 #define wsMaxSize 2 | |
69 #define wsMinSize 4 | |
70 #define wsShowWindow 8 | |
71 #define wsHideWindow 16 | |
72 #define wsOverredirect 32 | |
73 | |
74 #define wsNoBorder 0 | |
75 | |
76 #define wsSysName "AutoSpace Window System LiTe" | |
77 | |
78 #define wsRGB32 1 | |
79 #define wsBGR32 2 | |
80 #define wsRGB24 3 | |
81 #define wsBGR24 4 | |
82 #define wsRGB16 5 | |
83 #define wsBGR16 6 | |
84 #define wsRGB15 7 | |
85 #define wsBGR15 8 | |
86 | |
87 #define wsWindowVisible 1 | |
88 #define wsWindowPartialVisible 2 | |
89 #define wsWindowNotVisible 4 | |
90 #define wsWindowMapped 8 | |
91 #define wsWindowUnmapped 16 | |
92 #define wsWindowFocusIn 32 | |
93 #define wsWindowFocusOut 64 | |
94 #define wsWindowExpose 128 | |
95 #define wsWindowRolled 256 | |
96 #define wsWindowClosed 512 | |
97 | |
98 #define wsNone 0 | |
99 #define wsMapped 1 | |
100 #define wsFocused 2 | |
101 #define wsVisible 3 | |
102 #define wsNotVisible 4 | |
103 #define wsPVisible 5 | |
104 #define wsRolled 6 | |
105 | |
106 #define wsWMUnknown 0 | |
107 #define wsWMNetWM 1 | |
108 #define wsWMKDE 2 | |
109 #define wsWMIceWM 3 | |
110 #define wsWMWMaker 4 | |
111 | |
33539 | 112 typedef void (*wsTReDraw)(void); |
113 typedef void (*wsTReSize)(unsigned int X, unsigned int Y, unsigned int width, unsigned int height); | |
114 typedef void (*wsTIdle)(void); | |
115 typedef void (*wsTKeyHandler)(int KeyCode, int Type, int Key); | |
116 typedef void (*wsTMouseHandler)(int Button, int X, int Y, int RX, int RY); | |
117 typedef void (*wsTDNDHandler)(int num, char **str); | |
23077 | 118 |
33539 | 119 typedef struct { |
120 Window WindowID; | |
121 Window Parent; | |
122 int X, Y, Width, Height; | |
123 int OldX, OldY, OldWidth, OldHeight; | |
124 int MaxX, MaxY; | |
125 int isFullScreen; | |
126 int BorderWidth; | |
127 int Property; | |
128 unsigned char *bImage; | |
129 XImage *xImage; | |
130 Pixmap Mask; | |
131 int Decorations; | |
23077 | 132 |
33539 | 133 int State; |
134 int Visible; | |
135 int Mapped; | |
136 int Focused; | |
137 int Rolled; | |
23077 | 138 |
33539 | 139 wsTReDraw ReDraw; |
140 wsTReSize ReSize; | |
141 wsTIdle Idle; | |
142 wsTKeyHandler KeyHandler; | |
143 wsTMouseHandler MouseHandler; | |
144 wsTDNDHandler DandDHandler; | |
23077 | 145 |
33539 | 146 int Alt; |
147 int Shift; | |
148 int Control; | |
149 int NumLock; | |
150 int CapsLock; | |
34684 | 151 /* Misc ------------------------------------------------------------------------------------- */ |
23077 | 152 |
33539 | 153 Atom AtomDeleteWindow; |
154 Atom AtomTakeFocus; | |
155 Atom AtomRolle; | |
156 Atom AtomProtocols; | |
157 Atom AtomsProtocols[3]; | |
158 Atom AtomLeaderClient; | |
159 Atom AtomRemote; | |
160 Atom AtomWMSizeHint; | |
161 Atom AtomWMNormalHint; | |
23077 | 162 |
34465 | 163 #ifdef HAVE_SHM |
33539 | 164 XShmSegmentInfo Shminfo; |
34465 | 165 #endif |
33539 | 166 unsigned char *ImageData; |
167 unsigned short int *ImageDataw; | |
168 unsigned int *ImageDatadw; | |
169 GC wGC; | |
170 XGCValues wGCV; | |
171 unsigned long WindowMask; | |
172 XVisualInfo VisualInfo; | |
173 XSetWindowAttributes WindowAttrib; | |
174 XSizeHints SizeHint; | |
175 XWMHints WMHints; | |
23077 | 176 |
33539 | 177 XFontStruct *Font; |
178 int FontHeight; | |
23077 | 179 |
33539 | 180 Cursor wsCursor; |
181 char wsCursorData[1]; | |
182 Pixmap wsCursorPixmap; | |
183 int wsMouseEventType; | |
184 XColor wsColor; | |
23077 | 185 } wsTWindow; |
186 | |
33539 | 187 extern int wsMaxX; |
188 extern int wsMaxY; | |
189 extern int wsOrgX; | |
190 extern int wsOrgY; | |
23077 | 191 |
33539 | 192 extern Display *wsDisplay; |
193 extern int wsScreen; | |
194 extern Window wsRootWin; | |
195 extern int wsLayer; | |
23077 | 196 |
33539 | 197 extern unsigned char *wsImageData; |
23077 | 198 |
33539 | 199 extern XEvent wsEvent; |
23077 | 200 |
33539 | 201 extern int wsDepthOnScreen; |
202 extern int wsRedMask; | |
203 extern int wsGreenMask; | |
204 extern int wsBlueMask; | |
23077 | 205 |
33539 | 206 extern int wsUseXShm; |
23077 | 207 |
208 // ---------------------------------------------------------------------------------------------- | |
209 // wsKeyTable | |
210 // ---------------------------------------------------------------------------------------------- | |
33539 | 211 extern unsigned long wsKeyTable[512]; |
23077 | 212 |
33539 | 213 void wsXDone(void); |
214 void wsXInit(Display *disp); | |
23077 | 215 |
33539 | 216 int wsGetDepthOnScreen(void); |
23077 | 217 |
33539 | 218 void wsDoExit(void); |
219 void wsMainLoop(void); | |
34083 | 220 void wsAutohideCursor(void); |
33541 | 221 Bool wsEvents(Display *display, XEvent *Event); |
33539 | 222 void wsHandleEvents(void); |
23077 | 223 |
224 // ---------------------------------------------------------------------------------------------- | |
225 // wsCrateWindow: create a new window on the screen. | |
226 // X,Y : window position | |
227 // wX,hY : window size | |
228 // bW : window frame size | |
229 // cV : mouse cursor visible | |
230 // D : "decoration", visible titlebar, etc ... | |
231 // ---------------------------------------------------------------------------------------------- | |
33539 | 232 void wsCreateWindow(wsTWindow *win, int X, int Y, int wX, int hY, int bW, int cV, unsigned char D, char *label); |
233 void wsDestroyWindow(wsTWindow *win); | |
33993 | 234 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
|
235 void wsMoveWindowWithin(wsTWindow *win, Bool abs, int x, int y); |
33539 | 236 void wsResizeWindow(wsTWindow *win, int sx, int sy); |
35355 | 237 void wsIconify(wsTWindow *win); |
33999 | 238 void wsRaiseWindowTop(Display *dpy, Window win); |
33539 | 239 void wsSetBackground(wsTWindow *win, int color); |
240 void wsSetForegroundRGB(wsTWindow *win, int r, int g, int b); | |
241 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
|
242 #define wsClearWindow(win) XClearWindow(wsDisplay, (win)->WindowID) |
33539 | 243 void wsSetTitle(wsTWindow *win, char *name); |
244 void wsVisibleWindow(wsTWindow *win, int show); | |
245 void wsWindowDecoration(wsTWindow *win, long d); | |
246 void wsSetLayer(Display *wsDisplay, Window win, int layer); | |
247 void wsFullScreen(wsTWindow *win); | |
248 void wsPostRedisplay(wsTWindow *win); | |
249 void wsSetShape(wsTWindow *win, char *data); | |
33999 | 250 void wsSetIcon(Display *dpy, Window win, guiIcon_t *icon); |
23077 | 251 |
252 // ---------------------------------------------------------------------------------------------- | |
253 // Show / hide mouse cursor. | |
254 // ---------------------------------------------------------------------------------------------- | |
33539 | 255 void wsVisibleMouse(wsTWindow *win, int m); |
256 void wsSetMousePosition(wsTWindow *win, int x, int y); | |
23077 | 257 |
258 // ---------------------------------------------------------------------------------------------- | |
259 // Image handling | |
260 // ---------------------------------------------------------------------------------------------- | |
33539 | 261 void wsCreateImage(wsTWindow *win, int Width, int Height); |
33548 | 262 void wsConvert(wsTWindow *win, unsigned char *Image); |
33539 | 263 void wsPutImage(wsTWindow *win); |
264 void wsResizeImage(wsTWindow *win, int Width, int Height); | |
265 void wsDestroyImage(wsTWindow *win); | |
266 int wsGetOutMask(void); | |
23077 | 267 |
33539 | 268 void wsScreenSaverOn(Display *mDisplay); |
269 void wsScreenSaverOff(Display *mDisplay); | |
23077 | 270 |
33539 | 271 #define wgIsRect(X, Y, tX, tY, bX, bY) (((X) > (tX)) && ((Y) > (tY)) && ((X) < (bX)) && ((Y) < (bY))) |
23077 | 272 |
26029 | 273 #endif /* MPLAYER_GUI_WS_H */ |