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