1 #ifndef WAYLAND_SERVER_CORE_H
2 #define WAYLAND_SERVER_CORE_H
6 static int WL_EVENT_LOOP_ADD_FD_ERROR;
7 static int WL_EVENT_SOURCE_FD_UPDATE_ERROR;
8 static int WL_EVENT_LOOP_ADD_TIMER_ERROR;
9 static int WL_EVENT_SOURCE_TIMER_UPDATE_ERROR;
10 static int WL_DISPLAY_CREATE_ERROR;
13 WL_EVENT_READABLE = 0x01,
14 WL_EVENT_WRITABLE = 0x02,
15 WL_EVENT_HANGUP = 0x04,
23 struct wl_interface wl_tdm_interface;
25 struct wl_interface wl_tdm_vblank_interface;
28 WL_TDM_ERROR_INVALID_NAME,
29 WL_TDM_ERROR_OPERATION_FAILED
37 struct wl_tdm_interface {
38 void (*_tdm_server_cb_wait_vblank)(struct wl_client *client,
39 struct wl_resource *resource,
40 uint32_t id, const char *name, int32_t interval);
43 struct wl_event_loop {
47 struct wl_event_source {
51 wl_display ut_wl_display;
52 wl_event_loop ut_wl_event_loop;
54 static void wl_display_flush_clients(struct wl_display *display)
59 static struct wl_display *wl_display_create()
61 if (WL_DISPLAY_CREATE_ERROR)
63 return &ut_wl_display;
66 static struct wl_event_loop *wl_display_get_event_loop(struct wl_display *display)
70 return &ut_wl_event_loop;
73 static void wl_display_destroy(struct wl_display *display)
78 static int wl_event_loop_get_fd(struct wl_event_loop *loop)
85 typedef void (*wl_global_bind_func_t)(struct wl_client *client, void *data,
86 uint32_t version, uint32_t id);
88 static int wl_event_loop_dispatch(struct wl_event_loop *loop, int timeout)
96 typedef int (*wl_event_loop_fd_func_t)(int fd, uint32_t wl_mask, void *data);
98 struct wl_event_source event_source;
100 static struct wl_event_source *wl_event_loop_add_fd(struct wl_event_loop *loop,
101 int fd, uint32_t mask,
102 wl_event_loop_fd_func_t func,
111 if (WL_EVENT_LOOP_ADD_FD_ERROR) {
115 return &event_source;
118 static int wl_event_source_fd_update(struct wl_event_source *source, uint32_t mask)
123 if (WL_EVENT_SOURCE_FD_UPDATE_ERROR) {
130 typedef int (*wl_event_loop_timer_func_t) (void *data);
132 static struct wl_event_source *wl_event_loop_add_timer(struct wl_event_loop *loop,
133 wl_event_loop_timer_func_t func,
140 if (WL_EVENT_LOOP_ADD_TIMER_ERROR) {
144 return &event_source;
147 static int wl_event_source_timer_update(struct wl_event_source *source, int ms_delay)
152 if (WL_EVENT_SOURCE_TIMER_UPDATE_ERROR) {
159 static int wl_event_source_remove(struct wl_event_source *source)
166 typedef void (*wl_resource_destroy_func_t) (struct wl_resource *resource);
168 #endif /* WAYLAND_SERVER_CORE_H */