aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-09-29 15:38:06 +0200
committeremersion <contact@emersion.fr>2018-10-04 21:55:31 +0200
commit3aad9fd6a96aa7c7d0fcf0dfa421c49caae83625 (patch)
tree8833b9c903b55aa00a80d53a5e77196451555635 /include
parentc67ce71fddeae90f6b3d89a742a77d049ffb3e20 (diff)
presentation-time: add protocol implementation
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/meson.build9
-rw-r--r--include/wlr/types/wlr_presentation_time.h56
2 files changed, 61 insertions, 4 deletions
diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build
index 6a8955c3..7a02c3da 100644
--- a/include/wlr/types/meson.build
+++ b/include/wlr/types/meson.build
@@ -5,10 +5,10 @@ install_headers(
'wlr_cursor.h',
'wlr_data_device.h',
'wlr_export_dmabuf_v1.h',
- 'wlr_gamma_control.h',
'wlr_gamma_control_v1.h',
- 'wlr_idle.h',
+ 'wlr_gamma_control.h',
'wlr_idle_inhibit_v1.h',
+ 'wlr_idle.h',
'wlr_input_device.h',
'wlr_input_inhibitor.h',
'wlr_keyboard.h',
@@ -16,10 +16,11 @@ install_headers(
'wlr_linux_dmabuf_v1.h',
'wlr_list.h',
'wlr_matrix.h',
- 'wlr_output.h',
'wlr_output_damage.h',
'wlr_output_layout.h',
+ 'wlr_output.h',
'wlr_pointer.h',
+ 'wlr_presentation_time.h',
'wlr_primary_selection.h',
'wlr_region.h',
'wlr_screencopy_v1.h',
@@ -36,7 +37,7 @@ install_headers(
'wlr_xcursor_manager.h',
'wlr_xdg_decoration_v1.h',
'wlr_xdg_output_v1.h',
- 'wlr_xdg_shell.h',
'wlr_xdg_shell_v6.h',
+ 'wlr_xdg_shell.h',
subdir: 'wlr/types',
)
diff --git a/include/wlr/types/wlr_presentation_time.h b/include/wlr/types/wlr_presentation_time.h
new file mode 100644
index 00000000..71bf5977
--- /dev/null
+++ b/include/wlr/types/wlr_presentation_time.h
@@ -0,0 +1,56 @@
+/*
+ * This an unstable interface of wlroots. No guarantees are made regarding the
+ * future consistency of this API.
+ */
+#ifndef WLR_USE_UNSTABLE
+#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
+#endif
+
+#ifndef WLR_TYPES_WLR_PRESENTATION_TIME_H
+#define WLR_TYPES_WLR_PRESENTATION_TIME_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <time.h>
+#include <wayland-server.h>
+
+struct wlr_presentation {
+ struct wl_global *global;
+ struct wl_list resources; // wl_resource_get_link
+ struct wl_list feedbacks; // wlr_presentation_feedback::link
+ clockid_t clock;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+
+ struct wl_listener display_destroy;
+};
+
+struct wlr_presentation_feedback {
+ struct wl_resource *resource;
+ struct wlr_presentation *presentation;
+ struct wlr_surface *surface;
+ bool committed;
+ struct wl_list link; // wlr_presentation::feedbacks
+
+ struct wl_listener surface_commit;
+ struct wl_listener surface_destroy;
+};
+
+struct wlr_presentation_event {
+ struct wlr_output *output;
+ uint64_t tv_sec;
+ uint32_t tv_nsec;
+ uint32_t refresh;
+ uint64_t seq;
+ uint32_t flags; // wp_presentation_feedback_kind
+};
+
+struct wlr_presentation *wlr_presentation_create(struct wl_display *display);
+void wlr_presentation_destroy(struct wlr_presentation *presentation);
+void wlr_presentation_send_surface_presented(
+ struct wlr_presentation *presentation, struct wlr_surface *surface,
+ struct wlr_presentation_event *event);
+
+#endif