aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-03-07 17:51:43 +0100
committerDrew DeVault <sir@cmpwn.com>2019-04-11 09:19:57 -0600
commit3a233b3fccee189d77878c66cdc0961951b53739 (patch)
treebc648a47e3686e1a908c1739188dc2c6b9223739 /include
parentb6d0de177adaeeb0f5990613b52d50520bc15301 (diff)
Add support for wlr-output-management-unstable-v1
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/meson.build1
-rw-r--r--include/wlr/types/wlr_output_management_v1.h66
2 files changed, 67 insertions, 0 deletions
diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build
index fe39db36..fe82aeb5 100644
--- a/include/wlr/types/meson.build
+++ b/include/wlr/types/meson.build
@@ -23,6 +23,7 @@ install_headers(
'wlr_matrix.h',
'wlr_output_damage.h',
'wlr_output_layout.h',
+ 'wlr_output_management_v1.h',
'wlr_output.h',
'wlr_pointer_constraints_v1.h',
'wlr_pointer_gestures_v1.h',
diff --git a/include/wlr/types/wlr_output_management_v1.h b/include/wlr/types/wlr_output_management_v1.h
new file mode 100644
index 00000000..7f0ad4f9
--- /dev/null
+++ b/include/wlr/types/wlr_output_management_v1.h
@@ -0,0 +1,66 @@
+/*
+ * 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_OUTPUT_MANAGEMENT_V1_H
+#define WLR_TYPES_WLR_OUTPUT_MANAGEMENT_V1_H
+
+#include <wayland-server.h>
+#include <wlr/types/wlr_output.h>
+
+struct wlr_output_configuration_v1;
+
+struct wlr_output_manager_v1 {
+ struct wl_display *display;
+ struct wl_global *global;
+ struct wl_list resources;
+
+ struct wlr_output_configuration_v1 *current;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+
+ struct wl_listener display_destroy;
+
+ void *data;
+};
+
+// TODO: split this into multiple structs (state + output_head + output_configuration_head)
+struct wlr_output_configuration_head_v1 {
+ struct wlr_output_configuration_v1 *config;
+ struct wlr_output *output;
+ struct wl_list link;
+
+ // for current config only
+ struct wl_list resources;
+
+ bool enabled;
+
+ struct wl_listener output_destroy;
+};
+
+struct wlr_output_configuration_v1 {
+ struct wl_list heads;
+ uint32_t serial;
+};
+
+struct wlr_output_manager_v1 *wlr_output_manager_v1_create(
+ struct wl_display *display);
+void wlr_output_manager_v1_set_configuration(
+ struct wlr_output_manager_v1 *manager,
+ struct wlr_output_configuration_v1 *config);
+
+struct wlr_output_configuration_v1 *wlr_output_configuration_v1_create(void);
+void wlr_output_configuration_v1_destroy(
+ struct wlr_output_configuration_v1 *config);
+
+struct wlr_output_configuration_head_v1 *
+ wlr_output_configuration_head_v1_create(
+ struct wlr_output_configuration_v1 *config, struct wlr_output *output);
+
+#endif