diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWayland.h')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWayland.h | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.h b/intern/ghost/intern/GHOST_SystemWayland.h index caea7b0d748..a8e8d8ddc45 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.h +++ b/intern/ghost/intern/GHOST_SystemWayland.h @@ -21,18 +21,13 @@ # include <wayland_dynload_libdecor.h> # endif # include <libdecor.h> -#else -/* Generated by `wayland-scanner`. */ -# include <xdg-decoration-unstable-v1-client-protocol.h> -# include <xdg-shell-client-protocol.h> #endif +#include <mutex> #include <string> class GHOST_WindowWayland; -struct GWL_Display; - bool ghost_wl_output_own(const struct wl_output *wl_output); void ghost_wl_output_tag(struct wl_output *wl_output); struct GWL_Output *ghost_wl_output_user_data(struct wl_output *wl_output); @@ -52,10 +47,13 @@ void ghost_wl_surface_tag_cursor_tablet(struct wl_surface *surface); * Return true when all required WAYLAND libraries are present, * Performs dynamic loading when `WITH_GHOST_WAYLAND_DYNLOAD` is in use. */ -bool ghost_wl_dynload_libraries(); +bool ghost_wl_dynload_libraries_init(); +void ghost_wl_dynload_libraries_exit(); #endif struct GWL_Output { + GHOST_SystemWayland *system = nullptr; + struct wl_output *wl_output = nullptr; struct zxdg_output_v1 *xdg_output = nullptr; /** Dimensions in pixels. */ @@ -89,11 +87,12 @@ struct GWL_Output { class GHOST_SystemWayland : public GHOST_System { public: - GHOST_SystemWayland(); + GHOST_SystemWayland(bool background); + GHOST_SystemWayland() : GHOST_SystemWayland(true){}; ~GHOST_SystemWayland() override; - GHOST_TSuccess init(); + GHOST_TSuccess init() override; bool processEvents(bool waitForEvent) override; @@ -133,7 +132,6 @@ class GHOST_SystemWayland : public GHOST_System { uint32_t width, uint32_t height, GHOST_TWindowState state, - GHOST_TDrawingContextType type, GHOST_GLSettings glSettings, const bool exclusive, const bool is_dialog, @@ -155,31 +153,33 @@ class GHOST_SystemWayland : public GHOST_System { GHOST_TSuccess setCursorVisibility(bool visible); - bool supportsCursorWarp(); - bool supportsWindowPosition(); + bool supportsCursorWarp() override; + bool supportsWindowPosition() override; bool getCursorGrabUseSoftwareDisplay(const GHOST_TGrabCursorMode mode); /* WAYLAND direct-data access. */ - wl_display *display(); - - wl_compositor *compositor(); + struct wl_display *wl_display(); + struct wl_compositor *wl_compositor(); + struct zwp_primary_selection_device_manager_v1 *wp_primary_selection_manager(); + struct zwp_pointer_gestures_v1 *wp_pointer_gestures(); #ifdef WITH_GHOST_WAYLAND_LIBDECOR - libdecor *decor_context(); -#else - xdg_wm_base *xdg_shell(); - zxdg_decoration_manager_v1 *xdg_decoration_manager(); + libdecor *libdecor_context(); #endif + struct xdg_wm_base *xdg_decor_shell(); + struct zxdg_decoration_manager_v1 *xdg_decor_manager(); + /* End `xdg_decor`. */ const std::vector<GWL_Output *> &outputs() const; - wl_shm *shm() const; + struct wl_shm *wl_shm() const; /* WAYLAND utility functions. */ - void selection_set(const std::string &selection); + /** Set this seat to be active. */ + void seat_active_set(const struct GWL_Seat *seat); /** Clear all references to this surface to prevent accessing NULL pointers. */ void window_surface_unref(const wl_surface *wl_surface); @@ -192,7 +192,10 @@ class GHOST_SystemWayland : public GHOST_System { wl_surface *wl_surface, int scale); +#ifdef WITH_GHOST_WAYLAND_LIBDECOR + static bool use_libdecor_runtime(); +#endif + private: - struct GWL_Display *d; - std::string selection; + struct GWL_Display *display_; }; |