Introduce a Linux-only C++20 `nebula-shell` host built with CMake, GTK4, gtk4-layer-shell, and WebKitGTK 6.0. Add a shared `Surface` abstraction and concrete Desktop/TopBar/Launcher surfaces with layer placement, sizing, transparency, and per-surface `?surface=` URL loading. Add `ShellApplication` startup flow that validates `NEBULA_SHELL_DEV_URL`, checks layer-shell support, creates/presents desktop and top bar, and keeps launcher created but hidden for future bridge-driven toggling. Update the native README to document architecture, development setup, dependencies, and current milestone scope.
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <gtk/gtk.h>
|
|
#include <gtk4-layer-shell.h>
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
// 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);
|