SDL 2.0
SDL_waylanddatamanager.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2019 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#include "../../SDL_internal.h"
23
24#ifndef SDL_waylanddatamanager_h_
25#define SDL_waylanddatamanager_h_
26
27#include "SDL_waylandvideo.h"
28#include "SDL_waylandwindow.h"
29
30#define TEXT_MIME "text/plain;charset=utf-8"
31#define FILE_MIME "text/uri-list"
32
33typedef struct {
34 char *mime_type;
35 void *data;
36 size_t length;
37 struct wl_list link;
39
40typedef struct {
41 struct wl_data_source *source;
42 struct wl_list mimes;
44
45typedef struct {
46 struct wl_data_offer *offer;
47 struct wl_list mimes;
50
51typedef struct {
52 struct wl_data_device *data_device;
54
55 /* Drag and Drop */
59
60 /* Clipboard */
64
65extern const char* Wayland_convert_mime_type(const char *mime_type);
66
67/* Wayland Data Source - (Sending) */
70 const char *mime_type, int fd);
72 const char *mime_type,
73 const void *buffer,
74 size_t length);
76 const char *mime_type);
78 size_t *length,
79 const char *mime_type,
80 SDL_bool null_terminate);
82
83/* Wayland Data Offer - (Receiving) */
85 size_t *length,
86 const char *mime_type,
87 SDL_bool null_terminate);
89 const char *mime_type);
91 const char *mime_type);
93
94/* Clipboard */
99 uint32_t serial);
100#endif /* SDL_waylanddatamanager_h_ */
101
102/* vi: set ts=4 sw=4 expandtab: */
103
#define _THIS
unsigned int uint32_t
GLsizei GLsizei GLchar * source
GLuint buffer
GLuint GLsizei GLsizei * length
SDL_bool
Definition: SDL_stdinc.h:162
SDL_bool Wayland_data_source_has_mime(SDL_WaylandDataSource *source, const char *mime_type)
int Wayland_data_device_set_selection(SDL_WaylandDataDevice *device, SDL_WaylandDataSource *source)
void Wayland_data_offer_destroy(SDL_WaylandDataOffer *offer)
void * Wayland_data_source_get_data(SDL_WaylandDataSource *source, size_t *length, const char *mime_type, SDL_bool null_terminate)
ssize_t Wayland_data_source_send(SDL_WaylandDataSource *source, const char *mime_type, int fd)
int Wayland_data_device_clear_selection(SDL_WaylandDataDevice *device)
SDL_WaylandDataSource * Wayland_data_source_create(_THIS)
int Wayland_data_offer_add_mime(SDL_WaylandDataOffer *offer, const char *mime_type)
void Wayland_data_source_destroy(SDL_WaylandDataSource *source)
const char * Wayland_convert_mime_type(const char *mime_type)
SDL_bool Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer, const char *mime_type)
void * Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, size_t *length, const char *mime_type, SDL_bool null_terminate)
int Wayland_data_device_set_serial(SDL_WaylandDataDevice *device, uint32_t serial)
int Wayland_data_source_add_data(SDL_WaylandDataSource *source, const char *mime_type, const void *buffer, size_t length)
GLuint64 GLenum GLint fd
Definition: gl2ext.h:1508
static SDL_AudioDeviceID device
Definition: loopwave.c:37
SDL_WaylandDataOffer * drag_offer
SDL_WaylandDataSource * selection_source
SDL_WaylandDataOffer * selection_offer
struct wl_data_device * data_device
struct wl_data_offer * offer
struct wl_data_source * source