Browse Source

Add pimpl Internal* struct to several classes that have a possibility of needing more member variables in 2.x.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
bb9e9b78ce
7 changed files with 21 additions and 0 deletions
  1. +3
    -0
      include/app/CableWidget.hpp
  2. +5
    -0
      include/app/ParamWidget.hpp
  3. +3
    -0
      include/app/PortWidget.hpp
  4. +3
    -0
      include/app/RackWidget.hpp
  5. +3
    -0
      include/patch.hpp
  6. +1
    -0
      src/app/CableWidget.cpp
  7. +3
    -0
      src/app/ParamWidget.cpp

+ 3
- 0
include/app/CableWidget.hpp View File

@@ -12,6 +12,9 @@ namespace app {




struct CableWidget : widget::OpaqueWidget { struct CableWidget : widget::OpaqueWidget {
struct Internal;
Internal* internal;

/** Owned. */ /** Owned. */
engine::Cable* cable = NULL; engine::Cable* cable = NULL;
NVGcolor color; NVGcolor color;


+ 5
- 0
include/app/ParamWidget.hpp View File

@@ -12,6 +12,9 @@ namespace app {


/** Manages an engine::Param on a ModuleWidget. */ /** Manages an engine::Param on a ModuleWidget. */
struct ParamWidget : widget::OpaqueWidget { struct ParamWidget : widget::OpaqueWidget {
struct Internal;
Internal* internal;

engine::Module* module = NULL; engine::Module* module = NULL;
int paramId = -1; int paramId = -1;


@@ -19,6 +22,8 @@ struct ParamWidget : widget::OpaqueWidget {
/** For triggering the Change event. `*/ /** For triggering the Change event. `*/
float lastValue = NAN; float lastValue = NAN;


ParamWidget();
~ParamWidget();
/** Configures ParamQuantity properties based on the type of ParamWidget. /** Configures ParamQuantity properties based on the type of ParamWidget.
This seems a bit hacky, but it's easier than requiring plugin developers to set `ParamQuantity::randomizeEnabled`, etc. This seems a bit hacky, but it's easier than requiring plugin developers to set `ParamQuantity::randomizeEnabled`, etc.
*/ */


+ 3
- 0
include/app/PortWidget.hpp View File

@@ -13,6 +13,9 @@ namespace app {


/** Manages an engine::Port on a ModuleWidget. */ /** Manages an engine::Port on a ModuleWidget. */
struct PortWidget : widget::OpaqueWidget { struct PortWidget : widget::OpaqueWidget {
struct Internal;
Internal* internal;

engine::Module* module = NULL; engine::Module* module = NULL;
engine::Port::Type type = engine::Port::INPUT; engine::Port::Type type = engine::Port::INPUT;
int portId = -1; int portId = -1;


+ 3
- 0
include/app/RackWidget.hpp View File

@@ -17,6 +17,9 @@ namespace app {


/** Container for ModuleWidget and CableWidget. */ /** Container for ModuleWidget and CableWidget. */
struct RackWidget : widget::OpaqueWidget { struct RackWidget : widget::OpaqueWidget {
struct Internal;
Internal* internal;

widget::Widget* moduleContainer; widget::Widget* moduleContainer;
widget::Widget* cableContainer; widget::Widget* cableContainer;
CableWidget* incompleteCable = NULL; CableWidget* incompleteCable = NULL;


+ 3
- 0
include/patch.hpp View File

@@ -8,6 +8,9 @@ namespace rack {




struct PatchManager { struct PatchManager {
struct Internal;
Internal* internal;

/** The currently loaded patch file path */ /** The currently loaded patch file path */
std::string path; std::string path;
/** Path to autosave folder */ /** Path to autosave folder */


+ 1
- 0
src/app/CableWidget.cpp View File

@@ -12,6 +12,7 @@
namespace rack { namespace rack {
namespace app { namespace app {



CableWidget::CableWidget() { CableWidget::CableWidget() {
color = color::BLACK_TRANSPARENT; color = color::BLACK_TRANSPARENT;
} }


+ 3
- 0
src/app/ParamWidget.cpp View File

@@ -152,6 +152,9 @@ engine::ParamQuantity* ParamWidget::getParamQuantity() {
return module->paramQuantities[paramId]; return module->paramQuantities[paramId];
} }


ParamWidget::ParamWidget() {}
ParamWidget::~ParamWidget() {}

void ParamWidget::createTooltip() { void ParamWidget::createTooltip() {
if (!settings::tooltips) if (!settings::tooltips)
return; return;


Loading…
Cancel
Save