Skip to content

Commit

Permalink
Use custom localizable string type on node interfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacsv committed May 10, 2020
1 parent c735357 commit 934a045
Show file tree
Hide file tree
Showing 35 changed files with 198 additions and 192 deletions.
18 changes: 9 additions & 9 deletions Sources/BuiltInNodes/BI_ArithmeticUINodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ NE::DynamicSerializationInfo MultiplicationNode::serializationInfo (NE::ObjectId
NE::DynamicSerializationInfo DivisionNode::serializationInfo (NE::ObjectId ("{652DDDFC-A441-40B1-87AC-0BED247F35E7}"), NE::ObjectVersion (1), DivisionNode::CreateSerializableInstance);

BinaryOperationNode::BinaryOperationNode () :
BinaryOperationNode (std::wstring (), NUIE::Point ())
BinaryOperationNode (NE::String (), NUIE::Point ())
{

}

BinaryOperationNode::BinaryOperationNode (const std::wstring& name, const NUIE::Point& position) :
BinaryOperationNode::BinaryOperationNode (const NE::String& name, const NUIE::Point& position) :
BasicUINode (name, position)
{
}
Expand All @@ -31,9 +31,9 @@ BinaryOperationNode::~BinaryOperationNode ()

void BinaryOperationNode::Initialize ()
{
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("a"), L"A", NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("b"), L"B", NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("result"), L"Result")));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("a"), NE::String (L"A"), NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("b"), NE::String (L"B"), NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("result"), NE::String (L"Result"))));
RegisterFeature (NUIE::NodeFeaturePtr (new BI::ValueCombinationFeature (NE::ValueCombinationMode::Longest)));
}

Expand Down Expand Up @@ -95,7 +95,7 @@ AdditionNode::AdditionNode () :

}

AdditionNode::AdditionNode (const std::wstring& name, const NUIE::Point& position) :
AdditionNode::AdditionNode (const NE::String& name, const NUIE::Point& position) :
BinaryOperationNode (name, position)
{

Expand All @@ -117,7 +117,7 @@ SubtractionNode::SubtractionNode () :

}

SubtractionNode::SubtractionNode (const std::wstring& name, const NUIE::Point& position) :
SubtractionNode::SubtractionNode (const NE::String& name, const NUIE::Point& position) :
BinaryOperationNode (name, position)
{

Expand All @@ -139,7 +139,7 @@ MultiplicationNode::MultiplicationNode () :

}

MultiplicationNode::MultiplicationNode (const std::wstring& name, const NUIE::Point& position) :
MultiplicationNode::MultiplicationNode (const NE::String& name, const NUIE::Point& position) :
BinaryOperationNode (name, position)
{

Expand All @@ -161,7 +161,7 @@ DivisionNode::DivisionNode () :

}

