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
23 #ifndef _WAYLAND_CLIENT_H
24 #define _WAYLAND_CLIENT_H
26 #include "wayland-util.h"
27 #include "wayland-client-protocol.h"
33 #define WL_DISPLAY_READABLE 0x01
34 #define WL_DISPLAY_WRITABLE 0x02
36 typedef int (*wl_display_update_func_t)(uint32_t mask, void *data);
37 typedef void (*wl_display_sync_func_t)(void *data);
38 typedef void (*wl_display_frame_func_t)(void *data, uint32_t time);
40 struct wl_display *wl_display_connect(const char *name);
41 void wl_display_destroy(struct wl_display *display);
42 int wl_display_get_fd(struct wl_display *display,
43 wl_display_update_func_t update, void *data);
44 uint32_t wl_display_allocate_id(struct wl_display *display);
45 void wl_display_iterate(struct wl_display *display, uint32_t mask);
46 int wl_display_sync_callback(struct wl_display *display,
47 wl_display_sync_func_t func, void *data);
48 int wl_display_frame_callback(struct wl_display *display,
49 wl_display_frame_func_t func, void *data);
51 struct wl_global_listener;
52 typedef void (*wl_display_global_func_t)(struct wl_display *display,
54 const char *interface,
58 wl_display_remove_global_listener(struct wl_display *display,
59 struct wl_global_listener *listener);
61 struct wl_global_listener *
62 wl_display_add_global_listener(struct wl_display *display,
63 wl_display_global_func_t handler, void *data);
65 wl_display_get_argb_visual(struct wl_display *display);
67 wl_display_get_premultiplied_argb_visual(struct wl_display *display);
69 wl_display_get_rgb_visual(struct wl_display *display);