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