wip prep commit in lieu of gfx subsystem update changes.
[AROS.git] / arch / all-hosted / hidd / sdl / sdl_intern.h
blobe5dc4194b20d12eeaf1f10207468a92cb42628f1
1 /*
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.
8 */
10 #ifndef SDL_INTERN_H
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>
17 #include <oop/oop.h>
18 #include <hidd/gfx.h>
19 #include <hidd/mouse.h>
21 #include "sdl_hostlib.h"
23 #define CLID_Hidd_Gfx_SDL "hidd.gfx.sdl"
24 #define IID_Hidd_Gfx_SDL "hidd.gfx.sdl"
26 struct gfxdata
28 OOP_Object *shownbm; /* Currently shown bitmap object */
29 OOP_Object *framebuffer; /* Framebuffer bitmap object */
32 #define IID_Hidd_BitMap_SDL "hidd.bitmap.sdl"
34 enum
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)
44 struct bmdata {
45 SDL_Surface *surface;
46 BOOL is_onscreen;
49 #define IID_Hidd_Mouse_SDL "hidd.mouse.sdl"
51 struct mousedata {
52 VOID (*callback)(APTR, struct pHidd_Mouse_Event *);
53 APTR callbackdata;
56 enum {
57 moHidd_Mouse_SDL_HandleEvent
60 struct pHidd_Mouse_SDL_HandleEvent {
61 OOP_MethodID mID;
62 SDL_Event *e;
65 VOID Hidd_Mouse_SDL_HandleEvent(OOP_Object *o, SDL_Event *e);
67 #define IID_Hidd_Kbd_SDL "hidd.kbd.sdl"
69 struct kbddata {
70 VOID (*callback)(APTR, UWORD);
71 APTR callbackdata;
74 enum {
75 moHidd_Kbd_SDL_HandleEvent
78 struct pHidd_Kbd_SDL_HandleEvent {
79 OOP_MethodID mID;
80 SDL_Event *e;
83 VOID Hidd_Kbd_SDL_HandleEvent(OOP_Object *o, SDL_Event *e);
85 struct sdlhidd
87 APTR sdl_handle;
89 SDL_Surface *icon;
91 OOP_Class *basebm; /* baseclass for CreateObject */
93 OOP_Class *gfxclass;
94 OOP_Class *bmclass;
95 OOP_Class *mouseclass;
96 OOP_Class *kbdclass;
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;
106 OOP_Object *kbdhidd;
108 UBYTE keycode[SDLK_LAST];
110 BOOL use_hwsurface;
111 BOOL use_fullscreen;
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);
133 #endif