app: migrate all engine access to the C ABI facade (nm U _ZN5olive = 0)
Every app module now reaches liboakengine exclusively through oakengine_* C calls, EngineEventBridge subscriptions and app-side handle headers (cliphandle/keyframehandle/nodevaluehandle/oakvaluehelper). Direct C++ command construction, engine signal connect()s, and engine type usage in MOC-visible signatures are gone: 557 -> 0 undefined olive:: symbols in oak-editor.
This commit is contained in:
@@ -23,19 +23,22 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "oakengine/node.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
Menu *create_node_menu(QWidget *parent, bool create_none_item,
|
||||
Node::CategoryID restrict_to, uint64_t restrict_flags)
|
||||
{
|
||||
const QList<Node *> &library = NodeFactory::get_library();
|
||||
const int library_size = oakengine_node_factory_id_count();
|
||||
|
||||
Menu *menu = new Menu(parent);
|
||||
menu->setToolTipsVisible(true);
|
||||
|
||||
for (int i = 0; i < library.size(); i++) {
|
||||
Node *n = library.at(i);
|
||||
for (int i = 0; i < library_size; i++) {
|
||||
olive::Node *n = reinterpret_cast<olive::Node *>(
|
||||
oakengine_node_factory_node_at(i));
|
||||
|
||||
if (restrict_to != Node::k_category_unknown &&
|
||||
!n->category().contains(restrict_to)) {
|
||||
@@ -54,9 +57,11 @@ Menu *create_node_menu(QWidget *parent, bool create_none_item,
|
||||
// Make sure nodes are up-to-date with the current translation
|
||||
n->retranslate();
|
||||
|
||||
QString category_name = Node::get_category_name(
|
||||
n->category().isEmpty() ? Node::k_category_unknown :
|
||||
n->category().first());
|
||||
char cat_buf[256];
|
||||
oakengine_node_category_name(
|
||||
n->category().isEmpty() ? 0 : n->category().first(),
|
||||
cat_buf, sizeof(cat_buf));
|
||||
QString category_name = QString::fromUtf8(cat_buf);
|
||||
|
||||
// Find or create top-level category menu
|
||||
Menu *top_menu = nullptr;
|
||||
@@ -120,7 +125,9 @@ Node *create_node_from_menu_action(QAction *action)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return NodeFactory::get_library().at(index)->copy();
|
||||
olive::Node *proto = reinterpret_cast<olive::Node *>(
|
||||
oakengine_node_factory_node_at(index));
|
||||
return proto ? proto->copy() : nullptr;
|
||||
}
|
||||
|
||||
QString get_node_id_from_menu_action(QAction *action)
|
||||
@@ -131,7 +138,9 @@ QString get_node_id_from_menu_action(QAction *action)
|
||||
return QString();
|
||||
}
|
||||
|
||||
return NodeFactory::get_library().at(action->data().toInt())->id();
|
||||
olive::Node *proto = reinterpret_cast<olive::Node *>(
|
||||
oakengine_node_factory_node_at(index));
|
||||
return proto ? proto->id() : QString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
#include "node/factory.h"
|
||||
#include "oakengine/node.h"
|
||||
#include "node/node.h"
|
||||
#include "widget/menu/menu.h"
|
||||
|
||||
namespace olive
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "panel/timeline/timeline.h"
|
||||
#include "window/mainwindow/mainwindow.h"
|
||||
|
||||
#include "oakengine/undo.h"
|
||||
namespace olive
|
||||
{
|
||||
|
||||
@@ -172,8 +173,8 @@ void MenuShared::add_items_for_new_menu(Menu *m)
|
||||
|
||||
void MenuShared::add_items_for_edit_menu(Menu *m, bool for_clips)
|
||||
{
|
||||
m->addAction(Core::instance()->undo_stack()->GetUndoAction());
|
||||
m->addAction(Core::instance()->undo_stack()->GetRedoAction());
|
||||
m->addAction(reinterpret_cast<QAction*>(oakengine_undo_undo_action()));
|
||||
m->addAction(reinterpret_cast<QAction*>(oakengine_undo_redo_action()));
|
||||
|
||||
m->addSeparator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user