2 * sdl.hidd - SDL graphics/sound/keyboard for AROS hosted
3 * Copyright (c) 2007 Robert Norris. All rights reserved.
4 * Copyright (c) 2010-2015 The AROS Development Team. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the same terms as AROS itself.
11 #define SDL_INTERN_H 1
13 #include <exec/types.h>
14 #include <exec/tasks.h>
15 #include <exec/libraries.h>
16 #include <exec/semaphores.h>
18 #include <hidd/graphics.h>
19 #include <hidd/mouse.h>
21 #include "sdl_hostlib.h"
23 #define CLID_Hidd_SDLGfx "hidd.gfx.sdl"
24 #define IID_Hidd_SDLGFX "hidd.gfx.sdl"
28 OOP_Object
*shownbm
; /* Currently shown bitmap object */
29 OOP_Object
*framebuffer
; /* Framebuffer bitmap object */
32 #define IID_Hidd_SDLBitMap "hidd.bitmap.sdl"
36 aoHidd_SDLBitMap_Surface
,
37 num_Hidd_SDLBitMap_Attrs
40 #define aHidd_SDLBitMap_Surface (((ULONG) HiddSDLBitMapAttrBase) + aoHidd_SDLBitMap_Surface)
42 #define SDLBM_ATTR(id) ((id)-HiddSDLBitMapAttrBase)
49 #define IID_Hidd_SDLMouse "hidd.mouse.sdl"
52 VOID (*callback
)(APTR
, struct pHidd_Mouse_Event
*);
57 moHidd_SDLMouse_HandleEvent
60 struct pHidd_SDLMouse_HandleEvent
{
65 VOID
Hidd_SDLMouse_HandleEvent(OOP_Object
*o
, SDL_Event
*e
);
67 #define IID_Hidd_SDLKbd "hidd.kbd.sdl"
70 VOID (*callback
)(APTR
, UWORD
);
75 moHidd_SDLKbd_HandleEvent
78 struct pHidd_SDLKbd_HandleEvent
{
83 VOID
Hidd_SDLKbd_HandleEvent(OOP_Object
*o
, SDL_Event
*e
);
91 OOP_Class
*basebm
; /* baseclass for CreateObject */
95 OOP_Class
*mouseclass
;
98 struct Task
*eventtask
;
99 /* Object instance would be a better place for this, but event handler task gets
100 only pointer to this structure. Anyway there can be only one SDL display in
101 the system, so this will do. */
102 void (*cb
)(void *data
, void *bm
); /* Display activation callback function */
103 void *cbdata
; /* User data for activation callback */
105 OOP_Object
*mousehidd
;
108 UBYTE keycode
[SDLK_LAST
];
114 #define LIBBASETYPEPTR struct sdlhidd *
116 /* Class descriptors */
117 extern struct OOP_InterfaceDescr SDLGfx_ifdescr
[];
118 extern struct OOP_InterfaceDescr SDLBitMap_ifdescr
[];
119 extern struct OOP_InterfaceDescr SDLMouse_ifdescr
[];
120 extern struct OOP_InterfaceDescr SDLKbd_ifdescr
[];
122 extern OOP_AttrBase MetaAttrBase
;
123 extern OOP_AttrBase HiddAttrBase
;
124 extern OOP_AttrBase HiddSDLBitMapAttrBase
;
126 extern struct sdlhidd xsd
;
128 void sdl_keymap_init(LIBBASETYPEPTR LIBBASE
);
129 int sdl_hidd_init(LIBBASETYPEPTR LIBBASE
);
130 int sdl_event_init(LIBBASETYPEPTR LIBBASE
);
131 void sdl_event_expunge(LIBBASETYPEPTR LIBBASE
);