@@ -24,8 +24,13 @@ limitations under the License.
2424#include < array>
2525#include < map>
2626
27- #include " ILayoutPane.h"
28- #include < ezlibs/ezXml.hpp>
27+ // The plugin API is deliberately ImGui-free: plugins are pure modules (scripting + data) and link
28+ // no imguipack/glad/glfw. The host owns all UI. The only host objects a plugin borrows are
29+ // forwarded by pointer/interface at instantiation (ez::Log via init(), IDatasModel via load(),
30+ // IScriptDebugHost via enableDebug()). This is what lets LogToGraph build fully static. The host
31+ // settings-dialog interface (ISettings) is NOT here anymore — it moved to src/systems/ISettings.h
32+ // since plugins no longer provide settings.
33+ #include " IScriptDebugger.h"
2934
3035namespace ez {
3136class Log ;
@@ -44,46 +49,6 @@ class IProject {
4449typedef std::shared_ptr<IProject> IProjectPtr;
4550typedef std::weak_ptr<IProject> IProjectWeak;
4651
47- struct PluginPane : public virtual ILayoutPane {
48- bool init () override = 0; // return false if the init was failed
49- void unit () override = 0;
50-
51- // the return, is a user side use case here
52- bool drawPanes (bool * apOpened, LayoutPaneUserDatas apUserDatas) override = 0;
53- bool drawWidgets (LayoutPaneUserDatas /* apUserDatas*/ ) override { return false ; }
54- bool drawOverlays (const ImRect& /* aRect*/ , LayoutPaneUserDatas /* apUserDatas*/ ) override { return false ; }
55- bool drawDialogsAndPopups (const ImRect& /* aRect*/ , LayoutPaneUserDatas /* apUserDatas*/ ) override { return false ; }
56-
57- // if for any reason the pane must be hidden temporary, the user can control this here
58- virtual bool canBeDisplayed () override = 0;
59-
60- virtual void SetProjectInstance (IProjectWeak vProjectInstance) = 0;
61- };
62-
63- struct PluginPaneConfig {
64- ILayoutPaneWeak pane;
65- std::string name;
66- std::string category;
67- std::string disposal = " CENTRAL" ;
68- float disposalRatio = 0 .0f ;
69- bool openedDefault = false ;
70- bool focusedDefault = false ;
71- };
72-
73- typedef std::string SettingsCategoryPath;
74- enum class ISettingsType {
75- NONE = 0 ,
76- APP , // common for all users
77- PROJECT // user specific
78- };
79-
80- struct IXmlSettings {
81- // will be called by the saver
82- virtual ez::xml::Nodes getXmlSettings (const ISettingsType& vType) const = 0;
83- // will be called by the loader
84- virtual void setXmlSettings (const ez::xml::Node& vName, const ez::xml::Node& vParent, const std::string& vValue, const ISettingsType& vType) = 0;
85- };
86-
8752struct PluginParam {
8853 std::string name;
8954 enum class Type { NUM , STRING } type = Type::NUM ;
@@ -117,21 +82,6 @@ struct PluginModuleInfos {
11782 : path(vPath), label(vLabel), type(vType), color(vColor) {}
11883};
11984
120- struct ISettings : public IXmlSettings {
121- virtual ~ISettings () = default ;
122- // get the category path of the settings for the mebnu display. ex: "plugins/apis"
123- virtual SettingsCategoryPath getCategory () const = 0;
124- // will be called by the loader for inform the pluign than he must load somethings if any
125- virtual bool loadSettings () = 0;
126- // will be called by the saver for inform the pluign than he must save somethings if any, by ex: temporary vars
127- virtual bool saveSettings () = 0;
128- // will draw custom settings via imgui
129- virtual bool drawSettings () = 0;
130- };
131-
132- typedef std::shared_ptr<ISettings> ISettingsPtr;
133- typedef std::weak_ptr<ISettings> ISettingsWeak;
134-
13585typedef std::string ScriptFilePathName;
13686
13787struct ScriptingError {
@@ -163,14 +113,21 @@ struct ScriptingDatas {
163113 std::string buffer;
164114};
165115typedef std::string ScriptingModuleName;
166- struct ScriptingModule : public PluginModule {
116+ struct ScriptingModule : public PluginModule , public IScriptDebugger {
167117 virtual ~ScriptingModule () = default ;
168118 // will load the related scripting engine
169119 virtual bool load (IDatasModelWeak vDatasModel) = 0;
170120 // will unload the related scripting engine
171121 virtual void unload () = 0;
172- // will compile the script and return errors
122+ // will compile the script from a file path and return errors
173123 virtual bool compileScript (const ScriptFilePathName& vFilePathName, ErrorContainer& vOutErrors) = 0;
124+ // will compile the script from in-memory code (project script stored in the .ltg db).
125+ // default no-op so plugins that only support file-based scripts compile unchanged.
126+ virtual bool compileScriptCode (const std::string& aCode, ErrorContainer& aOutErrors) {
127+ (void )aCode;
128+ (void )aOutErrors;
129+ return false ;
130+ }
174131 // will call the start function from script and return errors
175132 virtual bool callScriptStart (ErrorContainer& vOutErrors) = 0;
176133 // will call the exec function from script with a buffer and return errors
@@ -186,11 +143,6 @@ struct ScriptingModule : public PluginModule {
186143typedef std::shared_ptr<ScriptingModule> ScriptingModulePtr;
187144typedef std::weak_ptr<ScriptingModule> ScriptingModuleWeak;
188145
189- struct PluginSettingsConfig {
190- ISettingsWeak settings;
191- PluginSettingsConfig (ISettingsWeak vSertings) : settings(vSertings) {}
192- };
193-
194146struct PluginInterface {
195147 virtual ~PluginInterface () = default ;
196148 virtual bool init (ez::Log* vLoggerInstancePtr) = 0;
@@ -206,8 +158,6 @@ struct PluginInterface {
206158 virtual std::string getDescription () const = 0;
207159 virtual std::vector<PluginModuleInfos> getModulesInfos () const = 0;
208160 virtual PluginModulePtr createModule (const std::string& vPluginModuleName, Ltg::PluginBridge* vBridgePtr) = 0;
209- virtual std::vector<PluginPaneConfig> getPanes () const = 0;
210- virtual std::vector<PluginSettingsConfig> getSettings () const = 0;
211161};
212162
213- } // namespace Ltg
163+ } // namespace Ltg
0 commit comments