Mercurial > mplayer.hg
annotate gui/wm/ws.h @ 34121:fbfde63a7e82
Fix include condition.
Don't explicitly list the sytems that need the windows.h header file.
Only OS/2 doesn't need it.
author | ib |
---|---|
date | Mon, 17 Oct 2011 10:46:38 +0000 |
parents | 0a44fc1d4e72 |
children | aa4bd0c197d8 |
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); | |
34083 | 219 void wsAutohideCursor(void); |
33541 | 220 Bool wsEvents(Display *display, XEvent *Event); |
33539 | 221 void wsHandleEvents(void); |
23077 | 222 |
223 // ---------------------------------------------------------------------------------------------- | |
224 // wsCrateWindow: create a new window on the screen. | |
225 // X,Y : window position | |
226 // wX,hY : window size | |
227 // bW : window frame size | |
228 // cV : mouse cursor visible | |
229 // D : "decoration", visible titlebar, etc ... | |
230 // ---------------------------------------------------------------------------------------------- | |
33539 | 231 void wsCreateWindow(wsTWindow *win, int X, int Y, int wX, int hY, int bW, int cV, unsigned char D, char *label); |
232 void wsDestroyWindow(wsTWindow *win); | |
33993 | 233 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
|
234 void wsMoveWindowWithin(wsTWindow *win, Bool abs, int x, int y); |
33539 | 235 void wsResizeWindow(wsTWindow *win, int sx, int sy); |
236 void wsIconify(wsTWindow win); | |
33999 | 237 void wsRaiseWindowTop(Display *dpy, Window win); |
33539 | 238 void wsSetBackground(wsTWindow *win, int color); |
239 void wsSetForegroundRGB(wsTWindow *win, int r, int g, int b); | |
240 void wsSetBackgroundRGB(wsTWindow *win, int r, int g, int b); | |
241 #define wsClearWindow(win) XClearWindow(wsDisplay, win.WindowID) | |
242 void wsSetTitle(wsTWindow *win, char *name); | |
243 void wsVisibleWindow(wsTWindow *win, int show); | |
244 void wsWindowDecoration(wsTWindow *win, long d); | |
245 void wsSetLayer(Display *wsDisplay, Window win, int layer); | |
246 void wsFullScreen(wsTWindow *win); | |
247 void wsPostRedisplay(wsTWindow *win); | |
248 void wsSetShape(wsTWindow *win, char *data); | |
33999 | 249 void wsSetIcon(Display *dpy, Window win, guiIcon_t *icon); |
23077 | 250 |
251 // ---------------------------------------------------------------------------------------------- | |
252 // Draw string at x,y with fc ( foreground color ) and bc ( background color ). | |
253 // ---------------------------------------------------------------------------------------------- | |
33539 | 254 void wsDrawString(wsTWindow win, int x, int y, char *str, int fc, int bc); |
255 int wsTextWidth(wsTWindow win, char *str); | |
23077 | 256 |
257 // ---------------------------------------------------------------------------------------------- | |
258 // Show / hide mouse cursor. | |
259 // ---------------------------------------------------------------------------------------------- | |
33539 | 260 void wsVisibleMouse(wsTWindow *win, int m); |
261 void wsSetMousePosition(wsTWindow *win, int x, int y); | |
23077 | 262 |
263 // ---------------------------------------------------------------------------------------------- | |
264 // Image handling | |
265 // ---------------------------------------------------------------------------------------------- | |
33539 | 266 void wsCreateImage(wsTWindow *win, int Width, int Height); |
33548 | 267 void wsConvert(wsTWindow *win, unsigned char *Image); |
33539 | 268 void wsPutImage(wsTWindow *win); |
269 void wsResizeImage(wsTWindow *win, int Width, int Height); | |
270 void wsDestroyImage(wsTWindow *win); | |
271 int wsGetOutMask(void); | |
23077 | 272 |
33539 | 273 void wsScreenSaverOn(Display *mDisplay); |
274 void wsScreenSaverOff(Display *mDisplay); | |
23077 | 275 |
33539 | 276 #define wgIsRect(X, Y, tX, tY, bX, bY) (((X) > (tX)) && ((Y) > (tY)) && ((X) < (bX)) && ((Y) < (bY))) |
23077 | 277 |
26029 | 278 #endif /* MPLAYER_GUI_WS_H */ |