diff --git a/include/eepp/scene/nodeattribute.hpp b/include/eepp/scene/nodeattribute.hpp index 4517ab4a2..b9c378cfd 100644 --- a/include/eepp/scene/nodeattribute.hpp +++ b/include/eepp/scene/nodeattribute.hpp @@ -35,6 +35,24 @@ class NodeAttribute { TypeRectf }; + class Info + { + public: + Info( AttributeType type, const std::string& name ); + + Info( AttributeType type, const std::vector& names ); + + bool isName( const std::string& name ); + + const AttributeType& getType() const; + + const std::vector& getNames() const; + protected: + AttributeType type; + + std::vector names; + }; + NodeAttribute( std::string name, std::string value ); std::string getName() const; diff --git a/include/eepp/ui/uistyle.hpp b/include/eepp/ui/uistyle.hpp new file mode 100644 index 000000000..736d9b508 --- /dev/null +++ b/include/eepp/ui/uistyle.hpp @@ -0,0 +1,27 @@ +#ifndef EE_UI_UISTYLE_HPP +#define EE_UI_UISTYLE_HPP + +#include +#include + +using namespace EE::Scene; + +namespace EE { namespace UI { + +class EE_API UIStyle : public UIState { + public: + static UIStyle * New(); + + explicit UIStyle(); + + virtual ~UIStyle(); + + bool stateExists( const Uint32& State ); + protected: + std::map > states;; +}; + +}} + + +#endif diff --git a/include/eepp/ui/uiwidgetcreator.hpp b/include/eepp/ui/uiwidgetcreator.hpp index ac8697ff1..dd55f69e2 100644 --- a/include/eepp/ui/uiwidgetcreator.hpp +++ b/include/eepp/ui/uiwidgetcreator.hpp @@ -11,6 +11,9 @@ class EE_API UIWidgetCreator { typedef std::function CustomWidgetCb; typedef std::function RegisterWidgetCb; + typedef std::map WidgetCallbackMap; + typedef std::map RegisteredWidgetCallbackMap; + static UIWidget * createFromName( std::string widgetName ); static void addCustomWidgetCallback( std::string widgetName, const CustomWidgetCb& cb ); @@ -24,9 +27,9 @@ class EE_API UIWidgetCreator { static void unregisterWidget( std::string widgetName ); static bool isWidgetRegistered( std::string widgetName ); + + static const RegisteredWidgetCallbackMap& getRegisteredWidgets(); protected: - typedef std::map WidgetCallbackMap; - typedef std::map RegisteredWidgetCallbackMap; static RegisteredWidgetCallbackMap registeredWidget; diff --git a/projects/linux/ee.files b/projects/linux/ee.files index 5268402a4..707abacc1 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -333,6 +333,7 @@ ../../include/eepp/ui/uispinbox.hpp ../../include/eepp/ui/uisprite.hpp ../../include/eepp/ui/uistate.hpp +../../include/eepp/ui/uistyle.hpp ../../include/eepp/ui/uitab.hpp ../../include/eepp/ui/uitablecell.hpp ../../include/eepp/ui/uitable.hpp @@ -732,6 +733,7 @@ ../../src/eepp/ui/uispinbox.cpp ../../src/eepp/ui/uisprite.cpp ../../src/eepp/ui/uistate.cpp +../../src/eepp/ui/uistyle.cpp ../../src/eepp/ui/uitab.cpp ../../src/eepp/ui/uitablecell.cpp ../../src/eepp/ui/uitable.cpp diff --git a/src/eepp/graphics/framebufferfbo.cpp b/src/eepp/graphics/framebufferfbo.cpp index a9762c8f3..480f1e6a9 100644 --- a/src/eepp/graphics/framebufferfbo.cpp +++ b/src/eepp/graphics/framebufferfbo.cpp @@ -95,7 +95,7 @@ bool FrameBufferFBO::create( const Uint32& Width, const Uint32& Height, bool Ste mFrameBuffer = static_cast( frameBuffer ); if ( !mFrameBuffer ) { - eePRINT("FrameBufferFBO::create: Failed to created FrameBuffer Object"); + eePRINTL("FrameBufferFBO::create: Failed to created FrameBuffer Object"); return false; } @@ -109,7 +109,7 @@ bool FrameBufferFBO::create( const Uint32& Width, const Uint32& Height, bool Ste mDepthBuffer = static_cast(depth); if ( !mDepthBuffer ) { - eePRINT("FrameBufferFBO::create: Failed to created Depth Buffer"); + eePRINTL("FrameBufferFBO::create: Failed to created Depth Buffer"); return false; } @@ -129,7 +129,7 @@ bool FrameBufferFBO::create( const Uint32& Width, const Uint32& Height, bool Ste mStencilBuffer = static_cast(stencil); if (!mStencilBuffer) { - eePRINT("FrameBufferFBO::create: Failed to created Stencil Buffer"); + eePRINTL("FrameBufferFBO::create: Failed to created Stencil Buffer"); return false; } diff --git a/src/eepp/network/socketselector.cpp b/src/eepp/network/socketselector.cpp index 010875cca..028c0bac9 100644 --- a/src/eepp/network/socketselector.cpp +++ b/src/eepp/network/socketselector.cpp @@ -44,7 +44,7 @@ void SocketSelector::add(Socket& socket) { if (mImpl->SocketCount >= FD_SETSIZE) { eePRINT( "The socket can't be added to the selector because its " ); eePRINT( "ID is too high. This is a limitation of your operating " ); - eePRINT( "system's FD_SETSIZE setting." ); + eePRINTL( "system's FD_SETSIZE setting." ); return; } @@ -56,7 +56,7 @@ void SocketSelector::add(Socket& socket) { if (handle >= FD_SETSIZE) { eePRINT( "The socket can't be added to the selector because its " ); eePRINT( "ID is too high. This is a limitation of your operating " ); - eePRINT( "system's FD_SETSIZE setting." ); + eePRINTL( "system's FD_SETSIZE setting." ); return; } diff --git a/src/eepp/scene/nodeattribute.cpp b/src/eepp/scene/nodeattribute.cpp index feab76ae8..dea0dcae1 100644 --- a/src/eepp/scene/nodeattribute.cpp +++ b/src/eepp/scene/nodeattribute.cpp @@ -1,10 +1,33 @@ #include #include +#include using namespace EE::Graphics; namespace EE { namespace Scene { +NodeAttribute::Info::Info( NodeAttribute::AttributeType type, const std::string& name ) : + type( type ), + names( { name } ) +{} + +NodeAttribute::Info::Info( AttributeType type, const std::vector& names ) : + type( type ), + names( names ) +{} + +bool NodeAttribute::Info::isName( const std::string& name ) { + return std::find(names.begin(), names.end(), name) != names.end(); +} + +const NodeAttribute::AttributeType& NodeAttribute::Info::getType() const { + return type; +} + +const std::vector& NodeAttribute::Info::getNames() const { + return names; +} + NodeAttribute::NodeAttribute( std::string name, std::string value ) : mName( String::toLower( name ) ), mValue( value ) diff --git a/src/eepp/ui/uistyle.cpp b/src/eepp/ui/uistyle.cpp new file mode 100644 index 000000000..b46b97a1c --- /dev/null +++ b/src/eepp/ui/uistyle.cpp @@ -0,0 +1,21 @@ +#include + +namespace EE { namespace UI { + +UIStyle * EE::UI::UIStyle::New() { + return eeNew( UIStyle, () ); +} + +UIStyle::UIStyle() +{ +} + +UIStyle::~UIStyle() +{ +} + +bool UIStyle::stateExists( const EE::Uint32 & State ) { + return false; +} + +}} diff --git a/src/eepp/ui/uiwidgetcreator.cpp b/src/eepp/ui/uiwidgetcreator.cpp index e66abcf48..dd37c70bf 100644 --- a/src/eepp/ui/uiwidgetcreator.cpp +++ b/src/eepp/ui/uiwidgetcreator.cpp @@ -117,4 +117,8 @@ bool UIWidgetCreator::isWidgetRegistered( std::string widgetName ) { return registeredWidget.find( String::toLower( widgetName ) ) != registeredWidget.end(); } +const UIWidgetCreator::RegisteredWidgetCallbackMap& UIWidgetCreator::getRegisteredWidgets() { + return registeredWidget; +} + }}