blob: 2f93bd4b57c07331202c89bf3c5326f583af7c90 [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"
Pekka Paalanen2396aec2013-04-25 13:57:41 +030030#include "subsurface-client-protocol.h"
Fred Morcosc4b8c452010-11-28 19:31:55 +010031
Kristian Høgsberg5717b6d2012-10-19 17:12:38 -040032#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
33
Kristian Høgsberg8c31a4c2012-10-19 23:05:37 -040034#define container_of(ptr, type, member) ({ \
35 const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
36 (type *)( (char *)__mptr - offsetof(type,member) );})
37
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -050038struct window;
Kristian Høgsbergc51f7992012-01-08 15:09:53 -050039struct widget;
Kristian Høgsberge28d05b2011-09-20 21:43:54 -040040struct display;
41struct input;
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -050042struct output;
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -050043
Kristian Høgsberg3a696272011-09-14 17:33:48 -040044struct task {
45 void (*run)(struct task *task, uint32_t events);
46 struct wl_list link;
47};
48
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -050049struct rectangle {
50 int32_t x;
51 int32_t y;
52 int32_t width;
53 int32_t height;
54};
55
Kristian Høgsberg43c28ee2009-01-26 23:42:46 -050056struct display *
Kristian Høgsberg4172f662013-02-20 15:27:49 -050057display_create(int *argc, char *argv[]);
Kristian Høgsberg7824d812010-06-08 14:59:44 -040058
Pekka Paalanen999c5b52011-11-30 10:52:38 +020059void
Pekka Paalanenfe6079a2011-12-15 15:20:04 +020060display_destroy(struct display *display);
61
62void
Pekka Paalanen999c5b52011-11-30 10:52:38 +020063display_set_user_data(struct display *display, void *data);
64
65void *
66display_get_user_data(struct display *display);
67
Kristian Høgsberg9d69f8e2010-09-03 14:46:38 -040068struct wl_display *
69display_get_display(struct display *display);
70
Kristian Høgsberg43c28ee2009-01-26 23:42:46 -050071struct wl_compositor *
72display_get_compositor(struct display *display);
73
Kristian Høgsberg58eec362011-01-19 14:27:42 -050074struct wl_shell *
75display_get_shell(struct display *display);
76
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -050077struct output *
78display_get_output(struct display *display);
79
Kristian Høgsbergeae5de72012-04-11 22:42:15 -040080uint32_t
81display_get_serial(struct display *display);
82
Kristian Høgsbergfa80e112012-10-10 21:34:26 -040083typedef void (*display_global_handler_t)(struct display *display,
84 uint32_t name,
85 const char *interface,
86 uint32_t version, void *data);
87
88void
89display_set_global_handler(struct display *display,
90 display_global_handler_t handler);
91void *
92display_bind(struct display *display, uint32_t name,
93 const struct wl_interface *interface, uint32_t version);
94
Pekka Paalanen999c5b52011-11-30 10:52:38 +020095typedef void (*display_output_handler_t)(struct output *output, void *data);
96
97/*
98 * The output configure handler is called, when a new output is connected
99 * and we know its current mode, or when the current mode changes.
100 * Test and set the output user data in your handler to know, if the
101 * output is new. Note: 'data' in the configure handler is the display
102 * user data.
103 */
104void
105display_set_output_configure_handler(struct display *display,
106 display_output_handler_t handler);
107
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400108struct wl_data_source *
109display_create_data_source(struct display *display);
110
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400111#ifdef EGL_NO_DISPLAY
112EGLDisplay
113display_get_egl_display(struct display *d);
Kristian Høgsberg2b43bd72010-11-08 15:45:55 -0500114
Benjamin Franzkecff904e2011-02-18 23:00:55 +0100115EGLConfig
Benjamin Franzke0c991632011-09-27 21:57:31 +0200116display_get_argb_egl_config(struct display *d);
Benjamin Franzkecff904e2011-02-18 23:00:55 +0100117
Benjamin Franzke1a89f282011-10-07 09:33:06 +0200118int
Benjamin Franzkecff904e2011-02-18 23:00:55 +0100119display_acquire_window_surface(struct display *display,
120 struct window *window,
121 EGLContext ctx);
122void
Benjamin Franzke0c991632011-09-27 21:57:31 +0200123display_release_window_surface(struct display *display,
124 struct window *window);
nobled98354172011-01-05 17:48:15 +0000125#endif
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400126
Kristian Høgsberg3be87d12011-05-13 13:45:17 -0400127#define SURFACE_OPAQUE 0x01
Ander Conselvan de Oliveira210eb9d2012-05-25 16:03:06 +0300128#define SURFACE_SHM 0x02
Kristian Høgsberg3be87d12011-05-13 13:45:17 -0400129
Pekka Paalanen02bba7c2013-02-13 16:17:15 +0200130#define SURFACE_HINT_RESIZE 0x10
131
Kristian Høgsbergdcb71b62010-06-15 17:16:35 -0400132cairo_surface_t *
133display_create_surface(struct display *display,
Benjamin Franzke6693ac22011-02-10 12:04:30 +0100134 struct wl_surface *surface,
Kristian Høgsberg3be87d12011-05-13 13:45:17 -0400135 struct rectangle *rectangle,
136 uint32_t flags);
Kristian Høgsbergdcb71b62010-06-15 17:16:35 -0400137
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400138struct wl_buffer *
139display_get_buffer_for_surface(struct display *display,
140 cairo_surface_t *surface);
141
Ander Conselvan de Oliveira1042dc12012-05-22 15:39:42 +0300142struct wl_cursor_image *
143display_get_pointer_image(struct display *display, int pointer);
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400144
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400145void
Kristian Høgsberg3a696272011-09-14 17:33:48 -0400146display_defer(struct display *display, struct task *task);
147
148void
149display_watch_fd(struct display *display,
150 int fd, uint32_t events, struct task *task);
151
152void
Dima Ryazanova85292e2012-11-29 00:27:09 -0800153display_unwatch_fd(struct display *display, int fd);
154
155void
Kristian Høgsberg7824d812010-06-08 14:59:44 -0400156display_run(struct display *d);
157
Pekka Paalanen826d7952011-12-15 10:14:07 +0200158void
159display_exit(struct display *d);
160
Ander Conselvan de Oliveiradc8c8fc2012-05-25 16:01:41 +0300161enum cursor_type {
162 CURSOR_BOTTOM_LEFT,
163 CURSOR_BOTTOM_RIGHT,
164 CURSOR_BOTTOM,
165 CURSOR_DRAGGING,
166 CURSOR_LEFT_PTR,
167 CURSOR_LEFT,
168 CURSOR_RIGHT,
169 CURSOR_TOP_LEFT,
170 CURSOR_TOP_RIGHT,
171 CURSOR_TOP,
172 CURSOR_IBEAM,
173 CURSOR_HAND1,
Kristian Høgsbergf3370522012-06-20 23:04:41 -0400174 CURSOR_WATCH,
175
176 CURSOR_BLANK
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400177};
178
Kristian Høgsberg67cac8a2011-01-19 14:20:33 -0500179typedef void (*window_key_handler_t)(struct window *window, struct input *input,
180 uint32_t time, uint32_t key, uint32_t unicode,
Daniel Stonec9785ea2012-05-30 16:31:52 +0100181 enum wl_keyboard_key_state state, void *data);
Tim Wiederhakedc3f8172011-01-17 17:25:34 +0100182
Kristian Høgsberg3c248cc2009-02-22 23:01:35 -0500183typedef void (*window_keyboard_focus_handler_t)(struct window *window,
Kristian Høgsberg808fd412010-07-20 17:06:19 -0400184 struct input *device, void *data);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500185
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400186typedef void (*window_data_handler_t)(struct window *window,
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400187 struct input *input,
Kristian Høgsberg80680c72012-05-10 12:21:37 -0400188 float x, float y,
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400189 const char **types,
190 void *data);
191
192typedef void (*window_drop_handler_t)(struct window *window,
193 struct input *input,
194 int32_t x, int32_t y, void *data);
195
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500196typedef void (*window_close_handler_t)(struct window *window, void *data);
Kristian Høgsberg67ace202012-07-23 21:56:31 -0400197typedef void (*window_fullscreen_handler_t)(struct window *window, void *data);
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500198
Ander Conselvan de Oliveira15256f62012-11-30 17:34:25 +0200199typedef void (*window_output_handler_t)(struct window *window, struct output *output,
200 int enter, void *data);
201
Kristian Høgsbergb67e94b2012-01-10 12:23:19 -0500202typedef void (*widget_resize_handler_t)(struct widget *widget,
203 int32_t width, int32_t height,
204 void *data);
205typedef void (*widget_redraw_handler_t)(struct widget *widget, void *data);
206
Kristian Høgsbergbb901fa2012-01-09 11:22:32 -0500207typedef int (*widget_enter_handler_t)(struct widget *widget,
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400208 struct input *input,
Kristian Høgsberg80680c72012-05-10 12:21:37 -0400209 float x, float y, void *data);
Kristian Høgsbergee143232012-01-09 08:42:24 -0500210typedef void (*widget_leave_handler_t)(struct widget *widget,
211 struct input *input, void *data);
Kristian Høgsberg04e98342012-01-09 09:36:16 -0500212typedef int (*widget_motion_handler_t)(struct widget *widget,
213 struct input *input, uint32_t time,
Kristian Høgsberg80680c72012-05-10 12:21:37 -0400214 float x, float y, void *data);
Kristian Høgsberga8a0db32012-01-09 11:12:05 -0500215typedef void (*widget_button_handler_t)(struct widget *widget,
216 struct input *input, uint32_t time,
Daniel Stone4dbadb12012-05-30 16:31:51 +0100217 uint32_t button,
218 enum wl_pointer_button_state state,
Daniel Stoneda5b93c2012-05-04 11:21:54 +0100219 void *data);
Philipp Brüschweiler7e0cc542012-08-14 11:02:41 +0200220typedef void (*widget_axis_handler_t)(struct widget *widget,
221 struct input *input, uint32_t time,
222 uint32_t axis,
223 wl_fixed_t value,
224 void *data);
Kristian Høgsbergee143232012-01-09 08:42:24 -0500225
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500226struct window *
Kristian Høgsberg009ac0a2012-01-31 15:24:48 -0500227window_create(struct display *display);
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500228struct window *
229window_create_transient(struct display *display, struct window *parent,
Tiago Vignattidec76582012-05-21 16:47:46 +0300230 int32_t x, int32_t y, uint32_t flags);
Kristian Høgsberg962342c2012-06-26 16:29:50 -0400231struct window *
232window_create_custom(struct display *display);
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500233
Kristian Høgsberg86adef92012-08-13 22:25:53 -0400234int
235window_has_focus(struct window *window);
236
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500237typedef void (*menu_func_t)(struct window *window, int index, void *data);
238
Pekka Paalanen6d174cf2012-01-19 15:17:59 +0200239void
240window_show_menu(struct display *display,
241 struct input *input, uint32_t time, struct window *parent,
242 int32_t x, int32_t y,
243 menu_func_t func, const char **entries, int count);
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500244
245void
Kristian Høgsbergd31fcab2012-01-31 09:53:44 -0500246window_show_frame_menu(struct window *window,
247 struct input *input, uint32_t time);
248
Ander Conselvan de Oliveira6d4cb4e2012-11-30 17:34:24 +0200249int
250window_get_buffer_transform(struct window *window);
251
252void
253window_set_buffer_transform(struct window *window,
254 enum wl_output_transform transform);
255
Kristian Høgsbergd31fcab2012-01-31 09:53:44 -0500256void
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500257window_destroy(struct window *window);
258
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500259struct widget *
260window_add_widget(struct window *window, void *data);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400261
Pekka Paalanen35e82632013-04-25 13:57:48 +0300262enum subsurface_mode {
263 SUBSURFACE_SYNCHRONIZED,
264 SUBSURFACE_DESYNCHRONIZED
265};
266
267struct widget *
268window_add_subsurface(struct window *window, void *data,
269 enum subsurface_mode default_mode);
270
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400271typedef void (*data_func_t)(void *data, size_t len,
272 int32_t x, int32_t y, void *user_data);
273
Kristian Høgsbergbcee9a42011-10-12 00:36:16 -0400274struct display *
275window_get_display(struct window *window);
Kristian Høgsberg248c1b62011-01-21 18:03:15 -0500276void
Kristian Høgsberg82da52b2010-12-17 09:53:12 -0500277window_move(struct window *window, struct input *input, uint32_t time);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500278void
Kristian Høgsbergbb977002012-01-10 19:11:42 -0500279window_get_allocation(struct window *window, struct rectangle *allocation);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500280void
Kristian Høgsberg80d746f2010-06-14 23:52:50 -0400281window_schedule_redraw(struct window *window);
Kristian Høgsbergb67e94b2012-01-10 12:23:19 -0500282void
283window_schedule_resize(struct window *window, int width, int height);
Kristian Høgsberga85fe3c2010-06-08 14:08:30 -0400284
285void
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400286window_damage(struct window *window, int32_t x, int32_t y,
287 int32_t width, int32_t height);
288
Kristian Høgsberg0ac16f02009-01-15 11:37:43 -0500289cairo_surface_t *
Kristian Høgsberga85fe3c2010-06-08 14:08:30 -0400290window_get_surface(struct window *window);
291
Benjamin Franzkeec4d3422011-03-14 12:07:26 +0100292struct wl_surface *
293window_get_wl_surface(struct window *window);
294
Pekka Paalanen9d1613e2011-11-25 12:09:16 +0200295struct wl_shell_surface *
296window_get_wl_shell_surface(struct window *window);
297
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400298enum window_buffer_type {
Benjamin Franzke6693ac22011-02-10 12:04:30 +0100299 WINDOW_BUFFER_TYPE_EGL_WINDOW,
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400300 WINDOW_BUFFER_TYPE_SHM,
301};
302
303void
Benjamin Franzkebde55ec2011-03-07 15:08:09 +0100304display_surface_damage(struct display *display, cairo_surface_t *cairo_surface,
305 int32_t x, int32_t y, int32_t width, int32_t height);
306
307void
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -0400308window_set_buffer_type(struct window *window, enum window_buffer_type type);
309
Kristian Høgsberg1671e112012-10-10 11:36:24 -0400310int
311window_is_fullscreen(struct window *window);
312
Kristian Høgsberg9d69f8e2010-09-03 14:46:38 -0400313void
Kristian Høgsberg0395f302008-12-22 12:14:50 -0500314window_set_fullscreen(struct window *window, int fullscreen);
315
Ander Conselvan de Oliveira5403f522012-12-14 13:37:23 -0200316void
317window_set_fullscreen_method(struct window *window,
318 enum wl_shell_surface_fullscreen_method method);
Kristian Høgsberg1671e112012-10-10 11:36:24 -0400319int
320window_is_maximized(struct window *window);
321
Kristian Høgsberg0395f302008-12-22 12:14:50 -0500322void
Kristian Høgsbergd6bcd7d2012-02-16 15:53:46 -0500323window_set_maximized(struct window *window, int maximized);
324
325void
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400326window_set_user_data(struct window *window, void *data);
327
Kristian Høgsberge9d37bd2010-09-02 20:22:42 -0400328void *
329window_get_user_data(struct window *window);
330
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400331void
Kristian Høgsberg6e83d582008-12-08 00:01:36 -0500332window_set_key_handler(struct window *window,
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400333 window_key_handler_t handler);
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500334
Kristian Høgsberg3c248cc2009-02-22 23:01:35 -0500335void
336window_set_keyboard_focus_handler(struct window *window,
Kristian Høgsbergc8c37342010-06-25 11:19:22 -0400337 window_keyboard_focus_handler_t handler);
Kristian Høgsberga85fe3c2010-06-08 14:08:30 -0400338
339void
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400340window_set_data_handler(struct window *window,
341 window_data_handler_t handler);
342
343void
344window_set_drop_handler(struct window *window,
345 window_drop_handler_t handler);
346
347void
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500348window_set_close_handler(struct window *window,
349 window_close_handler_t handler);
Kristian Høgsberg67ace202012-07-23 21:56:31 -0400350void
351window_set_fullscreen_handler(struct window *window,
352 window_fullscreen_handler_t handler);
Ander Conselvan de Oliveira15256f62012-11-30 17:34:25 +0200353void
354window_set_output_handler(struct window *window,
355 window_output_handler_t handler);
Kristian Høgsberg4f7dcd62012-01-06 21:59:05 -0500356
357void
Callum Lowcayef57a9b2011-01-14 20:46:23 +1300358window_set_title(struct window *window, const char *title);
359
360const char *
361window_get_title(struct window *window);
362
Scott Moreau7a1b32a2012-05-27 14:25:02 -0600363void
364window_set_text_cursor_position(struct window *window, int32_t x, int32_t y);
365
Tiago Vignatti82db9d82012-05-23 22:06:27 +0300366int
367widget_set_tooltip(struct widget *parent, char *entry, float x, float y);
368
369void
370widget_destroy_tooltip(struct widget *parent);
371
Kristian Høgsberg441338c2012-01-10 13:52:34 -0500372struct widget *
373widget_add_widget(struct widget *parent, void *data);
Tiago Vignatti82db9d82012-05-23 22:06:27 +0300374
Kristian Høgsberg441338c2012-01-10 13:52:34 -0500375void
376widget_destroy(struct widget *widget);
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400377void
Kristian Høgsbergbf74d522012-11-30 14:54:35 -0500378widget_set_default_cursor(struct widget *widget, int cursor);
379void
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500380widget_get_allocation(struct widget *widget, struct rectangle *allocation);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400381
382void
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500383widget_set_allocation(struct widget *widget,
384 int32_t x, int32_t y, int32_t width, int32_t height);
Kristian Høgsbergbb977002012-01-10 19:11:42 -0500385void
386widget_set_size(struct widget *widget, int32_t width, int32_t height);
387void
Kristian Høgsberg010f98b2012-02-23 17:30:45 -0500388widget_set_transparent(struct widget *widget, int transparent);
389void
Kristian Høgsbergbb977002012-01-10 19:11:42 -0500390widget_schedule_resize(struct widget *widget, int32_t width, int32_t height);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400391
392void *
Kristian Høgsbergc51f7992012-01-08 15:09:53 -0500393widget_get_user_data(struct widget *widget);
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400394
Pekka Paalanen0c4445b2013-02-13 16:17:23 +0200395cairo_t *
396widget_cairo_create(struct widget *widget);
397
Kristian Høgsberge28d05b2011-09-20 21:43:54 -0400398void
Kristian Høgsbergb67e94b2012-01-10 12:23:19 -0500399widget_set_redraw_handler(struct widget *widget,
400 widget_redraw_handler_t handler);
401void
402widget_set_resize_handler(struct widget *widget,
403 widget_resize_handler_t handler);
404void
Kristian Høgsbergee143232012-01-09 08:42:24 -0500405widget_set_enter_handler(struct widget *widget,
406 widget_enter_handler_t handler);
407void
408widget_set_leave_handler(struct widget *widget,
409 widget_leave_handler_t handler);
Kristian Høgsberg04e98342012-01-09 09:36:16 -0500410void
411widget_set_motion_handler(struct widget *widget,
412 widget_motion_handler_t handler);
Kristian Høgsberg9a13dab2012-01-08 15:18:19 -0500413void
Kristian Høgsberga8a0db32012-01-09 11:12:05 -0500414widget_set_button_handler(struct widget *widget,
415 widget_button_handler_t handler);
Philipp Brüschweiler7e0cc542012-08-14 11:02:41 +0200416void
417widget_set_axis_handler(struct widget *widget,
418 widget_axis_handler_t handler);
Kristian Høgsberga8a0db32012-01-09 11:12:05 -0500419
420void
Kristian Høgsberg9a13dab2012-01-08 15:18:19 -0500421widget_schedule_redraw(struct widget *widget);
422
Kristian Høgsberg29af3eb2012-01-10 22:41:05 -0500423struct widget *
424frame_create(struct window *window, void *data);
Pekka Paalanen0c4445b2013-02-13 16:17:23 +0200425
Kristian Høgsberga1627922012-06-20 17:30:03 -0400426void
427frame_set_child_size(struct widget *widget, int child_width, int child_height);
Kristian Høgsberg29af3eb2012-01-10 22:41:05 -0500428
Kristian Høgsberg9a13dab2012-01-08 15:18:19 -0500429void
Kristian Høgsberg5a4e9ff2012-06-04 16:04:07 -0400430input_set_pointer_image(struct input *input, int pointer);
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400431
432void
Kristian Høgsberg9a686242010-08-18 15:28:04 -0400433input_get_position(struct input *input, int32_t *x, int32_t *y);
434
Kristian Høgsberg70163132012-05-08 15:55:39 -0400435#define MOD_SHIFT_MASK 0x01
436#define MOD_ALT_MASK 0x02
437#define MOD_CONTROL_MASK 0x04
438
Kristian Høgsberg67cac8a2011-01-19 14:20:33 -0500439uint32_t
440input_get_modifiers(struct input *input);
441
Kristian Høgsberg831dd522012-01-10 23:46:33 -0500442void
443input_grab(struct input *input, struct widget *widget, uint32_t button);
444
445void
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400446input_ungrab(struct input *input);
Kristian Høgsberg831dd522012-01-10 23:46:33 -0500447
Kristian Høgsbergb6323512012-01-11 00:04:42 -0500448struct widget *
449input_get_focus_widget(struct input *input);
450
Kristian Høgsbergd56bd902012-06-05 09:58:51 -0400451struct display *
452input_get_display(struct input *input);
453
Daniel Stone37816df2012-05-16 18:45:18 +0100454struct wl_seat *
455input_get_seat(struct input *input);
Kristian Høgsberg1d7ffd32010-08-25 16:34:05 -0400456
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400457struct wl_data_device *
458input_get_data_device(struct input *input);
459
Kristian Høgsberg6bccebe2011-01-21 16:23:09 -0500460void
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400461input_set_selection(struct input *input,
462 struct wl_data_source *source, uint32_t time);
463
464void
Kristian Høgsbergeae5de72012-04-11 22:42:15 -0400465input_accept(struct input *input, const char *type);
Kristian Høgsberg47fe08a2011-10-28 12:26:06 -0400466
467
468void
469input_receive_drag_data(struct input *input, const char *mime_type,
470 data_func_t func, void *user_data);
471
472int
473input_receive_selection_data(struct input *input, const char *mime_type,
474 data_func_t func, void *data);
Kristian Høgsberge7aaec32011-12-27 13:50:04 -0500475int
476input_receive_selection_data_to_fd(struct input *input,
477 const char *mime_type, int fd);
Kristian Høgsberg58eec362011-01-19 14:27:42 -0500478
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -0500479void
Pekka Paalanen999c5b52011-11-30 10:52:38 +0200480output_set_user_data(struct output *output, void *data);
481
482void *
483output_get_user_data(struct output *output);
484
485void
486output_set_destroy_handler(struct output *output,
487 display_output_handler_t handler);
488
489void
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -0500490output_get_allocation(struct output *output, struct rectangle *allocation);
491
Pekka Paalanen999c5b52011-11-30 10:52:38 +0200492struct wl_output *
493output_get_wl_output(struct output *output);
Kristian Høgsberg53ff2f62011-11-26 17:27:37 -0500494
Ander Conselvan de Oliveira15256f62012-11-30 17:34:25 +0200495enum wl_output_transform
496output_get_transform(struct output *output);
497
Jan Arne Petersencd997062012-11-18 19:06:44 +0100498void
499keysym_modifiers_add(struct wl_array *modifiers_map,
500 const char *name);
501
502xkb_mod_mask_t
503keysym_modifiers_get_mask(struct wl_array *modifiers_map,
504 const char *name);
505
Kristian Høgsberg0c4457f2008-12-07 19:59:11 -0500506#endif