Kristian Høgsberg | ffd710e | 2008-12-02 15:15:01 -0500 | [diff] [blame] | 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 | |
Kristian Høgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 23 | #ifndef _WAYLAND_CLIENT_H |
| 24 | #define _WAYLAND_CLIENT_H |
| 25 | |
Kristian Høgsberg | b56cb00 | 2010-07-29 15:43:46 -0400 | [diff] [blame] | 26 | #include "wayland-util.h" |
Kristian Høgsberg | a1f3f60 | 2010-08-03 09:26:44 -0400 | [diff] [blame] | 27 | #include "wayland-client-protocol.h" |
Kristian Høgsberg | 2d6b7c1 | 2010-06-25 16:51:57 -0400 | [diff] [blame] | 28 | |
Kristian Høgsberg | da6c6b1 | 2010-06-10 13:48:44 -0400 | [diff] [blame] | 29 | #ifdef __cplusplus |
| 30 | extern "C" { |
| 31 | #endif |
| 32 | |
Kristian Høgsberg | fb59084 | 2008-11-07 14:27:23 -0500 | [diff] [blame] | 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 | |
Kristian Høgsberg | dc0f355 | 2008-12-07 15:22:22 -0500 | [diff] [blame] | 38 | struct wl_display *wl_display_create(const char *name, size_t name_size); |
Kristian Høgsberg | 427524a | 2008-10-08 13:32:07 -0400 | [diff] [blame] | 39 | void wl_display_destroy(struct wl_display *display); |
Kristian Høgsberg | fb59084 | 2008-11-07 14:27:23 -0500 | [diff] [blame] | 40 | int wl_display_get_fd(struct wl_display *display, |
| 41 | wl_display_update_func_t update, void *data); |
Kristian Høgsberg | 4fe1a3e | 2010-08-10 14:02:48 -0400 | [diff] [blame] | 42 | uint32_t wl_display_allocate_id(struct wl_display *display); |
Kristian Høgsberg | 427524a | 2008-10-08 13:32:07 -0400 | [diff] [blame] | 43 | void wl_display_iterate(struct wl_display *display, uint32_t mask); |
Kristian Høgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 44 | |
Kristian Høgsberg | 94448c0 | 2008-12-30 11:03:33 -0500 | [diff] [blame] | 45 | struct wl_global_listener; |
| 46 | typedef void (*wl_display_global_func_t)(struct wl_display *display, |
Kristian Høgsberg | 4fe1a3e | 2010-08-10 14:02:48 -0400 | [diff] [blame] | 47 | uint32_t id, |
| 48 | const char *interface, |
| 49 | uint32_t version, |
Kristian Høgsberg | 94448c0 | 2008-12-30 11:03:33 -0500 | [diff] [blame] | 50 | void *data); |
Kristian Høgsberg | ee02ca6 | 2008-12-21 23:37:12 -0500 | [diff] [blame] | 51 | void |
Kristian Høgsberg | 94448c0 | 2008-12-30 11:03:33 -0500 | [diff] [blame] | 52 | wl_display_remove_global_listener(struct wl_display *display, |
| 53 | struct wl_global_listener *listener); |
| 54 | |
| 55 | struct wl_global_listener * |
| 56 | wl_display_add_global_listener(struct wl_display *display, |
| 57 | wl_display_global_func_t handler, void *data); |
Kristian Høgsberg | de31d5c | 2008-12-18 17:55:33 -0500 | [diff] [blame] | 58 | struct wl_visual * |
| 59 | wl_display_get_argb_visual(struct wl_display *display); |
| 60 | struct wl_visual * |
| 61 | wl_display_get_premultiplied_argb_visual(struct wl_display *display); |
| 62 | struct wl_visual * |
| 63 | wl_display_get_rgb_visual(struct wl_display *display); |
Kristian Høgsberg | d2412e2 | 2008-12-15 20:35:24 -0500 | [diff] [blame] | 64 | |
Kristian Høgsberg | da6c6b1 | 2010-06-10 13:48:44 -0400 | [diff] [blame] | 65 | #ifdef __cplusplus |
| 66 | } |
| 67 | #endif |
| 68 | |
Kristian Høgsberg | a67a71a | 2008-10-07 10:10:36 -0400 | [diff] [blame] | 69 | #endif |