add sandbox support to desktop designer, fix mouse coordinates and UI issues
- Add DesktopSandbox class that integrates timer, JSON, crypto, and VirtualFS APIs - Fix mouse coordinate handling: GLFW reports window coordinates, not physical pixels - Fix font path resolution to search multiple locations for test apps - Fix screenshot capture timing (capture before buffer swap) - Fix test app CSS: use border-width instead of border:none, add display:block - Fix test app Lua: add document nil checks, use HTML entities for symbols - Update hot_reload to reset sandbox state on reload Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
33
designer/src/desktop_sandbox.h
Normal file
33
designer/src/desktop_sandbox.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
struct lua_State;
|
||||
|
||||
namespace mosis {
|
||||
|
||||
class TimerManager;
|
||||
class VirtualFS;
|
||||
|
||||
struct DesktopSandboxConfig {
|
||||
std::string app_id = "com.mosis.designer";
|
||||
std::string data_root = "./sandbox_data";
|
||||
};
|
||||
|
||||
class DesktopSandbox {
|
||||
public:
|
||||
explicit DesktopSandbox(const DesktopSandboxConfig& config);
|
||||
~DesktopSandbox();
|
||||
|
||||
void RegisterAPIs(lua_State* L);
|
||||
void UnregisterAPIs(lua_State* L);
|
||||
void Update(); // Process timers - call each frame
|
||||
void Reset(); // For hot-reload
|
||||
|
||||
private:
|
||||
DesktopSandboxConfig m_config;
|
||||
std::unique_ptr<TimerManager> m_timer_manager;
|
||||
std::unique_ptr<VirtualFS> m_vfs;
|
||||
};
|
||||
|
||||
} // namespace mosis
|
||||
Reference in New Issue
Block a user