blob: 05f19b01d03bbc11132753ec167feb1da9f2505a [file] [log] [blame]
Kristian Høgsberga67a71a2008-10-07 10:10:36 -04001#ifndef _WAYLAND_CLIENT_H
2#define _WAYLAND_CLIENT_H
3
Kristian Høgsbergb7a01922008-11-08 15:39:41 -05004/* GCC visibility */
5#if defined(__GNUC__) && __GNUC__ >= 4
6#define WL_EXPORT __attribute__ ((visibility("default")))
7#else
8#define WL_EXPORT
9#endif
10
Kristian Høgsberga67a71a2008-10-07 10:10:36 -040011struct wl_display;
12struct wl_surface;
13
Kristian Høgsbergfb590842008-11-07 14:27:23 -050014#define WL_DISPLAY_READABLE 0x01
15#define WL_DISPLAY_WRITABLE 0x02
16
17typedef int (*wl_display_update_func_t)(uint32_t mask, void *data);
18
19struct wl_display *wl_display_create(const char *address);
Kristian Høgsberg427524a2008-10-08 13:32:07 -040020void wl_display_destroy(struct wl_display *display);
Kristian Høgsbergfb590842008-11-07 14:27:23 -050021int wl_display_get_fd(struct wl_display *display,
22 wl_display_update_func_t update, void *data);
23
Kristian Høgsberg427524a2008-10-08 13:32:07 -040024void wl_display_iterate(struct wl_display *display, uint32_t mask);
Kristian Høgsberga67a71a2008-10-07 10:10:36 -040025
Kristian Høgsberg5a27f3e2008-11-02 10:55:25 -050026typedef void (*wl_display_event_func_t)(struct wl_display *display,
27 uint32_t opcode,
28 uint32_t arg1, uint32_t arg2,
29 void *data);
30
31void wl_display_set_event_handler(struct wl_display *display,
32 wl_display_event_func_t handler,
33 void *data);
34
Kristian Høgsberga67a71a2008-10-07 10:10:36 -040035struct wl_surface *
36wl_display_create_surface(struct wl_display *display);
37
Kristian Høgsberg05eff512008-10-07 10:10:36 -040038void wl_surface_destroy(struct wl_surface *surface);
39void wl_surface_attach(struct wl_surface *surface,
Kristian Høgsberg7f77bd82008-11-07 08:39:37 -050040 uint32_t name, int32_t width, int32_t height, uint32_t stride);
Kristian Høgsberg05eff512008-10-07 10:10:36 -040041void wl_surface_map(struct wl_surface *surface,
42 int32_t x, int32_t y, int32_t width, int32_t height);
Kristian Høgsberg7f77bd82008-11-07 08:39:37 -050043void wl_surface_copy(struct wl_surface *surface, int32_t dst_x, int32_t dst_y,
44 uint32_t name, uint32_t stride,
45 int32_t x, int32_t y, int32_t width, int32_t height);
46void wl_surface_damage(struct wl_surface *surface,
47 int32_t x, int32_t y, int32_t width, int32_t height);
Kristian Høgsberga67a71a2008-10-07 10:10:36 -040048
Kristian Høgsberg1e4b86a2008-11-23 23:41:08 -050049
50/* These entry points are for client side implementation of custom
51 * objects. */
52
53uint32_t wl_display_get_object_id(struct wl_display *display,
54 const char *interface);
55uint32_t wl_display_allocate_id(struct wl_display *display);
56void wl_display_write(struct wl_display *display,
57 const void *data,
58 size_t count);
59
Kristian Høgsberga67a71a2008-10-07 10:10:36 -040060#endif