DivisionNode::DivisionNode (const std::wstring& name, const NUIE::Point& position) :
DivisionNode::DivisionNode (const NE::String& name, const NUIE::Point& position) :
BinaryOperationNode (name, position)
{

Expand Down
10 changes: 5 additions & 5 deletions Sources/BuiltInNodes/BI_ArithmeticUINodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BinaryOperationNode : public BasicUINode

public:
BinaryOperationNode ();
BinaryOperationNode (const std::wstring& name, const NUIE::Point& position);
BinaryOperationNode (const NE::String& name, const NUIE::Point& position);
virtual ~BinaryOperationNode ();

virtual void Initialize () override;
Expand All @@ -36,7 +36,7 @@ class AdditionNode : public BinaryOperationNode

public:
AdditionNode ();
AdditionNode (const std::wstring& name, const NUIE::Point& position);
AdditionNode (const NE::String& name, const NUIE::Point& position);
virtual ~AdditionNode ();

private:
Expand All @@ -49,7 +49,7 @@ class SubtractionNode : public BinaryOperationNode

public:
SubtractionNode ();
SubtractionNode (const std::wstring& name, const NUIE::Point& position);
SubtractionNode (const NE::String& name, const NUIE::Point& position);
virtual ~SubtractionNode ();

private:
Expand All @@ -62,7 +62,7 @@ class MultiplicationNode : public BinaryOperationNode

public:
MultiplicationNode ();
MultiplicationNode (const std::wstring& name, const NUIE::Point& position);
MultiplicationNode (const NE::String& name, const NUIE::Point& position);
virtual ~MultiplicationNode ();

private:
Expand All @@ -75,7 +75,7 @@ class DivisionNode : public BinaryOperationNode

public:
DivisionNode ();
DivisionNode (const std::wstring& name, const NUIE::Point& position);
DivisionNode (const NE::String& name, const NUIE::Point& position);
virtual ~DivisionNode ();

private:
Expand Down
8 changes: 4 additions & 4 deletions Sources/BuiltInNodes/BI_BasicUINode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ namespace BI
NE::SerializationInfo BasicUINode::serializationInfo (NE::ObjectVersion (1));

BasicUINode::BasicUINode () :
BasicUINode (std::wstring (), NUIE::Point ())
BasicUINode (NE::String (), NUIE::Point ())
{

}

BasicUINode::BasicUINode (const std::wstring& name, const NUIE::Point& position) :
BasicUINode::BasicUINode (const NE::String& name, const NUIE::Point& position) :
BasicUINode (name, position, NUIE::InvalidIconId, UINodeLayoutPtr (new HeaderWithSlotsLayout ()))
{

}

BasicUINode::BasicUINode (const std::wstring& name, const NUIE::Point& position, const NUIE::IconId& iconId) :
BasicUINode::BasicUINode (const NE::String& name, const NUIE::Point& position, const NUIE::IconId& iconId) :
BasicUINode (name, position, iconId, UINodeLayoutPtr (new HeaderWithSlotsLayout ()))
{

}
BasicUINode::BasicUINode (const std::wstring& name, const NUIE::Point& position, const NUIE::IconId& iconId, const UINodeLayoutPtr& layout) :
BasicUINode::BasicUINode (const NE::String& name, const NUIE::Point& position, const NUIE::IconId& iconId, const UINodeLayoutPtr& layout) :
NUIE::UINode (name, position),
iconId (iconId),
layout (layout)
Expand Down
6 changes: 3 additions & 3 deletions Sources/BuiltInNodes/BI_BasicUINode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class BasicUINode : public NUIE::UINode

public:
BasicUINode ();
BasicUINode (const std::wstring& name, const NUIE::Point& position);
BasicUINode (const std::wstring& name, const NUIE::Point& position, const NUIE::IconId& iconId);
BasicUINode (const std::wstring& name, const NUIE::Point& position, const NUIE::IconId& iconId, const UINodeLayoutPtr& layout);
BasicUINode (const NE::String& name, const NUIE::Point& position);
BasicUINode (const NE::String& name, const NUIE::Point& position, const NUIE::IconId& iconId);
BasicUINode (const NE::String& name, const NUIE::Point& position, const NUIE::IconId& iconId, const UINodeLayoutPtr& layout);
virtual ~BasicUINode ();

bool HasIconId () const;
Expand Down
68 changes: 34 additions & 34 deletions Sources/BuiltInNodes/BI_InputUINodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ std::shared_ptr<HeaderWithSlotsAndSwitchLayout::ClickHandler> BooleanNode::Layou
}

BooleanNode::BooleanNode () :
BooleanNode (std::wstring (), NUIE::Point (), false)
BooleanNode (NE::String (), NUIE::Point (), false)
{

}

BooleanNode::BooleanNode (const std::wstring& name, const NUIE::Point& position, bool val) :
BooleanNode::BooleanNode (const NE::String& name, const NUIE::Point& position, bool val) :
BasicUINode (name, position, NUIE::InvalidIconId, UINodeLayoutPtr (new Layout ("switch", NE::LocalizeString (L"true"), NE::LocalizeString (L"false")))),
val (val)
{
Expand All @@ -102,7 +102,7 @@ BooleanNode::~BooleanNode ()

void BooleanNode::Initialize ()
{
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), L"Output")));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), NE::String (L"Output"))));
}

bool BooleanNode::IsForceCalculated () const
Expand Down Expand Up @@ -218,12 +218,12 @@ std::shared_ptr<HeaderWithSlotsAndButtonsLayout::ClickHandler> NumericUpDownNode
}

NumericUpDownNode::NumericUpDownNode () :
NumericUpDownNode (std::wstring (), NUIE::Point ())
NumericUpDownNode (NE::String (), NUIE::Point ())
{

}

