Kristian Høgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 1 | #ifndef _WAYLAND_CLIENT_H |
| 2 | #define _WAYLAND_CLIENT_H |
| 3 | |
Kristian Høgsberg | b7a0192 | 2008-11-08 15:39:41 -0500 | [diff] [blame] | 4 | /* 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øgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 11 | struct wl_display; |
| 12 | struct wl_surface; |
| 13 | |
Kristian Høgsberg | fb59084 | 2008-11-07 14:27:23 -0500 | [diff] [blame] | 14 | #define WL_DISPLAY_READABLE 0x01 |
| 15 | #define WL_DISPLAY_WRITABLE 0x02 |
| 16 | |
| 17 | typedef int (*wl_display_update_func_t)(uint32_t mask, void *data); |
| 18 | |
| 19 | struct wl_display *wl_display_create(const char *address); |
Kristian Høgsberg | 427524a | 2008-10-08 13:32:07 -0400 | [diff] [blame] | 20 | void wl_display_destroy(struct wl_display *display); |
Kristian Høgsberg | fb59084 | 2008-11-07 14:27:23 -0500 | [diff] [blame] | 21 | int wl_display_get_fd(struct wl_display *display, |
| 22 | wl_display_update_func_t update, void *data); |
| 23 | |
Kristian Høgsberg | 427524a | 2008-10-08 13:32:07 -0400 | [diff] [blame] | 24 | void wl_display_iterate(struct wl_display *display, uint32_t mask); |
Kristian Høgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 25 | |
Kristian Høgsberg | 5a27f3e | 2008-11-02 10:55:25 -0500 | [diff] [blame] | 26 | typedef 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 | |
| 31 | void wl_display_set_event_handler(struct wl_display *display, |
| 32 | wl_display_event_func_t handler, |
| 33 | void *data); |
| 34 | |
| 35 | |
Kristian Høgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 36 | struct wl_surface * |
| 37 | wl_display_create_surface(struct wl_display *display); |
| 38 | |
Kristian Høgsberg | 05eff51 | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 39 | void wl_surface_destroy(struct wl_surface *surface); |
| 40 | void wl_surface_attach(struct wl_surface *surface, |
Kristian Høgsberg | 7f77bd8 | 2008-11-07 08:39:37 -0500 | [diff] [blame] | 41 | uint32_t name, int32_t width, int32_t height, uint32_t stride); |
Kristian Høgsberg | 05eff51 | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 42 | void wl_surface_map(struct wl_surface *surface, |
| 43 | int32_t x, int32_t y, int32_t width, int32_t height); |
Kristian Høgsberg | 7f77bd8 | 2008-11-07 08:39:37 -0500 | [diff] [blame] | 44 | void wl_surface_copy(struct wl_surface *surface, int32_t dst_x, int32_t dst_y, |
| 45 | uint32_t name, uint32_t stride, |
| 46 | int32_t x, int32_t y, int32_t width, int32_t height); |
| 47 | void wl_surface_damage(struct wl_surface *surface, |
| 48 | int32_t x, int32_t y, int32_t width, int32_t height); |
Kristian Høgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 49 | |
| 50 | #endif |