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
38 display_create(struct wl_display *display, int fd);
39 struct wl_compositor *
40 display_get_compositor(struct display *display);
43 WINDOW_MODIFIER_SHIFT = 0x01,
44 WINDOW_MODIFIER_ALT = 0x02,
45 WINDOW_MODIFIER_CONTROL = 0x04,
48 typedef void (*window_resize_handler_t)(struct window *window, void *data);
49 typedef void (*window_frame_handler_t)(struct window *window, uint32_t frame, uint32_t timestamp, void *data);
50 typedef void (*window_acknowledge_handler_t)(struct window *window, uint32_t key, void *data);
51 typedef void (*window_key_handler_t)(struct window *window, uint32_t key, uint32_t unicode,
52 uint32_t state, uint32_t modifiers, void *data);
53 typedef void (*window_keyboard_focus_handler_t)(struct window *window,
54 struct wl_input_device *device, void *data);
57 window_create(struct display *display, const char *title,
58 int32_t x, int32_t y, int32_t width, int32_t height);
61 window_draw(struct window *window);
63 window_commit(struct window *window, uint32_t key);
65 window_get_child_rectangle(struct window *window,
66 struct rectangle *rectangle);
68 window_set_child_size(struct window *window,
69 struct rectangle *rectangle);
71 window_copy(struct window *window,
72 struct rectangle *rectangle,
73 uint32_t name, uint32_t stride);
76 window_create_surface(struct window *window,
77 struct rectangle *rectangle);
80 window_copy_surface(struct window *window,
81 struct rectangle *rectangle,
82 cairo_surface_t *surface);
85 window_set_fullscreen(struct window *window, int fullscreen);
88 window_set_resize_handler(struct window *window,
89 window_resize_handler_t handler, void *data);
91 window_set_frame_handler(struct window *window,
92 window_frame_handler_t handler, void *data);
94 window_set_acknowledge_handler(struct window *window,
95 window_acknowledge_handler_t handler, void *data);
97 window_set_key_handler(struct window *window,
98 window_key_handler_t handler, void *data);
101 window_set_keyboard_focus_handler(struct window *window,
102 window_keyboard_focus_handler_t handler,