src/video/wayland/SDL_waylanddyn.h
changeset 8104 2e4f1bd21196
child 8113 9fa492281bc9
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/video/wayland/SDL_waylanddyn.h	Thu Jan 09 13:56:21 2014 -0300
     1.3 @@ -0,0 +1,103 @@
     1.4 +/*
     1.5 +  Simple DirectMedia Layer
     1.6 +  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
     1.7 +
     1.8 +  This software is provided 'as-is', without any express or implied
     1.9 +  warranty.  In no event will the authors be held liable for any damages
    1.10 +  arising from the use of this software.
    1.11 +
    1.12 +  Permission is granted to anyone to use this software for any purpose,
    1.13 +  including commercial applications, and to alter it and redistribute it
    1.14 +  freely, subject to the following restrictions:
    1.15 +
    1.16 +  1. The origin of this software must not be misrepresented; you must not
    1.17 +     claim that you wrote the original software. If you use this software
    1.18 +     in a product, an acknowledgment in the product documentation would be
    1.19 +     appreciated but is not required.
    1.20 +  2. Altered source versions must be plainly marked as such, and must not be
    1.21 +     misrepresented as being the original software.
    1.22 +  3. This notice may not be removed or altered from any source distribution.
    1.23 +*/
    1.24 +
    1.25 +#ifndef _SDL_waylanddyn_h
    1.26 +#define _SDL_waylanddyn_h
    1.27 +
    1.28 +#include "../../SDL_internal.h"
    1.29 +
    1.30 +/* We can't include wayland-client.h here 
    1.31 + * but we need some structs from it
    1.32 + */
    1.33 +struct wl_interface;
    1.34 +struct wl_proxy;
    1.35 +struct wl_event_queue;
    1.36 +struct wl_display;
    1.37 +struct wl_surface;
    1.38 +struct wl_shm;
    1.39 +
    1.40 +#include <stdint.h>
    1.41 +#include "wayland-cursor.h"
    1.42 +#include "wayland-util.h"
    1.43 +#include "xkbcommon/xkbcommon.h"
    1.44 +
    1.45 +#ifdef __cplusplus
    1.46 +extern "C"
    1.47 +{
    1.48 +#endif
    1.49 +
    1.50 +int SDL_WAYLAND_LoadSymbols(void);
    1.51 +void SDL_WAYLAND_UnloadSymbols(void);
    1.52 +
    1.53 +#define SDL_WAYLAND_MODULE(modname) extern int SDL_WAYLAND_HAVE_##modname;
    1.54 +#define SDL_WAYLAND_SYM(rc,fn,params) \
    1.55 +    typedef rc (*SDL_DYNWAYLANDFN_##fn) params; \
    1.56 +    extern SDL_DYNWAYLANDFN_##fn WAYLAND_##fn;
    1.57 +#define SDL_WAYLAND_INTERFACE(iface) extern const struct wl_interface *WAYLAND_##iface;
    1.58 +#include "SDL_waylandsym.h"
    1.59 +#undef SDL_WAYLAND_MODULE
    1.60 +#undef SDL_WAYLAND_SYM
    1.61 +#undef SDL_WAYLAND_INTERFACE
    1.62 + 
    1.63 +
    1.64 +#ifdef __cplusplus
    1.65 +}
    1.66 +#endif
    1.67 +
    1.68 +#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
    1.69 +
    1.70 +#ifdef _WAYLAND_CLIENT_H
    1.71 +#error Do not include wayland-client ahead of SDL_waylanddyn.h in dynamic loading mode
    1.72 +#endif
    1.73 +
    1.74 +/* wayland-client-protocol.h included from wayland-client.h
    1.75 + * has inline functions that require these to be defined in dynamic loading mode
    1.76 + */
    1.77 +
    1.78 +#define wl_proxy_create (*WAYLAND_wl_proxy_create)
    1.79 +#define wl_proxy_destroy (*WAYLAND_wl_proxy_destroy)
    1.80 +#define wl_proxy_marshal (*WAYLAND_wl_proxy_marshal)
    1.81 +#define wl_proxy_set_user_data (*WAYLAND_wl_proxy_set_user_data)
    1.82 +#define wl_proxy_get_user_data (*WAYLAND_wl_proxy_get_user_data)
    1.83 +#define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener)
    1.84 +
    1.85 +#define wl_seat_interface (*WAYLAND_wl_seat_interface)
    1.86 +#define wl_surface_interface (*WAYLAND_wl_surface_interface)
    1.87 +#define wl_shm_pool_interface (*WAYLAND_wl_shm_pool_interface)
    1.88 +#define wl_buffer_interface (*WAYLAND_wl_buffer_interface)
    1.89 +#define wl_registry_interface (*WAYLAND_wl_registry_interface)
    1.90 +#define wl_shell_surface_interface (*WAYLAND_wl_shell_surface_interface)
    1.91 +#define wl_region_interface (*WAYLAND_wl_region_interface)
    1.92 +#define wl_pointer_interface (*WAYLAND_wl_pointer_interface)
    1.93 +#define wl_keyboard_interface (*WAYLAND_wl_keyboard_interface)
    1.94 +#define wl_compositor_interface (*WAYLAND_wl_compositor_interface)
    1.95 +#define wl_output_interface (*WAYLAND_wl_output_interface)
    1.96 +#define wl_shell_interface (*WAYLAND_wl_shell_interface)
    1.97 +#define wl_shm_interface (*WAYLAND_wl_shm_interface)
    1.98 +
    1.99 +#endif /* SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */
   1.100 +
   1.101 +#include "wayland-client.h"
   1.102 +#include "wayland-egl.h"
   1.103 +
   1.104 +#endif /* !defined _SDL_waylanddyn_h */
   1.105 +
   1.106 +/* vi: set ts=4 sw=4 expandtab: */