Drop libdrm CFLAGS where no longer necessary.
[profile/ivi/wayland.git] / window.h
1 /*
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
26 struct window;
27
28 struct rectangle {
29         int32_t x;
30         int32_t y;
31         int32_t width;
32         int32_t height;
33 };
34
35 typedef void (*window_resize_handler_t)(struct window *window, void *data);
36 typedef void (*window_frame_handler_t)(struct window *window, uint32_t frame, uint32_t timestamp, void *data);
37 typedef void (*window_acknowledge_handler_t)(struct window *window, uint32_t key, void *data);
38 typedef void (*window_key_handler_t)(struct window *window, uint32_t key, uint32_t state, void *data);
39
40
41 struct window *
42 window_create(struct wl_display *display, int fd,
43               const char *title,
44               int32_t x, int32_t y, int32_t width, int32_t height);
45
46 void
47 window_draw(struct window *window);
48 void
49 window_get_child_rectangle(struct window *window,
50                            struct rectangle *rectangle);
51 void
52 window_set_child_size(struct window *window,
53                       struct rectangle *rectangle);
54 void
55 window_copy(struct window *window,
56             struct rectangle *rectangle,
57             uint32_t name, uint32_t stride);
58
59 cairo_surface_t *
60 window_create_surface(struct window *window,
61                       struct rectangle *rectangle);
62
63 void
64 window_copy_surface(struct window *window,
65                     struct rectangle *rectangle,
66                     cairo_surface_t *surface);
67
68 void
69 window_set_fullscreen(struct window *window, int fullscreen);
70
71 void
72 window_set_resize_handler(struct window *window,
73                           window_resize_handler_t handler, void *data);
74 void
75 window_set_frame_handler(struct window *window,
76                          window_frame_handler_t handler, void *data);
77 void
78 window_set_acknowledge_handler(struct window *window,
79                                window_acknowledge_handler_t handler, void *data);
80 void
81 window_set_key_handler(struct window *window,
82                        window_key_handler_t handler, void *data);
83
84 #endif