feat(automation): add open_files to backend interface + kErrLoadFailed (1007)

This commit is contained in:
SoftFever
2026-06-03 19:55:46 +08:00
parent b70be9178e
commit b3d7a732c5
3 changed files with 17 additions and 0 deletions

View File

@@ -95,6 +95,12 @@ public:
// Screenshot. target == nullptr => main frame. Captured from the on-screen
// composited framebuffer, so it includes the GL viewport and ImGui overlays.
virtual PngImage screenshot_window(const UiNode* target) = 0;
// Load one or more files (absolute paths) into the running instance on the GUI
// thread. Returns the number of objects added to the scene (load_files(...).size()).
// Throws AutomationError(kErrLoadFailed) when nothing loads. Header stays wx-free:
// the concrete LoadStrategy is chosen inside WxUiBackend, not exposed here.
virtual int open_files(const std::vector<std::string>& paths) = 0;
};
}}} // namespace Slic3r::GUI::Automation

View File

@@ -17,6 +17,7 @@ constexpr int kErrWaitTimeout = 1003;
constexpr int kErrGuiBusy = 1004; // GUI thread timeout
constexpr int kErrScreenshotFail = 1005;
constexpr int kErrDisabled = 1006;
constexpr int kErrLoadFailed = 1007; // file.open: load_files returned empty / threw
constexpr const char* kProtocolVersion = "2.0";
constexpr const char* kAutomationVersion = "1.0.0";