Skip to content

Commit

Permalink
Updated last input status to be not const
Browse files Browse the repository at this point in the history
  • Loading branch information
Neko-Box-Coder committed Sep 15, 2023
1 parent 5358f4e commit e8d5772
Show file tree
Hide file tree
Showing 61 changed files with 109 additions and 66 deletions.
13 changes: 13 additions & 0 deletions Include/ssGUI/DataClasses/DragData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace ssGUI
private:
ssGUI::Enums::DragDataType CurrentDragDataType = ssGUI::Enums::DragDataType::NONE;
std::string CustomDataIdentifier = "";
ssGUI::GUIObject* Interceptor = nullptr;

union
{
Expand Down Expand Up @@ -61,6 +62,18 @@ namespace ssGUI
//Sets the drag data for custom data
void SetDragData(void* data);

//function: SetInterceptor
//Sets the interceptor for the current drag data, setting nullptr to unset it
void SetInterceptor(ssGUI::GUIObject* interceptor);

//function: IsIntercepted
//Returns if the current drag data is being intercepted
bool IsIntercepted() const;

//function: GetInterceptor
//Returns the GUI Object that has intercepted the current drag data, nullptr if none.
ssGUI::GUIObject* GetInterceptor() const;

//function: GetDragData
//Sets the drag data for the corresponding data type.
//To see which data type, call <GetDragDataType>
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/DataClasses/EventInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace ssGUI
ssGUI::InputStatus& CurrentInputStatus;

//var: LastInputStatus
const ssGUI::InputStatus& LastInputStatus;
ssGUI::InputStatus& LastInputStatus;

//var: MainWindow
ssGUI::GUIObject* MainWindow;
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/AdvancedPosition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/AdvancedSize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Border.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/BoxShadow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
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 @@ -139,7 +139,7 @@ namespace Extensions

virtual void AttemptUndockingFromGUI( ssGUI::Window* containerWindow,
ssGUI::MainWindow* mainWindow,
const ssGUI::InputStatus& lastInputStatus);
ssGUI::InputStatus& lastInputStatus);

virtual bool IsAttemptingToUndockFromGUI();

Expand Down Expand Up @@ -351,7 +351,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/DockingArea.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Extension.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) = 0;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Legacy/Dockable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Legacy/Docker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Mask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/MaskEnforcer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Outline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/RoundedCorners.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/Shape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/TemplateExtension.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Extensions/WindowLayoutItemEnforcer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace Extensions
virtual void Internal_Update( bool isPreUpdate,
ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Internal_Draw
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/Button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace ssGUI
virtual void SetButtonState(ssGUI::Enums::ButtonState state);
virtual void MainLogic( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace ssGUI

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

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace ssGUI

virtual void MainLogic( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;
public:
//====================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace ssGUI

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

public:
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/CompositeClasses/Slider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace ssGUI

virtual void MainLogic( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;
public:
//string: ListenerKey
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/GUIObjectClasses/GUIObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace ssGUI
ssGUI::GUIObject* mainWindow);
virtual void MainLogic( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow);

public:
Expand Down Expand Up @@ -118,7 +118,7 @@ namespace ssGUI
//(Internal ssGUI function) Update function called by <ssGUIManager>
virtual void Internal_Update( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow);

//function: Clone
Expand Down
4 changes: 2 additions & 2 deletions Include/ssGUI/GUIObjectClasses/MainWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace ssGUI

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

public:
Expand Down Expand Up @@ -269,7 +269,7 @@ namespace ssGUI
//See <GUIObject::Internal_Update>
virtual void Internal_Update( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

//function: Clone
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/Menu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace ssGUI

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

public:
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/Text.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ namespace ssGUI

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

public:
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/TextField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace ssGUI

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

public:
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/Widget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace ssGUI
virtual void ConstructRenderInfo() override;
virtual void MainLogic( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

public:
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/Window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace ssGUI
virtual void ConstructRenderInfo() override;
virtual void MainLogic( ssGUI::Backend::BackendSystemInputInterface* inputInterface,
ssGUI::InputStatus& currentInputStatus,
const ssGUI::InputStatus& lastInputStatus,
ssGUI::InputStatus& lastInputStatus,
ssGUI::GUIObject* mainWindow) override;

public:
Expand Down
15 changes: 15 additions & 0 deletions Src/ssGUI/DataClasses/DragData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ namespace ssGUI
CurrentDragDataType = ssGUI::Enums::DragDataType::CUSTOM;
}

void DragData::SetInterceptor(ssGUI::GUIObject* interceptor)
{
Interceptor = interceptor;
}

bool DragData::IsIntercepted() const
{
return Interceptor != nullptr;
}

ssGUI::GUIObject* DragData::GetInterceptor() const
{
return Interceptor;
}

template<>
ssGUI::GUIObject* DragData::GetDragData() const
{
Expand Down
Loading

0 comments on commit e8d5772

Please sign in to comment.