5 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
8 Desc: Include for the x11 HIDD.
13 #ifndef EXEC_LIBRARIES_H
14 # include <exec/libraries.h>
21 #define timeval sys_timeval
23 # include <X11/Xlib.h>
27 # include <X11/Xutil.h>
31 #ifndef EXEC_SEMAPHORES_H
32 # include <exec/semaphores.h>
37 #define X11_LOAD_KEYMAPTABLE 1
39 #include "x11_hostlib.h"
42 /***** X11Mouse HIDD *******************/
45 struct pHidd_Mouse_Event
;
48 VOID (*mouse_callback
)(APTR
, struct pHidd_Mouse_Event
*);
53 #define IID_Hidd_X11Mouse "hidd.mouse.x11"
54 #define CLID_Hidd_X11Mouse "hidd.mouse.x11"
60 moHidd_X11Mouse_HandleEvent
63 struct pHidd_X11Mouse_HandleEvent
69 VOID
Hidd_X11Mouse_HandleEvent(OOP_Object
*o
, XEvent
*event
);
71 /***** X11Kbd HIDD *******************/
76 VOID (*kbd_callback
)(APTR
, UWORD
);
82 #define IID_Hidd_X11Kbd "hidd.kbd.x11"
83 #define CLID_Hidd_X11Kbd "hidd.kbd.x11"
88 moHidd_X11Kbd_HandleEvent
91 struct pHidd_X11Kbd_HandleEvent
97 VOID
Hidd_X11Kbd_HandleEvent(OOP_Object
*o
, XEvent
*event
);
103 struct x11task_params
109 struct x11_staticdata
*xsd
;
121 /* Message used for getting info on when a window has been mapped */
134 struct Message execmsg
;
135 ULONG notify_type
; /* NOTY_xxxx */
138 Window masterxwindow
;
140 /* Only for NOTY_RESIZEWINDOW */
146 struct x11_staticdata
148 struct SignalSemaphore sema
; /* Protecting this whole struct */
149 struct SignalSemaphore x11sema
;
151 /* This port is used for asking the x11 task for notifications
152 on when some event occurs, for example MapNotify
154 struct MsgPort
*x11task_notify_port
;
155 struct MsgPort
*x11task_quit_port
;
156 struct ExecBase
*sysbase
;
164 OOP_Class
*onbmclass
;
165 OOP_Class
*offbmclass
;
166 OOP_Class
*mouseclass
;
170 OOP_Object
*mousehidd
;
174 struct SignalSemaphore shm_sema
; /* singlethread access to shared mem */
175 BOOL use_xshm
; /* May we use Xshm ? */
179 /* This window is used as a frien drawable for pixmaps. The window is
180 never mapped, ie. it is never shown onscreen.
182 Window dummy_window_for_creating_pixmaps
;
189 ULONG depth
; /* Size of pixel in bits */ /* stegerg: was called "size" */
190 ULONG bytes_per_pixel
;
195 Atom delete_win_atom
;
197 Atom clipboard_property_atom
;
198 Atom clipboard_incr_atom
;
199 Atom clipboard_targets_atom
;
202 VOID (*activecallback
)(APTR
, OOP_Object
*, BOOL
);
208 struct MsgPort
*hostclipboardmp
;
209 struct Message
*hostclipboardmsg
;
210 ULONG hostclipboard_readstate
;
211 unsigned char *hostclipboard_incrbuffer
;
212 ULONG hostclipboard_incrbuffer_size
;
213 unsigned char *hostclipboard_writebuffer
;
214 ULONG hostclipboard_writebuffer_size
;
215 Window hostclipboard_writerequest_window
;
216 Atom hostclipboard_writerequest_property
;
217 ULONG hostclipboard_write_chunks
;
222 struct Library library
;
225 struct x11_staticdata xsd
;
228 /* Private instance data for Gfx hidd class */
236 Window fbwin
; /* Frame buffer window */
237 //#if ADJUST_XWIN_SIZE
242 #define HOSTCLIPBOARDSTATE_IDLE 0
243 #define HOSTCLIPBOARDSTATE_READ 1
244 #define HOSTCLIPBOARDSTATE_READ_INCR 2
245 #define HOSTCLIPBOARDSTATE_WRITE 3
247 VOID
get_bitmap_info(struct x11_staticdata
*xsd
, Drawable d
, ULONG
*sz
, ULONG
*bpl
);
249 BOOL
set_pixelformat(struct TagItem
*pftags
, struct x11_staticdata
*xsd
, Drawable d
);
252 OOP_Class
*init_gfxclass ( struct x11_staticdata
* );
253 OOP_Class
*init_onbmclass ( struct x11_staticdata
* );
254 OOP_Class
*init_offbmclass ( struct x11_staticdata
* );
255 OOP_Class
*init_kbdclass ( struct x11_staticdata
* );
256 OOP_Class
*init_mouseclass ( struct x11_staticdata
* );
258 VOID
free_gfxclass ( struct x11_staticdata
* );
259 VOID
free_onbmclass ( struct x11_staticdata
* );
260 VOID
free_offbmclass ( struct x11_staticdata
* );
261 VOID
free_osbmclass ( struct x11_staticdata
* );
262 VOID
free_kbdclass ( struct x11_staticdata
* );
263 VOID
free_mouseclass ( struct x11_staticdata
* );
265 ULONG
x11clipboard_init(struct x11_staticdata
*);
266 VOID
x11clipboard_handle_commands(struct x11_staticdata
*);
267 BOOL
x11clipboard_want_event(XEvent
*);
268 VOID
x11clipboard_handle_event(struct x11_staticdata
*, XEvent
*);
271 #define XSD(cl) (&((struct x11clbase *)cl->UserData)->xsd)
273 /* This lock has two uses:
274 - Making X calls threadsafe.
275 - In the bitmap class, protecting the bimtap X GC from changes
279 #define LOCK_X11 ObtainSemaphore (&XSD(cl)->x11sema);
280 #define UNLOCK_X11 ReleaseSemaphore(&XSD(cl)->x11sema);
282 #endif /* HIDD_X11_H */