summaryrefslogtreecommitdiffstats
path: root/src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-12-05 17:09:02 +0100
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-12-07 09:58:35 +0100
commit4c89518228012ddc3602eab405e4b5fb8108fcdf (patch)
tree615d4fdc38999e408d52998c39760064d223b652 /src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h
parent542eca71e074b5110df2aaf822449bf7d6ec2b91 (diff)
Make wayland actually a module
Also fix so that QtCompositor can be built as shared object. + fix so that the default QT_WAYLAND_GL_CONFIG is wayland_egl Change-Id: I02b72e99286584426bd37ab2d00bbc84af11efdc Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h')
-rw-r--r--src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h b/src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h
new file mode 100644
index 000000000..f502bbaf3
--- /dev/null
+++ b/src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h
@@ -0,0 +1,74 @@
+#ifndef XCOMPOSITE_CLIENT_PROTOCOL_H
+#define XCOMPOSITE_CLIENT_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-util.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct wl_xcomposite;
+
+extern const struct wl_interface wl_xcomposite_interface;
+
+struct wl_xcomposite_listener {
+ void (*root)(void *data,
+ struct wl_xcomposite *wl_xcomposite,
+ const char *display_name,
+ uint32_t root_window);
+};
+
+static inline int
+wl_xcomposite_add_listener(struct wl_xcomposite *wl_xcomposite,
+ const struct wl_xcomposite_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_xcomposite,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_XCOMPOSITE_CREATE_BUFFER 0
+
+static inline void
+wl_xcomposite_set_user_data(struct wl_xcomposite *wl_xcomposite, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_xcomposite, user_data);
+}
+
+static inline void *
+wl_xcomposite_get_user_data(struct wl_xcomposite *wl_xcomposite)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_xcomposite);
+}
+
+static inline void
+wl_xcomposite_destroy(struct wl_xcomposite *wl_xcomposite)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_xcomposite);
+}
+
+static inline struct wl_buffer *
+wl_xcomposite_create_buffer(struct wl_xcomposite *wl_xcomposite, uint32_t x_window, int32_t width, int32_t height)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_create((struct wl_proxy *) wl_xcomposite,
+ &wl_buffer_interface);
+ if (!id)
+ return NULL;
+
+ wl_proxy_marshal((struct wl_proxy *) wl_xcomposite,
+ WL_XCOMPOSITE_CREATE_BUFFER, id, x_window, width, height);
+
+ return (struct wl_buffer *) id;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif