5 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 Desc: Linux hidd for AROS
13 # include <exec/types.h>
15 #ifndef EXEC_LIBRARIES_H
16 # include <exec/libraries.h>
18 #ifndef EXEC_SEMAPHORES_H
19 # include <exec/semaphores.h>
22 # include <dos/bptr.h>
27 #ifndef HIDD_GRAPHICS_H
28 # include <hidd/graphics.h>
31 /* hack: prevent linux include header <bits/time.h> to re-define timeval struct */
32 # define _STRUCT_TIMEVAL 1
38 #define BUFFERED_VRAM 1
40 /* Private Attrs and methods for the X11Gfx Hidd */
42 #define CLID_Hidd_LinuxFB "hidd.gfx.linuxfb"
44 #define IID_Hidd_LinuxFB "hidd.gfx.linuxfb"
47 #define HiddLinuxFBAttrBase __abHidd_LinuxFB
48 extern OOP_AttrBase HiddLinuxFBAttrBase
;
52 num_Hidd_LinuxFB_Attrs
56 /***** Linux Kbd HIDD *******************/
59 #define IID_Hidd_LinuxKbd "hidd.kbd.linux"
60 #define CLID_Hidd_LinuxKbd "hidd.kbd.linux"
65 moHidd_LinuxKbd_HandleEvent
68 struct pHidd_LinuxKbd_HandleEvent
73 VOID
HIDD_LinuxKbd_HandleEvent(OOP_Object
*o
, UBYTE scanCode
);
78 VOID (*kbd_callback
)(APTR
, UWORD
);
83 /***** Linux Mouse HIDD *******************/
86 #define IID_Hidd_LinuxMouse "hidd.mouse.linux"
87 #define CLID_Hidd_LinuxMouse "hidd.mouse.linux"
93 moHidd_LinuxMouse_HandleEvent
96 struct pHidd_LinuxMouse_HandleEvent
99 struct pHidd_Mouse_Event
*mouseEvent
;
102 VOID
HIDD_LinuxMouse_HandleEvent(OOP_Object
*o
, struct pHidd_Mouse_Event
*mouseEvent
);
107 VOID (*mouse_callback
)(APTR
, struct pHidd_Mouse_Event
*);
111 /*** Shared data ***/
112 struct linux_staticdata
{
113 struct SignalSemaphore sema
;
118 OOP_Class
*mouseclass
;
120 /* The device file */
122 struct fb_fix_screeninfo fsi
;
123 struct fb_var_screeninfo vsi
;
125 HIDDT_PixelFormat pf
;
135 struct Task
*input_task
;
137 OOP_Object
*mousehidd
;
139 struct SignalSemaphore framebufferlock
;
145 struct Library library
;
146 struct linux_staticdata lsd
;
149 struct Task
*init_linuxinput_task(struct linux_staticdata
*lsd
);
150 VOID
kill_linuxinput_task(struct linux_staticdata
*lsd
);
152 BOOL
init_linuxkbd(struct linux_staticdata
*lsd
);
153 VOID
cleanup_linuxkbd(struct linux_staticdata
*lsd
);
155 BOOL
init_linuxmouse(struct linux_staticdata
*lsd
);
156 VOID
cleanup_linuxmouse(struct linux_staticdata
*lsd
);
160 VOID
fbRefreshArea(struct BitmapData
*data
, LONG x1
, LONG y1
, LONG x2
, LONG y2
);
163 #define LOCK_FRAMEBUFFER(lsd) ObtainSemaphore(&lsd->framebufferlock)
164 #define UNLOCK_FRAMEBUFFER(lsd) ReleaseSemaphore(&lsd->framebufferlock)
167 #define LSD(cl) (&((struct linux_base *)cl->UserData)->lsd)
169 #endif /* LINUX_INTERN_H */