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 int wl_display_sync_callback(struct wl_display *display,
64 wl_display_sync_func_t func, void *data);
65 int wl_display_frame_callback(struct wl_display *display,
66 struct wl_surface *surface,
67 wl_display_frame_func_t func, void *data);
69 struct wl_global_listener;
70 typedef void (*wl_display_global_func_t)(struct wl_display *display,
72 const char *interface,
76 wl_display_remove_global_listener(struct wl_display *display,
77 struct wl_global_listener *listener);
78 struct wl_global_listener *
79 wl_display_add_global_listener(struct wl_display *display,
80 wl_display_global_func_t handler, void *data);
82 wl_display_get_global(struct wl_display *display,
83 const char *interface, uint32_t version);
86 wl_display_get_argb_visual(struct wl_display *display);
88 wl_display_get_premultiplied_argb_visual(struct wl_display *display);
90 wl_display_get_rgb_visual(struct wl_display *display);