refactor: invert the last engine-to-UI dependencies

- NodeFactory's menu creation moves to UI-side widget/menu/factorymenu
  (the factory only exposes its node library read-only now)
- DiskManager's cache-settings dialog is created through a registered
  std::function handler (registered by Core at startup)
- OlivePluginInstance creates progress UIs through a
  PluginProgressReporter interface (Null fallback headless) and queries
  the active viewer through a provider callback, both registered by Core
- factory.h, diskmanager and pluginSupport no longer reference any
  widget//dialog//panel//window headers or classes
This commit is contained in:
2026-07-20 02:05:01 +08:00
parent bff06e00e5
commit 026ff94b5e
21 changed files with 630 additions and 179 deletions
+16 -2
View File
@@ -27,6 +27,7 @@
#include <map>
#include <mutex>
#include <functional>
#include <QCoreApplication>
#include <QPointer>
#include <QThread>
@@ -43,15 +44,28 @@ inline bool is_gui_thread()
}
return true;
}
class ProgressDialog;
class ViewerOutput;
namespace plugin
{
class PluginNode;
class PluginProgressReporter;
enum class ErrorType { error, warning, message };
struct PersistentErrors {
ErrorType type;
QString message;
};
/**
* @brief Provider returning the currently active viewer
*
* Registered by the UI layer, which resolves the viewer through the panel
* manager. Without a provider, the OFX timeline suite falls back to its
* safe defaults (current time 0, empty bounds, seeking does nothing).
*/
using ActiveViewerProvider = std::function<ViewerOutput *()>;
void set_active_viewer_provider(ActiveViewerProvider provider);
class OlivePluginInstance : public OFX::Host::ImageEffect::Instance {
public:
OlivePluginInstance(OFX::Host::ImageEffect::ImageEffectPlugin *plugin,
@@ -214,7 +228,7 @@ private:
QString edit_label_;
QString edit_first_label_;
int edit_param_count_ = 0;
QPointer<olive::ProgressDialog> progress_dialog_;
QPointer<PluginProgressReporter> progress_reporter_;
bool progress_cancelled_ = false;
bool progress_active_ = false;
bool open_gl_enabled_ = false;