6 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
9 WL_EVENT_READABLE = 0x01,
10 WL_EVENT_WRITEABLE = 0x02
14 struct wl_event_source;
15 typedef void (*wl_event_loop_fd_func_t)(int fd, uint32_t mask, void *data);
16 typedef void (*wl_event_loop_idle_func_t)(void *data);
18 struct wl_event_loop *wl_event_loop_create(void);
19 void wl_event_loop_destroy(struct wl_event_loop *loop);
20 struct wl_event_source *wl_event_loop_add_fd(struct wl_event_loop *loop,
21 int fd, uint32_t mask,
22 wl_event_loop_fd_func_t func,
24 int wl_event_loop_update_source(struct wl_event_loop *loop,
25 struct wl_event_source *source,
28 int wl_event_loop_remove_source(struct wl_event_loop *loop,
29 struct wl_event_source *source);
30 int wl_event_loop_wait(struct wl_event_loop *loop);
31 struct wl_event_source *wl_event_loop_add_idle(struct wl_event_loop *loop,
32 wl_event_loop_idle_func_t func,
36 struct wl_object **objects;
37 uint32_t count, alloc, id;
40 int wl_hash_insert(struct wl_hash *hash, struct wl_object *object);
41 struct wl_object *wl_hash_lookup(struct wl_hash *hash, uint32_t id);
42 void wl_hash_delete(struct wl_hash *hash, struct wl_object *object);
62 const struct wl_argument *arguments;
73 const struct wl_method *methods;
75 const struct wl_event *events;
79 const struct wl_interface *interface;
87 int32_t x, y, width, height;
90 struct wl_event_loop *wl_display_get_event_loop(struct wl_display *display);
92 void wl_surface_set_data(struct wl_surface *surface, void *data);
93 void *wl_surface_get_data(struct wl_surface *surface);
95 struct wl_surface_iterator;
96 struct wl_surface_iterator *
97 wl_surface_iterator_create(struct wl_display *display, uint32_t mask);
98 int wl_surface_iterator_next(struct wl_surface_iterator *iterator,
99 struct wl_surface **surface);
100 void wl_surface_iterator_destroy(struct wl_surface_iterator *iterator);
103 wl_input_device_create(struct wl_display *display,
104 const char *path, uint32_t id);
106 wl_display_post_relative_event(struct wl_display *display,
107 struct wl_object *source, int dx, int dy);
109 wl_display_post_absolute_event(struct wl_display *display,
110 struct wl_object *source, int x, int y);
112 wl_display_post_button_event(struct wl_display *display,
113 struct wl_object *source, int button, int state);
115 struct wl_compositor {
116 struct wl_compositor_interface *interface;
119 struct wl_compositor_interface {
120 void (*notify_surface_create)(struct wl_compositor *compositor,
121 struct wl_surface *surface);
122 void (*notify_surface_destroy)(struct wl_compositor *compositor,
123 struct wl_surface *surface);
124 void (*notify_surface_attach)(struct wl_compositor *compositor,
125 struct wl_surface *surface, uint32_t name,
126 uint32_t width, uint32_t height, uint32_t stride);
127 void (*notify_surface_map)(struct wl_compositor *compositor,
128 struct wl_surface *surface, struct wl_map *map);
131 struct wl_compositor *wl_compositor_create(struct wl_display *display);
133 void wl_display_set_compositor(struct wl_display *display,
134 struct wl_compositor *compositor);