Create socket in /var/run/user/${HOME}
[profile/ivi/weston.git] / wayland / wayland-client.h
1 /*
2  * Copyright © 2008 Kristian Høgsberg
3  *
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.
13  *
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
20  * OF THIS SOFTWARE.
21  */
22
23 #ifndef _WAYLAND_CLIENT_H
24 #define _WAYLAND_CLIENT_H
25
26 #include "wayland-util.h"
27 #include "wayland-client-protocol.h"
28
29 #ifdef  __cplusplus
30 extern "C" {
31 #endif
32
33 #define WL_DISPLAY_READABLE 0x01
34 #define WL_DISPLAY_WRITABLE 0x02
35
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);
39
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);
50
51 struct wl_global_listener;
52 typedef void (*wl_display_global_func_t)(struct wl_display *display,
53                                          uint32_t id,
54                                          const char *interface,
55                                          uint32_t version,
56                                          void *data);
57 void
58 wl_display_remove_global_listener(struct wl_display *display,
59                                   struct wl_global_listener *listener);
60
61 struct wl_global_listener *
62 wl_display_add_global_listener(struct wl_display *display,
63                                wl_display_global_func_t handler, void *data);
64 struct wl_visual *
65 wl_display_get_argb_visual(struct wl_display *display);
66 struct wl_visual *
67 wl_display_get_premultiplied_argb_visual(struct wl_display *display);
68 struct wl_visual *
69 wl_display_get_rgb_visual(struct wl_display *display);
70
71 #ifdef  __cplusplus
72 }
73 #endif
74
75 #endif