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:
@@ -50,10 +50,10 @@ ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent)
|
||||
#ifdef OAK_ENABLE_DYNAMIC_RENDER_BACKEND
|
||||
{
|
||||
auto *dynamic_renderer = new DynamicRenderer(
|
||||
RenderManager::BackendToString(
|
||||
RenderManager::backend_to_string(
|
||||
RenderManager::instance()->requested_backend()),
|
||||
this);
|
||||
if (!dynamic_renderer->Load()) {
|
||||
if (!dynamic_renderer->load()) {
|
||||
qWarning()
|
||||
<< "Failed to load dynamic render backend for viewer, falling back to OpenGL";
|
||||
delete dynamic_renderer;
|
||||
@@ -66,22 +66,22 @@ ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent)
|
||||
attached_renderer_ = new OpenGLRenderer(this);
|
||||
#endif
|
||||
|
||||
if (attached_renderer_->IsOpenGL()) {
|
||||
if (attached_renderer_->is_open_gl()) {
|
||||
// OpenGL path
|
||||
inner_widget_ = new ManagedDisplayWidgetOpenGL();
|
||||
inner_widget_->setAttribute(Qt::WA_TranslucentBackground, false);
|
||||
connect(static_cast<ManagedDisplayWidgetOpenGL *>(inner_widget_),
|
||||
&ManagedDisplayWidgetOpenGL::OnInit, this,
|
||||
&ManagedDisplayWidget::OnInit, Qt::DirectConnection);
|
||||
&ManagedDisplayWidgetOpenGL::on_init, this,
|
||||
&ManagedDisplayWidget::on_init, Qt::DirectConnection);
|
||||
connect(static_cast<ManagedDisplayWidgetOpenGL *>(inner_widget_),
|
||||
&ManagedDisplayWidgetOpenGL::OnDestroy, this,
|
||||
&ManagedDisplayWidget::OnDestroy, Qt::DirectConnection);
|
||||
&ManagedDisplayWidgetOpenGL::on_destroy, this,
|
||||
&ManagedDisplayWidget::on_destroy, Qt::DirectConnection);
|
||||
connect(static_cast<ManagedDisplayWidgetOpenGL *>(inner_widget_),
|
||||
&ManagedDisplayWidgetOpenGL::OnPaint, this,
|
||||
&ManagedDisplayWidget::OnPaint, Qt::DirectConnection);
|
||||
&ManagedDisplayWidgetOpenGL::on_paint, this,
|
||||
&ManagedDisplayWidget::on_paint, Qt::DirectConnection);
|
||||
connect(static_cast<ManagedDisplayWidgetOpenGL *>(inner_widget_),
|
||||
&ManagedDisplayWidgetOpenGL::frameSwapped, this,
|
||||
&ManagedDisplayWidget::frameSwapped, Qt::DirectConnection);
|
||||
&ManagedDisplayWidget::frame_swapped, Qt::DirectConnection);
|
||||
|
||||
inner_widget_->installEventFilter(this);
|
||||
|
||||
@@ -100,8 +100,8 @@ ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent)
|
||||
inner_widget_ = bn_widget;
|
||||
inner_widget_->setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
inner_widget_->installEventFilter(this);
|
||||
connect(bn_widget, &ManagedDisplayWidgetBackendNeutral::OnPaint, this,
|
||||
&ManagedDisplayWidget::OnPaint, Qt::DirectConnection);
|
||||
connect(bn_widget, &ManagedDisplayWidgetBackendNeutral::on_paint, this,
|
||||
&ManagedDisplayWidget::on_paint, Qt::DirectConnection);
|
||||
wrapper_ = inner_widget_;
|
||||
layout->addWidget(wrapper_);
|
||||
}
|
||||
@@ -113,37 +113,37 @@ ManagedDisplayWidget::~ManagedDisplayWidget()
|
||||
MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR_INNER;
|
||||
|
||||
disconnect(static_cast<ManagedDisplayWidgetOpenGL *>(inner_widget_),
|
||||
&ManagedDisplayWidgetOpenGL::OnDestroy, this,
|
||||
&ManagedDisplayWidget::OnDestroy);
|
||||
&ManagedDisplayWidgetOpenGL::on_destroy, this,
|
||||
&ManagedDisplayWidget::on_destroy);
|
||||
} else {
|
||||
OnDestroy();
|
||||
on_destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::ConnectColorManager(ColorManager *color_manager)
|
||||
void ManagedDisplayWidget::connect_color_manager(ColorManager *color_manager)
|
||||
{
|
||||
if (color_manager_ == color_manager) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (color_manager_ != nullptr) {
|
||||
disconnect(color_manager_, &ColorManager::ConfigChanged, this,
|
||||
&ManagedDisplayWidget::ColorConfigChanged);
|
||||
disconnect(color_manager_, &ColorManager::ReferenceSpaceChanged, this,
|
||||
&ManagedDisplayWidget::ColorConfigChanged);
|
||||
disconnect(color_manager_, &ColorManager::config_changed, this,
|
||||
&ManagedDisplayWidget::color_config_changed);
|
||||
disconnect(color_manager_, &ColorManager::reference_space_changed, this,
|
||||
&ManagedDisplayWidget::color_config_changed);
|
||||
}
|
||||
|
||||
color_manager_ = color_manager;
|
||||
|
||||
if (color_manager_ != nullptr) {
|
||||
connect(color_manager_, &ColorManager::ConfigChanged, this,
|
||||
&ManagedDisplayWidget::ColorConfigChanged);
|
||||
connect(color_manager_, &ColorManager::ReferenceSpaceChanged, this,
|
||||
&ManagedDisplayWidget::ColorConfigChanged);
|
||||
connect(color_manager_, &ColorManager::config_changed, this,
|
||||
&ManagedDisplayWidget::color_config_changed);
|
||||
connect(color_manager_, &ColorManager::reference_space_changed, this,
|
||||
&ManagedDisplayWidget::color_config_changed);
|
||||
}
|
||||
|
||||
ColorConfigChanged();
|
||||
emit ColorManagerChanged(color_manager_);
|
||||
color_config_changed();
|
||||
emit color_manager_changed(color_manager_);
|
||||
}
|
||||
|
||||
ColorManager *ManagedDisplayWidget::color_manager() const
|
||||
@@ -151,25 +151,25 @@ ColorManager *ManagedDisplayWidget::color_manager() const
|
||||
return color_manager_;
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::DisconnectColorManager()
|
||||
void ManagedDisplayWidget::disconnect_color_manager()
|
||||
{
|
||||
ConnectColorManager(nullptr);
|
||||
connect_color_manager(nullptr);
|
||||
}
|
||||
|
||||
const ColorTransform &ManagedDisplayWidget::GetColorTransform() const
|
||||
const ColorTransform &ManagedDisplayWidget::get_color_transform() const
|
||||
{
|
||||
return color_transform_;
|
||||
}
|
||||
|
||||
Menu *ManagedDisplayWidget::GetColorSpaceMenu(QMenu *parent, bool auto_connect)
|
||||
Menu *ManagedDisplayWidget::get_color_space_menu(QMenu *parent, bool auto_connect)
|
||||
{
|
||||
QStringList colorspaces = color_manager()->ListAvailableColorspaces();
|
||||
QStringList colorspaces = color_manager()->list_available_colorspaces();
|
||||
|
||||
Menu *ocio_colorspace_menu = new Menu(tr("Color Space"), parent);
|
||||
|
||||
if (auto_connect) {
|
||||
connect(ocio_colorspace_menu, &Menu::triggered, this,
|
||||
&ManagedDisplayWidget::MenuColorspaceSelect);
|
||||
&ManagedDisplayWidget::menu_colorspace_select);
|
||||
}
|
||||
|
||||
foreach (const QString &c, colorspaces) {
|
||||
@@ -182,7 +182,7 @@ Menu *ManagedDisplayWidget::GetColorSpaceMenu(QMenu *parent, bool auto_connect)
|
||||
return ocio_colorspace_menu;
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::ColorConfigChanged()
|
||||
void ManagedDisplayWidget::color_config_changed()
|
||||
{
|
||||
if (!color_manager_) {
|
||||
color_service_ = nullptr;
|
||||
@@ -195,13 +195,13 @@ void ManagedDisplayWidget::ColorConfigChanged()
|
||||
// which is usually a scene-referred space (e.g. ACEScg / Linear) and makes
|
||||
// the picture look raw/wrong on a monitor.
|
||||
if (color_transform_.output().isEmpty()) {
|
||||
QString display = color_manager_->GetDefaultDisplay();
|
||||
QString view = color_manager_->GetDefaultView(display);
|
||||
SetColorTransform(color_manager_->GetCompliantColorSpace(
|
||||
QString display = color_manager_->get_default_display();
|
||||
QString view = color_manager_->get_default_view(display);
|
||||
set_color_transform(color_manager_->get_compliant_color_space(
|
||||
ColorTransform(display, view, QString()), true));
|
||||
} else {
|
||||
SetColorTransform(
|
||||
color_manager_->GetCompliantColorSpace(color_transform_, false));
|
||||
set_color_transform(
|
||||
color_manager_->get_compliant_color_space(color_transform_, false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,16 +210,16 @@ ColorProcessorPtr ManagedDisplayWidget::color_service()
|
||||
return color_service_;
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::ShowDefaultContextMenu()
|
||||
void ManagedDisplayWidget::show_default_context_menu()
|
||||
{
|
||||
Menu m(this);
|
||||
|
||||
if (color_manager_) {
|
||||
m.addMenu(GetColorSpaceMenu(&m));
|
||||
m.addMenu(get_color_space_menu(&m));
|
||||
m.addSeparator();
|
||||
m.addMenu(GetDisplayMenu(&m));
|
||||
m.addMenu(GetViewMenu(&m));
|
||||
m.addMenu(GetLookMenu(&m));
|
||||
m.addMenu(get_display_menu(&m));
|
||||
m.addMenu(get_view_menu(&m));
|
||||
m.addMenu(get_look_menu(&m));
|
||||
} else {
|
||||
QAction *a = m.addAction(tr("No color manager connected"));
|
||||
a->setEnabled(false);
|
||||
@@ -228,61 +228,61 @@ void ManagedDisplayWidget::ShowDefaultContextMenu()
|
||||
m.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::MenuDisplaySelect(QAction *action)
|
||||
void ManagedDisplayWidget::menu_display_select(QAction *action)
|
||||
{
|
||||
const ColorTransform &old_transform = GetColorTransform();
|
||||
const ColorTransform &old_transform = get_color_transform();
|
||||
|
||||
ColorTransform new_transform = color_manager()->GetCompliantColorSpace(
|
||||
ColorTransform new_transform = color_manager()->get_compliant_color_space(
|
||||
ColorTransform(action->data().toString(), old_transform.view(),
|
||||
old_transform.look()));
|
||||
|
||||
SetColorTransform(new_transform);
|
||||
set_color_transform(new_transform);
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::MenuViewSelect(QAction *action)
|
||||
void ManagedDisplayWidget::menu_view_select(QAction *action)
|
||||
{
|
||||
const ColorTransform &old_transform = GetColorTransform();
|
||||
const ColorTransform &old_transform = get_color_transform();
|
||||
|
||||
ColorTransform new_transform = color_manager()->GetCompliantColorSpace(
|
||||
ColorTransform new_transform = color_manager()->get_compliant_color_space(
|
||||
ColorTransform(old_transform.display(), action->data().toString(),
|
||||
old_transform.look()));
|
||||
|
||||
SetColorTransform(new_transform);
|
||||
set_color_transform(new_transform);
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::MenuLookSelect(QAction *action)
|
||||
void ManagedDisplayWidget::menu_look_select(QAction *action)
|
||||
{
|
||||
const ColorTransform &old_transform = GetColorTransform();
|
||||
const ColorTransform &old_transform = get_color_transform();
|
||||
|
||||
ColorTransform new_transform = color_manager()->GetCompliantColorSpace(
|
||||
ColorTransform new_transform = color_manager()->get_compliant_color_space(
|
||||
ColorTransform(old_transform.display(), old_transform.view(),
|
||||
action->data().toString()));
|
||||
|
||||
SetColorTransform(new_transform);
|
||||
set_color_transform(new_transform);
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::MenuColorspaceSelect(QAction *action)
|
||||
void ManagedDisplayWidget::menu_colorspace_select(QAction *action)
|
||||
{
|
||||
SetColorTransform(color_manager()->GetCompliantColorSpace(
|
||||
set_color_transform(color_manager()->get_compliant_color_space(
|
||||
ColorTransform(action->data().toString())));
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::OnDestroy()
|
||||
void ManagedDisplayWidget::on_destroy()
|
||||
{
|
||||
attached_renderer_->Destroy();
|
||||
attached_renderer_->PostDestroy();
|
||||
attached_renderer_->destroy();
|
||||
attached_renderer_->post_destroy();
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::SetColorTransform(const ColorTransform &transform)
|
||||
void ManagedDisplayWidget::set_color_transform(const ColorTransform &transform)
|
||||
{
|
||||
color_transform_ = transform;
|
||||
|
||||
SetupColorProcessor();
|
||||
setup_color_processor();
|
||||
|
||||
ColorProcessorChangedEvent();
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::OnInit()
|
||||
void ManagedDisplayWidget::on_init()
|
||||
{
|
||||
if (!is_backend_neutral_) {
|
||||
QOpenGLContext *context =
|
||||
@@ -290,23 +290,23 @@ void ManagedDisplayWidget::OnInit()
|
||||
#ifdef OAK_ENABLE_DYNAMIC_RENDER_BACKEND
|
||||
if (auto *dynamic_renderer =
|
||||
dynamic_cast<DynamicRenderer *>(attached_renderer_)) {
|
||||
dynamic_renderer->InitWithOpenGLContext(context);
|
||||
dynamic_renderer->PostInit();
|
||||
dynamic_renderer->init_with_open_gl_context(context);
|
||||
dynamic_renderer->post_init();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
static_cast<OpenGLRenderer *>(attached_renderer_)->Init(context);
|
||||
static_cast<OpenGLRenderer *>(attached_renderer_)->PostInit();
|
||||
static_cast<OpenGLRenderer *>(attached_renderer_)->init(context);
|
||||
static_cast<OpenGLRenderer *>(attached_renderer_)->post_init();
|
||||
} else {
|
||||
attached_renderer_->Init();
|
||||
attached_renderer_->PostInit();
|
||||
attached_renderer_->init();
|
||||
attached_renderer_->post_init();
|
||||
}
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::EnableDefaultContextMenu()
|
||||
void ManagedDisplayWidget::enable_default_context_menu()
|
||||
{
|
||||
connect(this, &ManagedDisplayWidget::customContextMenuRequested, this,
|
||||
&ManagedDisplayWidget::ShowDefaultContextMenu);
|
||||
&ManagedDisplayWidget::show_default_context_menu);
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::ColorProcessorChangedEvent()
|
||||
@@ -314,14 +314,14 @@ void ManagedDisplayWidget::ColorProcessorChangedEvent()
|
||||
update();
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::makeCurrent()
|
||||
void ManagedDisplayWidget::make_current()
|
||||
{
|
||||
if (!is_backend_neutral_) {
|
||||
static_cast<ManagedDisplayWidgetOpenGL *>(inner_widget_)->makeCurrent();
|
||||
}
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::doneCurrent()
|
||||
void ManagedDisplayWidget::done_current()
|
||||
{
|
||||
if (!is_backend_neutral_) {
|
||||
static_cast<ManagedDisplayWidgetOpenGL *>(inner_widget_)->doneCurrent();
|
||||
@@ -333,21 +333,21 @@ QPaintDevice *ManagedDisplayWidget::paint_device() const
|
||||
return inner_widget_;
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::SetInnerMouseTracking(bool e)
|
||||
void ManagedDisplayWidget::set_inner_mouse_tracking(bool e)
|
||||
{
|
||||
if (wrapper_) {
|
||||
wrapper_->setMouseTracking(e);
|
||||
}
|
||||
}
|
||||
|
||||
VideoParams ManagedDisplayWidget::GetViewportParams() const
|
||||
VideoParams ManagedDisplayWidget::get_viewport_params() const
|
||||
{
|
||||
int device_width = width() * devicePixelRatioF();
|
||||
int device_height = height() * devicePixelRatioF();
|
||||
PixelFormat device_format = static_cast<PixelFormat::Format>(
|
||||
OLIVE_CONFIG("OfflinePixelFormat").toInt());
|
||||
OAK_CONFIG("OfflinePixelFormat").toInt());
|
||||
return VideoParams(device_width, device_height, device_format,
|
||||
VideoParams::kInternalChannelCount);
|
||||
VideoParams::k_internal_channel_count);
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::update()
|
||||
@@ -367,7 +367,7 @@ bool ManagedDisplayWidget::eventFilter(QObject *o, QEvent *e)
|
||||
case QEvent::FocusIn:
|
||||
// HACK: QWindow focus isn't accounted for in QApplication::focusChanged, so we handle it
|
||||
// manually here.
|
||||
PanelManager::instance()->FocusChanged(nullptr, this);
|
||||
PanelManager::instance()->focus_changed(nullptr, this);
|
||||
break;
|
||||
case QEvent::ContextMenu: {
|
||||
QContextMenuEvent *ctx = static_cast<QContextMenuEvent *>(e);
|
||||
@@ -391,15 +391,15 @@ bool ManagedDisplayWidget::eventFilter(QObject *o, QEvent *e)
|
||||
return super::eventFilter(o, e);
|
||||
}
|
||||
|
||||
Menu *ManagedDisplayWidget::GetDisplayMenu(QMenu *parent, bool auto_connect)
|
||||
Menu *ManagedDisplayWidget::get_display_menu(QMenu *parent, bool auto_connect)
|
||||
{
|
||||
QStringList displays = color_manager()->ListAvailableDisplays();
|
||||
QStringList displays = color_manager()->list_available_displays();
|
||||
|
||||
Menu *ocio_display_menu = new Menu(tr("Display"), parent);
|
||||
|
||||
if (auto_connect) {
|
||||
connect(ocio_display_menu, &Menu::triggered, this,
|
||||
&ManagedDisplayWidget::MenuDisplaySelect);
|
||||
&ManagedDisplayWidget::menu_display_select);
|
||||
}
|
||||
|
||||
foreach (const QString &d, displays) {
|
||||
@@ -412,16 +412,16 @@ Menu *ManagedDisplayWidget::GetDisplayMenu(QMenu *parent, bool auto_connect)
|
||||
return ocio_display_menu;
|
||||
}
|
||||
|
||||
Menu *ManagedDisplayWidget::GetViewMenu(QMenu *parent, bool auto_connect)
|
||||
Menu *ManagedDisplayWidget::get_view_menu(QMenu *parent, bool auto_connect)
|
||||
{
|
||||
QStringList views =
|
||||
color_manager()->ListAvailableViews(color_transform_.display());
|
||||
color_manager()->list_available_views(color_transform_.display());
|
||||
|
||||
Menu *ocio_view_menu = new Menu(tr("View"), parent);
|
||||
|
||||
if (auto_connect) {
|
||||
connect(ocio_view_menu, &Menu::triggered, this,
|
||||
&ManagedDisplayWidget::MenuViewSelect);
|
||||
&ManagedDisplayWidget::menu_view_select);
|
||||
}
|
||||
|
||||
foreach (const QString &v, views) {
|
||||
@@ -434,15 +434,15 @@ Menu *ManagedDisplayWidget::GetViewMenu(QMenu *parent, bool auto_connect)
|
||||
return ocio_view_menu;
|
||||
}
|
||||
|
||||
Menu *ManagedDisplayWidget::GetLookMenu(QMenu *parent, bool auto_connect)
|
||||
Menu *ManagedDisplayWidget::get_look_menu(QMenu *parent, bool auto_connect)
|
||||
{
|
||||
QStringList looks = color_manager()->ListAvailableLooks();
|
||||
QStringList looks = color_manager()->list_available_looks();
|
||||
|
||||
Menu *ocio_look_menu = new Menu(tr("Look"), parent);
|
||||
|
||||
if (auto_connect) {
|
||||
connect(ocio_look_menu, &Menu::triggered, this,
|
||||
&ManagedDisplayWidget::MenuLookSelect);
|
||||
&ManagedDisplayWidget::menu_look_select);
|
||||
}
|
||||
|
||||
// Setup "no look" action
|
||||
@@ -462,17 +462,17 @@ Menu *ManagedDisplayWidget::GetLookMenu(QMenu *parent, bool auto_connect)
|
||||
return ocio_look_menu;
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::SetupColorProcessor()
|
||||
void ManagedDisplayWidget::setup_color_processor()
|
||||
{
|
||||
color_service_ = nullptr;
|
||||
|
||||
if (color_manager_) {
|
||||
// (Re)create color processor
|
||||
try {
|
||||
color_service_ = ColorProcessor::Create(
|
||||
color_manager_, color_manager_->GetReferenceColorSpace(),
|
||||
color_service_ = ColorProcessor::create(
|
||||
color_manager_, color_manager_->get_reference_color_space(),
|
||||
color_transform_);
|
||||
} catch (OCIO::Exception &e) {
|
||||
} catch (ocio::Exception &e) {
|
||||
QMessageBox::critical(
|
||||
this, tr("OpenColorIO Error"),
|
||||
tr("Failed to set color configuration: %1").arg(e.what()),
|
||||
@@ -482,7 +482,7 @@ void ManagedDisplayWidget::SetupColorProcessor()
|
||||
color_service_ = nullptr;
|
||||
}
|
||||
|
||||
emit ColorProcessorChanged(color_service_);
|
||||
emit color_processor_changed(color_service_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef MANAGEDDISPLAYOBJECT_H
|
||||
#define MANAGEDDISPLAYOBJECT_H
|
||||
#ifndef OAK_MANAGEDDISPLAYOBJECT_H
|
||||
#define OAK_MANAGEDDISPLAYOBJECT_H
|
||||
|
||||
//#define USE_QOPENGLWINDOW
|
||||
|
||||
@@ -53,48 +53,48 @@ public:
|
||||
virtual ~ManagedDisplayWidgetOpenGL() override
|
||||
{
|
||||
if (context()) {
|
||||
DestroyListener();
|
||||
destroy_listener();
|
||||
disconnect(context(), &QOpenGLContext::aboutToBeDestroyed, this,
|
||||
&ManagedDisplayWidgetOpenGL::DestroyListener);
|
||||
&ManagedDisplayWidgetOpenGL::destroy_listener);
|
||||
}
|
||||
}
|
||||
|
||||
signals:
|
||||
// Render signals
|
||||
void OnInit();
|
||||
void OnPaint();
|
||||
void OnDestroy();
|
||||
void on_init();
|
||||
void on_paint();
|
||||
void on_destroy();
|
||||
|
||||
protected:
|
||||
virtual void initializeGL() override
|
||||
{
|
||||
connect(context(), &QOpenGLContext::aboutToBeDestroyed, this,
|
||||
&ManagedDisplayWidgetOpenGL::DestroyListener,
|
||||
&ManagedDisplayWidgetOpenGL::destroy_listener,
|
||||
Qt::DirectConnection);
|
||||
|
||||
emit OnInit();
|
||||
emit on_init();
|
||||
}
|
||||
|
||||
virtual void paintGL() override
|
||||
{
|
||||
emit OnPaint();
|
||||
emit on_paint();
|
||||
}
|
||||
|
||||
private slots:
|
||||
void DestroyListener()
|
||||
void destroy_listener()
|
||||
{
|
||||
makeCurrent();
|
||||
|
||||
emit OnDestroy();
|
||||
emit on_destroy();
|
||||
|
||||
doneCurrent();
|
||||
}
|
||||
};
|
||||
|
||||
#define MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR_INNER \
|
||||
makeCurrent(); \
|
||||
OnDestroy(); \
|
||||
doneCurrent()
|
||||
make_current(); \
|
||||
on_destroy(); \
|
||||
done_current()
|
||||
#define MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(x) \
|
||||
virtual ~x() override \
|
||||
{ \
|
||||
@@ -116,14 +116,14 @@ public:
|
||||
}
|
||||
|
||||
signals:
|
||||
void OnPaint();
|
||||
void on_paint();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *event) override
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
emit OnPaint();
|
||||
emit on_paint();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
/**
|
||||
* @brief Disconnect a ColorManager (equivalent to ConnectColorManager(nullptr))
|
||||
*/
|
||||
void DisconnectColorManager();
|
||||
void disconnect_color_manager();
|
||||
|
||||
/**
|
||||
* @brief Access currently connected ColorManager (nullptr if none)
|
||||
@@ -147,27 +147,27 @@ public:
|
||||
/**
|
||||
* @brief Get current color transform
|
||||
*/
|
||||
const ColorTransform &GetColorTransform() const;
|
||||
const ColorTransform &get_color_transform() const;
|
||||
|
||||
/**
|
||||
* @brief Get menu that can be used to select the colorspace
|
||||
*/
|
||||
Menu *GetColorSpaceMenu(QMenu *parent, bool auto_connect = true);
|
||||
Menu *get_color_space_menu(QMenu *parent, bool auto_connect = true);
|
||||
|
||||
/**
|
||||
* @brief Get menu that can be used to select the display transform
|
||||
*/
|
||||
Menu *GetDisplayMenu(QMenu *parent, bool auto_connect = true);
|
||||
Menu *get_display_menu(QMenu *parent, bool auto_connect = true);
|
||||
|
||||
/**
|
||||
* @brief Get menu that can be used to select the view transform
|
||||
*/
|
||||
Menu *GetViewMenu(QMenu *parent, bool auto_connect = true);
|
||||
Menu *get_view_menu(QMenu *parent, bool auto_connect = true);
|
||||
|
||||
/**
|
||||
* @brief Get menu that can be used to select the look transform
|
||||
*/
|
||||
Menu *GetLookMenu(QMenu *parent, bool auto_connect = true);
|
||||
Menu *get_look_menu(QMenu *parent, bool auto_connect = true);
|
||||
|
||||
/**
|
||||
* @brief Passes update signal through to inner widget
|
||||
@@ -180,25 +180,25 @@ public slots:
|
||||
/**
|
||||
* @brief Replaces the color transform with a new one
|
||||
*/
|
||||
void SetColorTransform(const ColorTransform &transform);
|
||||
void set_color_transform(const ColorTransform &transform);
|
||||
|
||||
/**
|
||||
* @brief Connect a ColorManager (ColorManagers usually belong to the Project)
|
||||
*/
|
||||
void ConnectColorManager(ColorManager *color_manager);
|
||||
void connect_color_manager(ColorManager *color_manager);
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Emitted when the color processor changes
|
||||
*/
|
||||
void ColorProcessorChanged(ColorProcessorPtr processor);
|
||||
void color_processor_changed(ColorProcessorPtr processor);
|
||||
|
||||
/**
|
||||
* @brief Emitted when a new color manager is connected
|
||||
*/
|
||||
void ColorManagerChanged(ColorManager *color_manager);
|
||||
void color_manager_changed(ColorManager *color_manager);
|
||||
|
||||
void frameSwapped();
|
||||
void frame_swapped();
|
||||
|
||||
protected:
|
||||
/**
|
||||
@@ -209,7 +209,7 @@ protected:
|
||||
/**
|
||||
* @brief Enables a context menu that allows simple access to the DVL pipeline
|
||||
*/
|
||||
void EnableDefaultContextMenu();
|
||||
void enable_default_context_menu();
|
||||
|
||||
/**
|
||||
* @brief Function called whenever the processor changes
|
||||
@@ -223,9 +223,9 @@ protected:
|
||||
return attached_renderer_;
|
||||
}
|
||||
|
||||
void makeCurrent();
|
||||
void make_current();
|
||||
|
||||
void doneCurrent();
|
||||
void done_current();
|
||||
|
||||
#ifdef USE_QOPENGLWINDOW
|
||||
QWindow *
|
||||
@@ -245,46 +245,46 @@ protected:
|
||||
*/
|
||||
QPaintDevice *paint_device() const;
|
||||
|
||||
void SetInnerMouseTracking(bool e);
|
||||
void set_inner_mouse_tracking(bool e);
|
||||
|
||||
bool IsBackendNeutral() const
|
||||
bool is_backend_neutral() const
|
||||
{
|
||||
return is_backend_neutral_;
|
||||
}
|
||||
|
||||
QRect GetInnerRect() const
|
||||
QRect get_inner_rect() const
|
||||
{
|
||||
return wrapper_ ? wrapper_->rect() : QRect();
|
||||
}
|
||||
|
||||
VideoParams GetViewportParams() const;
|
||||
VideoParams get_viewport_params() const;
|
||||
|
||||
protected slots:
|
||||
/**
|
||||
* @brief Called whenever the internal rendering context has been created
|
||||
*/
|
||||
virtual void OnInit();
|
||||
virtual void on_init();
|
||||
|
||||
/**
|
||||
* @brief Called while the internal rendering context is being rendered
|
||||
*/
|
||||
virtual void OnPaint() = 0;
|
||||
virtual void on_paint() = 0;
|
||||
|
||||
/**
|
||||
* @brief Called just before the internal rendering context is destroyed
|
||||
*/
|
||||
virtual void OnDestroy();
|
||||
virtual void on_destroy();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Call this if this user has selected a different display/view/look to recreate the processor
|
||||
*/
|
||||
void SetupColorProcessor();
|
||||
void setup_color_processor();
|
||||
|
||||
/**
|
||||
* @brief Cleanup function
|
||||
*/
|
||||
void ClearOCIOLutTexture();
|
||||
void clear_ocio_lut_texture();
|
||||
|
||||
/**
|
||||
* @brief Main drawing surface abstraction
|
||||
@@ -322,34 +322,34 @@ private slots:
|
||||
/**
|
||||
* @brief Sets all color settings to the defaults pertaining to this configuration
|
||||
*/
|
||||
void ColorConfigChanged();
|
||||
void color_config_changed();
|
||||
|
||||
/**
|
||||
* @brief The default context menu shown
|
||||
*/
|
||||
void ShowDefaultContextMenu();
|
||||
void show_default_context_menu();
|
||||
|
||||
/**
|
||||
* @brief If GetDisplayMenu() is called with `auto_connect` set to true, it will be connected to this
|
||||
*/
|
||||
void MenuDisplaySelect(QAction *action);
|
||||
void menu_display_select(QAction *action);
|
||||
|
||||
/**
|
||||
* @brief If GetViewMenu() is called with `auto_connect` set to true, it will be connected to this
|
||||
*/
|
||||
void MenuViewSelect(QAction *action);
|
||||
void menu_view_select(QAction *action);
|
||||
|
||||
/**
|
||||
* @brief If GetLookMenu() is called with `auto_connect` set to true, it will be connected to this
|
||||
*/
|
||||
void MenuLookSelect(QAction *action);
|
||||
void menu_look_select(QAction *action);
|
||||
|
||||
/**
|
||||
* @brief If GetColorSpaceMenu() is called with `auto_connect` set to true, it will be connected to this
|
||||
*/
|
||||
void MenuColorspaceSelect(QAction *action);
|
||||
void menu_colorspace_select(QAction *action);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // MANAGEDDISPLAYOBJECT_H
|
||||
#endif // OAK_MANAGEDDISPLAYOBJECT_H
|
||||
|
||||
Reference in New Issue
Block a user