Mercurial > mplayer.hg
annotate gui/wm/ws.h @ 36045:a6f9525929a4
Remove unnecessary initialization.
author | ib |
---|---|
date | Wed, 03 Apr 2013 16:25:33 +0000 |
parents | eba3a00b9c92 |
children | 63e8bfb208c6 |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
35666
01ac3cd2f101
Cosmetic: Relocate and revise comments on code origin.
ib
parents:
35665
diff
changeset
|
17 * |
01ac3cd2f101
Cosmetic: Relocate and revise comments on code origin.
ib
parents:
35665
diff
changeset
|
18 * based on: AutoSpace Window System for Linux/Win32, |
01ac3cd2f101
Cosmetic: Relocate and revise comments on code origin.
ib
parents:
35665
diff
changeset
|
19 * written by pontscho/fresh!mindworkz |
26458 | 20 */ |
23077 | 21 |
26029 | 22 #ifndef MPLAYER_GUI_WS_H |
23 #define MPLAYER_GUI_WS_H | |
23077 | 24 |
35702 | 25 #include <X11/Xlib.h> |
26 #include <X11/Xutil.h> | |
27 | |
35529 | 28 #include "gui/dialog/dialog.h" |
35689 | 29 |
35450 | 30 #include "config.h" |
33529 | 31 |
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 | |
39 #define wsPLMouseButton 1 | |
40 #define wsPMMouseButton 2 | |
41 #define wsPRMouseButton 3 | |
42 #define wsP4MouseButton 4 | |
43 #define wsP5MouseButton 5 | |
44 #define wsRLMouseButton (1 + 128) | |
45 #define wsRMMouseButton (2 + 128) | |
46 #define wsRRMouseButton (3 + 128) | |
47 #define wsR4MouseButton (4 + 128) | |
48 #define wsR5MouseButton (5 + 128) | |
49 #define wsEnterWindow 253 | |
50 #define wsLeaveWindow 254 | |
51 #define wsMoveMouse 255 | |
52 | |
53 #define wsShowMouseCursor 1 | |
54 #define wsHideMouseCursor 0 | |
55 #define wsHandleMouseButton 2 | |
56 #define wsHandleMouseMove 4 | |
57 | |
58 #define wsHideFrame 0 | |
59 #define wsShowFrame 1 | |
60 #define wsMaxSize 2 | |
61 #define wsMinSize 4 | |
62 #define wsShowWindow 8 | |
63 #define wsHideWindow 16 | |
64 #define wsOverredirect 32 | |
35652 | 65 #define wsWaitMap 64 |
35657 | 66 #define wsAspect 128 |
23077 | 67 |
35499
af72f85b6f44
Define symbolic constant wsNone for "no window state".
ib
parents:
35498
diff
changeset
|
68 #define wsNone 0 |
23077 | 69 #define wsWindowVisible 1 |
70 #define wsWindowPartialVisible 2 | |
71 #define wsWindowNotVisible 4 | |
72 #define wsWindowMapped 8 | |
73 #define wsWindowUnmapped 16 | |
74 #define wsWindowFocusIn 32 | |
75 #define wsWindowFocusOut 64 | |
76 #define wsWindowExpose 128 | |
77 #define wsWindowRolled 256 | |
78 #define wsWindowClosed 512 | |
79 | |
35498
c505a4aa9582
Rename wsNone wsNo and use it instead of a numeric constant.
ib
parents:
35497
diff
changeset
|
80 #define wsNo 0 |
23077 | 81 #define wsMapped 1 |
82 #define wsFocused 2 | |
83 #define wsVisible 3 | |
84 #define wsNotVisible 4 | |
85 #define wsPVisible 5 | |
86 #define wsRolled 6 | |
87 | |
35760 | 88 typedef void (*wsTDrawHandler)(void); |
35764 | 89 typedef void (*wsTMouseHandler)(int Button, int X, int Y, int RX, int RY); |
33539 | 90 typedef void (*wsTKeyHandler)(int KeyCode, int Type, int Key); |
91 typedef void (*wsTDNDHandler)(int num, char **str); | |
23077 | 92 |
33539 | 93 typedef struct { |
94 Window WindowID; | |
95 Window Parent; | |
96 int X, Y, Width, Height; | |
97 int OldX, OldY, OldWidth, OldHeight; | |
35695 | 98 Bool isFullScreen; |
33539 | 99 int Property; |
100 unsigned char *bImage; | |
101 XImage *xImage; | |
102 Pixmap Mask; | |
35696 | 103 Bool Decoration; |
23077 | 104 |
33539 | 105 int State; |
106 int Visible; | |
107 int Mapped; | |
108 int Focused; | |
109 int Rolled; | |
23077 | 110 |
35760 | 111 wsTDrawHandler DrawHandler; |
35764 | 112 wsTMouseHandler MouseHandler; |
33539 | 113 wsTKeyHandler KeyHandler; |
35759 | 114 wsTDNDHandler DNDHandler; |
23077 | 115 |
33539 | 116 int Alt; |
117 int Shift; | |
118 int Control; | |
119 int NumLock; | |
120 int CapsLock; | |
34684 | 121 /* Misc ------------------------------------------------------------------------------------- */ |
23077 | 122 |
33539 | 123 Atom AtomDeleteWindow; |
124 Atom AtomTakeFocus; | |
125 Atom AtomRolle; | |
126 Atom AtomProtocols; | |
127 Atom AtomsProtocols[3]; | |
128 Atom AtomLeaderClient; | |
129 Atom AtomWMSizeHint; | |
130 Atom AtomWMNormalHint; | |
23077 | 131 |
34465 | 132 #ifdef HAVE_SHM |
33539 | 133 XShmSegmentInfo Shminfo; |
34465 | 134 #endif |
33539 | 135 unsigned char *ImageData; |
136 unsigned short int *ImageDataw; | |
137 unsigned int *ImageDatadw; | |
138 GC wGC; | |
139 unsigned long WindowMask; | |
140 XVisualInfo VisualInfo; | |
141 XSetWindowAttributes WindowAttrib; | |
142 XWMHints WMHints; | |
23077 | 143 |
33539 | 144 Cursor wsCursor; |
145 char wsCursorData[1]; | |
146 Pixmap wsCursorPixmap; | |
147 int wsMouseEventType; | |
148 XColor wsColor; | |
35656 | 149 } wsWindow; |
23077 | 150 |
33539 | 151 extern int wsMaxX; |
152 extern int wsMaxY; | |
153 extern int wsOrgX; | |
154 extern int wsOrgY; | |
23077 | 155 |
33539 | 156 extern Display *wsDisplay; |
23077 | 157 |
158 // ---------------------------------------------------------------------------------------------- | |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
159 void wsDone(void); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
160 void wsInit(Display *display); |
35636 | 161 void wsSetErrorHandler(void); |
23077 | 162 |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
163 void wsMouseAutohide(void); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
164 void wsEvent(XEvent *event); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
165 void wsEvents(void); |
23077 | 166 |
35687 | 167 void wsWindowCreate(wsWindow *win, int x, int y, int w, int h, int p, int c, char *label); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
168 void wsWindowDestroy(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
169 void wsWindowMove(wsWindow *win, Bool abs, int x, int y); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
170 void wsWindowMoveWithin(wsWindow *win, Bool abs, int x, int y); |
35682 | 171 void wsWindowResize(wsWindow *win, int w, int h); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
172 void wsWindowIconify(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
173 void wsWindowRaiseTop(Display *display, Window Win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
174 void wsWindowBackground(wsWindow *win, int r, int g, int b); |
35682 | 175 void wsWindowVisibility(wsWindow *win, int vis); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
176 void wsWindowLayer(Display *display, Window Win, Bool fullscreen); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
177 void wsWindowFullscreen(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
178 void wsWindowRedraw(wsWindow *win); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
179 void wsWindowShape(wsWindow *win, char *data); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
180 void wsWindowIcon(Display *display, Window Win, guiIcon_t *icon); |
23077 | 181 |
182 // ---------------------------------------------------------------------------------------------- | |
183 // Show / hide mouse cursor. | |
184 // ---------------------------------------------------------------------------------------------- | |
35682 | 185 void wsMouseVisibility(wsWindow *win, int vis); |
23077 | 186 |
187 // ---------------------------------------------------------------------------------------------- | |
188 // Image handling | |
189 // ---------------------------------------------------------------------------------------------- | |
35682 | 190 void wsImageCreate(wsWindow *win, int w, int h); |
35744 | 191 void wsImageRender(wsWindow *win, unsigned char *img); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
192 void wsImageDraw(wsWindow *win); |
35682 | 193 void wsImageResize(wsWindow *win, int w, int h); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35679
diff
changeset
|
194 void wsImageDestroy(wsWindow *win); |
23077 | 195 |
26029 | 196 #endif /* MPLAYER_GUI_WS_H */ |