SDL  2.0
SDL_waylanddatamanager.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2018 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 
33 typedef struct {
34  char *mime_type;
35  void *data;
36  size_t length;
37  struct wl_list link;
39 
40 typedef struct {
41  struct wl_data_source *source;
42  struct wl_list mimes;
44 
45 typedef struct {
46  struct wl_data_offer *offer;
47  struct wl_list mimes;
48  void *data_device;
50 
51 typedef struct {
52  struct wl_data_device *data_device;
54 
55  /* Drag and Drop */
59 
60  /* Clipboard */
64 
65 extern 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