src/video/wayland/SDL_waylanddyn.h
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 30 Oct 2016 21:01:33 +0100
changeset 10563 e3d84016cb79
parent 10303 b326f93e1bc5
child 10583 974f8ebcb819
permissions -rw-r--r--
Fixed outdated info in README.
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 
    22 #ifndef _SDL_waylanddyn_h
    23 #define _SDL_waylanddyn_h
    24 
    25 #include "../../SDL_internal.h"
    26 
    27 /* We can't include wayland-client.h here 
    28  * but we need some structs from it
    29  */
    30 struct wl_interface;
    31 struct wl_proxy;
    32 struct wl_event_queue;
    33 struct wl_display;
    34 struct wl_surface;
    35 struct wl_shm;
    36 
    37 #include <stdint.h>
    38 #include "wayland-cursor.h"
    39 #include "wayland-util.h"
    40 #include "xkbcommon/xkbcommon.h"
    41 
    42 #ifdef __cplusplus
    43 extern "C"
    44 {
    45 #endif
    46 
    47 int SDL_WAYLAND_LoadSymbols(void);
    48 void SDL_WAYLAND_UnloadSymbols(void);
    49 
    50 #define SDL_WAYLAND_MODULE(modname) extern int SDL_WAYLAND_HAVE_##modname;
    51 #define SDL_WAYLAND_SYM(rc,fn,params) \
    52     typedef rc (*SDL_DYNWAYLANDFN_##fn) params; \
    53     extern SDL_DYNWAYLANDFN_##fn WAYLAND_##fn;
    54 #define SDL_WAYLAND_INTERFACE(iface) extern const struct wl_interface *WAYLAND_##iface;
    55 #include "SDL_waylandsym.h"
    56 
    57 
    58 #ifdef __cplusplus
    59 }
    60 #endif
    61 
    62 #ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
    63 
    64 #ifdef _WAYLAND_CLIENT_H
    65 #error Do not include wayland-client ahead of SDL_waylanddyn.h in dynamic loading mode
    66 #endif
    67 
    68 /* wayland-client-protocol.h included from wayland-client.h
    69  * has inline functions that require these to be defined in dynamic loading mode
    70  */
    71 
    72 #define wl_proxy_create (*WAYLAND_wl_proxy_create)
    73 #define wl_proxy_destroy (*WAYLAND_wl_proxy_destroy)
    74 #define wl_proxy_marshal (*WAYLAND_wl_proxy_marshal)
    75 #define wl_proxy_set_user_data (*WAYLAND_wl_proxy_set_user_data)
    76 #define wl_proxy_get_user_data (*WAYLAND_wl_proxy_get_user_data)
    77 #define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener)
    78 #define wl_proxy_marshal_constructor (*WAYLAND_wl_proxy_marshal_constructor)
    79 #define wl_proxy_marshal_constructor_versioned (*WAYLAND_wl_proxy_marshal_constructor_versioned)
    80 
    81 #define wl_seat_interface (*WAYLAND_wl_seat_interface)
    82 #define wl_surface_interface (*WAYLAND_wl_surface_interface)
    83 #define wl_shm_pool_interface (*WAYLAND_wl_shm_pool_interface)
    84 #define wl_buffer_interface (*WAYLAND_wl_buffer_interface)
    85 #define wl_registry_interface (*WAYLAND_wl_registry_interface)
    86 #define wl_shell_surface_interface (*WAYLAND_wl_shell_surface_interface)
    87 #define wl_region_interface (*WAYLAND_wl_region_interface)
    88 #define wl_pointer_interface (*WAYLAND_wl_pointer_interface)
    89 #define wl_keyboard_interface (*WAYLAND_wl_keyboard_interface)
    90 #define wl_compositor_interface (*WAYLAND_wl_compositor_interface)
    91 #define wl_output_interface (*WAYLAND_wl_output_interface)
    92 #define wl_shell_interface (*WAYLAND_wl_shell_interface)
    93 #define wl_shm_interface (*WAYLAND_wl_shm_interface)
    94 
    95 #endif /* SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */
    96 
    97 #include "wayland-client-core.h"
    98 #include "wayland-client-protocol.h"
    99 #include "wayland-egl.h"
   100 
   101 #endif /* !defined _SDL_waylanddyn_h */
   102 
   103 /* vi: set ts=4 sw=4 expandtab: */