blob: 804eef54b89e26c720ae53b524c74227bbbc4c3d [file] [log] [blame]
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -05001/*
2 * Copyright © 2008 Kristian Høgsberg
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
23#ifndef _WINDOW_H_
24#define _WINDOW_H_
25
Daniel Stone9d4f0302012-02-15 16:33:21 +000026#include <xkbcommon/xkbcommon.h>
Fred Morcosc4b8c452010-11-28 19:31:55 +010027#include <wayland-client.h>
Benjamin Franzkecff904e2011-02-18 23:00:55 +010028#include <cairo.h>
Kristian Høgsbergbcacef12012-03-11 21:05:57 -040029#include "../shared/config-parser.h"
Fred Morcosc4b8c452010-11-28 19:31:55 +010030
Kristian Høgsberg5717b6d2012-10-19 17:12:38 -040031#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
32
Kristian Høgsberg8c31a4c2012-10-19 23:05:37 -040033#define container_of(ptr, type, member) ({ \
34 const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
35 (type *)( (char *)__mptr - offsetof(type,member) );})
36
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -050037struct window;
Kristian Høgsbergc51f7992012-01-08 15:09:53 -050038struct widget;
Kristian Høgsberge28d05b2011-09-20 21:43:54 -040039struct display;
40struct input;
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -050041struct output;
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -050042
Kristian Høgsberg3a696272011-09-14 17:33:48 -040043struct task {
44 void (*run)(struct task *task, uint32_t events);
45 struct wl_list link;
46};
47
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -050048struct rectangle {
49 int32_t x;
50 int32_t y;
51 int32_t width;
52 int32_t height;
53};
54
Kristian Høgsberg43c28ee2009-01-26 23:42:46 -050055struct display *
Kristian Høgsbergbcacef12012-03-11 21:05:57 -040056display_create(int argc, char *argv[]);
Kristian Høgsberg7824d812010-06-08 14:59:44 -040057
Pekka Paalanen999c5b52011-11-30 10:52:38 +020058void
Pekka Paalanenfe6079a2011-12-15 15:20:04 +020059display_destroy(struct display *display);
60
61void
Pekka Paalanen999c5b52011-11-30 10:52:38 +020062display_set_user_data(struct display *display, void *data);
63
64void *
65display_get_user_data(struct display *display);
66
Kristian Høgsberg9d69f8e2010-09-03 14:46:38 -040067struct wl_display *
68display_get_display(struct display *display);
69
Kristian Høgsberg43c28ee2009-01-26 23:42:46 -050070struct wl_compositor *
71display_get_compositor(struct display *display);
72
Kristian Høgsberg58eec362011-01-19 14:27:42 -050073struct wl_shell *
74display_get_shell(struct display *display);
75
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -050076struct output *
77display_get_output(struct display *display);
78
Kristian Høgsbergeae5de72012-04-11 22:42:15 -040079uint32_t
80display_get_serial(struct display *display);
81
Kristian Høgsbergfa80e112012-10-10 21:34:26 -040082typedef void (*display_global_handler_t)(struct display *display,
83 uint32_t name,
84 const char *interface,
85 uint32_t version, void *data);
86
87void
88display_set_global_handler(struct display *display,
89 display_global_handler_t handler);
90void *
91display_bind(struct display *display, uint32_t name,
92 const struct wl_interface *interface, uint32_t version);
93
Pekka Paalanen999c5b52011-11-30 10:52:38 +020094typedef void (*display_output_handler_t)(struct output *output, void *data);
95
96/*
97 * The output configure handler is called, when a new output is connected
98 * and we know its current mode, or when the current mode changes.
99 * Test and set the output user data in your handler to know, if the
100 * output is new. Note: 'data' in the configure handler is the display
101 * user data.
102 */
103void
104display_set_output_configure_handler(struct display *display,
105 display_output_handler_t handler);
106
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400107struct wl_data_source *
108display_create_data_source(struct display *display);
109
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400110#ifdef EGL_NO_DISPLAY
111EGLDisplay
112display_get_egl_display(struct display *d);
Kristian Høgsberg2b43bd72010-11-08 15:45:55 -0500113
Benjamin Franzkecff904e2011-02-18 23:00:55 +0100114EGLConfig
Benjamin Franzke0c991632011-09-27 21:57:31 +0200115display_get_argb_egl_config(struct display *d);
Benjamin Franzkecff904e2011-02-18 23:00:55 +0100116
Benjamin Franzke1a89f282011-10-07 09:33:06 +0200117int
Benjamin Franzkecff904e2011-02-18 23:00:55 +0100118display_acquire_window_surface(struct display *display,
119 struct window *window,
120 EGLContext ctx);
121void
Benjamin Franzke0c991632011-09-27 21:57:31 +0200122display_release_window_surface(struct display *display,
123 struct window *window);
nobled98354172011-01-05 17:48:15 +0000124#endif
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400125
Kristian Høgsberg3be87d12011-05-13 13:45:17 -0400126#define SURFACE_OPAQUE 0x01
Ander Conselvan de Oliveira210eb9d2012-05-25 16:03:06 +0300127#define SURFACE_SHM 0x02
Kristian Høgsberg3be87d12011-05-13 13:45:17 -0400128
Kristian Høgsbergdcb71b62010-06-15 17:16:35 -0400129cairo_surface_t *
130display_create_surface(struct display *display,
Benjamin Franzke6693ac22011-02-10 12:04:30 +0100131 struct wl_surface *surface,
Kristian Høgsberg3be87d12011-05-13 13:45:17 -0400132 struct rectangle *rectangle,
133 uint32_t flags);
Kristian Høgsbergdcb71b62010-06-15 17:16:35 -0400134
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400135struct wl_buffer *
136display_get_buffer_for_surface(struct display *display,
137 cairo_surface_t *surface);
138
Ander Conselvan de Oliveira1042dc12012-05-22 15:39:42 +0300139struct wl_cursor_image *
140display_get_pointer_image(struct display *display, int pointer);
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400141
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400142void
Kristian Høgsberg3a696272011-09-14 17:33:48 -0400143display_defer(struct display *display, struct task *task);
144
145void
146display_watch_fd(struct display *display,
147 int fd, uint32_t events, struct task *task);
148
149void
Dima Ryazanova85292e2012-11-29 00:27:09 -0800150display_unwatch_fd(struct display *display, int fd);
151
152void
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400153display_run(struct display *d);
154
Pekka Paalanen826d7952011-12-15 10:14:07 +0200155void
156display_exit(struct display *d);
157
Ander Conselvan de Oliveiradc8c8fc2012-05-25 16:01:41 +0300158enum cursor_type {
159 CURSOR_BOTTOM_LEFT,
160 CURSOR_BOTTOM_RIGHT,
161 CURSOR_BOTTOM,
162 CURSOR_DRAGGING,
163 CURSOR_LEFT_PTR,
164 CURSOR_LEFT,
165 CURSOR_RIGHT,
166 CURSOR_TOP_LEFT,
167 CURSOR_TOP_RIGHT,
168 CURSOR_TOP,
169 CURSOR_IBEAM,
170 CURSOR_HAND1,
Kristian Høgsbergf3370522012-06-20 23:04:41 -0400171 CURSOR_WATCH,
172
173 CURSOR_BLANK
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400174};
175
Kristian Høgsberg67cac8a2011-01-19 14:20:33 -0500176typedef void (*window_key_handler_t)(struct window *window, struct input *input,
177 uint32_t time, uint32_t key, uint32_t unicode,
Daniel Stonec9785ea2012-05-30 16:31:52 +0100178 enum wl_keyboard_key_state state, void *data);
Tim Wiederhakedc3f8172011-01-17 17:25:34 +0100179
Kristian Høgsberg3c248cc2009-02-22 23:01:35 -0500180typedef void (*window_keyboard_focus_handler_t)(struct window *window,
Kristian Høgsberg808fd412010-07-20 17:06:19 -0400181 struct input *device, void *data);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500182
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400183typedef void (*window_data_handler_t)(struct window *window,
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400184 struct input *input,
Kristian Høgsberg80680c72012-05-10 12:21:37 -0400185 float x, float y,
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400186 const char **types,
187 void *data);
188
189typedef void (*window_drop_handler_t)(struct window *window,
190 struct input *input,
191 int32_t x, int32_t y, void *data);
192
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500193typedef void (*window_close_handler_t)(struct window *window, void *data);
Kristian Høgsberg67ace202012-07-23 21:56:31 -0400194typedef void (*window_fullscreen_handler_t)(struct window *window, void *data);
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500195
Kristian Høgsbergb67e94b2012-01-10 12:23:19 -0500196typedef void (*widget_resize_handler_t)(struct widget *widget,
197 int32_t width, int32_t height,
198 void *data);
199typedef void (*widget_redraw_handler_t)(struct widget *widget, void *data);
200
Kristian Høgsbergbb901fa2012-01-09 11:22:32 -0500201typedef int (*widget_enter_handler_t)(struct widget *widget,
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400202 struct input *input,
Kristian Høgsberg80680c72012-05-10 12:21:37 -0400203 float x, float y, void *data);
Kristian Høgsbergee143232012-01-09 08:42:24 -0500204typedef void (*widget_leave_handler_t)(struct widget *widget,
205 struct input *input, void *data);
Kristian Høgsberg04e98342012-01-09 09:36:16 -0500206typedef int (*widget_motion_handler_t)(struct widget *widget,
207 struct input *input, uint32_t time,
Kristian Høgsberg80680c72012-05-10 12:21:37 -0400208 float x, float y, void *data);
Kristian Høgsberga8a0db32012-01-09 11:12:05 -0500209typedef void (*widget_button_handler_t)(struct widget *widget,
210 struct input *input, uint32_t time,
Daniel Stone4dbadb12012-05-30 16:31:51 +0100211 uint32_t button,
212 enum wl_pointer_button_state state,
Daniel Stoneda5b93c2012-05-04 11:21:54 +0100213 void *data);
Philipp Brüschweiler7e0cc542012-08-14 11:02:41 +0200214typedef void (*widget_axis_handler_t)(struct widget *widget,
215 struct input *input, uint32_t time,
216 uint32_t axis,
217 wl_fixed_t value,
218 void *data);
Kristian Høgsbergee143232012-01-09 08:42:24 -0500219
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500220struct window *
Kristian Høgsberg009ac0a2012-01-31 15:24:48 -0500221window_create(struct display *display);
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500222struct window *
223window_create_transient(struct display *display, struct window *parent,
Tiago Vignattidec76582012-05-21 16:47:46 +0300224 int32_t x, int32_t y, uint32_t flags);
Kristian Høgsberg962342c2012-06-26 16:29:50 -0400225struct window *
226window_create_custom(struct display *display);
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500227
Kristian Høgsberg86adef92012-08-13 22:25:53 -0400228int
229window_has_focus(struct window *window);
230
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500231typedef void (*menu_func_t)(struct window *window, int index, void *data);
232
Pekka Paalanen6d174cf2012-01-19 15:17:59 +0200233void
234window_show_menu(struct display *display,
235 struct input *input, uint32_t time, struct window *parent,
236 int32_t x, int32_t y,
237 menu_func_t func, const char **entries, int count);
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500238
239void
Kristian Høgsbergd31fcab2012-01-31 09:53:44 -0500240window_show_frame_menu(struct window *window,
241 struct input *input, uint32_t time);
242
243void
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500244window_destroy(struct window *window);
245
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500246struct widget *
247window_add_widget(struct window *window, void *data);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400248
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400249typedef void (*data_func_t)(void *data, size_t len,
250 int32_t x, int32_t y, void *user_data);
251
Kristian Høgsbergbcee9a42011-10-12 00:36:16 -0400252struct display *
253window_get_display(struct window *window);
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500254void
Kristian Høgsberg82da52b2010-12-17 09:53:12 -0500255window_move(struct window *window, struct input *input, uint32_t time);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500256void
Kristian Høgsbergbb977002012-01-10 19:11:42 -0500257window_get_allocation(struct window *window, struct rectangle *allocation);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500258void
Kristian Høgsberg80d746f2010-06-14 23:52:50 -0400259window_schedule_redraw(struct window *window);
Kristian Høgsbergb67e94b2012-01-10 12:23:19 -0500260void
261window_schedule_resize(struct window *window, int width, int height);
Kristian Høgsberga85fe3c2010-06-08 14:08:30 -0400262
263void
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400264window_damage(struct window *window, int32_t x, int32_t y,
265 int32_t width, int32_t height);
266
Kristian Høgsberg0ac16f02009-01-15 11:37:43 -0500267cairo_surface_t *
Kristian Høgsberga85fe3c2010-06-08 14:08:30 -0400268window_get_surface(struct window *window);
269
Benjamin Franzkeec4d3422011-03-14 12:07:26 +0100270struct wl_surface *
271window_get_wl_surface(struct window *window);
272
Pekka Paalanen9d1613e2011-11-25 12:09:16 +0200273struct wl_shell_surface *
274window_get_wl_shell_surface(struct window *window);
275
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400276enum window_buffer_type {
Benjamin Franzke6693ac22011-02-10 12:04:30 +0100277 WINDOW_BUFFER_TYPE_EGL_WINDOW,
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400278 WINDOW_BUFFER_TYPE_SHM,
279};
280
281void
Benjamin Franzkebde55ec2011-03-07 15:08:09 +0100282display_surface_damage(struct display *display, cairo_surface_t *cairo_surface,
283 int32_t x, int32_t y, int32_t width, int32_t height);
284
285void
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400286window_set_buffer_type(struct window *window, enum window_buffer_type type);
287
Kristian Høgsberg1671e112012-10-10 11:36:24 -0400288int
289window_is_fullscreen(struct window *window);
290
Kristian Høgsberg9d69f8e2010-09-03 14:46:38 -0400291void
Kristian Høgsberg0395f302008-12-22 12:14:50 -0500292window_set_fullscreen(struct window *window, int fullscreen);
293
Kristian Høgsberg1671e112012-10-10 11:36:24 -0400294int
295window_is_maximized(struct window *window);
296
Kristian Høgsberg0395f302008-12-22 12:14:50 -0500297void
Kristian Høgsbergd6bcd7d2012-02-16 15:53:46 -0500298window_set_maximized(struct window *window, int maximized);
299
300void
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400301window_set_user_data(struct window *window, void *data);
302
Kristian Høgsberge9d37bd2010-09-02 20:22:42 -0400303void *
304window_get_user_data(struct window *window);
305
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400306void
Kristian Høgsberg6e83d582008-12-08 00:01:36 -0500307window_set_key_handler(struct window *window,
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400308 window_key_handler_t handler);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500309
Kristian Høgsberg3c248cc2009-02-22 23:01:35 -0500310void
311window_set_keyboard_focus_handler(struct window *window,
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400312 window_keyboard_focus_handler_t handler);
Kristian Høgsberga85fe3c2010-06-08 14:08:30 -0400313
314void
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400315window_set_data_handler(struct window *window,
316 window_data_handler_t handler);
317
318void
319window_set_drop_handler(struct window *window,
320 window_drop_handler_t handler);
321
322void
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500323window_set_close_handler(struct window *window,
324 window_close_handler_t handler);
Kristian Høgsberg67ace202012-07-23 21:56:31 -0400325void
326window_set_fullscreen_handler(struct window *window,
327 window_fullscreen_handler_t handler);
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500328
329void
Callum Lowcayef57a9b2011-01-14 20:46:23 +1300330window_set_title(struct window *window, const char *title);
331
332const char *
333window_get_title(struct window *window);
334
Scott Moreau7a1b32a2012-05-27 14:25:02 -0600335void
336window_set_text_cursor_position(struct window *window, int32_t x, int32_t y);
337
Tiago Vignatti82db9d82012-05-23 22:06:27 +0300338int
339widget_set_tooltip(struct widget *parent, char *entry, float x, float y);
340
341void
342widget_destroy_tooltip(struct widget *parent);
343
Kristian Høgsberg441338c2012-01-10 13:52:34 -0500344struct widget *
345widget_add_widget(struct widget *parent, void *data);
Tiago Vignatti82db9d82012-05-23 22:06:27 +0300346
Kristian Høgsberg441338c2012-01-10 13:52:34 -0500347void
348widget_destroy(struct widget *widget);
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400349void
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500350widget_get_allocation(struct widget *widget, struct rectangle *allocation);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400351
352void
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500353widget_set_allocation(struct widget *widget,
354 int32_t x, int32_t y, int32_t width, int32_t height);
Kristian Høgsbergbb977002012-01-10 19:11:42 -0500355void
356widget_set_size(struct widget *widget, int32_t width, int32_t height);
357void
Kristian Høgsberg010f98b2012-02-23 17:30:45 -0500358widget_set_transparent(struct widget *widget, int transparent);
359void
Kristian Høgsbergbb977002012-01-10 19:11:42 -0500360widget_schedule_resize(struct widget *widget, int32_t width, int32_t height);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400361
362void *
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500363widget_get_user_data(struct widget *widget);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400364
365void
Kristian Høgsbergb67e94b2012-01-10 12:23:19 -0500366widget_set_redraw_handler(struct widget *widget,
367 widget_redraw_handler_t handler);
368void
369widget_set_resize_handler(struct widget *widget,
370 widget_resize_handler_t handler);
371void
Kristian Høgsbergee143232012-01-09 08:42:24 -0500372widget_set_enter_handler(struct widget *widget,
373 widget_enter_handler_t handler);
374void
375widget_set_leave_handler(struct widget *widget,
376 widget_leave_handler_t handler);
Kristian Høgsberg04e98342012-01-09 09:36:16 -0500377void
378widget_set_motion_handler(struct widget *widget,
379 widget_motion_handler_t handler);
Kristian Høgsberg9a13dab2012-01-08 15:18:19 -0500380void
Kristian Høgsberga8a0db32012-01-09 11:12:05 -0500381widget_set_button_handler(struct widget *widget,
382 widget_button_handler_t handler);
Philipp Brüschweiler7e0cc542012-08-14 11:02:41 +0200383void
384widget_set_axis_handler(struct widget *widget,
385 widget_axis_handler_t handler);
Kristian Høgsberga8a0db32012-01-09 11:12:05 -0500386
387void
Kristian Høgsberg9a13dab2012-01-08 15:18:19 -0500388widget_schedule_redraw(struct widget *widget);
389
Kristian Høgsberg29af3eb2012-01-10 22:41:05 -0500390struct widget *
391frame_create(struct window *window, void *data);
Kristian Høgsberga1627922012-06-20 17:30:03 -0400392void
393frame_set_child_size(struct widget *widget, int child_width, int child_height);
Kristian Høgsberg29af3eb2012-01-10 22:41:05 -0500394
Kristian Høgsberg9a13dab2012-01-08 15:18:19 -0500395void
Kristian Høgsberg5a4e9ff2012-06-04 16:04:07 -0400396input_set_pointer_image(struct input *input, int pointer);
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400397
398void
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400399input_get_position(struct input *input, int32_t *x, int32_t *y);
400
Kristian Høgsberg70163132012-05-08 15:55:39 -0400401#define MOD_SHIFT_MASK 0x01
402#define MOD_ALT_MASK 0x02
403#define MOD_CONTROL_MASK 0x04
404
Kristian Høgsberg67cac8a2011-01-19 14:20:33 -0500405uint32_t
406input_get_modifiers(struct input *input);
407
Kristian Høgsberg831dd522012-01-10 23:46:33 -0500408void
409input_grab(struct input *input, struct widget *widget, uint32_t button);
410
411void
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400412input_ungrab(struct input *input);
Kristian Høgsberg831dd522012-01-10 23:46:33 -0500413
Kristian Høgsbergb6323512012-01-11 00:04:42 -0500414struct widget *
415input_get_focus_widget(struct input *input);
416
Kristian Høgsbergd56bd902012-06-05 09:58:51 -0400417struct display *
418input_get_display(struct input *input);
419
Daniel Stone37816df2012-05-16 18:45:18 +0100420struct wl_seat *
421input_get_seat(struct input *input);
Kristian Høgsberg1d7ffd32010-08-25 16:34:05 -0400422
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400423struct wl_data_device *
424input_get_data_device(struct input *input);
425
Kristian Høgsberg6bccebe2011-01-21 16:23:09 -0500426void
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400427input_set_selection(struct input *input,
428 struct wl_data_source *source, uint32_t time);
429
430void
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400431input_accept(struct input *input, const char *type);
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400432
433
434void
435input_receive_drag_data(struct input *input, const char *mime_type,
436 data_func_t func, void *user_data);
437
438int
439input_receive_selection_data(struct input *input, const char *mime_type,
440 data_func_t func, void *data);
Kristian Høgsberge7aaec32011-12-27 13:50:04 -0500441int
442input_receive_selection_data_to_fd(struct input *input,
443 const char *mime_type, int fd);
Kristian Høgsberg58eec362011-01-19 14:27:42 -0500444
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -0500445void
Pekka Paalanen999c5b52011-11-30 10:52:38 +0200446output_set_user_data(struct output *output, void *data);
447
448void *
449output_get_user_data(struct output *output);
450
451void
452output_set_destroy_handler(struct output *output,
453 display_output_handler_t handler);
454
455void
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -0500456output_get_allocation(struct output *output, struct rectangle *allocation);
457
Pekka Paalanen999c5b52011-11-30 10:52:38 +0200458struct wl_output *
459output_get_wl_output(struct output *output);
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -0500460
Jan Arne Petersencd997062012-11-18 19:06:44 +0100461void
462keysym_modifiers_add(struct wl_array *modifiers_map,
463 const char *name);
464
465xkb_mod_mask_t
466keysym_modifiers_get_mask(struct wl_array *modifiers_map,
467 const char *name);
468
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500469#endif