NumericUpDownNode::NumericUpDownNode (const std::wstring& name, const NUIE::Point& position) :
NumericUpDownNode::NumericUpDownNode (const NE::String& name, const NUIE::Point& position) :
BasicUINode (name, position, NUIE::InvalidIconId, UINodeLayoutPtr (new Layout ("minus", NE::LocalizeString (L"<"), "plus", NE::LocalizeString (L">"))))
{

Expand All @@ -236,7 +236,7 @@ NumericUpDownNode::~NumericUpDownNode ()

void NumericUpDownNode::Initialize ()
{
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), L"Output")));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), NE::String (L"Output"))));
}

bool NumericUpDownNode::IsForceCalculated () const
Expand All @@ -259,12 +259,12 @@ NE::Stream::Status NumericUpDownNode::Write (NE::OutputStream& outputStream) con
}

IntegerUpDownNode::IntegerUpDownNode () :
IntegerUpDownNode (std::wstring (), NUIE::Point (), 0, 0)
IntegerUpDownNode (NE::String (), NUIE::Point (), 0, 0)
{

}

IntegerUpDownNode::IntegerUpDownNode (const std::wstring& name, const NUIE::Point& position, int val, int step) :
IntegerUpDownNode::IntegerUpDownNode (const NE::String& name, const NUIE::Point& position, int val, int step) :
NumericUpDownNode (name, position),
val (val),
step (step)
Expand Down Expand Up @@ -382,12 +382,12 @@ void IntegerUpDownNode::SetStep (int newStep)
}

DoubleUpDownNode::DoubleUpDownNode () :
DoubleUpDownNode (std::wstring (), NUIE::Point (), 0.0, 0.0)
DoubleUpDownNode (NE::String (), NUIE::Point (), 0.0, 0.0)
{

}

DoubleUpDownNode::DoubleUpDownNode (const std::wstring& name, const NUIE::Point& position, double val, double step) :
DoubleUpDownNode::DoubleUpDownNode (const NE::String& name, const NUIE::Point& position, double val, double step) :
NumericUpDownNode (name, position),
val (val),
step (step)
Expand Down Expand Up @@ -505,12 +505,12 @@ void DoubleUpDownNode::SetStep (double newStep)
}

NumericRangeNode::NumericRangeNode () :
NumericRangeNode (std::wstring (), NUIE::Point ())
NumericRangeNode (NE::String (), NUIE::Point ())
{

}

NumericRangeNode::NumericRangeNode (const std::wstring& name, const NUIE::Point& position) :
NumericRangeNode::NumericRangeNode (const NE::String& name, const NUIE::Point& position) :
BasicUINode (name, position)
{

Expand Down Expand Up @@ -541,12 +541,12 @@ NE::Stream::Status NumericRangeNode::Write (NE::OutputStream& outputStream) cons
}

IntegerIncrementedNode::IntegerIncrementedNode () :
IntegerIncrementedNode (std::wstring (), NUIE::Point ())
IntegerIncrementedNode (NE::String (), NUIE::Point ())
{

}

IntegerIncrementedNode::IntegerIncrementedNode (const std::wstring& name, const NUIE::Point& position) :
IntegerIncrementedNode::IntegerIncrementedNode (const NE::String& name, const NUIE::Point& position) :
NumericRangeNode (name, position)
{

Expand All @@ -559,10 +559,10 @@ IntegerIncrementedNode::~IntegerIncrementedNode ()

void IntegerIncrementedNode::Initialize ()
{
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("start"), L"Start", NE::ValuePtr (new NE::IntValue (0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("step"), L"Step", NE::ValuePtr (new NE::IntValue (1)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("count"), L"Count", NE::ValuePtr (new NE::IntValue (10)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), L"List")));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("start"), NE::String (L"Start"), NE::ValuePtr (new NE::IntValue (0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("step"), NE::String (L"Step"), NE::ValuePtr (new NE::IntValue (1)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("count"), NE::String (L"Count"), NE::ValuePtr (new NE::IntValue (10)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), NE::String (L"List"))));
}

NE::ValueConstPtr IntegerIncrementedNode::Calculate (NE::EvaluationEnv& env) const
Expand Down Expand Up @@ -612,12 +612,12 @@ NE::Stream::Status IntegerIncrementedNode::Write (NE::OutputStream& outputStream
}

DoubleIncrementedNode::DoubleIncrementedNode () :
DoubleIncrementedNode (std::wstring (), NUIE::Point ())
DoubleIncrementedNode (NE::String (), NUIE::Point ())
{

}

DoubleIncrementedNode::DoubleIncrementedNode (const std::wstring& name, const NUIE::Point& position) :
DoubleIncrementedNode::DoubleIncrementedNode (const NE::String& name, const NUIE::Point& position) :
NumericRangeNode (name, position)
{

Expand All @@ -630,10 +630,10 @@ DoubleIncrementedNode::~DoubleIncrementedNode ()

void DoubleIncrementedNode::Initialize ()
{
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("start"), L"Start", NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("step"), L"Step", NE::ValuePtr (new NE::DoubleValue (1.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("count"), L"Count", NE::ValuePtr (new NE::IntValue (10)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), L"List")));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("start"), NE::String (L"Start"), NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("step"), NE::String (L"Step"), NE::ValuePtr (new NE::DoubleValue (1.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("count"), NE::String (L"Count"), NE::ValuePtr (new NE::IntValue (10)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), NE::String (L"List"))));
}

