summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/wayland/wayland-server-protocol.h
blob: bd6f91c9822f4d6b92d233288ff4af34bf5b99ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
/*
 * Copyright © 2010 Kristian Høgsberg
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that copyright
 * notice and this permission notice appear in supporting documentation, and
 * that the name of the copyright holders not be used in advertising or
 * publicity pertaining to distribution of the software without specific,
 * written prior permission.  The copyright holders make no representations
 * about the suitability of this software for any purpose.  It is provided "as
 * is" without express or implied warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 * OF THIS SOFTWARE.
 */


#ifndef WAYLAND_SERVER_PROTOCOL_H
#define WAYLAND_SERVER_PROTOCOL_H

#ifdef  __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stddef.h>
#include "wayland-util.h"

struct wl_client;

struct wl_display;
struct wl_compositor;
struct wl_shm;
struct wl_buffer;
struct wl_shell;
struct wl_selection;
struct wl_selection_offer;
struct wl_drag;
struct wl_drag_offer;
struct wl_surface;
struct wl_input_device;
struct wl_output;
struct wl_visual;

extern const struct wl_interface wl_display_interface;
extern const struct wl_interface wl_compositor_interface;
extern const struct wl_interface wl_shm_interface;
extern const struct wl_interface wl_buffer_interface;
extern const struct wl_interface wl_shell_interface;
extern const struct wl_interface wl_selection_interface;
extern const struct wl_interface wl_selection_offer_interface;
extern const struct wl_interface wl_drag_interface;
extern const struct wl_interface wl_drag_offer_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface wl_input_device_interface;
extern const struct wl_interface wl_output_interface;
extern const struct wl_interface wl_visual_interface;

struct wl_display_interface {
	void (*bind)(struct wl_client *client,
		     struct wl_display *wl_display,
		     uint32_t id,
		     const char *interface,
		     uint32_t version);
	void (*sync)(struct wl_client *client,
		     struct wl_display *wl_display,
		     uint32_t key);
	void (*frame)(struct wl_client *client,
		      struct wl_display *wl_display,
		      struct wl_surface *surface,
		      uint32_t key);
};

#define WL_DISPLAY_INVALID_OBJECT	0
#define WL_DISPLAY_INVALID_METHOD	1
#define WL_DISPLAY_NO_MEMORY	2
#define WL_DISPLAY_GLOBAL	3
#define WL_DISPLAY_RANGE	4
#define WL_DISPLAY_KEY	5

struct wl_compositor_interface {
	void (*create_surface)(struct wl_client *client,
			       struct wl_compositor *wl_compositor,
			       uint32_t id);
};

struct wl_shm_interface {
	void (*create_buffer)(struct wl_client *client,
			      struct wl_shm *wl_shm,
			      uint32_t id,
			      int fd,
			      int width,
			      int height,
			      uint32_t stride,
			      struct wl_visual *visual);
};

struct wl_buffer_interface {
	void (*damage)(struct wl_client *client,
		       struct wl_buffer *wl_buffer,
		       int x,
		       int y,
		       int width,
		       int height);
	void (*destroy)(struct wl_client *client,
			struct wl_buffer *wl_buffer);
};

#ifndef WL_SHELL_RESIZE_ENUM
#define WL_SHELL_RESIZE_ENUM
enum wl_shell_resize {
	WL_SHELL_RESIZE_NONE = 0,
	WL_SHELL_RESIZE_TOP = 1,
	WL_SHELL_RESIZE_BOTTOM = 2,
	WL_SHELL_RESIZE_LEFT = 4,
	WL_SHELL_RESIZE_TOP_LEFT = 5,
	WL_SHELL_RESIZE_BOTTOM_LEFT = 6,
	WL_SHELL_RESIZE_RIGHT = 8,
	WL_SHELL_RESIZE_TOP_RIGHT = 9,
	WL_SHELL_RESIZE_BOTTOM_RIGHT = 10,
};
#endif /* WL_SHELL_RESIZE_ENUM */

