build: split the engine into liboakengine.so; worker drops the UI entirely

Physical split: app/{audio,cli,codec,common,config,node,pluginSupport,
render,task,timeline,undo,tool,shaders} plus coreengine, version and
ui/icons+colorcoding move to a new top-level engine/ tree, built as
liboakengine.so (shared). The render backends (oakgl/oakvulkan) move
with it and link the engine library instead of embedding a static
render-core subset (libolive-rendercore is gone).

- oak-render-worker now links liboakengine instead of the whole
  libolive-editor object set: 336MB -> 2.9MB, no Qt Widgets UI
- the editor links liboakengine for the engine and keeps only UI
  objects in libolive-editor
- install/packaging: GNUInstallDirs libdir on Linux, bundle copy on
  macOS, oakengine.dll staged for NSIS, AppImage validation entry
- fix backend lookup for the new layout: DynamicRenderer searched
  ../app but backends now live in engine/; a stale pre-split liboakgl
  in the build tree got dlopened instead, re-initialized and later
  destroyed the interposed engine statics (full-suite segfault at
  DialogSequenceParameterTab, found via gdb watchpoint)
This commit is contained in:
2026-07-20 03:23:28 +08:00
parent 026ff94b5e
commit 28c4426236
604 changed files with 243 additions and 172 deletions
+36
View File
@@ -0,0 +1,36 @@
# Olive - Non-Linear Video Editor
# Copyright (C) 2022 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/gizmo/draggable.cpp
node/gizmo/draggable.h
node/gizmo/gizmo.cpp
node/gizmo/gizmo.h
node/gizmo/line.cpp
node/gizmo/line.h
node/gizmo/path.cpp
node/gizmo/path.h
node/gizmo/point.cpp
node/gizmo/point.h
node/gizmo/polygon.cpp
node/gizmo/polygon.h
node/gizmo/screen.cpp
node/gizmo/screen.h
node/gizmo/text.cpp
node/gizmo/text.h
PARENT_SCOPE
)
+56
View File
@@ -0,0 +1,56 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "draggable.h"
namespace olive
{
DraggableGizmo::DraggableGizmo(QObject *parent)
: NodeGizmo{ parent }
, drag_value_behavior_(k_absolute)
{
}
void DraggableGizmo::drag_start(const NodeValueRow &row, double abs_x,
double abs_y, const Rational &time)
{
for (int i = 0; i < draggers_.size(); i++) {
draggers_[i].start(inputs_[i], time);
}
emit handle_start(row, abs_x, abs_y, time);
}
void DraggableGizmo::drag_move(double x, double y,
const Qt::KeyboardModifiers &modifiers)
{
emit handle_movement(x, y, modifiers);
}
void DraggableGizmo::drag_end(MultiUndoCommand *command)
{
for (int i = 0; i < draggers_.size(); i++) {
draggers_[i].end(command);
}
}
}
+93
View File
@@ -0,0 +1,93 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_DRAGGABLEGIZMO_H
#define OAK_DRAGGABLEGIZMO_H
#include "gizmo.h"
#include "node/inputdragger.h"
#include "undo/undocommand.h"
namespace olive
{
class DraggableGizmo : public NodeGizmo {
Q_OBJECT
public:
/// Changes what the X/Y coordinates emitted from HandleMovement specify
enum DragValueBehavior {
/// X/Y will be the exact mouse coordinates (in sequence pixels)
k_absolute,
/// X/Y will be the movement since the last time HandleMovement was called
k_delta_from_previous,
/// X/Y will be the movement from the start of the drag
k_delta_from_start
};
explicit DraggableGizmo(QObject *parent = nullptr);
void drag_start(const NodeValueRow &row, double abs_x, double abs_y,
const olive::core::Rational &time);
void drag_move(double x, double y, const Qt::KeyboardModifiers &modifiers);
void drag_end(olive::MultiUndoCommand *command);
void add_input(const NodeKeyframeTrackReference &input)
{
inputs_.append(input);
draggers_.append(NodeInputDragger());
}
QVector<NodeInputDragger> &get_draggers()
{
return draggers_;
}
DragValueBehavior get_drag_value_behavior() const
{
return drag_value_behavior_;
}
void set_drag_value_behavior(DragValueBehavior d)
{
drag_value_behavior_ = d;
}
signals:
void handle_start(const olive::NodeValueRow &row, double x, double y,
const olive::core::Rational &time);
void handle_movement(double x, double y,
const Qt::KeyboardModifiers &modifiers);
private:
QVector<NodeKeyframeTrackReference> inputs_;
QVector<NodeInputDragger> draggers_;
DragValueBehavior drag_value_behavior_;
};
}
#endif // OAK_DRAGGABLEGIZMO_H
+38
View File
@@ -0,0 +1,38 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "gizmo.h"
namespace olive
{
NodeGizmo::NodeGizmo(QObject *parent)
: visible_(true)
{
setParent(parent);
}
NodeGizmo::~NodeGizmo()
{
setParent(nullptr);
}
}
+71
View File
@@ -0,0 +1,71 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_NODEGIZMO_H
#define OAK_NODEGIZMO_H
#include <QObject>
#include <QPainter>
#include "node/globals.h"
namespace olive
{
class NodeGizmo : public QObject {
Q_OBJECT
public:
explicit NodeGizmo(QObject *parent = nullptr);
virtual ~NodeGizmo() override;
virtual void draw(QPainter *p) const
{
}
const NodeGlobals &get_globals() const
{
return globals_;
}
void set_globals(const NodeGlobals &globals)
{
globals_ = globals;
}
bool is_visible() const
{
return visible_;
}
void set_visible(bool e)
{
visible_ = e;
}
signals:
private:
NodeGlobals globals_;
bool visible_;
};
}
#endif // OAK_NODEGIZMO_H
+47
View File
@@ -0,0 +1,47 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "line.h"
namespace olive
{
LineGizmo::LineGizmo(QObject *parent)
: NodeGizmo(parent)
{
}
void LineGizmo::draw(QPainter *p) const
{
// Draw transposed black
QLineF transposed = p->transform().map(line_);
transposed.translate(1, 1);
transposed = p->transform().inverted().map(transposed);
p->setPen(QPen(Qt::black, 0));
p->drawLine(transposed);
// Draw normal white polygon
p->setPen(QPen(Qt::white, 0));
p->setBrush(Qt::NoBrush);
p->drawLine(line_);
}
}
+54
View File
@@ -0,0 +1,54 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_LINEGIZMO_H
#define OAK_LINEGIZMO_H
#include <QLineF>
#include "gizmo.h"
namespace olive
{
class LineGizmo : public NodeGizmo {
Q_OBJECT
public:
LineGizmo(QObject *parent = nullptr);
const QLineF &get_line() const
{
return line_;
}
void set_line(const QLineF &line)
{
line_ = line;
}
virtual void draw(QPainter *p) const override;
private:
QLineF line_;
};
}
#endif // OAK_LINEGIZMO_H
+47
View File
@@ -0,0 +1,47 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "path.h"
namespace olive
{
PathGizmo::PathGizmo(QObject *parent)
: DraggableGizmo{ parent }
{
}
void PathGizmo::draw(QPainter *p) const
{
// Draw transposed black
QPainterPath transposed = p->transform().map(path_);
transposed.translate(1, 1);
transposed = p->transform().inverted().map(transposed);
p->setPen(QPen(Qt::black, 0));
p->drawPath(transposed);
// Draw normal white polygon
p->setPen(QPen(Qt::white, 0));
p->setBrush(Qt::NoBrush);
p->drawPath(path_);
}
}
+54
View File
@@ -0,0 +1,54 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_PATHGIZMO_H
#define OAK_PATHGIZMO_H
#include <QPainterPath>
#include "draggable.h"
namespace olive
{
class PathGizmo : public DraggableGizmo {
Q_OBJECT
public:
explicit PathGizmo(QObject *parent = nullptr);
const QPainterPath &get_path() const
{
return path_;
}
void set_path(const QPainterPath &path)
{
path_ = path;
}
virtual void draw(QPainter *p) const override;
private:
QPainterPath path_;
};
}
#endif // OAK_PATHGIZMO_H
+109
View File
@@ -0,0 +1,109 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "point.h"
#include <QApplication>
namespace olive
{
PointGizmo::PointGizmo(const Shape &shape, bool smaller, QObject *parent)
: DraggableGizmo{ parent }
, shape_(shape)
, smaller_(smaller)
{
}
PointGizmo::PointGizmo(const Shape &shape, QObject *parent)
: PointGizmo(shape, false, parent)
{
}
PointGizmo::PointGizmo(QObject *parent)
: PointGizmo(k_square, parent)
{
}
void PointGizmo::draw(QPainter *p) const
{
QRectF rect = get_drawing_rect(p->transform(), get_standard_radius());
if (shape_ != k_anchor_point) {
p->setPen(QPen(Qt::black, 0));
p->setBrush(Qt::white);
}
switch (shape_) {
case k_square:
p->drawRect(rect);
break;
case k_circle:
p->drawEllipse(rect);
break;
case k_anchor_point:
p->setPen(QPen(Qt::white, 0));
p->setBrush(Qt::NoBrush);
p->drawEllipse(rect);
p->drawLines({ QPointF(rect.left(), rect.center().y()),
QPointF(rect.right(), rect.center().y()),
QPointF(rect.center().x(), rect.top()),
QPointF(rect.center().x(), rect.bottom()) });
break;
}
}
QRectF PointGizmo::get_clicking_rect(const QTransform &t) const
{
return get_drawing_rect(t, get_standard_radius());
}
double PointGizmo::get_standard_radius()
{
return QFontMetrics(qApp->font()).height() * 0.25;
}
QRectF PointGizmo::get_drawing_rect(const QTransform &transform,
double radius) const
{
QRectF r(0, 0, radius, radius);
r = transform.inverted().mapRect(r);
double width = r.width();
double height = r.height();
if (shape_ == k_anchor_point) {
width *= 2;
height *= 2;
}
if (smaller_) {
width *= 0.5;
height *= 0.5;
}
return QRectF(point_.x() - width, point_.y() - height, 2 * width,
2 * height);
}
}
+87
View File
@@ -0,0 +1,87 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_POINTGIZMO_H
#define OAK_POINTGIZMO_H
#include <QPointF>
#include "draggable.h"
namespace olive
{
class PointGizmo : public DraggableGizmo {
Q_OBJECT
public:
enum Shape { k_square, k_circle, k_anchor_point };
explicit PointGizmo(const Shape &shape, bool smaller,
QObject *parent = nullptr);
explicit PointGizmo(const Shape &shape, QObject *parent = nullptr);
explicit PointGizmo(QObject *parent = nullptr);
const Shape &get_shape() const
{
return shape_;
}
void set_shape(const Shape &s)
{
shape_ = s;
}
const QPointF &get_point() const
{
return point_;
}
void set_point(const QPointF &pt)
{
point_ = pt;
}
bool get_smaller() const
{
return smaller_;
}
void set_smaller(bool e)
{
smaller_ = e;
}
virtual void draw(QPainter *p) const override;
QRectF get_clicking_rect(const QTransform &t) const;
private:
static double get_standard_radius();
QRectF get_drawing_rect(const QTransform &transform, double radius) const;
Shape shape_;
QPointF point_;
bool smaller_;
};
}
#endif // OAK_POINTGIZMO_H
+47
View File
@@ -0,0 +1,47 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "polygon.h"
namespace olive
{
PolygonGizmo::PolygonGizmo(QObject *parent)
: DraggableGizmo{ parent }
{
}
void PolygonGizmo::draw(QPainter *p) const
{
// Draw transposed black
QPolygonF transposed = p->transform().map(polygon_);
transposed.translate(1, 1);
transposed = p->transform().inverted().map(transposed);
p->setPen(QPen(Qt::black, 0));
p->drawPolyline(transposed);
// Draw normal white polygon
p->setPen(QPen(Qt::white, 0));
p->setBrush(Qt::NoBrush);
p->drawPolyline(polygon_);
}
}
+54
View File
@@ -0,0 +1,54 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_POLYGONGIZMO_H
#define OAK_POLYGONGIZMO_H
#include <QPolygonF>
#include "draggable.h"
namespace olive
{
class PolygonGizmo : public DraggableGizmo {
Q_OBJECT
public:
explicit PolygonGizmo(QObject *parent = nullptr);
const QPolygonF &get_polygon() const
{
return polygon_;
}
void set_polygon(const QPolygonF &polygon)
{
polygon_ = polygon;
}
virtual void draw(QPainter *p) const override;
private:
QPolygonF polygon_;
};
}
#endif // OAK_POLYGONGIZMO_H
+32
View File
@@ -0,0 +1,32 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "screen.h"
namespace olive
{
ScreenGizmo::ScreenGizmo(QObject *parent)
: DraggableGizmo{ parent }
{
}
}
+38
View File
@@ -0,0 +1,38 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_SCREENGIZMO_H
#define OAK_SCREENGIZMO_H
#include "draggable.h"
namespace olive
{
class ScreenGizmo : public DraggableGizmo {
Q_OBJECT
public:
explicit ScreenGizmo(QObject *parent = nullptr);
};
}
#endif // OAK_SCREENGIZMO_H
+58
View File
@@ -0,0 +1,58 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "text.h"
#include "coreengine.h"
#include "undo/undocommand.h"
namespace olive
{
TextGizmo::TextGizmo(QObject *parent)
: NodeGizmo{ parent }
, valign_(Qt::AlignTop)
{
}
void TextGizmo::set_rect(const QRectF &r)
{
rect_ = r;
emit rect_changed(rect_);
}
void TextGizmo::update_input_html(const QString &s, const Rational &time)
{
if (input_.is_valid()) {
MultiUndoCommand *command = new MultiUndoCommand();
Node::set_value_at_time(input_.input(), time, s, input_.track(), command,
true);
EngineCore::instance()->undo_stack()->push(command, tr("Edit Text"));
}
}
void TextGizmo::set_vertical_alignment(Qt::Alignment va)
{
valign_ = va;
emit vertical_alignment_changed(valign_);
}
}
+82
View File
@@ -0,0 +1,82 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef OAK_TEXTGIZMO_H
#define OAK_TEXTGIZMO_H
#include "gizmo.h"
#include "node/param.h"
namespace olive
{
class TextGizmo : public NodeGizmo {
Q_OBJECT
public:
explicit TextGizmo(QObject *parent = nullptr);
const QRectF &get_rect() const
{
return rect_;
}
void set_rect(const QRectF &r);
const QString &get_html() const
{
return text_;
}
void set_html(const QString &t)
{
text_ = t;
}
void set_input(const NodeKeyframeTrackReference &input)
{
input_ = input;
}
void update_input_html(const QString &s, const Rational &time);
Qt::Alignment get_vertical_alignment() const
{
return valign_;
}
void set_vertical_alignment(Qt::Alignment va);
signals:
void activated();
void deactivated();
void vertical_alignment_changed(Qt::Alignment va);
void rect_changed(const QRectF &r);
private:
QRectF rect_;
QString text_;
NodeKeyframeTrackReference input_;
Qt::Alignment valign_;
};
}
#endif // OAK_TEXTGIZMO_H