#pragma once #include #include #include #include // Shared Layer Shell + WebKitGTK surface. Subclasses only supply layout. class Surface { public: struct Config { const char* layer_namespace = nullptr; const char* surface_name = nullptr; GtkLayerShellLayer layer = GTK_LAYER_SHELL_LAYER_TOP; bool anchor_top = false; bool anchor_bottom = false; bool anchor_left = false; bool anchor_right = false; int height_px = -1; GtkLayerShellKeyboardMode keyboard_mode = GTK_LAYER_SHELL_KEYBOARD_MODE_NONE; bool auto_exclusive_zone = false; }; Surface(GtkApplication* app, const std::string& base_url, const Config& config); ~Surface() = default; Surface(const Surface&) = delete; Surface& operator=(const Surface&) = delete; Surface(Surface&&) = delete; Surface& operator=(Surface&&) = delete; void present(); GtkWindow* window() const { return window_; } private: GtkWindow* window_ = nullptr; }; std::string make_surface_url(std::string_view base_url, std::string_view surface_name);