Skip to content

Commit

Permalink
Added StaticWidgetType member to widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
texus committed Dec 10, 2022
1 parent d89d25b commit 1c0b9a0
Show file tree
Hide file tree
Showing 45 changed files with 140 additions and 50 deletions.
4 changes: 3 additions & 1 deletion include/TGUI/Backend/Renderer/GLES2/CanvasGLES2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ namespace tgui
using Ptr = std::shared_ptr<CanvasGLES2>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const CanvasGLES2>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "CanvasGLES2"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -74,7 +76,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CanvasGLES2(const char* typeName = "CanvasGLES2", bool initRenderer = true);
CanvasGLES2(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Backend/Renderer/OpenGL3/CanvasOpenGL3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ namespace tgui
using Ptr = std::shared_ptr<CanvasOpenGL3>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const CanvasOpenGL3>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "CanvasOpenGL3"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -74,7 +76,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CanvasOpenGL3(const char* typeName = "CanvasOpenGL3", bool initRenderer = true);
CanvasOpenGL3(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Backend/Renderer/SDL_Renderer/CanvasSDL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ namespace tgui
using Ptr = std::shared_ptr<CanvasSDL>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const CanvasSDL>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "CanvasSDL"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -78,7 +80,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CanvasSDL(const char* typeName = "CanvasSDL", bool initRenderer = true);
CanvasSDL(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Backend/Renderer/SFML-Graphics/CanvasSFML.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ namespace tgui
using Ptr = std::shared_ptr<CanvasSFML>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const CanvasSFML>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "CanvasSFML"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -79,7 +81,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CanvasSFML(const char* typeName = "CanvasSFML", bool initRenderer = true);
CanvasSFML(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ namespace tgui
using Ptr = std::shared_ptr<RootContainer>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const RootContainer>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "RootContainer"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -693,7 +695,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
RootContainer(const char* typeName = "RootContainer", bool initRenderer = true);
RootContainer(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/CustomWidgetForBindings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace tgui
using Ptr = std::shared_ptr<CustomWidgetForBindings>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const CustomWidgetForBindings>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "CustomWidget"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -52,7 +54,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CustomWidgetForBindings(const char* typeName = "CustomWidget", bool initRenderer = true);
CustomWidgetForBindings(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/BitmapButton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ namespace tgui
using Ptr = std::shared_ptr<BitmapButton>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const BitmapButton>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "BitmapButton"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -51,7 +53,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
BitmapButton(const char* typeName = "BitmapButton", bool initRenderer = true);
BitmapButton(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/Button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace tgui
using Ptr = std::shared_ptr<Button>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const Button>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "Button"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -50,7 +52,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Button(const char* typeName = "Button", bool initRenderer = true);
Button(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 2 additions & 6 deletions include/TGUI/Widgets/ChatBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ namespace tgui
using Ptr = std::shared_ptr<ChatBox>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const ChatBox>; //!< Shared constant widget pointer

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
protected:
static constexpr const char StaticWidgetType[] = "ChatBox"; //!< Type name of the widget

struct Line
{
Expand All @@ -56,17 +55,14 @@ namespace tgui
};


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
/// @brief Constructor
/// @param typeName Type of the widget
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ChatBox(const char* typeName = "ChatBox", bool initRenderer = true);
ChatBox(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/CheckBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace tgui
using Ptr = std::shared_ptr<CheckBox>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const CheckBox>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "CheckBox"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -52,7 +54,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CheckBox(const char* typeName = "CheckBox", bool initRenderer = true);
CheckBox(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/ChildWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ namespace tgui
using Ptr = std::shared_ptr<ChildWindow>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const ChildWindow>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "ChildWindow"; //!< Type name of the widget


/// Title alignments, possible options for the setTitleAlignment function
enum class TitleAlignment
Expand All @@ -73,7 +75,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ChildWindow(const char* typeName = "ChildWindow", bool initRenderer = true);
ChildWindow(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/ClickableWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ namespace tgui
using Ptr = std::shared_ptr<ClickableWidget>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const ClickableWidget>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "ClickableWidget"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -51,7 +53,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ClickableWidget(const char* typeName = "ClickableWidget", bool initRenderer = true);
ClickableWidget(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/ColorPicker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ namespace tgui
using Ptr = std::shared_ptr<ColorPicker>; ///< Shared widget pointer
using ConstPtr = std::shared_ptr<const ColorPicker>; ///< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "ColorPicker"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -53,7 +55,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ColorPicker(const char* typeName = "ColorPicker", bool initRenderer = true);
ColorPicker(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/ComboBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ namespace tgui
using Ptr = std::shared_ptr<ComboBox>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const ComboBox>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "ComboBox"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -62,7 +64,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ComboBox(const char* typeName = "ComboBox", bool initRenderer = true);
ComboBox(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/EditBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ namespace tgui
using Ptr = std::shared_ptr<EditBox>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const EditBox>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "EditBox"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief The text alignment
Expand Down Expand Up @@ -85,7 +87,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
EditBox(const char* typeName = "EditBox", bool initRenderer = true);
EditBox(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/FileDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ namespace tgui
using Ptr = std::shared_ptr<FileDialog>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const FileDialog>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "FileDialog"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -73,7 +75,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FileDialog(const char* typeName = "FileDialog", bool initRenderer = true);
FileDialog(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/Grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ namespace tgui
using Ptr = std::shared_ptr<Grid>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const Grid>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "Grid"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief The alignment of the widget in its cell
Expand Down Expand Up @@ -72,7 +74,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Grid(const char* typeName = "Grid", bool initRenderer = true);
Grid(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion include/TGUI/Widgets/Group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ namespace tgui
using Ptr = std::shared_ptr<Group>; //!< Shared widget pointer
using ConstPtr = std::shared_ptr<const Group>; //!< Shared constant widget pointer

static constexpr const char StaticWidgetType[] = "Group"; //!< Type name of the widget


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
Expand All @@ -55,7 +57,7 @@ namespace tgui
/// @param initRenderer Should the renderer be initialized? Should be true unless a derived class initializes it.
/// @see create
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Group(const char* typeName = "Group", bool initRenderer = true);
Group(const char* typeName = StaticWidgetType, bool initRenderer = true);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 1c0b9a0

Please sign in to comment.