Skip to content

Commit

Permalink
Merge pull request Neko-Box-Coder#27 from Neko-Box-Coder/ExtensionsUp…
Browse files Browse the repository at this point in the history
…date

Extensions Update
  • Loading branch information
Neko-Box-Coder authored Oct 25, 2023
2 parents cb30630 + 2c64a38 commit e51eca9
Show file tree
Hide file tree
Showing 33 changed files with 130 additions and 217 deletions.
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/AdvancedPosition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/AdvancedSize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/Border.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/BoxShadow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/DockableV2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/DockingArea.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/Extension.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace Extensions

//function: GetExtensionName
//Returns this extension's name
virtual std::string GetExtensionName() = 0;
virtual std::string GetExtensionName() const = 0;

//TODO: CHange this to internal

Expand All @@ -79,7 +79,7 @@ namespace Extensions

//function: Copy
//Copy all values of this extension to another extension
virtual void Copy(ssGUI::Extensions::Extension* extension) = 0;
virtual void Copy(const ssGUI::Extensions::Extension* extension) = 0;

//function: Internal_GetObjectsReferences
//Returns all the referenced GUI Objects. If nullptr is returned, this extension is not referencing any GUI Object (exception for container).
Expand Down
15 changes: 13 additions & 2 deletions Include/ssGUI/Extensions/Layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ namespace Extensions
static const std::string EXTENSION_NAME;

//function: IsHorizontalLayout
//Returns true if the children are positioned left to right (horizontal) or top to bottom (vertical)
virtual bool IsHorizontalLayout() const;

//function: SetHorizontalLayout
//Sets if the children are positioned left to right (horizontal) or top to bottom (vertical)
virtual void SetHorizontalLayout(bool horizontal);

//function: AddPreferredSizeMultiplier
Expand All @@ -172,6 +174,8 @@ namespace Extensions
virtual void AddPreferredSizeMultiplier(float sizeMultiplier);

//function: AddPreferredSizeMultiplier
//Template version of <AddPreferredSizeMultiplier> for adding multiple size multipliers at once.
//See <AddPreferredSizeMultiplier>
template<typename... floats>
inline void AddPreferredSizeMultipliers(float sizeMultiplier, floats... sizeMultipliers)
{
Expand All @@ -180,6 +184,8 @@ namespace Extensions
}

//function: AddPreferredSizeMultiplier
//Array version of <AddPreferredSizeMultiplier> for adding multiple size multipliers at once.
//See <AddPreferredSizeMultiplier>
virtual void AddPreferredSizeMultipliers(float sizeMultipliers[], int count);

//function: SetPreferredSizeMultiplier
Expand Down Expand Up @@ -289,6 +295,11 @@ namespace Extensions
//If a GUI Object is excluded, it will be ignored
virtual void UnexcludeObject(ssGUI::GUIObject* obj);

virtual void ForceUpdateLayout( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow);

//function: Internal_OnRecursiveChildAdded
//(Internal ssGUI function) Listener function when a child is being added
virtual void Internal_OnRecursiveChildAdded(ssGUI::GUIObject* child);
Expand Down Expand Up @@ -328,15 +339,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/Legacy/Dockable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/Legacy/Docker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/Mask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/MaskEnforcer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/Outline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/RoundedCorners.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
6 changes: 4 additions & 2 deletions Include/ssGUI/Extensions/Shape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ namespace Extensions
Nullptr can be returned if the id is invalid. */
virtual std::vector<glm::u8vec4>* GetAdditionalShapeColorsWithID(int id);

//TODO: Get shape index with id

//TODO: Maybe allow getting properties of different shapes

//function: GetAdditionalShapesCount
Expand Down Expand Up @@ -356,15 +358,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/TemplateExtension.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/Extensions/WindowLayoutItemEnforcer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ namespace Extensions

//function: GetExtensionName
//See <Extension::GetExtensionName>
virtual std::string GetExtensionName() override;
virtual std::string GetExtensionName() const override;

//function: BindToObject
//See <Extension::BindToObject>
virtual void BindToObject(ssGUI::GUIObject* bindObj) override;

//function: Copy
//See <Extension::Copy>
virtual void Copy(ssGUI::Extensions::Extension* extension) override;
virtual void Copy(const ssGUI::Extensions::Extension* extension) override;

//function: Internal_GetObjectsReferences
//See <Extension::Internal_GetObjectsReferences>
Expand Down
14 changes: 4 additions & 10 deletions Src/ssGUI/Extensions/AdvancedPosition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ namespace Extensions
AdvancedPosition::AdvancedPosition(AdvancedPosition const& other)
{
Container = nullptr;
Enabled = other.IsEnabled();
CurrentHorizontal = other.GetHorizontalAlignment();
CurrentVertical = other.GetVerticalAlignment();
HorizontalPixelValue = other.GetHorizontalPixel();
VerticalPixelValue = other.GetVerticalPixel();
HorizontalPercentageValue = other.GetHorizontalPercentage();
VerticalPercentageValue = other.GetVerticalPercentage();
Copy(&other);
}

void AdvancedPosition::ConstructRenderInfo()
Expand Down Expand Up @@ -231,7 +225,7 @@ namespace Extensions
//Nothing to draw
}

std::string AdvancedPosition::GetExtensionName()
std::string AdvancedPosition::GetExtensionName() const
{
return EXTENSION_NAME;
}
Expand All @@ -241,12 +235,12 @@ namespace Extensions
Container = bindObj;
}

void AdvancedPosition::Copy(ssGUI::Extensions::Extension* extension)
void AdvancedPosition::Copy(const ssGUI::Extensions::Extension* extension)
{
if(extension->GetExtensionName() != EXTENSION_NAME)
return;

ssGUI::Extensions::AdvancedPosition* ap = static_cast<ssGUI::Extensions::AdvancedPosition*>(extension);
auto* ap = static_cast<const ssGUI::Extensions::AdvancedPosition*>(extension);
Enabled = ap->IsEnabled();
CurrentHorizontal = ap->GetHorizontalAlignment();
CurrentVertical = ap->GetVerticalAlignment();
Expand Down
Loading

0 comments on commit e51eca9

Please sign in to comment.