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"
35 void wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...);
36 struct wl_proxy *wl_proxy_create(struct wl_proxy *factory,
37 const struct wl_interface *interface);
38 struct wl_proxy *wl_proxy_create_for_id(struct wl_display *display,
39 const struct wl_interface *interface,
41 void wl_proxy_destroy(struct wl_proxy *proxy);
42 int wl_proxy_add_listener(struct wl_proxy *proxy,
43 void (**implementation)(void), void *data);
44 void wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);
45 void *wl_proxy_get_user_data(struct wl_proxy *proxy);
47 #include "wayland-client-protocol.h"
49 #define WL_DISPLAY_READABLE 0x01
50 #define WL_DISPLAY_WRITABLE 0x02
52 typedef int (*wl_display_update_func_t)(uint32_t mask, void *data);
53 typedef void (*wl_display_sync_func_t)(void *data);
54 typedef void (*wl_display_frame_func_t)(struct wl_surface *surface,
55 void *data, uint32_t time);
57 struct wl_display *wl_display_connect(const char *name);
58 void wl_display_destroy(struct wl_display *display);
59 int wl_display_get_fd(struct wl_display *display,
60 wl_display_update_func_t update, void *data);
61 uint32_t wl_display_allocate_id(struct wl_display *display);
62 void wl_display_iterate(struct wl_display *display, uint32_t mask);
63 void wl_display_flush(struct wl_display *display);
64 int wl_display_sync_callback(struct wl_display *display,
65 wl_display_sync_func_t func, void *data);
66 int wl_display_frame_callback(struct wl_display *display,
67 struct wl_surface *surface,
68 wl_display_frame_func_t func, void *data);
70 struct wl_global_listener;
71 typedef void (*wl_display_global_func_t)(struct wl_display *display,
73 const char *interface,
77 wl_display_remove_global_listener(struct wl_display *display,
78 struct wl_global_listener *listener);
79 struct wl_global_listener *
80 wl_display_add_global_listener(struct wl_display *display,
81 wl_display_global_func_t handler, void *data);
83 wl_display_get_global(struct wl_display *display,
84 const char *interface, uint32_t version);