2 * Copyright © 2008 Kristian Høgsberg
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.
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
39 display_create(int *argc, char **argv[], const GOptionEntry *option_entries);
41 struct wl_compositor *
42 display_get_compositor(struct display *display);
46 display_get_egl_display(struct display *d);
50 display_create_surface(struct display *display,
51 struct rectangle *rectangle);
54 display_get_buffer_for_surface(struct display *display,
55 cairo_surface_t *surface);
58 display_get_pointer_surface(struct display *display, int pointer,
59 int *width, int *height,
60 int *hotspot_x, int *hotspot_y);
63 display_add_drag_listener(struct display *display,
64 const struct wl_drag_listener *drag_listener,
68 display_flush_cairo_device(struct display *display);
71 display_run(struct display *d);
74 WINDOW_MODIFIER_SHIFT = 0x01,
75 WINDOW_MODIFIER_LOCK = 0x02,
76 WINDOW_MODIFIER_CONTROL = 0x04,
77 WINDOW_MODIFIER_ALT = 0x08,
78 WINDOW_MODIFIER_MOD2 = 0x10,
96 typedef void (*window_resize_handler_t)(struct window *window, void *data);
97 typedef void (*window_redraw_handler_t)(struct window *window, void *data);
98 typedef void (*window_frame_handler_t)(struct window *window, uint32_t frame, uint32_t timestamp, void *data);
99 typedef void (*window_acknowledge_handler_t)(struct window *window, uint32_t key, uint32_t frame, void *data);
100 typedef void (*window_key_handler_t)(struct window *window, uint32_t key, uint32_t unicode,
101 uint32_t state, uint32_t modifiers, void *data);
102 typedef void (*window_keyboard_focus_handler_t)(struct window *window,
103 struct input *device, void *data);
105 typedef void (*window_button_handler_t)(struct window *window,
106 struct input *input, uint32_t time,
107 int button, int state, void *data);
109 typedef int (*window_motion_handler_t)(struct window *window,
110 struct input *input, uint32_t time,
111 int32_t x, int32_t y,
112 int32_t sx, int32_t sy, void *data);
115 window_create(struct display *display, const char *title,
116 int32_t x, int32_t y, int32_t width, int32_t height);
119 window_draw(struct window *window);
121 window_commit(struct window *window, uint32_t key);
123 window_get_child_rectangle(struct window *window,
124 struct rectangle *rectangle);
126 window_set_child_size(struct window *window,
127 struct rectangle *rectangle);
129 window_copy_image(struct window *window,
130 struct rectangle *rectangle,
133 window_schedule_redraw(struct window *window);
136 window_move(struct window *window, int32_t x, int32_t y);
139 window_get_surface(struct window *window);
142 window_copy_surface(struct window *window,
143 struct rectangle *rectangle,
144 cairo_surface_t *surface);
147 window_set_fullscreen(struct window *window, int fullscreen);
150 window_set_user_data(struct window *window, void *data);
153 window_set_redraw_handler(struct window *window,
154 window_redraw_handler_t handler);
157 window_set_decoration(struct window *window, int decoration);
160 window_set_resize_handler(struct window *window,
161 window_resize_handler_t handler);
163 window_set_frame_handler(struct window *window,
164 window_frame_handler_t handler);
166 window_set_acknowledge_handler(struct window *window,
167 window_acknowledge_handler_t handler);
170 window_set_key_handler(struct window *window,
171 window_key_handler_t handler);
174 window_set_button_handler(struct window *window,
175 window_button_handler_t handler);
178 window_set_motion_handler(struct window *window,
179 window_motion_handler_t handler);
182 window_set_keyboard_focus_handler(struct window *window,
183 window_keyboard_focus_handler_t handler);
186 window_set_acknowledge_handler(struct window *window,
187 window_acknowledge_handler_t handler);
190 window_set_frame_handler(struct window *window,
191 window_frame_handler_t handler);
194 window_start_drag(struct window *window, struct input *input, uint32_t time);
197 input_get_position(struct input *input, int32_t *x, int32_t *y);
199 struct wl_input_device *
200 input_get_input_device(struct input *input);