1 /* this file is all aobut reusing stock SDL's x11 functions */
3 #include "SDL_x11reuse.h"
4 #define SDL_PrivateVideoData SDL_x11_PrivateVideoData
5 #include "../x11/SDL_x11video.h"
7 /* mess from SDL_x11video.h */
14 struct x11reuse_context {
15 SDL_VideoDevice fake_device;
16 struct SDL_x11_PrivateVideoData fake_x11private;
19 struct x11reuse_context *x11reuse_init(void)
21 struct x11reuse_context *retval;
24 ret = SDL_X11_LoadSymbols();
26 fprintf(stderr, "omapsdl: SDL_X11_LoadSymbols failed\n");
30 retval = calloc(1, sizeof(*retval));
34 retval->fake_device.hidden = &retval->fake_x11private;
38 void x11reuse_SetCaption(struct x11reuse_context *context,
39 void *display, int screen, void *window,
40 const char *title, const char *icon)
45 context->fake_x11private.X11_Display =
46 context->fake_x11private.GFX_Display = display;
47 context->fake_x11private.WMwindow = (Window)window;
48 X11_SetCaptionNoLock(&context->fake_device, title, icon);
51 void x11reuse_SetIcon(struct x11reuse_context *context,
52 void *display, int screen, void *window,
53 void *icon, void *mask)
58 context->fake_x11private.X11_Display =
59 context->fake_x11private.GFX_Display = display;
60 context->fake_x11private.WMwindow = (Window)window;
61 X11_SetIcon(&context->fake_device, icon, mask);