NE::ValueConstPtr DoubleIncrementedNode::Calculate (NE::EvaluationEnv& env) const
Expand Down Expand Up @@ -683,12 +683,12 @@ NE::Stream::Status DoubleIncrementedNode::Write (NE::OutputStream& outputStream)
}

DoubleDistributedNode::DoubleDistributedNode () :
DoubleDistributedNode (std::wstring (), NUIE::Point ())
DoubleDistributedNode (NE::String (), NUIE::Point ())
{

}

DoubleDistributedNode::DoubleDistributedNode (const std::wstring& name, const NUIE::Point& position) :
DoubleDistributedNode::DoubleDistributedNode (const NE::String& name, const NUIE::Point& position) :
NumericRangeNode (name, position)
{

Expand All @@ -701,10 +701,10 @@ DoubleDistributedNode::~DoubleDistributedNode ()

void DoubleDistributedNode::Initialize ()
{
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("start"), L"Start", NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("end"), L"End", NE::ValuePtr (new NE::DoubleValue (1.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("count"), L"Count", NE::ValuePtr (new NE::IntValue (10)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), L"List")));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("start"), NE::String (L"Start"), NE::ValuePtr (new NE::DoubleValue (0.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("end"), NE::String (L"End"), NE::ValuePtr (new NE::DoubleValue (1.0)), NE::OutputSlotConnectionMode::Single)));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("count"), NE::String (L"Count"), NE::ValuePtr (new NE::IntValue (10)), NE::OutputSlotConnectionMode::Single)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), NE::String (L"List"))));
}

NE::ValueConstPtr DoubleDistributedNode::Calculate (NE::EvaluationEnv& env) const
Expand Down Expand Up @@ -755,12 +755,12 @@ NE::Stream::Status DoubleDistributedNode::Write (NE::OutputStream& outputStream)
}

ListBuilderNode::ListBuilderNode () :
ListBuilderNode (std::wstring (), NUIE::Point ())
ListBuilderNode (NE::String (), NUIE::Point ())
{

}

ListBuilderNode::ListBuilderNode (const std::wstring& name, const NUIE::Point& position) :
ListBuilderNode::ListBuilderNode (const NE::String& name, const NUIE::Point& position) :
BasicUINode (name, position)
{

Expand All @@ -773,8 +773,8 @@ ListBuilderNode::~ListBuilderNode ()

void ListBuilderNode::Initialize ()
{
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("in"), L"Input", nullptr, NE::OutputSlotConnectionMode::Multiple)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), L"Output")));
RegisterUIInputSlot (NUIE::UIInputSlotPtr (new NUIE::UIInputSlot (NE::SlotId ("in"), NE::String (L"Input"), nullptr, NE::OutputSlotConnectionMode::Multiple)));
RegisterUIOutputSlot (NUIE::UIOutputSlotPtr (new NUIE::UIOutputSlot (NE::SlotId ("out"), NE::String (L"Output"))));
}

NE::ValueConstPtr ListBuilderNode::Calculate (NE::EvaluationEnv& env) const
Expand Down
Loading

0 comments on commit 934a045

Please sign in to comment.