From 4666fc78a0f49dd3a8907d62dc213b7c3bdf0ee6 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 12 Feb 2019 12:10:25 +1300 Subject: [PATCH] backend: Add capability bitmask This allows for a more robust an extensible way to advertise features that a backend is capable of. --- include/wlr/backend.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/wlr/backend.h b/include/wlr/backend.h index 54f2b5e8a..664128ef4 100644 --- a/include/wlr/backend.h +++ b/include/wlr/backend.h @@ -15,8 +15,45 @@ struct wlr_backend_impl; +enum wlr_backend_capability { + /* + * This backend supports input devices. + * New input devices are advertised with the 'new_input' event. + */ + WLR_BACKEND_CAP_INPUT = 1 << 0, + /* + * This backend supports graphical outputs. + * New outputs are advertised with the 'new_output' event. + */ + WLR_BACKEND_CAP_OUTPUT = 1 << 1, + /* + * This backend takes control of the login session or 'seat'. + * See the wlr_session type for more details. + */ + WLR_BACKEND_CAP_SESSION = 1 << 2, + /* + * This backend is capable of setting an output's mode (resolution) to + * an arbitrary value. If this is not supported, you must use a mode + * listed by the wlr_output. + */ + WLR_BACKEND_CAP_ARBITRARY_MODES = 1 << 3, + /* + * This backend supports setting cursors without requiring them to be + * composited to the main framebuffer. Some backends may have extra + * restrictions for what it can accept as a valid hardware cursor. + */ + WLR_BACKEND_CAP_HARDWARE_CURSOR = 1 << 4, + /* + * This backend supports accurate feedback for when a frame is + * presented to an output. This is relevant to the wp_presentation + * protocol. + */ + WLR_BACKEND_CAP_PRESENTATION_TIME = 1 << 5, +}; + struct wlr_backend { const struct wlr_backend_impl *impl; + uint32_t capabilities; // Bitmask of enum wlr_backend_capability struct { /** Raised when destroyed, passed the wlr_backend reference */