Mercurial > mplayer.hg
annotate Gui/wm/ws.h @ 5638:86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
author | arpi |
---|---|
date | Mon, 15 Apr 2002 19:17:12 +0000 |
parents | 3473ca9ef158 |
children | 60cf2bca993f |
rev | line source |
---|---|
1693 | 1 |
2 // ---------------------------------------------------------------------------------------------- | |
3 // AutoSpace Window System for Linux/Win32 v0.61 | |
4 // Writed by pontscho / fresh!mindworkz | |
5 // ---------------------------------------------------------------------------------------------- | |
6 | |
7 #ifndef __MY_WS | |
8 #define __MY_WS | |
9 | |
10 #include <X11/Xlib.h> | |
11 #include <X11/Xutil.h> | |
12 #include <X11/keysym.h> | |
13 #include <X11/Xatom.h> | |
14 #include <X11/extensions/XShm.h> | |
4679 | 15 #ifdef HAVE_XDPMS |
1693 | 16 #include <X11/extensions/dpms.h> |
4679 | 17 #endif |
1693 | 18 |
19 #define wsKeyReleased 0 | |
20 #define wsKeyPressed 1 | |
21 | |
22 #define wsShift (1L<<0) | |
23 #define wsLock (1L<<1) | |
24 #define wsCtrl (1L<<2) | |
25 #define wsAlt (1L<<3) | |
26 | |
27 #define wsPLMouseButton 1 | |
28 #define wsPMMouseButton 2 | |
29 #define wsPRMouseButton 3 | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
30 #define wsP4MouseButton 4 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
31 #define wsP5MouseButton 5 |
1693 | 32 #define wsRLMouseButton 1 + 128 |
33 #define wsRMMouseButton 2 + 128 | |
34 #define wsRRMouseButton 3 + 128 | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
35 #define wsR4MouseButton 4 + 128 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
36 #define wsR5MouseButton 5 + 128 |
1693 | 37 #define wsEnterWindow 253 |
38 #define wsLeaveWindow 254 | |
39 #define wsMoveMouse 255 | |
40 | |
41 #define wsShowMouseCursor 1 | |
42 #define wsMouse 1 | |
43 #define wsHideMouseCursor 0 | |
44 #define wsNoMouse 0 | |
45 #define wsHandleMouseButton 2 | |
46 #define wsHandleMouseMove 4 | |
47 | |
48 #define wsHideFrame 0 | |
49 #define wsNoFrame 0 | |
50 #define wsShowFrame 1 | |
51 #define wsFrame 1 | |
52 #define wsMaxSize 2 | |
53 #define wsMinSize 4 | |
54 #define wsShowWindow 8 | |
55 #define wsHideWindow 16 | |
56 #define wsOverredirect 32 | |
57 | |
58 #define wsNoBorder 0 | |
59 | |
60 #define wsSysName "AutoSpace Window System LiTe" | |
61 | |
62 #define wsRGB32 1 | |
63 #define wsBGR32 2 | |
64 #define wsRGB24 3 | |
65 #define wsBGR24 4 | |
66 #define wsRGB16 5 | |
67 #define wsBGR16 6 | |
68 #define wsRGB15 7 | |
69 #define wsBGR15 8 | |
70 | |
71 #define wsWindowVisible 1 | |
72 #define wsWindowPartialVisible 2 | |
73 #define wsWindowNotVisible 4 | |
74 #define wsWindowMapped 8 | |
75 #define wsWindowUnmapped 16 | |
76 #define wsWindowFocusIn 32 | |
77 #define wsWindowFocusOut 64 | |
78 #define wsWindowExpose 128 | |
79 #define wsWindowRolled 256 | |
80 | |
81 #define wsNone 0 | |
82 #define wsMapped 1 | |
83 #define wsFocused 2 | |
84 #define wsVisible 3 | |
85 #define wsNotVisible 4 | |
86 #define wsPVisible 5 | |
87 #define wsRolled 6 | |
88 | |
89 #define wsParamDisplay Display *dpy,Window w | |
90 | |
91 typedef void (*wsTReDraw)( wsParamDisplay ); | |
92 typedef void (*wsTReSize)( unsigned int X,unsigned int Y,unsigned int width,unsigned int height ); | |
93 typedef void (*wsTIdle)( void ); | |
94 typedef void (*wsTKeyHandler)( int State,int Type,int Key ); | |
95 typedef void (*wsTMouseHandler)( int Button,int X,int Y,int RX,int RY ); | |
96 typedef void (*wsRemoteHandler)( char * str ); | |
97 | |
98 typedef struct | |
99 { | |
100 Window WindowID; | |
101 Window Parent; | |
102 int X,Y,Width,Height; | |
103 int OldX,OldY,OldWidth,OldHeight; | |
104 int MaxX,MaxY; | |
105 int isFullScreen; | |
106 int BorderWidth; | |
107 int Property; | |
108 unsigned char * bImage; | |
109 XImage * xImage; | |
110 Pixmap Mask; | |
111 int Decorations; | |
112 | |
113 int State; | |
114 int Visible; | |
115 int Mapped; | |
116 int Focused; | |
117 int Rolled; | |
118 | |
119 wsTReDraw ReDraw; | |
120 wsTReSize ReSize; | |
121 wsTIdle Idle; | |
122 wsTKeyHandler KeyHandler; | |
123 wsTMouseHandler MouseHandler; | |
124 wsRemoteHandler RemoteHandler; | |
125 | |
126 int Alt; | |
127 int Shift; | |
128 int Control; | |
129 int NumLock; | |
130 int CapsLock; | |
131 // --- Misc ------------------------------------------------------------------------------------- | |
132 | |
133 Atom AtomDeleteWindow; | |
134 Atom AtomTakeFocus; | |
135 Atom AtomRolle; | |
136 Atom AtomProtocols; | |
137 Atom AtomsProtocols[3]; | |
138 Atom AtomLeaderClient; | |
139 Atom AtomRemote; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
140 Atom AtomWMSizeHint; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
141 Atom AtomWMNormalHint; |
1693 | 142 |
143 XShmSegmentInfo Shminfo; | |
144 unsigned char * ImageData; | |
145 unsigned short int * ImageDataw; | |
146 unsigned int * ImageDatadw; | |
147 GC wGC; | |
148 XGCValues wGCV; | |
149 unsigned long WindowMask; | |
150 XVisualInfo VisualInfo; | |
151 XWindowAttributes Attribs; | |
152 XSetWindowAttributes WindowAttrib; | |
153 XSizeHints SizeHint; | |
154 XWMHints WMHints; | |
155 | |
156 XFontStruct * Font; | |
157 int FontHeight; | |
158 | |
159 Cursor wsCursor; | |
160 char wsCursorData[1]; | |
161 Pixmap wsCursorPixmap; | |
162 int wsMouseEventType; | |
163 XColor wsColor; | |
164 } wsTWindow; | |
165 | |
4465 | 166 extern int wsMaxX; |
167 extern int wsMaxY; | |
1693 | 168 |
169 extern Display * wsDisplay; | |
170 extern int wsScreen; | |
171 extern Window wsRootWin; | |
172 | |
173 extern unsigned char * wsImageData; | |
174 | |
175 extern XEvent wsEvent; | |
176 | |
177 extern int wsDepthOnScreen; | |
178 extern int wsRedMask; | |
179 extern int wsGreenMask; | |
180 extern int wsBlueMask; | |
181 | |
182 extern int wsUseXShm; | |
183 extern int wsUseDGA; | |
184 | |
185 // ---------------------------------------------------------------------------------------------- | |
186 // wsKeyTable | |
187 // ---------------------------------------------------------------------------------------------- | |
188 extern unsigned long wsKeyTable[512]; | |
189 | |
190 extern void wsXDone( void ); | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
191 extern void wsXInit( void* disp ); |
1693 | 192 |
193 extern int wsGetDepthOnScreen( void ); | |
194 | |
195 extern void wsDoExit( void ); | |
196 extern void wsMainLoop( void ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4679
diff
changeset
|
197 extern Bool wsEvents( Display * display,XEvent * Event,XPointer arg ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4679
diff
changeset
|
198 extern void wsHandleEvents( void ); |
1693 | 199 |
200 // ---------------------------------------------------------------------------------------------- | |
201 // wsCrateWindow: create a new window on the screen. | |
202 // X,Y : window position | |
203 // wX,hY : window size | |
204 // bW : window frame size | |
205 // cV : mouse cursor visible | |
206 // D : "decoration", visible titlebar, etc ... | |
207 // ---------------------------------------------------------------------------------------------- | |
208 extern void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,unsigned char D,char * label ); | |
209 extern void wsDestroyWindow( wsTWindow * win ); | |
2854 | 210 extern void wsMoveWindow( wsTWindow * win,int b,int x, int y ); |
1693 | 211 extern void wsResizeWindow( wsTWindow * win,int sx, int sy ); |
212 extern void wsIconify( wsTWindow win ); | |
213 extern void wsMoveTopWindow( wsTWindow * win ); | |
214 extern void wsSetBackground( wsTWindow * win,int color ); | |
1814 | 215 extern void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b ); |
1693 | 216 extern void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b ); |
217 #define wsClearWindow( win ); XClearWindow( wsDisplay,win.WindowID ); | |
218 extern void wsSetTitle( wsTWindow * win,char * name ); | |
219 extern void wsVisibleWindow( wsTWindow * win,int show ); | |
220 extern void wsWindowDecoration( wsTWindow * win,long d ); | |
221 extern void wsFullScreen( wsTWindow * win ); | |
222 extern void wsPostRedisplay( wsTWindow * win ); | |
223 extern void wsSetShape( wsTWindow * win,char * data ); | |
224 | |
225 // ---------------------------------------------------------------------------------------------- | |
226 // Draw string at x,y with fc ( foreground color ) and bc ( background color ). | |
227 // ---------------------------------------------------------------------------------------------- | |
228 extern void wsDrawString( wsTWindow win,int x,int y,char * str,int fc,int bc ); | |
229 extern int wsTextWidth( wsTWindow win,char * str ); | |
230 | |
231 // ---------------------------------------------------------------------------------------------- | |
232 // Show / hide mouse cursor. | |
233 // ---------------------------------------------------------------------------------------------- | |
234 extern void wsVisibleMouse( wsTWindow * win,int m ); | |
235 extern void wsSetMousePosition( wsTWindow * win,int x, int y ); | |
236 | |
237 // ---------------------------------------------------------------------------------------------- | |
238 // Image handling | |
239 // ---------------------------------------------------------------------------------------------- | |
1858
88a88d0a3f94
fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents:
1853
diff
changeset
|
240 extern void wsCreateImage( wsTWindow * win,int Width,int Height ); |
1693 | 241 extern void wsConvert( wsTWindow * win,unsigned char * Image,unsigned int Size ); |
242 extern void wsPutImage( wsTWindow * win ); | |
1858
88a88d0a3f94
fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents:
1853
diff
changeset
|
243 extern void wsResizeImage( wsTWindow * win,int Width,int Height ); |
1693 | 244 extern void wsDestroyImage( wsTWindow * win ); |
245 extern int wsGetOutMask( void ); | |
246 | |
247 extern void wsScreenSaverOn( Display *mDisplay ); | |
248 extern void wsScreenSaverOff( Display * mDisplay ); | |
249 | |
2082 | 250 #endif |
251 |