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>
56 lines
2.5 KiB
C++
56 lines
2.5 KiB
C++
/* SPDX-FileCopyrightText: 2026 Blender Authors
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#pragma once
|
|
|
|
#include "GHOST_WindowNULL.hh"
|
|
#include "GHOST_Rect.hh"
|
|
#include <vector>
|
|
|
|
/* A worker-owned canvas window. Unsupported desktop operations retain the
|
|
* headless implementation until the browser host provides those services. */
|
|
class GHOST_WindowWeb : public GHOST_WindowNULL {
|
|
public:
|
|
GHOST_WindowWeb(const char *selector, uint32_t width, uint32_t height, float pixel_ratio);
|
|
bool getValid() const override;
|
|
void setTitle(const char *title) override;
|
|
std::string getTitle() const override;
|
|
GHOST_TWindowState getState() const override { return observed_state_; }
|
|
void acknowledgeFullscreen(bool fullscreen)
|
|
{
|
|
observed_state_ = fullscreen ? GHOST_kWindowStateFullScreen : GHOST_kWindowStateNormal;
|
|
}
|
|
GHOST_TSuccess setState(GHOST_TWindowState state) override;
|
|
GHOST_TSuccess invalidate() override;
|
|
void getClientBounds(GHOST_Rect &bounds) const override;
|
|
GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override;
|
|
GHOST_TSuccess setClientWidth(uint32_t width) override;
|
|
GHOST_TSuccess setClientHeight(uint32_t height) override;
|
|
GHOST_TSuccess activateDrawingContext() override;
|
|
GHOST_TSuccess swapBufferRelease() override;
|
|
void setPixelRatio(float ratio);
|
|
uint16_t getDPIHint() override;
|
|
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor shape) override;
|
|
GHOST_TSuccess getCursorBitmap(GHOST_CursorBitmapRef *bitmap) override;
|
|
uint32_t cursorRevision() const { return cursor_revision_; }
|
|
|
|
private:
|
|
GHOST_TSuccess setWindowCursorVisibility(bool visible) override;
|
|
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override;
|
|
GHOST_TSuccess setWindowCustomCursorShape(const uint8_t *bitmap,
|
|
const uint8_t *mask,
|
|
const int size[2],
|
|
const int hot_spot[2],
|
|
bool can_invert_color) override;
|
|
std::vector<uint8_t> cursor_pixels_;
|
|
int cursor_size_[2] = {}, cursor_hotspot_[2] = {};
|
|
uint32_t cursor_revision_ = 0;
|
|
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override;
|
|
bool getCursorGrabUseSoftwareDisplay() override;
|
|
GHOST_Context *newDrawingContext(GHOST_TDrawingContextType type) override;
|
|
std::string selector_;
|
|
std::string title_ = "Blender";
|
|
GHOST_TWindowState observed_state_ = GHOST_kWindowStateNormal;
|
|
uint32_t width_, height_;
|
|
float pixel_ratio_ = 1.0f;
|
|
};
|