- 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>
34 lines
702 B
C++
34 lines
702 B
C++
#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
|