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