Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
57 lines
2.3 KiB
C++
57 lines
2.3 KiB
C++
/* SPDX-FileCopyrightText: 2026 Blender Authors
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#pragma once
|
|
|
|
#include "GHOST_SystemHeadless.hh"
|
|
|
|
#include <string>
|
|
|
|
class GHOST_WindowWeb;
|
|
|
|
/* Browser services not yet implemented retain the headless failure behavior. */
|
|
class GHOST_SystemWeb : public GHOST_SystemHeadless {
|
|
public:
|
|
bool bindCanvas(const char *selector, float pixel_ratio);
|
|
GHOST_IWindow *createWindow(const char *title,
|
|
int32_t left,
|
|
int32_t top,
|
|
uint32_t width,
|
|
uint32_t height,
|
|
GHOST_TWindowState state,
|
|
GHOST_GPUSettings gpu_settings,
|
|
bool exclusive,
|
|
bool is_dialog,
|
|
const GHOST_IWindow *parent_window) override;
|
|
GHOST_TSuccess disposeWindow(GHOST_IWindow *window) override;
|
|
bool processEvents(bool wait_for_event) override;
|
|
uint64_t getMilliSeconds() const override;
|
|
GHOST_TCapabilityFlag getCapabilities() const override
|
|
{
|
|
return GHOST_TCapabilityFlag(GHOST_SystemHeadless::getCapabilities() |
|
|
GHOST_kCapabilityCursorRGBA);
|
|
}
|
|
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const override;
|
|
GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override;
|
|
GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const override;
|
|
GHOST_TSuccess setCursorPosition(int32_t x, int32_t y) override;
|
|
GHOST_TSuccess moveBrowserCursor(float x, float y, bool relative);
|
|
void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override;
|
|
void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override;
|
|
GHOST_IWindow *getWindowUnderCursor(int32_t x, int32_t y) override;
|
|
GHOST_TSuccess pushBrowserEvent(std::unique_ptr<const GHOST_IEvent> event);
|
|
void setBrowserModifiers(int modifiers,
|
|
GHOST_TKey changed_key = GHOST_kKeyUnknown,
|
|
bool down = false);
|
|
|
|
private:
|
|
std::string canvas_selector_;
|
|
float pixel_ratio_ = 1.0f;
|
|
GHOST_WindowWeb *canvas_window_ = nullptr;
|
|
GHOST_ModifierKeys modifiers_;
|
|
GHOST_Buttons buttons_;
|
|
int32_t cursor_x_ = 0;
|
|
int32_t cursor_y_ = 0;
|
|
bool cursor_valid_ = false;
|
|
double cursor_remainder_[2] = {};
|
|
};
|