struct wl_shell_interface {
	void (*move)(struct wl_client *client,
		     struct wl_shell *wl_shell,
		     struct wl_surface *surface,
		     struct wl_input_device *input_device,
		     uint32_t time);
	void (*resize)(struct wl_client *client,
		       struct wl_shell *wl_shell,
		       struct wl_surface *surface,
		       struct wl_input_device *input_device,
		       uint32_t time,
		       uint32_t edges);
	void (*create_drag)(struct wl_client *client,
			    struct wl_shell *wl_shell,
			    uint32_t id);
	void (*create_selection)(struct wl_client *client,
				 struct wl_shell *wl_shell,
				 uint32_t id);
};

#define WL_SHELL_CONFIGURE	0

struct wl_selection_interface {
	void (*offer)(struct wl_client *client,
		      struct wl_selection *wl_selection,
		      const char *type);
	void (*activate)(struct wl_client *client,
			 struct wl_selection *wl_selection,
			 struct wl_input_device *input_device,
			 uint32_t time);
	void (*destroy)(struct wl_client *client,
			struct wl_selection *wl_selection);
};

#define WL_SELECTION_SEND	0
#define WL_SELECTION_CANCELLED	1

struct wl_selection_offer_interface {
	void (*receive)(struct wl_client *client,
			struct wl_selection_offer *wl_selection_offer,
			const char *mime_type,
			int fd);
};

#define WL_SELECTION_OFFER_OFFER	0
#define WL_SELECTION_OFFER_KEYBOARD_FOCUS	1

struct wl_drag_interface {
	void (*offer)(struct wl_client *client,
		      struct wl_drag *wl_drag,
		      const char *type);
	void (*activate)(struct wl_client *client,
			 struct wl_drag *wl_drag,
			 struct wl_surface *surface,
			 struct wl_input_device *input_device,
			 uint32_t time);
	void (*destroy)(struct wl_client *client,
			struct wl_drag *wl_drag);
};

#define WL_DRAG_TARGET	0
#define WL_DRAG_FINISH	1
#define WL_DRAG_REJECT	2

struct wl_drag_offer_interface {
	void (*accept)(struct wl_client *client,
		       struct wl_drag_offer *wl_drag_offer,
		       uint32_t time,
		       const char *type);
	void (*receive)(struct wl_client *client,
			struct wl_drag_offer *wl_drag_offer,
			int fd);
	void (*reject)(struct wl_client *client,
		       struct wl_drag_offer *wl_drag_offer);
};

#define WL_DRAG_OFFER_OFFER	0
#define WL_DRAG_OFFER_POINTER_FOCUS	1
#define WL_DRAG_OFFER_MOTION	2
#define WL_DRAG_OFFER_DROP	3

struct wl_surface_interface {
	void (*destroy)(struct wl_client *client,
			struct wl_surface *wl_surface);
	void (*attach)(struct wl_client *client,
		       struct wl_surface *wl_surface,
		       struct wl_buffer *buffer,
		       int x,
		       int y);
	void (*map_toplevel)(struct wl_client *client,
			     struct wl_surface *wl_surface);
	void (*map_transient)(struct wl_client *client,
			      struct wl_surface *wl_surface,
			      struct wl_surface *parent,
			      int x,
			      int y,
			      uint32_t flags);
	void (*map_fullscreen)(struct wl_client *client,
			       struct wl_surface *wl_surface);
	void (*damage)(struct wl_client *client,
		       struct wl_surface *wl_surface,
		       int x,
		       int y,
		       int width,
		       int height);
};

struct wl_input_device_interface {
	void (*attach)(struct wl_client *client,
		       struct wl_input_device *wl_input_device,
		       uint32_t time,
		       struct wl_buffer *buffer,
		       int hotspot_x,
		       int hotspot_y);
};

#define WL_INPUT_DEVICE_MOTION	0
#define WL_INPUT_DEVICE_BUTTON	1
#define WL_INPUT_DEVICE_KEY	2
#define WL_INPUT_DEVICE_POINTER_FOCUS	3
#define WL_INPUT_DEVICE_KEYBOARD_FOCUS	4

#define WL_OUTPUT_GEOMETRY	0

#ifdef  __cplusplus
}
#endif

#endif