-#include <dali-toolkit/internal/builder/builder-get-is.inl.h>
-
-namespace // unnamed namespace
-{
-
-using namespace Dali;
-using namespace Dali::Scripting;
-
-ColorMode GetColorMode( const std::string& value )
-{
- ColorMode v( USE_OWN_COLOR );
-
- bool set = \
- SetIfEqual(value, "USE_OWN_COLOR" , v, USE_OWN_COLOR ) || \
- SetIfEqual(value, "USE_PARENT_COLOR" , v, USE_PARENT_COLOR ) || \
- SetIfEqual(value, "USE_OWN_MULTIPLY_PARENT_COLOR", v, USE_OWN_MULTIPLY_PARENT_COLOR);
-
- if( !set )
- {
- DALI_ASSERT_ALWAYS( !"Unknown Color mode" );
- }
-
- return v;
-}
-
-PositionInheritanceMode GetPositionInheritanceMode( const std::string& value )
-{
- PositionInheritanceMode v(INHERIT_PARENT_POSITION);
-
- bool set = \
- SetIfEqual(value, "INHERIT_PARENT_POSITION", v, INHERIT_PARENT_POSITION ) || \
- SetIfEqual(value, "USE_PARENT_POSITION" , v, USE_PARENT_POSITION ) || \
- SetIfEqual(value, "USE_PARENT_POSITION_PLUS_LOCAL_POSITION", v, USE_PARENT_POSITION_PLUS_LOCAL_POSITION ) || \
- SetIfEqual(value, "DONT_INHERIT_POSITION" , v, DONT_INHERIT_POSITION);
-
- if( !set )
- {
- DALI_ASSERT_ALWAYS( !"Unknown position inheritance mode" );
- }
-
- return v;
-}
-
-DrawMode::Type GetDrawMode( const std::string& value )
-{
- DrawMode::Type e(DrawMode::NORMAL);
-
- bool set = \
- SetIfEqual(value, "NORMAL", e, DrawMode::NORMAL ) || \
- SetIfEqual(value, "OVERLAY",e, DrawMode::OVERLAY ) || \
- SetIfEqual(value, "STENCIL",e, DrawMode::STENCIL);
-
- if(!set)
- {
- DALI_ASSERT_ALWAYS( !"Unknown DrawMode type" );
- }
-
- return e;
-}
-
-
-Vector3 GetAnchorConstant( const std::string& value )
-{
- Vector3 v = ParentOrigin::CENTER; // a Vector3x
-
- bool set =
- SetIfEqual( value, "BACK_TOP_LEFT", v, ParentOrigin::BACK_TOP_LEFT ) ||
- SetIfEqual( value, "BACK_TOP_CENTER", v, ParentOrigin::BACK_TOP_CENTER ) ||
- SetIfEqual( value, "BACK_TOP_RIGHT", v, ParentOrigin::BACK_TOP_RIGHT ) ||
- SetIfEqual( value, "BACK_CENTER_LEFT", v, ParentOrigin::BACK_CENTER_LEFT ) ||
- SetIfEqual( value, "BACK_CENTER", v, ParentOrigin::BACK_CENTER ) ||
- SetIfEqual( value, "BACK_CENTER_RIGHT", v, ParentOrigin::BACK_CENTER_RIGHT ) ||
- SetIfEqual( value, "BACK_BOTTOM_LEFT", v, ParentOrigin::BACK_BOTTOM_LEFT ) ||
- SetIfEqual( value, "BACK_BOTTOM_CENTER", v, ParentOrigin::BACK_BOTTOM_CENTER ) ||
- SetIfEqual( value, "BACK_BOTTOM_RIGHT", v, ParentOrigin::BACK_BOTTOM_RIGHT ) ||
- SetIfEqual( value, "TOP_LEFT", v, ParentOrigin::TOP_LEFT ) ||
- SetIfEqual( value, "TOP_CENTER", v, ParentOrigin::TOP_CENTER ) ||
- SetIfEqual( value, "TOP_RIGHT", v, ParentOrigin::TOP_RIGHT ) ||
- SetIfEqual( value, "CENTER_LEFT", v, ParentOrigin::CENTER_LEFT ) ||
- SetIfEqual( value, "CENTER", v, ParentOrigin::CENTER ) ||
- SetIfEqual( value, "CENTER_RIGHT", v, ParentOrigin::CENTER_RIGHT ) ||
- SetIfEqual( value, "BOTTOM_LEFT", v, ParentOrigin::BOTTOM_LEFT ) ||
- SetIfEqual( value, "BOTTOM_CENTER", v, ParentOrigin::BOTTOM_CENTER ) ||
- SetIfEqual( value, "BOTTOM_RIGHT", v, ParentOrigin::BOTTOM_RIGHT ) ||
- SetIfEqual( value, "FRONT_TOP_LEFT", v, ParentOrigin::FRONT_TOP_LEFT ) ||
- SetIfEqual( value, "FRONT_TOP_CENTER", v, ParentOrigin::FRONT_TOP_CENTER ) ||
- SetIfEqual( value, "FRONT_TOP_RIGHT", v, ParentOrigin::FRONT_TOP_RIGHT ) ||
- SetIfEqual( value, "FRONT_CENTER_LEFT", v, ParentOrigin::FRONT_CENTER_LEFT ) ||
- SetIfEqual( value, "FRONT_CENTER", v, ParentOrigin::FRONT_CENTER ) ||
- SetIfEqual( value, "FRONT_CENTER_RIGHT", v, ParentOrigin::FRONT_CENTER_RIGHT ) ||
- SetIfEqual( value, "FRONT_BOTTOM_LEFT", v, ParentOrigin::FRONT_BOTTOM_LEFT ) ||
- SetIfEqual( value, "FRONT_BOTTOM_CENTER", v, ParentOrigin::FRONT_BOTTOM_CENTER) ||
- SetIfEqual( value, "FRONT_BOTTOM_RIGHT", v, ParentOrigin::FRONT_BOTTOM_RIGHT );
-
- if(!set)
- {
- DALI_ASSERT_ALWAYS(!"Unknown Parent origin Constant" );
- }
-
- return v;
-}
-
-
-}; // unnamed namespace
-