Mercurial > mplayer.hg
annotate gui/wm/ws.h @ 35527:b89f8ab15c5e
Rebuild GUI directory structure.
Remove obsolete directory ui/gtk/.
author | ib |
---|---|
date | Thu, 06 Dec 2012 14:32:33 +0000 |
parents | af72f85b6f44 |
children | 8ad4d2fb46e8 |
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 | |
35499
af72f85b6f44
Define symbolic constant wsNone for "no window state".
ib
parents:
35498
diff
changeset
|
88 #define wsNone 0 |
23077 | 89 #define wsWindowVisible 1 |
90 #define wsWindowPartialVisible 2 | |
91 #define wsWindowNotVisible 4 | |
92 #define wsWindowMapped 8 | |
93 #define wsWindowUnmapped 16 | |
94 #define wsWindowFocusIn 32 | |
95 #define wsWindowFocusOut 64 | |
96 #define wsWindowExpose 128 | |
97 #define wsWindowRolled 256 | |
98 #define wsWindowClosed 512 | |
99 | |
35498
c505a4aa9582
Rename wsNone wsNo and use it instead of a numeric constant.
ib
parents:
35497
diff
changeset
|
100 #define wsNo 0 |
23077 | 101 #define wsMapped 1 |
102 #define wsFocused 2 | |
103 #define wsVisible 3 | |
104 #define wsNotVisible 4 | |
105 #define wsPVisible 5 | |
106 #define wsRolled 6 | |
107 | |
108 #define wsWMUnknown 0 | |
109 #define wsWMNetWM 1 | |
110 #define wsWMKDE 2 | |
111 #define wsWMIceWM 3 | |
112 #define wsWMWMaker 4 | |
113 | |
33539 | 114 typedef void (*wsTReDraw)(void); |
115 typedef void (*wsTReSize)(unsigned int X, unsigned int Y, unsigned int width, unsigned int height); | |
116 typedef void (*wsTIdle)(void); | |
117 typedef void (*wsTKeyHandler)(int KeyCode, int Type, int Key); | |
118 typedef void (*wsTMouseHandler)(int Button, int X, int Y, int RX, int RY); | |
119 typedef void (*wsTDNDHandler)(int num, char **str); | |
23077 | 120 |
33539 | 121 typedef struct { |
122 Window WindowID; | |
123 Window Parent; | |
124 int X, Y, Width, Height; | |
125 int OldX, OldY, OldWidth, OldHeight; | |
126 int MaxX, MaxY; | |
127 int isFullScreen; | |
128 int BorderWidth; | |
129 int Property; | |
130 unsigned char *bImage; | |
131 XImage *xImage; | |
132 Pixmap Mask; | |
133 int Decorations; | |
23077 | 134 |
33539 | 135 int State; |
136 int Visible; | |
137 int Mapped; | |
138 int Focused; | |
139 int Rolled; | |
23077 | 140 |
33539 | 141 wsTReDraw ReDraw; |
142 wsTReSize ReSize; | |
143 wsTIdle Idle; | |
144 wsTKeyHandler KeyHandler; | |
145 wsTMouseHandler MouseHandler; | |
146 wsTDNDHandler DandDHandler; | |
23077 | 147 |
33539 | 148 int Alt; |
149 int Shift; | |
150 int Control; | |
151 int NumLock; | |
152 int CapsLock; | |
34684 | 153 /* Misc ------------------------------------------------------------------------------------- */ |
23077 | 154 |
33539 | 155 Atom AtomDeleteWindow; |
156 Atom AtomTakeFocus; | |
157 Atom AtomRolle; | |
158 Atom AtomProtocols; | |
159 Atom AtomsProtocols[3]; | |
160 Atom AtomLeaderClient; | |
161 Atom AtomRemote; | |
162 Atom AtomWMSizeHint; | |
163 Atom AtomWMNormalHint; | |
23077 | 164 |
34465 | 165 #ifdef HAVE_SHM |
33539 | 166 XShmSegmentInfo Shminfo; |
34465 | 167 #endif |
33539 | 168 unsigned char *ImageData; |
169 unsigned short int *ImageDataw; | |
170 unsigned int *ImageDatadw; | |
171 GC wGC; | |
172 XGCValues wGCV; | |
173 unsigned long WindowMask; | |
174 XVisualInfo VisualInfo; | |
175 XSetWindowAttributes WindowAttrib; | |
176 XSizeHints SizeHint; | |
177 XWMHints WMHints; | |
23077 | 178 |
33539 | 179 XFontStruct *Font; |
180 int FontHeight; | |
23077 | 181 |
33539 | 182 Cursor wsCursor; |
183 char wsCursorData[1]; | |
184 Pixmap wsCursorPixmap; | |
185 int wsMouseEventType; | |
186 XColor wsColor; | |
23077 | 187 } wsTWindow; |
188 | |
33539 | 189 extern int wsMaxX; |
190 extern int wsMaxY; | |
191 extern int wsOrgX; | |
192 extern int wsOrgY; | |
23077 | 193 |
33539 | 194 extern Display *wsDisplay; |
195 extern int wsScreen; | |
196 extern Window wsRootWin; | |
197 extern int wsLayer; | |
23077 | 198 |
33539 | 199 extern unsigned char *wsImageData; |
23077 | 200 |
33539 | 201 extern XEvent wsEvent; |
23077 | 202 |
33539 | 203 extern int wsDepthOnScreen; |
204 extern int wsRedMask; | |
205 extern int wsGreenMask; | |
206 extern int wsBlueMask; | |
23077 | 207 |
33539 | 208 extern int wsUseXShm; |
23077 | 209 |
210 // ---------------------------------------------------------------------------------------------- | |
211 // wsKeyTable | |
212 // ---------------------------------------------------------------------------------------------- | |
33539 | 213 extern unsigned long wsKeyTable[512]; |
23077 | 214 |
33539 | 215 void wsXDone(void); |
216 void wsXInit(Display *disp); | |
23077 | 217 |
33539 | 218 int wsGetDepthOnScreen(void); |
23077 | 219 |
33539 | 220 void wsDoExit(void); |
221 void wsMainLoop(void); | |
34083 | 222 void wsAutohideCursor(void); |
33541 | 223 Bool wsEvents(Display *display, XEvent *Event); |
33539 | 224 void wsHandleEvents(void); |
23077 | 225 |
226 // ---------------------------------------------------------------------------------------------- | |
227 // wsCrateWindow: create a new window on the screen. | |
228 // X,Y : window position | |
229 // wX,hY : window size | |
230 // bW : window frame size | |
231 // cV : mouse cursor visible | |
232 // D : "decoration", visible titlebar, etc ... | |
233 // ---------------------------------------------------------------------------------------------- | |
33539 | 234 void wsCreateWindow(wsTWindow *win, int X, int Y, int wX, int hY, int bW, int cV, unsigned char D, char *label); |
235 void wsDestroyWindow(wsTWindow *win); | |
33993 | 236 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
|
237 void wsMoveWindowWithin(wsTWindow *win, Bool abs, int x, int y); |
33539 | 238 void wsResizeWindow(wsTWindow *win, int sx, int sy); |
35355 | 239 void wsIconify(wsTWindow *win); |
33999 | 240 void wsRaiseWindowTop(Display *dpy, Window win); |
33539 | 241 void wsSetBackground(wsTWindow *win, int color); |
242 void wsSetForegroundRGB(wsTWindow *win, int r, int g, int b); | |
243 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
|
244 #define wsClearWindow(win) XClearWindow(wsDisplay, (win)->WindowID) |
33539 | 245 void wsSetTitle(wsTWindow *win, char *name); |
246 void wsVisibleWindow(wsTWindow *win, int show); | |
35497 | 247 void wsWindowDecoration(wsTWindow *win, Bool decor); |
33539 | 248 void wsSetLayer(Display *wsDisplay, Window win, int layer); |
249 void wsFullScreen(wsTWindow *win); | |
250 void wsPostRedisplay(wsTWindow *win); | |
251 void wsSetShape(wsTWindow *win, char *data); | |
33999 | 252 void wsSetIcon(Display *dpy, Window win, guiIcon_t *icon); |
23077 | 253 |
254 // ---------------------------------------------------------------------------------------------- | |
255 // Show / hide mouse cursor. | |
256 // ---------------------------------------------------------------------------------------------- | |
33539 | 257 void wsVisibleMouse(wsTWindow *win, int m); |
258 void wsSetMousePosition(wsTWindow *win, int x, int y); | |
23077 | 259 |
260 // ---------------------------------------------------------------------------------------------- | |
261 // Image handling | |
262 // ---------------------------------------------------------------------------------------------- | |
33539 | 263 void wsCreateImage(wsTWindow *win, int Width, int Height); |
33548 | 264 void wsConvert(wsTWindow *win, unsigned char *Image); |
33539 | 265 void wsPutImage(wsTWindow *win); |
266 void wsResizeImage(wsTWindow *win, int Width, int Height); | |
267 void wsDestroyImage(wsTWindow *win); | |
268 int wsGetOutMask(void); | |
23077 | 269 |
33539 | 270 void wsScreenSaverOn(Display *mDisplay); |
271 void wsScreenSaverOff(Display *mDisplay); | |
23077 | 272 |
33539 | 273 #define wgIsRect(X, Y, tX, tY, bX, bY) (((X) > (tX)) && ((Y) > (tY)) && ((X) < (bX)) && ((Y) < (bY))) |
23077 | 274 |
26029 | 275 #endif /* MPLAYER_GUI_WS_H */ |