SET(TC_SOURCES
utc-Dali-BidirectionalSupport.cpp
utc-Dali-ColorConversion.cpp
+ utc-Dali-Control-internal.cpp
utc-Dali-DebugRendering.cpp
utc-Dali-ItemView-internal.cpp
utc-Dali-LogicalModel.cpp
utc-Dali-Text-Typesetter.cpp
utc-Dali-Text-ViewModel.cpp
utc-Dali-TextureManager.cpp
+ utc-Dali-Visuals-internal.cpp
utc-Dali-VisualModel.cpp
utc-Dali-VisualUrl.cpp
)
../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
dali-toolkit-test-utils/toolkit-text-utils.cpp
+ dali-toolkit-test-utils/dummy-visual.cpp
)
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "dummy-visual.h"
+
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+typedef IntrusivePtr<VisualFactoryCache> VisualFactoryCachePtr;
+
+DummyVisualPtr DummyVisual::New( const Property::Map& properties )
+{
+ VisualFactoryCachePtr factoryCache = new VisualFactoryCache;
+
+ DummyVisualPtr dummyVisualPtr( new DummyVisual( *( factoryCache.Get() ) ) );
+
+ return dummyVisualPtr;
+}
+
+DummyVisual::DummyVisual( VisualFactoryCache& factoryCache )
+: Visual::Base( factoryCache ),
+ mActionCounter( 0 )
+{
+}
+
+void DummyVisual::DoCreatePropertyMap( Property::Map& map ) const
+{
+ // Implement if required
+}
+
+void DummyVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+ // Implement if required
+}
+
+void DummyVisual::DoSetProperties( const Property::Map& propertyMap )
+{
+ // Implement if required
+}
+
+void DummyVisual::OnSetTransform()
+{
+ // Implement if required
+}
+
+void DummyVisual::DoSetOnStage( Actor& actor )
+{
+ // Implement if required
+}
+
+void DummyVisual::OnDoAction( const Property::Index actionName, const Property::Value attributes )
+{
+ if ( DummyVisual::TEST_ACTION == actionName )
+ {
+ mActionCounter++; // GetActionCounter can be used to test for this.
+ }
+ // Further Actions can be added here
+}
+
+unsigned int DummyVisual::GetActionCounter() const
+{
+ return mActionCounter;
+}
+
+void DummyVisual::ResetActionCounter()
+{
+ mActionCounter = 0;
+}
+
+} // Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_TOOLKIT_TEST_DUMMY_VISUAL_H__
+#define __DALI_TOOLKIT_TEST_DUMMY_VISUAL_H__
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
+
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/intrusive-ptr.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+class DummyVisual;
+
+typedef IntrusivePtr< DummyVisual > DummyVisualPtr;
+
+/**
+ * Dummy Visual that can be used for testing
+ * Cannot create an instance of an existing Visual, so use this dummy class for the implementation.
+ */
+class DummyVisual : public Visual::Base
+{
+public:
+
+ // Actions that the dummy visual can perform. These actions are called through the Visual::Base::DoAction API.
+ enum Type
+ {
+ TEST_ACTION = 0, ///< Updates the action counter
+ };
+
+public:
+
+ // Constructor for DummyVisual
+ static DummyVisualPtr New( const Property::Map& properties );
+
+ // Prevent default methods being used.
+ DummyVisual( const DummyVisual& dummyVisual ) = delete;
+ DummyVisual( const DummyVisual&& dummyVisual ) = delete;
+ DummyVisual& operator=( const DummyVisual& dummyVisual ) = delete;
+ DummyVisual& operator=( const DummyVisual&& dummyVisual ) = delete;
+
+ // Get the Action counter, action counter incremented with every successful Action
+ unsigned int GetActionCounter() const;
+ // Reset the Action counter to 0;
+ void ResetActionCounter();
+
+protected:
+
+ DummyVisual( VisualFactoryCache& factoryCache );
+
+ virtual void DoCreatePropertyMap( Property::Map& map ) const override;
+ virtual void DoCreateInstancePropertyMap( Property::Map& map ) const override;
+ virtual void DoSetProperties( const Property::Map& propertyMap ) override;
+ virtual void OnSetTransform() override;
+ virtual void DoSetOnStage( Actor& actor ) override;
+ virtual void OnDoAction( const Property::Index actionName, const Property::Value attributes );
+
+private:
+ unsigned int mActionCounter;
+
+};
+
+
+} // Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEST_DUMMY_VISUAL_H__
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+
+#include <stdlib.h>
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <toolkit-text-utils.h>
+#include <dummy-visual.h>
+#include <../dali-toolkit/dali-toolkit-test-utils/dummy-control.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+
+int UtcDaliControlActionOnVisual(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline( "Register an ImageVisual and perform image reload Action on it. Tests Actions are completed." );
+ Vector2 controlSize( 20.f, 30.f );
+
+ //Created DummyVisual
+ Property::Map settings;
+ Toolkit::Internal::DummyVisualPtr dummyVisualPtr = Toolkit::Internal::DummyVisual::New( settings );
+
+ DummyControl dummyControl = DummyControl::New( true );
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+ tet_infoline( "Register test visual and stage control" );
+
+ Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( dummyVisualPtr.Get() );
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
+ dummyControl.SetSize(200.f, 200.f);
+ Stage::GetCurrent().Add( dummyControl );
+
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "Check action counter is 0 before DoAction" );
+ DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 0, TEST_LOCATION );
+
+ tet_infoline( "Perform TEST_ACTION action on registered test visual. Should increase the action counter" );
+
+ Property::Map attributes;
+ DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::Internal::DummyVisual::TEST_ACTION, attributes );
+
+ application.SendNotification();
+ DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 1, TEST_LOCATION );
+
+ END_TEST;
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+
+#include <stdlib.h>
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <toolkit-text-utils.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dummy-visual.h>
+#include <../dali-toolkit/dali-toolkit-test-utils/dummy-control.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+int UtcDaliVisualAction(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "Register an ImageVisual and and perform an Action on Visual directly" );
+ Vector2 controlSize( 20.f, 30.f );
+
+ //Created DummyVisual
+ Property::Map settings;
+ Toolkit::Internal::DummyVisualPtr dummyVisualPtr = Toolkit::Internal::DummyVisual::New( settings );
+
+ DummyControl dummyControl = DummyControl::New( true );
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+ tet_infoline( "Register visual and stage control" );
+
+ Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( dummyVisualPtr.Get() );
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
+ dummyControl.SetSize(200.f, 200.f);
+ Stage::GetCurrent().Add( dummyControl );
+
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "Check action counter is 0 before DoAction" );
+ DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 0, TEST_LOCATION );
+
+ tet_infoline( "Perform TEST_ACTION action on Visual. Should increase the action counter" );
+
+ Property::Map attributes;
+ Toolkit::Internal::Visual::Base& internalVisualBase = GetImplementation( visualBaseHandle );
+ internalVisualBase.DoAction( Dali::Toolkit::Internal::DummyVisual::TEST_ACTION, attributes );
+ application.SendNotification();
+ DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 1, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliVisualActionNotImplemented(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "Register an ImageVisual and and perform an Action on a Visual which does not support any Actions" );
+ Vector2 controlSize( 20.f, 30.f );
+
+ //Created DummyVisual
+ Property::Map settings;
+ Toolkit::Internal::DummyVisualPtr dummyVisualPtr = Toolkit::Internal::DummyVisual::New( settings );
+
+ DummyControl dummyControl = DummyControl::New( true );
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+ tet_infoline( "Register visual and stage control" );
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+ Visual::Base visual = factory.CreateVisual( propertyMap );
+
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyControl.SetSize(200.f, 200.f);
+ Stage::GetCurrent().Add( dummyControl );
+
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "Check action counter is 0 before DoAction" );
+ DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 0, TEST_LOCATION );
+
+ tet_infoline( "Perform TEST_ACTION action on Color Visual which does not support it.. Should not increment the action counter" );
+ Property::Map attributes;
+ GetImplementation( visual ).DoAction( Dali::Toolkit::Internal::DummyVisual::TEST_ACTION, attributes );
+ application.SendNotification();
+ DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 0, TEST_LOCATION );
+
+ END_TEST;
+}
return DevelControl::CreateTransition( *this, transition );
}
+void DummyControlImpl::DoAction( Dali::Property::Index index, Dali::Property::Index action, const Dali::Property::Value attributes )
+{
+ DummyControl control( *this );
+ DevelControl::DoAction( control, index, action, attributes);
+}
+
void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value )
{
Toolkit::DummyControl control = Toolkit::DummyControl::DownCast( Dali::BaseHandle( object ) );
int GetVisualCount();
Toolkit::Visual::Base GetVisual( Property::Index index );
Animation CreateTransition( const Toolkit::TransitionData& transition );
+ void DoAction( Dali::Property::Index index, Dali::Property::Index action, const Dali::Property::Value attributes );
static void SetProperty( BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value );
#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/actor-devel.h>
using namespace Dali;
using namespace Toolkit;
END_TEST;
}
+
+int UtcDaliToolkitFlexContainerRTLSupportP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitFlexContainerRTLSupportP");
+ FlexContainer flexContainer = FlexContainer::New();
+ DALI_TEST_CHECK( flexContainer );
+
+ Actor actor0 = Actor::New();
+
+ Stage::GetCurrent().Add( actor0 );
+ actor0.Add( flexContainer );
+
+ // Create two actors and add them to the container
+ Actor actor1 = Actor::New();
+ Actor actor2 = Actor::New();
+ DALI_TEST_CHECK( actor1 );
+ DALI_TEST_CHECK( actor2 );
+
+ flexContainer.Add(actor1);
+ flexContainer.Add(actor2);
+
+ // Check flex direction property.
+ flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, "row" );
+ DALI_TEST_EQUALS( (FlexContainer::FlexDirection)flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ), FlexContainer::ROW, TEST_LOCATION );
+
+ // Check content direction property.
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::INHERIT, TEST_LOCATION );
+
+ actor0.SetProperty( Dali::DevelActor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+
+ actor0.SetProperty( Dali::DevelActor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+
+ flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "RTL" );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+
+ flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "LTR" );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+
+ actor0.SetProperty( Dali::DevelActor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+
+ flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "inherit" );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+
+ actor0.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+
+ flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "inherit" );
+ DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+
+ flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "LTR" );
+ application.SendNotification();
+ application.Render();
+
+ flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "RTL" );
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
return controlDataImpl.CreateTransition( handle );
}
+void DoAction( Control& control, Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes )
+{
+ Internal::Control& controlInternal = Toolkit::Internal::GetImplementation( control );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlInternal );
+ controlDataImpl.DoAction( visualIndex, actionId, attributes );
+}
} // namespace DevelControl
*/
DALI_IMPORT_API Dali::Animation CreateTransition( Internal::Control& control, const Toolkit::TransitionData& transitionData );
+/**
+ * @brief Perform an action on a visual registered to this control.
+ *
+ * Visuals will have actions, this API is used to perform one of these actions with the given attributes.
+ *
+ * @param[in] control The control.
+ * @param[in] visualIndex The Property index of the visual.
+ * @param[in] actionId The action to perform. See Visual to find supported actions.
+ * @param[in] attributes Optional attributes for the action.
+ */
+DALI_IMPORT_API void DoAction( Control& control, Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes );
+
} // namespace DevelControl
} // namespace Toolkit
return transition;
}
+void Control::Impl::DoAction( Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes )
+{
+ RegisteredVisualContainer::Iterator iter;
+ if ( FindVisual( visualIndex, mVisuals, iter ) )
+ {
+ Toolkit::GetImplementation((*iter)->visual).DoAction( actionId, attributes );
+ }
+}
+
void Control::Impl::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
{
Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
Dali::Animation CreateTransition( const Toolkit::TransitionData& transitionData );
/**
+ * @copydoc Dali::Toolkit::DevelControl::DoAction()
+ */
+ void DoAction( Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes );
+
+ /**
* @brief Function used to set control properties.
* @param[in] object The object whose property to set
* @param[in] index The index of the property to set
// style properties are changed. So should always return true here.
return true;
}
-
} // Unnamed namespace
Toolkit::FlexContainer FlexContainer::New()
mChildrenNodes.clear();
}
-void FlexContainer::SetContentDirection( Toolkit::FlexContainer::ContentDirection contentDirection )
+void FlexContainer::SetContentDirection( Toolkit::FlexContainer::ContentDirection contentDirection)
{
if( mContentDirection != contentDirection )
{
- mContentDirection = contentDirection;
- mRootNode.node->style.direction = static_cast<css_direction_t>( mContentDirection );
+ Dali::CustomActor ownerActor(GetOwner());
+
+ if( Toolkit::FlexContainer::INHERIT != contentDirection )
+ {
+ mContentDirection = contentDirection;
+
+ ownerActor.SetProperty( Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION, false );
+
+ if( Toolkit::FlexContainer::LTR == contentDirection )
+ {
+ ownerActor.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
+ }
+ else
+ {
+ ownerActor.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
+ }
+ }
+ else
+ {
+ ownerActor.SetProperty( Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION, true );
+
+ Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( ownerActor.GetParent().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+
+ if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
+ {
+ mContentDirection = Toolkit::FlexContainer::RTL;
+ }
+ else
+ {
+ mContentDirection = Toolkit::FlexContainer::LTR;
+ }
+ }
RelayoutRequest();
}
Control::OnSizeSet( size );
}
+void FlexContainer::OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type )
+{
+ Toolkit::FlexContainer flexContainer = Toolkit::FlexContainer::DownCast(actor);
+ Toolkit::FlexContainer::ContentDirection direction;
+
+ if( type == Dali::LayoutDirection::RIGHT_TO_LEFT )
+ {
+ direction = Toolkit::FlexContainer::RTL;
+ }
+ else
+ {
+ direction = Toolkit::FlexContainer::LTR;
+ }
+
+ Toolkit::Internal::FlexContainer &flexContainerImpl = GetImpl( flexContainer );
+
+ if( flexContainerImpl.mContentDirection != direction )
+ {
+ Dali::CustomActor ownerActor(flexContainerImpl.GetOwner());
+ flexContainerImpl.mContentDirection = direction;
+
+ flexContainerImpl.RelayoutRequest();
+ }
+}
+
void FlexContainer::ComputeLayout()
{
if( mRootNode.node )
}
// Calculate the layout
- layoutNode( mRootNode.node, Self().GetMaximumSize().x, Self().GetMaximumSize().y, mRootNode.node->style.direction );
+ css_direction_t nodeLayoutDirection = CSS_DIRECTION_INHERIT;
+ switch( mContentDirection )
+ {
+ case Dali::Toolkit::FlexContainer::LTR:
+ {
+ nodeLayoutDirection = CSS_DIRECTION_LTR;
+ break;
+ }
+
+ case Dali::Toolkit::FlexContainer::RTL:
+ {
+ nodeLayoutDirection = CSS_DIRECTION_RTL;
+ break;
+ }
+
+ case Dali::Toolkit::FlexContainer::INHERIT:
+ {
+ nodeLayoutDirection = CSS_DIRECTION_INHERIT;
+ break;
+ }
+ }
+
+ layoutNode( mRootNode.node, Self().GetMaximumSize().x, Self().GetMaximumSize().y, nodeLayoutDirection);
}
}
{
// Initialize the node for the flex container itself
Dali::Actor self = Self();
+ self.LayoutDirectionChangedSignal().Connect( this, &FlexContainer::OnLayoutDirectionChanged );
+
mRootNode.actor = self;
mRootNode.node = new_css_node();
mRootNode.node->context = &mChildrenNodes;
*/
virtual void OnSizeSet( const Vector3& size );
+ /**
+ * @copydoc OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type )
+ * @param[in] actor The actor whose layoutDirection is changed.
+ * @param[in] type The layoutDirection.
+ */
+ void OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type );
+
private: // Implementation
/**
int mCurrentVideoPlayPosition;
bool mIsPlay;
- bool mIsPause;
bool mIsUnderlay;
};
// Don't render outline for other styles
outlineWidth = 0.0f;
}
+ if( style != Typesetter::STYLE_UNDERLINE )
+ {
+ fontClient.CreateBitmap( glyphInfo->fontId,
+ glyphInfo->index,
+ glyphData.glyphBitmap,
+ outlineWidth );
+ }
- fontClient.CreateBitmap( glyphInfo->fontId,
- glyphInfo->index,
- glyphData.glyphBitmap,
- outlineWidth );
// Sets the glyph's bitmap into the bitmap of the whole text.
if( NULL != glyphData.glyphBitmap.buffer )
naturalSize = Vector2::ZERO;
}
+void Visual::Base::DoAction( const Property::Index actionId, const Property::Value attributes )
+{
+ OnDoAction( actionId, attributes );
+}
+
void Visual::Base::SetDepthIndex( int index )
{
mImpl->mDepthIndex = index;
return mImpl->mFlags & Impl::IS_ON_STAGE;
}
+void Visual::Base::OnDoAction( const Property::Index actionId, const Property::Value attributes )
+{
+ // May be overriden by derived class
+}
+
void Visual::Base::RegisterMixColor()
{
// Only register if not already registered.
void SetTransformAndSize( const Property::Map& transform, Size controlSize );
/**
+ * @brief Performs an action on the visual with the given action name and attributes.
+ *
+ * @param[in] actionName The name of the action to perform this API only takes an Index
+ * @param[in] attributes The list of attributes for the action. ( optional for this data structure to have content )
+ */
+ void DoAction( const Dali::Property::Index actionName, const Dali::Property::Value attributes );
+
+ /**
* @copydoc Toolkit::Visual::Base::GetHeightForWidth
*/
virtual float GetHeightForWidth( float width );
*
* @param[in] actor The actor applying this visual.
*/
- virtual void DoSetOnStage( Actor& actor )=0;
+ virtual void DoSetOnStage( Actor& actor ) = 0;
/**
* @brief Called by SetOffStage() allowing sub classes to respond to the SetOffStage event
*/
virtual void DoSetOffStage( Actor& actor );
+ /**
+ * @brief Called by DoAction() allowing sub classes to do the given action.
+ *
+ * @param[in] actionId The action to perform
+ * @param[in] attributes The list of attributes for the action. ( optional for this data structure to have content )
+ */
+ virtual void OnDoAction( const Property::Index actionId, const Property::Value attributes );
+
protected:
/**
* OR Connect to signal before setting resource
*
* @code
- * auto myImageView = ImageView::New( resourceUrl );
+ * auto myImageView = ImageView::New();
* myImageView.ResourceReadySignal.Connect( .... )
* myImageView.SetProperty( ImageView::Property::IMAGE, resourceUrl );
* @endcode
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 0;
+const unsigned int TOOLKIT_MICRO_VERSION = 1;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.3.0
+Version: 1.3.1
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT