style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
@@ -26,30 +26,30 @@ namespace olive
|
||||
|
||||
DraggableGizmo::DraggableGizmo(QObject *parent)
|
||||
: NodeGizmo{ parent }
|
||||
, drag_value_behavior_(kAbsolute)
|
||||
, drag_value_behavior_(k_absolute)
|
||||
{
|
||||
}
|
||||
|
||||
void DraggableGizmo::DragStart(const NodeValueRow &row, double abs_x,
|
||||
double abs_y, const rational &time)
|
||||
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);
|
||||
draggers_[i].start(inputs_[i], time);
|
||||
}
|
||||
|
||||
emit HandleStart(row, abs_x, abs_y, time);
|
||||
emit handle_start(row, abs_x, abs_y, time);
|
||||
}
|
||||
|
||||
void DraggableGizmo::DragMove(double x, double y,
|
||||
void DraggableGizmo::drag_move(double x, double y,
|
||||
const Qt::KeyboardModifiers &modifiers)
|
||||
{
|
||||
emit HandleMovement(x, y, modifiers);
|
||||
emit handle_movement(x, y, modifiers);
|
||||
}
|
||||
|
||||
void DraggableGizmo::DragEnd(MultiUndoCommand *command)
|
||||
void DraggableGizmo::drag_end(MultiUndoCommand *command)
|
||||
{
|
||||
for (int i = 0; i < draggers_.size(); i++) {
|
||||
draggers_[i].End(command);
|
||||
draggers_[i].end(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
-17
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef DRAGGABLEGIZMO_H
|
||||
#define DRAGGABLEGIZMO_H
|
||||
#ifndef OAK_DRAGGABLEGIZMO_H
|
||||
#define OAK_DRAGGABLEGIZMO_H
|
||||
|
||||
#include "gizmo.h"
|
||||
#include "node/inputdragger.h"
|
||||
@@ -35,49 +35,49 @@ public:
|
||||
/// Changes what the X/Y coordinates emitted from HandleMovement specify
|
||||
enum DragValueBehavior {
|
||||
/// X/Y will be the exact mouse coordinates (in sequence pixels)
|
||||
kAbsolute,
|
||||
k_absolute,
|
||||
|
||||
/// X/Y will be the movement since the last time HandleMovement was called
|
||||
kDeltaFromPrevious,
|
||||
k_delta_from_previous,
|
||||
|
||||
/// X/Y will be the movement from the start of the drag
|
||||
kDeltaFromStart
|
||||
k_delta_from_start
|
||||
};
|
||||
|
||||
explicit DraggableGizmo(QObject *parent = nullptr);
|
||||
|
||||
void DragStart(const NodeValueRow &row, double abs_x, double abs_y,
|
||||
const olive::core::rational &time);
|
||||
void drag_start(const NodeValueRow &row, double abs_x, double abs_y,
|
||||
const olive::core::Rational &time);
|
||||
|
||||
void DragMove(double x, double y, const Qt::KeyboardModifiers &modifiers);
|
||||
void drag_move(double x, double y, const Qt::KeyboardModifiers &modifiers);
|
||||
|
||||
void DragEnd(olive::MultiUndoCommand *command);
|
||||
void drag_end(olive::MultiUndoCommand *command);
|
||||
|
||||
void AddInput(const NodeKeyframeTrackReference &input)
|
||||
void add_input(const NodeKeyframeTrackReference &input)
|
||||
{
|
||||
inputs_.append(input);
|
||||
draggers_.append(NodeInputDragger());
|
||||
}
|
||||
|
||||
QVector<NodeInputDragger> &GetDraggers()
|
||||
QVector<NodeInputDragger> &get_draggers()
|
||||
{
|
||||
return draggers_;
|
||||
}
|
||||
|
||||
DragValueBehavior GetDragValueBehavior() const
|
||||
DragValueBehavior get_drag_value_behavior() const
|
||||
{
|
||||
return drag_value_behavior_;
|
||||
}
|
||||
void SetDragValueBehavior(DragValueBehavior d)
|
||||
void set_drag_value_behavior(DragValueBehavior d)
|
||||
{
|
||||
drag_value_behavior_ = d;
|
||||
}
|
||||
|
||||
signals:
|
||||
void HandleStart(const olive::NodeValueRow &row, double x, double y,
|
||||
const olive::core::rational &time);
|
||||
void handle_start(const olive::NodeValueRow &row, double x, double y,
|
||||
const olive::core::Rational &time);
|
||||
|
||||
void HandleMovement(double x, double y,
|
||||
void handle_movement(double x, double y,
|
||||
const Qt::KeyboardModifiers &modifiers);
|
||||
|
||||
private:
|
||||
@@ -90,4 +90,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // DRAGGABLEGIZMO_H
|
||||
#endif // OAK_DRAGGABLEGIZMO_H
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef NODEGIZMO_H
|
||||
#define NODEGIZMO_H
|
||||
#ifndef OAK_NODEGIZMO_H
|
||||
#define OAK_NODEGIZMO_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QPainter>
|
||||
@@ -36,24 +36,24 @@ public:
|
||||
explicit NodeGizmo(QObject *parent = nullptr);
|
||||
virtual ~NodeGizmo() override;
|
||||
|
||||
virtual void Draw(QPainter *p) const
|
||||
virtual void draw(QPainter *p) const
|
||||
{
|
||||
}
|
||||
|
||||
const NodeGlobals &GetGlobals() const
|
||||
const NodeGlobals &get_globals() const
|
||||
{
|
||||
return globals_;
|
||||
}
|
||||
void SetGlobals(const NodeGlobals &globals)
|
||||
void set_globals(const NodeGlobals &globals)
|
||||
{
|
||||
globals_ = globals;
|
||||
}
|
||||
|
||||
bool IsVisible() const
|
||||
bool is_visible() const
|
||||
{
|
||||
return visible_;
|
||||
}
|
||||
void SetVisible(bool e)
|
||||
void set_visible(bool e)
|
||||
{
|
||||
visible_ = e;
|
||||
}
|
||||
@@ -68,4 +68,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // NODEGIZMO_H
|
||||
#endif // OAK_NODEGIZMO_H
|
||||
|
||||
@@ -29,7 +29,7 @@ LineGizmo::LineGizmo(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
void LineGizmo::Draw(QPainter *p) const
|
||||
void LineGizmo::draw(QPainter *p) const
|
||||
{
|
||||
// Draw transposed black
|
||||
QLineF transposed = p->transform().map(line_);
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef LINEGIZMO_H
|
||||
#define LINEGIZMO_H
|
||||
#ifndef OAK_LINEGIZMO_H
|
||||
#define OAK_LINEGIZMO_H
|
||||
|
||||
#include <QLineF>
|
||||
|
||||
@@ -34,16 +34,16 @@ class LineGizmo : public NodeGizmo {
|
||||
public:
|
||||
LineGizmo(QObject *parent = nullptr);
|
||||
|
||||
const QLineF &GetLine() const
|
||||
const QLineF &get_line() const
|
||||
{
|
||||
return line_;
|
||||
}
|
||||
void SetLine(const QLineF &line)
|
||||
void set_line(const QLineF &line)
|
||||
{
|
||||
line_ = line;
|
||||
}
|
||||
|
||||
virtual void Draw(QPainter *p) const override;
|
||||
virtual void draw(QPainter *p) const override;
|
||||
|
||||
private:
|
||||
QLineF line_;
|
||||
@@ -51,4 +51,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // LINEGIZMO_H
|
||||
#endif // OAK_LINEGIZMO_H
|
||||
|
||||
@@ -29,7 +29,7 @@ PathGizmo::PathGizmo(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
void PathGizmo::Draw(QPainter *p) const
|
||||
void PathGizmo::draw(QPainter *p) const
|
||||
{
|
||||
// Draw transposed black
|
||||
QPainterPath transposed = p->transform().map(path_);
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PATHGIZMO_H
|
||||
#define PATHGIZMO_H
|
||||
#ifndef OAK_PATHGIZMO_H
|
||||
#define OAK_PATHGIZMO_H
|
||||
|
||||
#include <QPainterPath>
|
||||
|
||||
@@ -34,16 +34,16 @@ class PathGizmo : public DraggableGizmo {
|
||||
public:
|
||||
explicit PathGizmo(QObject *parent = nullptr);
|
||||
|
||||
const QPainterPath &GetPath() const
|
||||
const QPainterPath &get_path() const
|
||||
{
|
||||
return path_;
|
||||
}
|
||||
void SetPath(const QPainterPath &path)
|
||||
void set_path(const QPainterPath &path)
|
||||
{
|
||||
path_ = path;
|
||||
}
|
||||
|
||||
virtual void Draw(QPainter *p) const override;
|
||||
virtual void draw(QPainter *p) const override;
|
||||
|
||||
private:
|
||||
QPainterPath path_;
|
||||
@@ -51,4 +51,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // PATHGIZMO_H
|
||||
#endif // OAK_PATHGIZMO_H
|
||||
|
||||
+12
-12
@@ -39,27 +39,27 @@ PointGizmo::PointGizmo(const Shape &shape, QObject *parent)
|
||||
}
|
||||
|
||||
PointGizmo::PointGizmo(QObject *parent)
|
||||
: PointGizmo(kSquare, parent)
|
||||
: PointGizmo(k_square, parent)
|
||||
{
|
||||
}
|
||||
|
||||
void PointGizmo::Draw(QPainter *p) const
|
||||
void PointGizmo::draw(QPainter *p) const
|
||||
{
|
||||
QRectF rect = GetDrawingRect(p->transform(), GetStandardRadius());
|
||||
QRectF rect = get_drawing_rect(p->transform(), get_standard_radius());
|
||||
|
||||
if (shape_ != kAnchorPoint) {
|
||||
if (shape_ != k_anchor_point) {
|
||||
p->setPen(QPen(Qt::black, 0));
|
||||
p->setBrush(Qt::white);
|
||||
}
|
||||
|
||||
switch (shape_) {
|
||||
case kSquare:
|
||||
case k_square:
|
||||
p->drawRect(rect);
|
||||
break;
|
||||
case kCircle:
|
||||
case k_circle:
|
||||
p->drawEllipse(rect);
|
||||
break;
|
||||
case kAnchorPoint:
|
||||
case k_anchor_point:
|
||||
p->setPen(QPen(Qt::white, 0));
|
||||
p->setBrush(Qt::NoBrush);
|
||||
|
||||
@@ -72,17 +72,17 @@ void PointGizmo::Draw(QPainter *p) const
|
||||
}
|
||||
}
|
||||
|
||||
QRectF PointGizmo::GetClickingRect(const QTransform &t) const
|
||||
QRectF PointGizmo::get_clicking_rect(const QTransform &t) const
|
||||
{
|
||||
return GetDrawingRect(t, GetStandardRadius());
|
||||
return get_drawing_rect(t, get_standard_radius());
|
||||
}
|
||||
|
||||
double PointGizmo::GetStandardRadius()
|
||||
double PointGizmo::get_standard_radius()
|
||||
{
|
||||
return QFontMetrics(qApp->font()).height() * 0.25;
|
||||
}
|
||||
|
||||
QRectF PointGizmo::GetDrawingRect(const QTransform &transform,
|
||||
QRectF PointGizmo::get_drawing_rect(const QTransform &transform,
|
||||
double radius) const
|
||||
{
|
||||
QRectF r(0, 0, radius, radius);
|
||||
@@ -92,7 +92,7 @@ QRectF PointGizmo::GetDrawingRect(const QTransform &transform,
|
||||
double width = r.width();
|
||||
double height = r.height();
|
||||
|
||||
if (shape_ == kAnchorPoint) {
|
||||
if (shape_ == k_anchor_point) {
|
||||
width *= 2;
|
||||
height *= 2;
|
||||
}
|
||||
|
||||
+14
-14
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef POINTGIZMO_H
|
||||
#define POINTGIZMO_H
|
||||
#ifndef OAK_POINTGIZMO_H
|
||||
#define OAK_POINTGIZMO_H
|
||||
|
||||
#include <QPointF>
|
||||
|
||||
@@ -32,48 +32,48 @@ namespace olive
|
||||
class PointGizmo : public DraggableGizmo {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Shape { kSquare, kCircle, kAnchorPoint };
|
||||
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 &GetShape() const
|
||||
const Shape &get_shape() const
|
||||
{
|
||||
return shape_;
|
||||
}
|
||||
void SetShape(const Shape &s)
|
||||
void set_shape(const Shape &s)
|
||||
{
|
||||
shape_ = s;
|
||||
}
|
||||
|
||||
const QPointF &GetPoint() const
|
||||
const QPointF &get_point() const
|
||||
{
|
||||
return point_;
|
||||
}
|
||||
void SetPoint(const QPointF &pt)
|
||||
void set_point(const QPointF &pt)
|
||||
{
|
||||
point_ = pt;
|
||||
}
|
||||
|
||||
bool GetSmaller() const
|
||||
bool get_smaller() const
|
||||
{
|
||||
return smaller_;
|
||||
}
|
||||
void SetSmaller(bool e)
|
||||
void set_smaller(bool e)
|
||||
{
|
||||
smaller_ = e;
|
||||
}
|
||||
|
||||
virtual void Draw(QPainter *p) const override;
|
||||
virtual void draw(QPainter *p) const override;
|
||||
|
||||
QRectF GetClickingRect(const QTransform &t) const;
|
||||
QRectF get_clicking_rect(const QTransform &t) const;
|
||||
|
||||
private:
|
||||
static double GetStandardRadius();
|
||||
static double get_standard_radius();
|
||||
|
||||
QRectF GetDrawingRect(const QTransform &transform, double radius) const;
|
||||
QRectF get_drawing_rect(const QTransform &transform, double radius) const;
|
||||
|
||||
Shape shape_;
|
||||
|
||||
@@ -84,4 +84,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // POINTGIZMO_H
|
||||
#endif // OAK_POINTGIZMO_H
|
||||
|
||||
@@ -29,7 +29,7 @@ PolygonGizmo::PolygonGizmo(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
void PolygonGizmo::Draw(QPainter *p) const
|
||||
void PolygonGizmo::draw(QPainter *p) const
|
||||
{
|
||||
// Draw transposed black
|
||||
QPolygonF transposed = p->transform().map(polygon_);
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef POLYGONGIZMO_H
|
||||
#define POLYGONGIZMO_H
|
||||
#ifndef OAK_POLYGONGIZMO_H
|
||||
#define OAK_POLYGONGIZMO_H
|
||||
|
||||
#include <QPolygonF>
|
||||
|
||||
@@ -34,16 +34,16 @@ class PolygonGizmo : public DraggableGizmo {
|
||||
public:
|
||||
explicit PolygonGizmo(QObject *parent = nullptr);
|
||||
|
||||
const QPolygonF &GetPolygon() const
|
||||
const QPolygonF &get_polygon() const
|
||||
{
|
||||
return polygon_;
|
||||
}
|
||||
void SetPolygon(const QPolygonF &polygon)
|
||||
void set_polygon(const QPolygonF &polygon)
|
||||
{
|
||||
polygon_ = polygon;
|
||||
}
|
||||
|
||||
virtual void Draw(QPainter *p) const override;
|
||||
virtual void draw(QPainter *p) const override;
|
||||
|
||||
private:
|
||||
QPolygonF polygon_;
|
||||
@@ -51,4 +51,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // POLYGONGIZMO_H
|
||||
#endif // OAK_POLYGONGIZMO_H
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef SCREENGIZMO_H
|
||||
#define SCREENGIZMO_H
|
||||
#ifndef OAK_SCREENGIZMO_H
|
||||
#define OAK_SCREENGIZMO_H
|
||||
|
||||
#include "draggable.h"
|
||||
|
||||
@@ -35,4 +35,4 @@ public:
|
||||
|
||||
}
|
||||
|
||||
#endif // SCREENGIZMO_H
|
||||
#endif // OAK_SCREENGIZMO_H
|
||||
|
||||
@@ -33,26 +33,26 @@ TextGizmo::TextGizmo(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
void TextGizmo::SetRect(const QRectF &r)
|
||||
void TextGizmo::set_rect(const QRectF &r)
|
||||
{
|
||||
rect_ = r;
|
||||
emit RectChanged(rect_);
|
||||
emit rect_changed(rect_);
|
||||
}
|
||||
|
||||
void TextGizmo::UpdateInputHtml(const QString &s, const rational &time)
|
||||
void TextGizmo::update_input_html(const QString &s, const Rational &time)
|
||||
{
|
||||
if (input_.IsValid()) {
|
||||
if (input_.is_valid()) {
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
Node::SetValueAtTime(input_.input(), time, s, input_.track(), command,
|
||||
Node::set_value_at_time(input_.input(), time, s, input_.track(), command,
|
||||
true);
|
||||
Core::instance()->undo_stack()->push(command, tr("Edit Text"));
|
||||
}
|
||||
}
|
||||
|
||||
void TextGizmo::SetVerticalAlignment(Qt::Alignment va)
|
||||
void TextGizmo::set_vertical_alignment(Qt::Alignment va)
|
||||
{
|
||||
valign_ = va;
|
||||
emit VerticalAlignmentChanged(valign_);
|
||||
emit vertical_alignment_changed(valign_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+15
-15
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef TEXTGIZMO_H
|
||||
#define TEXTGIZMO_H
|
||||
#ifndef OAK_TEXTGIZMO_H
|
||||
#define OAK_TEXTGIZMO_H
|
||||
|
||||
#include "gizmo.h"
|
||||
#include "node/param.h"
|
||||
@@ -33,39 +33,39 @@ class TextGizmo : public NodeGizmo {
|
||||
public:
|
||||
explicit TextGizmo(QObject *parent = nullptr);
|
||||
|
||||
const QRectF &GetRect() const
|
||||
const QRectF &get_rect() const
|
||||
{
|
||||
return rect_;
|
||||
}
|
||||
void SetRect(const QRectF &r);
|
||||
void set_rect(const QRectF &r);
|
||||
|
||||
const QString &GetHtml() const
|
||||
const QString &get_html() const
|
||||
{
|
||||
return text_;
|
||||
}
|
||||
void SetHtml(const QString &t)
|
||||
void set_html(const QString &t)
|
||||
{
|
||||
text_ = t;
|
||||
}
|
||||
|
||||
void SetInput(const NodeKeyframeTrackReference &input)
|
||||
void set_input(const NodeKeyframeTrackReference &input)
|
||||
{
|
||||
input_ = input;
|
||||
}
|
||||
|
||||
void UpdateInputHtml(const QString &s, const rational &time);
|
||||
void update_input_html(const QString &s, const Rational &time);
|
||||
|
||||
Qt::Alignment GetVerticalAlignment() const
|
||||
Qt::Alignment get_vertical_alignment() const
|
||||
{
|
||||
return valign_;
|
||||
}
|
||||
void SetVerticalAlignment(Qt::Alignment va);
|
||||
void set_vertical_alignment(Qt::Alignment va);
|
||||
|
||||
signals:
|
||||
void Activated();
|
||||
void Deactivated();
|
||||
void VerticalAlignmentChanged(Qt::Alignment va);
|
||||
void RectChanged(const QRectF &r);
|
||||
void activated();
|
||||
void deactivated();
|
||||
void vertical_alignment_changed(Qt::Alignment va);
|
||||
void rect_changed(const QRectF &r);
|
||||
|
||||
private:
|
||||
QRectF rect_;
|
||||
@@ -79,4 +79,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // TEXTGIZMO_H
|
||||
#endif // OAK_TEXTGIZMO_H
|
||||
|
||||
Reference in New Issue
Block a user