-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework input status, Adding input status for last frame & Docking v2...
Rework input status (4F85J3oD98), Adding input status for last frame (9uoLK4Po9J), Docking v2 (Js3lpwy7AJ)
- Loading branch information
1 parent
9ced04c
commit 5358f4e
Showing
84 changed files
with
3,247 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#ifndef SSGUI_BLOCK_DATA_HPP | ||
#define SSGUI_BLOCK_DATA_HPP | ||
|
||
#include "ssGUI/Enums/BlockDataType.hpp" | ||
#include <string> | ||
|
||
namespace ssGUI | ||
{ | ||
class GUIObject; | ||
class EventCallback; | ||
namespace Extensions | ||
{ | ||
class Extension; | ||
} | ||
|
||
//class: ssGUI::BlockData | ||
//This class holds the data that is currently blocking the input | ||
class BlockData | ||
{ | ||
private: | ||
ssGUI::Enums::BlockDataType CurrentBlockDataType = ssGUI::Enums::BlockDataType::NONE; | ||
std::string CustomDataIdentifier = ""; | ||
|
||
union | ||
{ | ||
ssGUI::GUIObject* CurrentGUIObject; | ||
ssGUI::Extensions::Extension* CurrentExtension; | ||
ssGUI::EventCallback* CurrentEventCallback; | ||
void* CurrentCustomData; | ||
} Data; | ||
|
||
public: | ||
//function: UnsetBlockData | ||
//Unsets the block data, meaning <GetBlockDataType> will return <ssGUI::Enums::BlockDataType::NONE> | ||
void UnsetBlockData(); | ||
|
||
//function: GetBlockDataType | ||
//Gets the block data type | ||
ssGUI::Enums::BlockDataType GetBlockDataType() const; | ||
|
||
//function: SetCustomDataIdentifier | ||
//Sets the identifier for custom data for the block data type <ssGUI::Enums::BlockDataType::CUSTOM> | ||
void SetCustomDataIdentifier(const std::string& identifier); | ||
|
||
//function: GetCustomDataIdentifier | ||
//Gets the identifier for custom data for the block data type <ssGUI::Enums::BlockDataType::CUSTOM> | ||
std::string GetCustomDataIdentifier() const; | ||
|
||
//function: SetBlockData | ||
//Sets the block data for <ssGUI::GUIObject> | ||
void SetBlockData(ssGUI::GUIObject* data); | ||
|
||
//function: SetBlockData | ||
//Sets the block data for <ssGUI::Extensions::Extension> | ||
void SetBlockData(ssGUI::Extensions::Extension* data); | ||
|
||
//function: SetBlockData | ||
//Sets the block data for <ssGUI::EventCallback> | ||
void SetBlockData(ssGUI::EventCallback* data); | ||
|
||
//function: SetBlockData | ||
//Sets the block data for custom data | ||
void SetBlockData(void* data); | ||
|
||
//function: GetBlockData | ||
//Sets the block data for the corresponding data type. | ||
//To see which data type, call <GetBlockDataType> | ||
template<typename T> | ||
T* GetBlockData() const; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef SSGUI_DOCK_EVENT_INFO_HPP | ||
#define SSGUI_DOCK_EVENT_INFO_HPP | ||
|
||
#include "ssGUI/Enums/DockSide.hpp" | ||
namespace ssGUI | ||
{ | ||
//struct: ssGUI::DockEventInfo | ||
struct DockEventInfo | ||
{ | ||
public: | ||
//var: AbortDocking | ||
bool AbortDocking = false; | ||
|
||
//var: CurrentDockSide | ||
ssGUI::Enums::DockSide CurrentDockSide; | ||
}; | ||
} | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#ifndef SSGUI_DRAG_DATA_HPP | ||
#define SSGUI_DRAG_DATA_HPP | ||
|
||
#include "ssGUI/Enums/DragDataType.hpp" | ||
#include <string> | ||
|
||
namespace ssGUI | ||
{ | ||
class GUIObject; | ||
|
||
/*class: ssGUI::DragData | ||
This class holds the data that the mouse is currently dragging | ||
Variables: | ||
============================== C++ ============================== | ||
private: | ||
ssGUI::Enums::DragDataType CurrentDragDataType = ssGUI::Enums::DragDataType::NONE; | ||
std::string CustomDataIdentifier = ""; | ||
union | ||
{ | ||
ssGUI::GUIObject* GUIObject; | ||
void* CustomData; | ||
} Data; | ||
================================================================= | ||
*/ | ||
class DragData | ||
{ | ||
private: | ||
ssGUI::Enums::DragDataType CurrentDragDataType = ssGUI::Enums::DragDataType::NONE; | ||
std::string CustomDataIdentifier = ""; | ||
|
||
union | ||
{ | ||
ssGUI::GUIObject* GUIObject; | ||
void* CustomData; | ||
} Data; | ||
|
||
public: | ||
//function: UnsetDragData | ||
//Unsets the drag data, meaning <GetDragDataType> will return <ssGUI::Enums::DragDataType::NONE> | ||
void UnsetDragData(); | ||
|
||
//function: GetDragDataType | ||
//Gets the drag data type | ||
ssGUI::Enums::DragDataType GetDragDataType() const; | ||
|
||
//function: SetCustomDataIdentifier | ||
//Sets the identifier for custom data for the block data type <ssGUI::Enums::DragDataType::CUSTOM> | ||
void SetCustomDataIdentifier(const std::string& identifier); | ||
|
||
//function: GetCustomDataIdentifier | ||
//Gets the identifier for custom data for the block data type <ssGUI::Enums::DragDataType::CUSTOM> | ||
std::string GetCustomDataIdentifier() const; | ||
|
||
//function: SetDragData | ||
//Sets the drag data for <ssGUI::GUIObject> | ||
void SetDragData(ssGUI::GUIObject* data); | ||
|
||
//function: SetDragData | ||
//Sets the drag data for custom data | ||
void SetDragData(void* data); | ||
|
||
//function: GetDragData | ||
//Sets the drag data for the corresponding data type. | ||
//To see which data type, call <GetDragDataType> | ||
template<typename T> | ||
T* GetDragData() const; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
#ifndef SSGUI_INPUT_STATUS_H | ||
#define SSGUI_INPUT_STATUS_H | ||
|
||
#include "ssGUI/DataClasses/BlockData.hpp" | ||
#include "ssGUI/DataClasses/DragData.hpp" | ||
|
||
//namespace: ssGUI | ||
namespace ssGUI | ||
{ | ||
class GUIObject; | ||
|
||
//class: ssGUI::InputStatus | ||
class InputStatus | ||
//This holds the status information such as blocking or docking for different inputs | ||
struct InputStatus | ||
{ | ||
public: | ||
//var: MouseInputBlockedObject | ||
ssGUI::GUIObject* MouseInputBlockedObject = nullptr; | ||
//var: MouseInputBlockedData | ||
//The object/data that is currently blocking mouse input | ||
BlockData MouseInputBlockedData; | ||
|
||
//var: KeyInputBlockedObject | ||
ssGUI::GUIObject* KeyInputBlockedObject = nullptr; | ||
//var: KeyInputBlockedData | ||
//The object/data that is currently blocking key press input | ||
BlockData KeyInputBlockedData; | ||
|
||
//var: DockingBlockedObject | ||
//var: LegacyDockingBlockedObject (Deprecated) | ||
//Blocks docking of a window if there's another GUI Object on top of it. | ||
ssGUI::GUIObject* DockingBlockedObject = nullptr; | ||
ssGUI::GUIObject* LegacyDockingBlockedObject = nullptr; | ||
|
||
//var: CurrentDragData | ||
//The data currently being dragged by the mouse | ||
DragData CurrentDragData; | ||
}; | ||
} | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef SSGUI_BLOCK_DATA_TYPE_HPP | ||
#define SSGUI_BLOCK_DATA_TYPE_HPP | ||
|
||
#include "ssGUI/HelperClasses/EnumToStringMacro.hpp" | ||
#include <cstdint> | ||
#include <string> | ||
|
||
namespace ssGUI | ||
{ | ||
//namespace: ssGUI::Enums | ||
namespace Enums | ||
{ | ||
/*enum: BlockDataType | ||
NONE - Nothing is blocking | ||
GUI_OBJECT - <ssGUI::GUIObject> is blocking | ||
EXTENSION - <ssGUI::Extensions::Extension> is blocking | ||
EVENT_CALLBACK - <ssGUI::EventCallback> is blocking | ||
CUSTOM - Custom data (such as user event) is blocking | ||
COUNT - Count | ||
*/ | ||
enum class BlockDataType : uint16_t | ||
{ | ||
NONE, | ||
GUI_OBJECT, | ||
EXTENSION, | ||
EVENT_CALLBACK, | ||
CUSTOM, | ||
COUNT | ||
}; | ||
|
||
//function: BlockDataTypeToString | ||
inline std::string BlockDataTypeToString(BlockDataType input) | ||
{ | ||
static_assert((int)BlockDataType::COUNT == 5, "ToString"); | ||
switch(input) | ||
{ | ||
RETURN_ENUM_STRING(BlockDataType::NONE); | ||
RETURN_ENUM_STRING(BlockDataType::GUI_OBJECT); | ||
RETURN_ENUM_STRING(BlockDataType::EXTENSION); | ||
RETURN_ENUM_STRING(BlockDataType::EVENT_CALLBACK); | ||
RETURN_ENUM_STRING(BlockDataType::CUSTOM); | ||
RETURN_ENUM_STRING(BlockDataType::COUNT); | ||
} | ||
|
||
return ""; | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#ifndef SSGUI_DOCK_SIDE_HPP | ||
#define SSGUI_DOCK_SIDE_HPP | ||
|
||
#include "ssGUI/HelperClasses/EnumToStringMacro.hpp" | ||
#include <string> | ||
namespace ssGUI | ||
{ | ||
|
||
//namespace: ssGUI::Enums | ||
namespace Enums | ||
{ | ||
/*enum: DockSide | ||
TOP - Docking to top half | ||
RIGHT - Docking to right half | ||
BOTTOM - Docking to bottom half | ||
LEFT - Docking to left half | ||
CENTER - Docking to the whole area | ||
COUNT - Count | ||
*/ | ||
enum class DockSide | ||
{ | ||
TOP, | ||
RIGHT, | ||
BOTTOM, | ||
LEFT, | ||
CENTER, | ||
COUNT | ||
}; | ||
|
||
//function: DockSideToString | ||
inline std::string DockSideToString(DockSide side) | ||
{ | ||
static_assert((int)DockSide::COUNT == 5, "ToString"); | ||
switch(side) | ||
{ | ||
RETURN_ENUM_STRING(DockSide::TOP); | ||
RETURN_ENUM_STRING(DockSide::RIGHT); | ||
RETURN_ENUM_STRING(DockSide::BOTTOM); | ||
RETURN_ENUM_STRING(DockSide::LEFT); | ||
RETURN_ENUM_STRING(DockSide::CENTER); | ||
RETURN_ENUM_STRING(DockSide::COUNT); | ||
} | ||
|
||
return ""; | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif |
Oops, something went wrong.