make the linux-ppc packags be in synch with other platforms
[tangerine.git] / arch / all-linux / hidd / linux_intern.h
blobf1d1ae818b58f17be68c9d4f9e139b9e78c897b0
1 #ifndef LINUX_INTERN_H
2 #define LINUX_INTERN_H
4 /*
5 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Linux hidd for AROS
9 Lang: English.
12 #ifndef EXEC_TYPES_H
13 # include <exec/types.h>
14 #endif
15 #ifndef EXEC_LIBRARIES_H
16 # include <exec/libraries.h>
17 #endif
18 #ifndef EXEC_SEMAPHORES_H
19 # include <exec/semaphores.h>
20 #endif
21 #ifndef DOS_BPTR_H
22 # include <dos/bptr.h>
23 #endif
24 #ifndef OOP_OOP_H
25 # include <oop/oop.h>
26 #endif
27 #ifndef HIDD_GRAPHICS_H
28 # include <hidd/graphics.h>
29 #endif
31 /* hack: prevent linux include header <bits/time.h> to re-define timeval struct */
32 # define _STRUCT_TIMEVAL 1
34 #include <linux/fb.h>
35 #include <linux/kd.h>
36 #include <termio.h>
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;
50 enum {
52 num_Hidd_LinuxFB_Attrs
56 /***** Linux Kbd HIDD *******************/
58 /* IDs */
59 #define IID_Hidd_LinuxKbd "hidd.kbd.linux"
60 #define CLID_Hidd_LinuxKbd "hidd.kbd.linux"
62 /* Methods */
63 enum
65 moHidd_LinuxKbd_HandleEvent
68 struct pHidd_LinuxKbd_HandleEvent
70 OOP_MethodID mID;
71 UBYTE scanCode;
73 VOID HIDD_LinuxKbd_HandleEvent(OOP_Object *o, UBYTE scanCode);
75 /* Data */
76 struct linuxkbd_data
78 VOID (*kbd_callback)(APTR, UWORD);
79 APTR callbackdata;
83 /***** Linux Mouse HIDD *******************/
85 /* IDs */
86 #define IID_Hidd_LinuxMouse "hidd.mouse.linux"
87 #define CLID_Hidd_LinuxMouse "hidd.mouse.linux"
90 /* Methods */
91 enum
93 moHidd_LinuxMouse_HandleEvent
96 struct pHidd_LinuxMouse_HandleEvent
98 OOP_MethodID mID;
99 struct pHidd_Mouse_Event *mouseEvent;
102 VOID HIDD_LinuxMouse_HandleEvent(OOP_Object *o, struct pHidd_Mouse_Event *mouseEvent);
104 /* Data */
105 struct mouse_data
107 VOID (*mouse_callback)(APTR, struct pHidd_Mouse_Event *);
108 APTR callbackdata;
111 /*** Shared data ***/
112 struct linux_staticdata {
113 struct SignalSemaphore sema;
115 OOP_Class *gfxclass;
116 OOP_Class *bmclass;
117 OOP_Class *kbdclass;
118 OOP_Class *mouseclass;
120 /* The device file */
121 int fbdev;
122 struct fb_fix_screeninfo fsi;
123 struct fb_var_screeninfo vsi;
125 HIDDT_PixelFormat pf;
127 char *baseaddr;
129 BOOL kbd_inited;
130 int kbdfd;
132 BOOL mouse_inited;
133 int mousefd;
135 struct Task *input_task;
136 OOP_Object *kbdhidd;
137 OOP_Object *mousehidd;
138 #if BUFFERED_VRAM
139 struct SignalSemaphore framebufferlock;
140 #endif
143 struct linux_base
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);
158 struct BitmapData;
160 VOID fbRefreshArea(struct BitmapData *data, LONG x1, LONG y1, LONG x2, LONG y2);
162 #if BUFFERED_VRAM
163 #define LOCK_FRAMEBUFFER(lsd) ObtainSemaphore(&lsd->framebufferlock)
164 #define UNLOCK_FRAMEBUFFER(lsd) ReleaseSemaphore(&lsd->framebufferlock)
165 #endif
167 #define LSD(cl) (&((struct linux_base *)cl->UserData)->lsd)
169 #endif /* LINUX_INTERN_H */