revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-hosted / hidd / sdl / sdl_hostlib.h
blobc3c3bba94d30f5eb997d25ed8921d5581963fe68
1 /*
2 * sdl.hidd - SDL graphics/sound/keyboard for AROS hosted
3 * Copyright (c) 2007 Robert Norris. All rights reserved.
4 * Copyright (c) 2007-2011 The AROS Development Team
6 * This program is free software; you can redistribute it and/or modify it
7 * under the same terms as AROS itself.
8 */
10 #define timeval sys_timeval
11 #include "SDL_platform.h"
12 #include "SDL_config.h"
13 #undef HAVE_CTYPE_H
14 #undef HAVE_ICONV_H
15 #undef HAVE_ICONV
16 #include "SDL.h"
17 #undef timeval
19 #include <exec/semaphores.h>
20 #include <proto/hostlib.h>
22 struct sdl_funcs
24 char * (*SDL_GetError) (void);
25 char * (*SDL_VideoDriverName) (char *namebuf, int maxlen);
26 SDL_Surface * (*SDL_GetVideoSurface) (void);
27 const SDL_VideoInfo * (*SDL_GetVideoInfo) (void);
28 SDL_Rect ** (*SDL_ListModes) (SDL_PixelFormat *format, Uint32 flags);
29 SDL_Surface * (*SDL_SetVideoMode) (int width, int height, int bpp, Uint32 flags);
30 void (*SDL_UpdateRect) (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
31 int (*SDL_SetColors) (SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);
32 SDL_Surface * (*SDL_CreateRGBSurface) (Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
33 SDL_Surface * (*SDL_CreateRGBSurfaceFrom) (void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
34 void (*SDL_FreeSurface) (SDL_Surface *surface);
35 int (*SDL_LockSurface) (SDL_Surface *surface);
36 void (*SDL_UnlockSurface) (SDL_Surface *surface);
37 int (*SDL_UpperBlit) (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
38 int (*SDL_FillRect) (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
39 void (*SDL_WM_SetCaption) (const char *title, const char *icon);
40 void (*SDL_WM_SetIcon) (SDL_Surface *icon, Uint8 *mask);
41 int (*SDL_ShowCursor) (int toggle);
42 void (*SDL_PumpEvents) (void);
43 int (*SDL_PeepEvents) (SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask);
44 const SDL_version * (*SDL_Linked_Version) (void);
45 int (*SDL_Init) (Uint32 flags);
46 void (*SDL_Quit) (void);
49 extern struct sdl_funcs sdl_funcs;
51 #define SDL_SOFILE "libSDL.so"
52 #define SDL_DYLIBFILE "libSDL.dylib"
53 #define SDL_DLLFILE "SDL.dll"
55 #define S(name, ...) \
56 ({ \
57 HostLib_Lock(); \
58 int __sdlret = sdl_funcs.name(__VA_ARGS__); \
59 HostLib_Unlock(); \
60 __sdlret; \
63 #define SP(name, ...) \
64 ({ \
65 HostLib_Lock(); \
66 const void *__sdlret = sdl_funcs.name(__VA_ARGS__); \
67 HostLib_Unlock(); \
68 (void *)__sdlret; \
71 #define SV(name, ...) \
72 do { \
73 HostLib_Lock(); \
74 sdl_funcs.name(__VA_ARGS__); \
75 HostLib_Unlock(); \
76 } while (0)
78 struct sdlhidd;
80 int sdl_hostlib_init(struct sdlhidd *LIBBASE);
81 int sdl_hostlib_expunge(struct sdlhidd *LIBBASE);