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