Mercurial > mplayer.hg
annotate Gui/wm/ws.h @ 5997:b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
author | pontscho |
---|---|
date | Mon, 06 May 2002 15:05:07 +0000 |
parents | 60cf2bca993f |
children | 39c2bfe5c267 |
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 | |
5919 | 80 #define wsWindowClosed 512 |
1693 | 81 |
82 #define wsNone 0 | |
83 #define wsMapped 1 | |
84 #define wsFocused 2 | |
85 #define wsVisible 3 | |
86 #define wsNotVisible 4 | |
87 #define wsPVisible 5 | |
88 #define wsRolled 6 | |
89 | |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
90 #define wsWMWMW 0 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
91 #define wsWMUnknown 1 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
92 #define wsWMNetWM 2 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
93 #define wsWMKDE 3 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
94 #define wsWMIceWM 4 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
95 #define wsWMBlackBox 5 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
96 #define wsWMGnome 6 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
97 #define wsWMWMaker 7 |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
98 |
1693 | 99 #define wsParamDisplay Display *dpy,Window w |
100 | |
101 typedef void (*wsTReDraw)( wsParamDisplay ); | |
102 typedef void (*wsTReSize)( unsigned int X,unsigned int Y,unsigned int width,unsigned int height ); | |
103 typedef void (*wsTIdle)( void ); | |
104 typedef void (*wsTKeyHandler)( int State,int Type,int Key ); | |
105 typedef void (*wsTMouseHandler)( int Button,int X,int Y,int RX,int RY ); | |
106 typedef void (*wsRemoteHandler)( char * str ); | |
107 | |
108 typedef struct | |
109 { | |
110 Window WindowID; | |
111 Window Parent; | |
112 int X,Y,Width,Height; | |
113 int OldX,OldY,OldWidth,OldHeight; | |
114 int MaxX,MaxY; | |
115 int isFullScreen; | |
116 int BorderWidth; | |
117 int Property; | |
118 unsigned char * bImage; | |
119 XImage * xImage; | |
120 Pixmap Mask; | |
121 int Decorations; | |
122 | |
123 int State; | |
124 int Visible; | |
125 int Mapped; | |
126 int Focused; | |
127 int Rolled; | |
128 | |
129 wsTReDraw ReDraw; | |
130 wsTReSize ReSize; | |
131 wsTIdle Idle; | |
132 wsTKeyHandler KeyHandler; | |
133 wsTMouseHandler MouseHandler; | |
134 wsRemoteHandler RemoteHandler; | |
135 | |
136 int Alt; | |
137 int Shift; | |
138 int Control; | |
139 int NumLock; | |
140 int CapsLock; | |
141 // --- Misc ------------------------------------------------------------------------------------- | |
142 | |
143 Atom AtomDeleteWindow; | |
144 Atom AtomTakeFocus; | |
145 Atom AtomRolle; | |
146 Atom AtomProtocols; | |
147 Atom AtomsProtocols[3]; | |
148 Atom AtomLeaderClient; | |
149 Atom AtomRemote; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
150 Atom AtomWMSizeHint; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2082
diff
changeset
|
151 Atom AtomWMNormalHint; |
1693 | 152 |
153 XShmSegmentInfo Shminfo; | |
154 unsigned char * ImageData; | |
155 unsigned short int * ImageDataw; | |
156 unsigned int * ImageDatadw; | |
157 GC wGC; | |
158 XGCValues wGCV; | |
159 unsigned long WindowMask; | |
160 XVisualInfo VisualInfo; | |
161 XWindowAttributes Attribs; | |
162 XSetWindowAttributes WindowAttrib; | |
163 XSizeHints SizeHint; | |
164 XWMHints WMHints; | |
165 | |
166 XFontStruct * Font; | |
167 int FontHeight; | |
168 | |
169 Cursor wsCursor; | |
170 char wsCursorData[1]; | |
171 Pixmap wsCursorPixmap; | |
172 int wsMouseEventType; | |
173 XColor wsColor; | |
174 } wsTWindow; | |
175 | |
4465 | 176 extern int wsMaxX; |
177 extern int wsMaxY; | |
1693 | 178 |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
179 extern int wsWMType; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
180 |
1693 | 181 extern Display * wsDisplay; |
182 extern int wsScreen; | |
183 extern Window wsRootWin; | |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
184 extern int wsLayer; |
1693 | 185 |
186 extern unsigned char * wsImageData; | |
187 | |
188 extern XEvent wsEvent; | |
189 | |
190 extern int wsDepthOnScreen; | |
191 extern int wsRedMask; | |
192 extern int wsGreenMask; | |
193 extern int wsBlueMask; | |
194 | |
195 extern int wsUseXShm; | |
196 extern int wsUseDGA; | |
197 | |
198 // ---------------------------------------------------------------------------------------------- | |
199 // wsKeyTable | |
200 // ---------------------------------------------------------------------------------------------- | |
201 extern unsigned long wsKeyTable[512]; | |
202 | |
203 extern void wsXDone( void ); | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
204 extern void wsXInit( void* disp ); |
1693 | 205 |
206 extern int wsGetDepthOnScreen( void ); | |
207 | |
208 extern void wsDoExit( void ); | |
209 extern void wsMainLoop( void ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4679
diff
changeset
|
210 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
|
211 extern void wsHandleEvents( void ); |
1693 | 212 |
213 // ---------------------------------------------------------------------------------------------- | |
214 // wsCrateWindow: create a new window on the screen. | |
215 // X,Y : window position | |
216 // wX,hY : window size | |
217 // bW : window frame size | |
218 // cV : mouse cursor visible | |
219 // D : "decoration", visible titlebar, etc ... | |
220 // ---------------------------------------------------------------------------------------------- | |
221 extern void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,unsigned char D,char * label ); | |
222 extern void wsDestroyWindow( wsTWindow * win ); | |
2854 | 223 extern void wsMoveWindow( wsTWindow * win,int b,int x, int y ); |
1693 | 224 extern void wsResizeWindow( wsTWindow * win,int sx, int sy ); |
225 extern void wsIconify( wsTWindow win ); | |
226 extern void wsMoveTopWindow( wsTWindow * win ); | |
227 extern void wsSetBackground( wsTWindow * win,int color ); | |
1814 | 228 extern void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b ); |
1693 | 229 extern void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b ); |
230 #define wsClearWindow( win ); XClearWindow( wsDisplay,win.WindowID ); | |
231 extern void wsSetTitle( wsTWindow * win,char * name ); | |
232 extern void wsVisibleWindow( wsTWindow * win,int show ); | |
233 extern void wsWindowDecoration( wsTWindow * win,long d ); | |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
234 extern void wsSetLayer( Display * wsDisplay,Window win, int layer ); |
1693 | 235 extern void wsFullScreen( wsTWindow * win ); |
236 extern void wsPostRedisplay( wsTWindow * win ); | |
237 extern void wsSetShape( wsTWindow * win,char * data ); | |
238 | |
239 // ---------------------------------------------------------------------------------------------- | |
240 // Draw string at x,y with fc ( foreground color ) and bc ( background color ). | |
241 // ---------------------------------------------------------------------------------------------- | |
242 extern void wsDrawString( wsTWindow win,int x,int y,char * str,int fc,int bc ); | |
243 extern int wsTextWidth( wsTWindow win,char * str ); | |
244 | |
245 // ---------------------------------------------------------------------------------------------- | |
246 // Show / hide mouse cursor. | |
247 // ---------------------------------------------------------------------------------------------- | |
248 extern void wsVisibleMouse( wsTWindow * win,int m ); | |
249 extern void wsSetMousePosition( wsTWindow * win,int x, int y ); | |
250 | |
251 // ---------------------------------------------------------------------------------------------- | |
252 // Image handling | |
253 // ---------------------------------------------------------------------------------------------- | |
1858
88a88d0a3f94
fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents:
1853
diff
changeset
|
254 extern void wsCreateImage( wsTWindow * win,int Width,int Height ); |
1693 | 255 extern void wsConvert( wsTWindow * win,unsigned char * Image,unsigned int Size ); |
256 extern void wsPutImage( wsTWindow * win ); | |
1858
88a88d0a3f94
fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents:
1853
diff
changeset
|
257 extern void wsResizeImage( wsTWindow * win,int Width,int Height ); |
1693 | 258 extern void wsDestroyImage( wsTWindow * win ); |
259 extern int wsGetOutMask( void ); | |
260 | |
261 extern void wsScreenSaverOn( Display *mDisplay ); | |
262 extern void wsScreenSaverOff( Display * mDisplay ); | |
263 | |
2082 | 264 #endif |
265 |