#ifndef SDL_waylandtouch_h_
#define SDL_waylandtouch_h_
#include "../../SDL_internal.h"
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
#include "SDL_waylandvideo.h"
#include <stdint.h>
#include <stddef.h>
#include "wayland-util.h"
void Wayland_touch_create(SDL_VideoData *data, uint32_t id);
void Wayland_touch_destroy(SDL_VideoData *data);
struct qt_touch_extension;
struct wl_client;
struct wl_resource;
struct qt_surface_extension;
struct qt_extended_surface;
extern const struct wl_interface qt_surface_extension_interface;
extern const struct wl_interface qt_extended_surface_interface;
#define QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE 0
static inline void
qt_surface_extension_set_user_data(struct qt_surface_extension *qt_surface_extension, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) qt_surface_extension, user_data);
}
static inline void *
qt_surface_extension_get_user_data(struct qt_surface_extension *qt_surface_extension)
{
return wl_proxy_get_user_data((struct wl_proxy *) qt_surface_extension);
}
static inline void
qt_surface_extension_destroy(struct qt_surface_extension *qt_surface_extension)
{
WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_surface_extension);
}
static inline struct qt_extended_surface *
qt_surface_extension_get_extended_surface(struct qt_surface_extension *qt_surface_extension, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_create((struct wl_proxy *) qt_surface_extension,
&qt_extended_surface_interface);
if (!id)
return NULL;
WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_surface_extension,
QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE, id, surface);
return (struct qt_extended_surface *) id;
}
#ifndef QT_EXTENDED_SURFACE_ORIENTATION_ENUM
#define QT_EXTENDED_SURFACE_ORIENTATION_ENUM
enum qt_extended_surface_orientation {
QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION = 0,
QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION = 1,
QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION = 2,
QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION = 4,
QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION = 8,
};
#endif
#ifndef QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM
#define QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM
enum qt_extended_surface_windowflag {
QT_EXTENDED_SURFACE_WINDOWFLAG_OVERRIDESSYSTEMGESTURES = 1,
QT_EXTENDED_SURFACE_WINDOWFLAG_STAYSONTOP = 2,
};
#endif
struct qt_extended_surface_listener {
void (*onscreen_visibility)(void *data,
struct qt_extended_surface *qt_extended_surface,
int32_t visible);
void (*set_generic_property)(void *data,
struct qt_extended_surface *qt_extended_surface,
const char *name,
struct wl_array *value);
void (*close)(void *data,
struct qt_extended_surface *qt_extended_surface);
};
static inline int
qt_extended_surface_add_listener(struct qt_extended_surface *qt_extended_surface,
const struct qt_extended_surface_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) qt_extended_surface,
(void (**)(void)) listener, data);
}
#define QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY 0
#define QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION 1
#define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS 2
static inline void
qt_extended_surface_set_user_data(struct qt_extended_surface *qt_extended_surface, void *user_data)
{
WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_extended_surface, user_data);
}
static inline void *
qt_extended_surface_get_user_data(struct qt_extended_surface *qt_extended_surface)
{
return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_extended_surface);
}
static inline void
qt_extended_surface_destroy(struct qt_extended_surface *qt_extended_surface)
{
WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_extended_surface);
}
static inline void
qt_extended_surface_update_generic_property(struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value)
{
WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY, name, value);
}
static inline void
qt_extended_surface_set_content_orientation(struct qt_extended_surface *qt_extended_surface, int32_t orientation)
{
WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION, orientation);
}
static inline void
qt_extended_surface_set_window_flags(struct qt_extended_surface *qt_extended_surface, int32_t flags)
{
WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS, flags);
}
extern const struct wl_interface qt_touch_extension_interface;
#ifndef QT_TOUCH_EXTENSION_FLAGS_ENUM
#define QT_TOUCH_EXTENSION_FLAGS_ENUM
enum qt_touch_extension_flags {
QT_TOUCH_EXTENSION_FLAGS_MOUSE_FROM_TOUCH = 0x1,
};
#endif
struct qt_touch_extension_listener {
void (*touch)(void *data,
struct qt_touch_extension *qt_touch_extension,
uint32_t time,
uint32_t id,
uint32_t state,
int32_t x,
int32_t y,
int32_t normalized_x,
int32_t normalized_y,
int32_t width,
int32_t height,
uint32_t pressure,
int32_t velocity_x,
int32_t velocity_y,
uint32_t flags,
struct wl_array *rawdata);
void (*configure)(void *data,
struct qt_touch_extension *qt_touch_extension,
uint32_t flags);
};
static inline int
qt_touch_extension_add_listener(struct qt_touch_extension *qt_touch_extension,
const struct qt_touch_extension_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) qt_touch_extension,
(void (**)(void)) listener, data);
}
#define QT_TOUCH_EXTENSION_DUMMY 0
static inline void
qt_touch_extension_set_user_data(struct qt_touch_extension *qt_touch_extension, void *user_data)
{
WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_touch_extension, user_data);
}
static inline void *
qt_touch_extension_get_user_data(struct qt_touch_extension *qt_touch_extension)
{
return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_touch_extension);
}
static inline void
qt_touch_extension_destroy(struct qt_touch_extension *qt_touch_extension)
{
WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_touch_extension);
}
static inline void
qt_touch_extension_dummy(struct qt_touch_extension *qt_touch_extension)
{
WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_touch_extension,
QT_TOUCH_EXTENSION_DUMMY);
}
extern const struct wl_interface qt_windowmanager_interface;
struct qt_windowmanager_listener {
void (*hints)(void *data,
struct qt_windowmanager *qt_windowmanager,
int32_t show_is_fullscreen);
void (*quit)(void *data,
struct qt_windowmanager *qt_windowmanager);
};
static inline int
qt_windowmanager_add_listener(struct qt_windowmanager *qt_windowmanager,
const struct qt_windowmanager_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) qt_windowmanager,
(void (**)(void)) listener, data);
}
#define QT_WINDOWMANAGER_OPEN_URL 0
static inline void
qt_windowmanager_set_user_data(struct qt_windowmanager *qt_windowmanager, void *user_data)
{
WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_windowmanager, user_data);
}
static inline void *
qt_windowmanager_get_user_data(struct qt_windowmanager *qt_windowmanager)
{
return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_windowmanager);
}
static inline void
qt_windowmanager_destroy(struct qt_windowmanager *qt_windowmanager)
{
WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_windowmanager);
}
static inline void
qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t remaining, const char *url)
{
WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_windowmanager,
QT_WINDOWMANAGER_OPEN_URL, remaining, url);
}
#endif
#endif