#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/scripting/scripting.h>
+#include <dali/devel-api/rendering/material.h>
+#include <dali/devel-api/rendering/renderer.h>
using namespace Dali;
using namespace Toolkit;
END_TEST;
}
+int UtcDaliImageViewSetGetProperty02(void)
+{
+ ToolkitTestApplication application;
+
+ Image image = CreateBufferImage( 10, 10, Color::WHITE );
+ ImageView imageView = ImageView::New(image);
+ Vector4 fullImageRect( 0.f, 0.f, 1.f, 1.f );
+
+ Stage::GetCurrent().Add( imageView );
+
+ application.SendNotification();
+ application.Render();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+
+ Vector4 pixelAreaUniform;
+ DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "pixelArea", pixelAreaUniform ) );
+ DALI_TEST_EQUALS( pixelAreaUniform, fullImageRect, TEST_LOCATION );
+
+ Property::Value value = imageView.GetProperty( ImageView::Property::PIXEL_AREA );
+ Vector4 pixelAreaValue;
+ DALI_TEST_CHECK( value.Get(pixelAreaValue) );
+ DALI_TEST_EQUALS( pixelAreaValue, fullImageRect, TEST_LOCATION );
+
+ Vector4 pixelAreaSet( 0.2f, 0.2f, 0.3f, 0.3f );
+ imageView.SetProperty( ImageView::Property::PIXEL_AREA, pixelAreaSet);
+
+ application.SendNotification();
+ application.Render();
+
+ value = imageView.GetProperty( ImageView::Property::PIXEL_AREA );
+ value.Get(pixelAreaValue);
+ DALI_TEST_EQUALS( pixelAreaValue, pixelAreaSet, TEST_LOCATION );
+
+ DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "pixelArea", pixelAreaUniform ) );
+ DALI_TEST_EQUALS( pixelAreaUniform, pixelAreaSet, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliImageViewSetGetProperty03(void)
+{
+ ToolkitTestApplication application;
+
+ Image image = CreateBufferImage( 10, 10, Color::WHITE );
+ ImageView imageView = ImageView::New(image);
+ Stage::GetCurrent().Add( imageView );
+ application.SendNotification();
+ application.Render();
+
+ // conventional alpha blending
+ Material material = imageView.GetRendererAt( 0 ).GetMaterial();
+ BlendingFactor::Type srcFactorRgb;
+ BlendingFactor::Type destFactorRgb;
+ BlendingFactor::Type srcFactorAlpha;
+ BlendingFactor::Type destFactorAlpha;
+ material.GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
+ DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::SRC_ALPHA );
+ DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA );
+ DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE );
+ DALI_TEST_CHECK( destFactorAlpha == BlendingFactor::ONE_MINUS_SRC_ALPHA );
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+
+ float alphaBlendingUniform;
+ DALI_TEST_CHECK( gl.GetUniformValue<float>( "uAlphaBlending", alphaBlendingUniform ) );
+ DALI_TEST_EQUALS( alphaBlendingUniform, 1.f, TEST_LOCATION );
+
+ // pre-multiplied alpha blending
+ imageView.SetProperty( Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA, true );
+ application.SendNotification();
+ application.Render();
+
+ material.GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
+ DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::ONE );
+ DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA );
+ DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE );
+ DALI_TEST_CHECK( destFactorAlpha == BlendingFactor::ONE );
+
+ DALI_TEST_CHECK( gl.GetUniformValue<float>( "uAlphaBlending", alphaBlendingUniform ) );
+ DALI_TEST_EQUALS( alphaBlendingUniform, 0.f, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliImageViewSizeWithBackground(void)
{
ToolkitTestApplication application;
END_TEST;
}
+
+int UtcDaliItemViewSetGetProperty(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+ DALI_TEST_CHECK(view);
+
+ // Event side properties
+
+ // Test "minimumSwipeSpeed" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("minimumSwipeSpeed") == ItemView::Property::MINIMUM_SWIPE_SPEED );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_SPEED).Get<float>(), view.GetMinimumSwipeSpeed(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::MINIMUM_SWIPE_SPEED, 2.5f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_SPEED).Get<float>(), 2.5f, TEST_LOCATION );
+
+ // Test "minimumSwipeDistance" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("minimumSwipeDistance") == ItemView::Property::MINIMUM_SWIPE_DISTANCE );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_DISTANCE).Get<float>(), view.GetMinimumSwipeDistance(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::MINIMUM_SWIPE_DISTANCE, 8.725f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_DISTANCE).Get<float>(), 8.725f, TEST_LOCATION );
+
+ // Test "wheelScrollDistanceStep" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("wheelScrollDistanceStep") == ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP).Get<float>(), view.GetWheelScrollDistanceStep(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP, 5.0f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP).Get<float>(), 5.0f, TEST_LOCATION );
+
+ // Test "snapToItemEnabled" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("snapToItemEnabled") == ItemView::Property::SNAP_TO_ITEM_ENABLED );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SNAP_TO_ITEM_ENABLED).Get<bool>(), view.GetAnchoring(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::SNAP_TO_ITEM_ENABLED, true );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SNAP_TO_ITEM_ENABLED).Get<bool>(), true, TEST_LOCATION );
+
+ // Test "refreshInterval" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("refreshInterval") == ItemView::Property::REFRESH_INTERVAL );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::REFRESH_INTERVAL).Get<float>(), view.GetRefreshInterval(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::REFRESH_INTERVAL, 11.0f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::REFRESH_INTERVAL).Get<float>(), 11.0f, TEST_LOCATION );
+
+ // Test "overshootEnabled" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("overshootEnabled") == Scrollable::Property::OVERSHOOT_ENABLED );
+ DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), view.IsOvershootEnabled(), TEST_LOCATION );
+ view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, false );
+ DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), false, TEST_LOCATION );
+
+ // Animatable properties
+
+ // Test "layoutPosition" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("layoutPosition") == ItemView::Property::LAYOUT_POSITION );
+ view.SetProperty( ItemView::Property::LAYOUT_POSITION, 20.5f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::LAYOUT_POSITION).Get<float>(), 20.5f, TEST_LOCATION );
+
+ // Test "scrollSpeed" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("scrollSpeed") == ItemView::Property::SCROLL_SPEED );
+ view.SetProperty( ItemView::Property::SCROLL_SPEED, 3.35f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SCROLL_SPEED).Get<float>(), 3.35f, TEST_LOCATION );
+
+ // Test "overshoot" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("overshoot") == ItemView::Property::OVERSHOOT );
+ view.SetProperty( ItemView::Property::OVERSHOOT, 0.15f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::OVERSHOOT).Get<float>(), 0.15f, TEST_LOCATION );
+
+ // Test "scrollDirection" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("scrollDirection") == ItemView::Property::SCROLL_DIRECTION );
+ view.SetProperty( ItemView::Property::SCROLL_DIRECTION, Vector2(0.85f, 0.5f) );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SCROLL_DIRECTION).Get<Vector2>(), Vector2(0.85f, 0.5f), TEST_LOCATION );
+
+ // Test "layoutOrientation" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("layoutOrientation") == ItemView::Property::LAYOUT_ORIENTATION );
+ view.SetProperty( ItemView::Property::LAYOUT_ORIENTATION, 2 );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::LAYOUT_ORIENTATION).Get<int>(), 2, TEST_LOCATION );
+
+ // Test "scrollContentSize" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("scrollContentSize") == ItemView::Property::SCROLL_CONTENT_SIZE );
+ view.SetProperty( ItemView::Property::SCROLL_CONTENT_SIZE, 250.0f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SCROLL_CONTENT_SIZE).Get<float>(), 250.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
END_TEST;
}
+
+int UtcDaliScrollViewSetGetProperty(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ScrollView actor
+ ScrollView scrollView = ScrollView::New();
+ DALI_TEST_CHECK(scrollView);
+
+ // Event side properties
+
+ // Test "wrapEnabled" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("wrapEnabled") == ScrollView::Property::WRAP_ENABLED );
+ scrollView.SetProperty( ScrollView::Property::WRAP_ENABLED, true );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::WRAP_ENABLED).Get<bool>(), true, TEST_LOCATION );
+
+ // Test "panningEnabled" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("panningEnabled") == ScrollView::Property::PANNING_ENABLED );
+ scrollView.SetProperty( ScrollView::Property::PANNING_ENABLED, false );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::PANNING_ENABLED).Get<bool>(), false, TEST_LOCATION );
+
+ // Test "axisAutoLockEnabled" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("axisAutoLockEnabled") == ScrollView::Property::AXIS_AUTO_LOCK_ENABLED );
+ scrollView.SetProperty( ScrollView::Property::AXIS_AUTO_LOCK_ENABLED, false );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::AXIS_AUTO_LOCK_ENABLED).Get<bool>(), false, TEST_LOCATION );
+
+ // Test "wheelScrollDistanceStep" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("wheelScrollDistanceStep") == ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP );
+ scrollView.SetProperty( ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP, Vector2(100.0f, 50.0f) );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP).Get<Vector2>(), Vector2(100.0f, 50.0f), TEST_LOCATION );
+
+ // Test "overshootEnabled" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("overshootEnabled") == Scrollable::Property::OVERSHOOT_ENABLED );
+ DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), scrollView.IsOvershootEnabled(), TEST_LOCATION );
+ scrollView.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, false );
+ DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), false, TEST_LOCATION );
+
+ // Animatable properties
+
+ // Test "scrollPosition" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPosition") == ScrollView::Property::SCROLL_POSITION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(320.0f, 550.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION).Get<Vector2>(), Vector2(320.0f, 550.0f), TEST_LOCATION );
+
+ // Test "scrollPrePosition", "scrollPrePositionX" and "scrollPrePositionY" properties
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePosition") == ScrollView::Property::SCROLL_PRE_POSITION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION, Vector2(300.0f, 500.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>(), Vector2(300.0f, 500.0f), TEST_LOCATION );
+
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionX") == ScrollView::Property::SCROLL_PRE_POSITION_X );
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionY") == ScrollView::Property::SCROLL_PRE_POSITION_Y );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_X).Get<float>(), 300.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_Y).Get<float>(), 500.0f, TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_X, 400.0f );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_Y, 600.0f );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_X).Get<float>(), 400.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_Y).Get<float>(), 600.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>(), Vector2(400.0f, 600.0f), TEST_LOCATION );
+
+ // Test "scrollPrePositionMax", "scrollPrePositionMaxX" and "scrollPrePositionMaxY" properties
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionMax") == ScrollView::Property::SCROLL_PRE_POSITION_MAX );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_MAX, Vector2(100.0f, 200.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX).Get<Vector2>(), Vector2(100.0f, 200.0f), TEST_LOCATION );
+
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionMaxX") == ScrollView::Property::SCROLL_PRE_POSITION_MAX_X );
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionMaxY") == ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_X).Get<float>(), 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y).Get<float>(), 200.0f, TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_MAX_X, 300.0f );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y, 400.0f );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_X).Get<float>(), 300.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y).Get<float>(), 400.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX).Get<Vector2>(), Vector2(300.0f, 400.0f), TEST_LOCATION );
+
+ // Test "overshootX" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("overshootX") == ScrollView::Property::OVERSHOOT_X );
+ scrollView.SetProperty( ScrollView::Property::OVERSHOOT_X, 0.8f );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X).Get<float>(), 0.8f, TEST_LOCATION );
+
+ // Test "overshootY" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("overshootY") == ScrollView::Property::OVERSHOOT_Y );
+ scrollView.SetProperty( ScrollView::Property::OVERSHOOT_Y, 0.8f );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y).Get<float>(), 0.8f, TEST_LOCATION );
+
+ // Test "scrollFinal", "scrollFinalX" and "scrollFinalY" properties
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollFinal") == ScrollView::Property::SCROLL_FINAL );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_FINAL, Vector2(200.0f, 300.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL).Get<Vector2>(), Vector2(200.0f, 300.0f), TEST_LOCATION );
+
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollFinalX") == ScrollView::Property::SCROLL_FINAL_X );
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollFinalY") == ScrollView::Property::SCROLL_FINAL_Y );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_X).Get<float>(), 200.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_Y).Get<float>(), 300.0f, TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_FINAL_X, 500.0f );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_FINAL_Y, 600.0f );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_X).Get<float>(), 500.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_Y).Get<float>(), 600.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL).Get<Vector2>(), Vector2(500.0f, 600.0f), TEST_LOCATION );
+
+ // Test "wrap" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("wrap") == ScrollView::Property::WRAP );
+ scrollView.SetProperty( ScrollView::Property::WRAP, false );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::WRAP).Get<bool>(), false, TEST_LOCATION );
+
+ // Test "panning" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("panning") == ScrollView::Property::PANNING );
+ scrollView.SetProperty( ScrollView::Property::PANNING, true );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::PANNING).Get<bool>(), true, TEST_LOCATION );
+
+ // Test "scrolling" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrolling") == ScrollView::Property::SCROLLING );
+ scrollView.SetProperty( ScrollView::Property::SCROLLING, false );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLLING).Get<bool>(), false, TEST_LOCATION );
+
+ // Test "scrollDomainSize", "scrollDomainSizeX" and "scrollDomainSizeY" properties
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainSize") == ScrollView::Property::SCROLL_DOMAIN_SIZE );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_SIZE, Vector2(1200.0f, 1300.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE).Get<Vector2>(), Vector2(1200.0f, 1300.0f), TEST_LOCATION );
+
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainSizeX") == ScrollView::Property::SCROLL_DOMAIN_SIZE_X );
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainSizeY") == ScrollView::Property::SCROLL_DOMAIN_SIZE_Y );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_X).Get<float>(), 1200.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_Y).Get<float>(), 1300.0f, TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_SIZE_X, 1500.0f );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_SIZE_Y, 1600.0f );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_X).Get<float>(), 1500.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_Y).Get<float>(), 1600.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE).Get<Vector2>(), Vector2(1500.0f, 1600.0f), TEST_LOCATION );
+
+ // Test "scrollDomainOffset" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainOffset") == ScrollView::Property::SCROLL_DOMAIN_OFFSET );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector2(500.0f, 200.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_OFFSET).Get<Vector2>(), Vector2(500.0f, 200.0f), TEST_LOCATION );
+
+ // Test "scrollPositionDelta" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPositionDelta") == ScrollView::Property::SCROLL_POSITION_DELTA );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION_DELTA, Vector2(10.0f, 30.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION_DELTA).Get<Vector2>(), Vector2(10.0f, 30.0f), TEST_LOCATION );
+
+ // Test "startPagePosition" property
+ DALI_TEST_CHECK( scrollView.GetPropertyIndex("startPagePosition") == ScrollView::Property::START_PAGE_POSITION );
+ scrollView.SetProperty( ScrollView::Property::START_PAGE_POSITION, Vector3(50.0f, 100.0f, 20.0f) );
+ Wait(application);
+ DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::START_PAGE_POSITION).Get<Vector3>(), Vector3(50.0f, 100.0f, 20.0f), TEST_LOCATION );
+
+ END_TEST;
+}
namespace
{
-void Indent(std::ostream& o, int indent)
+void Indent(std::ostream& o, int level, int indentWidth)
{
- for (int i = 0; i < indent; ++i)
+ for (int i = 0; i < level*indentWidth; ++i)
{
o << " ";
}
}
+std::string EscapeQuotes( const char* aString)
+{
+ std::string escapedString;
+ int length = strlen(aString);
+ escapedString.reserve(length);
+
+ const char* end = aString+length;
+ for( const char* iter = aString; iter != end ; ++iter)
+ {
+ if(*iter != '\"')
+ {
+ escapedString.push_back(*iter);
+ }
+ else
+ {
+ escapedString.append("\\\"");
+ }
+ }
+ return escapedString;
}
+} // anonymous namespace
+
TreeNodeManipulator::TreeNodeManipulator(TreeNode* node)
: mNode(node)
{
void TreeNodeManipulator::Write(std::ostream& output, int indent) const
{
DALI_ASSERT_DEBUG(mNode && "Operation on NULL JSON node");
- DoWrite(mNode, output, indent);
+ DoWrite(mNode, output, 0, indent, false);
}
-void TreeNodeManipulator::DoWrite(const TreeNode *value, std::ostream& output, int indent) const
+void TreeNodeManipulator::DoWrite(const TreeNode *value, std::ostream& output, int level, int indentWidth, bool groupChildren) const
{
DALI_ASSERT_DEBUG(value && "Operation on NULL JSON node");
- Indent(output, indent);
+ if(!groupChildren)
+ {
+ Indent(output, level, indentWidth);
+ }
if (value->GetName())
{
output << "null";
if(NULL != value->mNextSibling)
{
- output << ",";
+ output << ", ";
}
- if(indent)
+ if( !groupChildren )
{
output << std::endl;
}
case TreeNode::OBJECT:
case TreeNode::ARRAY:
{
+ bool groupMyChildren = false;
+
+ if( TreeNode::ARRAY == value->GetType() &&
+ ( TreeNode::INTEGER == value->mFirstChild->GetType() ||
+ TreeNode::FLOAT == value->mFirstChild->GetType() ) )
+ {
+ groupMyChildren = true;
+ }
+
if( value->GetType() == TreeNode::OBJECT)
{
+ output << std::endl;
+ Indent(output, level, indentWidth);
output << "{";
- if(indent)
- {
- output << std::endl;
- }
}
else
{
- output << "[";
- if(indent)
+ if( !groupMyChildren )
{
output << std::endl;
+ Indent(output, level, indentWidth);
}
+ output << "[";
+ }
+
+ if( groupMyChildren )
+ {
+ output << " ";
+ }
+ else
+ {
+ output << std::endl;
}
for (TreeNode::ConstIterator it = value->CBegin(); it != value->CEnd(); ++it)
{
- DoWrite( &((*it).second), output, indent + 1);
+ DoWrite( &((*it).second), output, level+1, indentWidth, groupMyChildren );
+ }
+
+ if( !groupMyChildren )
+ {
+ Indent(output, level, indentWidth);
}
- Indent(output, indent);
+
if( value->GetType() == TreeNode::OBJECT )
{
output << "}";
- if(indent)
- {
- output << std::endl;
- }
}
else
{
output << "]";
- if(indent)
- {
- output << std::endl;
- }
}
+
+ if( NULL != value->mNextSibling )
+ {
+ output << ",";
+ }
+
+ if( !groupChildren )
+ {
+ output << std::endl;
+ }
+
+ groupChildren = false;
break;
}
case TreeNode::STRING:
{
- output << "\"" << value->GetString() << "\"";
+ std::string escapedString = EscapeQuotes(value->GetString());
+ output << "\"" << escapedString << "\"";
if(NULL != value->mNextSibling)
{
output << ",";
}
- if(indent)
+
+ if( groupChildren )
+ {
+ output << " ";
+ }
+ else
{
output << std::endl;
}
-
break;
}
case TreeNode::INTEGER:
{
output << ",";
}
- if(indent)
+
+ if( groupChildren )
+ {
+ output << " ";
+ }
+ else
{
output << std::endl;
}
-
break;
}
case TreeNode::FLOAT:
{
output << ",";
}
- if(indent)
+
+ if( groupChildren )
+ {
+ output << " ";
+ }
+ else
{
output << std::endl;
}
{
output << "false";
}
+
if(NULL != value->mNextSibling)
{
output << ",";
}
- if(indent)
+
+ if( groupChildren )
+ {
+ output << " ";
+ }
+ else
{
output << std::endl;
}
} // namespace Toolkit
} // namespace Dali
-
/*
* Do write to string stream
*/
- void DoWrite(const TreeNode *value, std::ostream& output, int ident) const;
+ void DoWrite(const TreeNode *value, std::ostream& output, int level, int ident, bool groupChildren) const;
};
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ImageView, Toolkit::Control, Create );
DALI_PROPERTY_REGISTRATION( Toolkit, ImageView, "resourceUrl", STRING, RESOURCE_URL )
DALI_PROPERTY_REGISTRATION( Toolkit, ImageView, "image", MAP, IMAGE )
+DALI_PROPERTY_REGISTRATION( Toolkit, ImageView, "preMultipliedAlpha", BOOLEAN, PRE_MULTIPLIED_ALPHA )
+
+DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT( Toolkit, ImageView, "pixelArea", Vector4(0.f, 0.f, 1.f, 1.f), PIXEL_AREA )
DALI_TYPE_REGISTRATION_END()
} // anonymous namespace
using namespace Dali;
ImageView::ImageView()
-: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
+ mPremultipledAlphaEnabled( false )
{
}
}
}
+void ImageView::EnablePreMultipliedAlpha( bool preMultipled )
+{
+ mPremultipledAlphaEnabled = preMultipled;
+
+ if( mRenderer )
+ {
+ ControlRenderer& rendererImpl = GetImplementation( mRenderer );
+ if (&typeid( rendererImpl ) == &typeid(ImageRenderer) )
+ {
+ ImageRenderer* imageRenderer = static_cast<ImageRenderer*>( &rendererImpl );
+ imageRenderer->EnablePreMultipliedAlpha( preMultipled );
+ }
+ }
+}
+
+bool ImageView::IsPreMultipliedAlphaEnabled() const
+{
+ return mPremultipledAlphaEnabled;
+}
+
void ImageView::SetDepthIndex( int depthIndex )
{
- mRenderer.SetDepthIndex( depthIndex );
+ if( mRenderer )
+ {
+ mRenderer.SetDepthIndex( depthIndex );
+ }
}
Vector3 ImageView::GetNaturalSize()
size.x = mImageSize.GetWidth();
size.y = mImageSize.GetHeight();
- size.z = std::min(size.x, size.y);
if( size.x > 0 && size.y > 0 )
{
+ size.z = std::min(size.x, size.y);
return size;
}
else
}
}
+
///////////////////////////////////////////////////////////
//
// Private methods
Control::OnStageDisconnection();
}
-
///////////////////////////////////////////////////////////
//
// Properties
break;
}
+
+ case Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA:
+ {
+ bool IsPre;
+ if( value.Get( IsPre ) )
+ {
+ GetImpl(imageView).EnablePreMultipliedAlpha( IsPre );
+ }
+ break;
+ }
}
}
}
if ( imageview )
{
+ ImageView& impl = GetImpl( imageview );
switch ( propertyIndex )
{
case Toolkit::ImageView::Property::RESOURCE_URL:
{
- ImageView& impl = GetImpl( imageview );
if ( !impl.mUrl.empty() )
{
value = impl.mUrl;
case Toolkit::ImageView::Property::IMAGE:
{
- ImageView& impl = GetImpl( imageview );
if ( !impl.mUrl.empty() )
{
value = impl.mUrl;
}
break;
}
+
+ case Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA:
+ {
+ value = impl.IsPreMultipliedAlphaEnabled();
+ break;
+ }
}
}
{
class ImageView : public Control
{
- protected:
+protected:
/**
* Construct a new ImageView.
*/
virtual ~ImageView();
-
-
public:
/**
* Create a new ImageView.
*/
void SetImage( const std::string& imageUrl, ImageDimensions size );
+ /**
+ * @brief Set whether the Pre-multiplied Alpha Blending is required
+ *
+ * @param[in] preMultipled whether alpha is pre-multiplied.
+ */
+ void EnablePreMultipliedAlpha( bool preMultipled );
+
+ /**
+ * @brief Query whether alpha is pre-multiplied.
+ *
+ * @return True is alpha is pre-multiplied, false otherwise.
+ */
+ bool IsPreMultipliedAlphaEnabled() const;
+
// Properties
/**
* Called when a property of an object of this type is set.
virtual float GetWidthForHeight( float height );
private:
- /**
- * Attaches mImage member to the renderer, creating the renderers, samplers, meshes and materials if needed
- *
- * @pre mImage has been initialised
- */
- void AttachImage();
-
-private:
// Undefined
ImageView( const ImageView& );
ImageView& operator=( const ImageView& );
std::string mUrl; ///< the url for the image if the image came from a URL, empty otherwise
Image mImage; ///< the Image if the image came from a Image, null otherwise
Property::Map mPropertyMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise
+
+ bool mPremultipledAlphaEnabled; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
};
} // namespace Internal
const char * const DONT_CARE("dontCare");
const std::string TEXTURE_UNIFORM_NAME = "sTexture";
-const std::string TEXTURE_RECT_UNIFORM_NAME = "uTextureRect";
+const std::string ATLAS_RECT_UNIFORM_NAME = "uAtlasRect";
+const std::string PIXEL_AREA_UNIFORM_NAME = "pixelArea";
+
+// Set this uniform to 1.0 for conventional alpha blending; if pre-multiplied alpha blending, set this uniform to 0.0
+const std::string ALPHA_BLENDING_UNIFORM_NAME = "uAlphaBlending";
+
const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
- varying mediump vec2 vTexCoord;\n
uniform mediump mat4 uMvpMatrix;\n
uniform mediump vec3 uSize;\n
- uniform mediump vec4 uTextureRect;\n
+ uniform mediump vec4 uAtlasRect;\n
+ uniform mediump vec4 pixelArea;
+ varying mediump vec2 vTexCoord;\n
\n
void main()\n
{\n
vertexPosition.xyz *= uSize;\n
vertexPosition = uMvpMatrix * vertexPosition;\n
\n
- vTexCoord = mix( uTextureRect.xy, uTextureRect.zw, aPosition + vec2(0.5));\n
+ vTexCoord = mix( uAtlasRect.xy, uAtlasRect.zw, pixelArea.xy+pixelArea.zw*(aPosition + vec2(0.5) ) );\n
gl_Position = vertexPosition;\n
}\n
);
varying mediump vec2 vTexCoord;\n
uniform sampler2D sTexture;\n
uniform lowp vec4 uColor;\n
+ uniform lowp float uAlphaBlending; // Set to 1.0 for conventional alpha blending; if pre-multiplied alpha blending, set to 0.0
\n
void main()\n
{\n
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+ gl_FragColor = texture2D( sTexture, vTexCoord ) * vec4( uColor.rgb*max( uAlphaBlending, uColor.a ), uColor.a );\n
}\n
);
ImageRenderer::ImageRenderer( RendererFactoryCache& factoryCache, ImageAtlasManager& atlasManager )
: ControlRenderer( factoryCache ),
mAtlasManager( atlasManager ),
- mTextureRect( FULL_TEXTURE_RECT ),
mDesiredSize(),
mFittingMode( FittingMode::DEFAULT ),
- mSamplingMode( SamplingMode::DEFAULT )
+ mSamplingMode( SamplingMode::DEFAULT ),
+ mIsAlphaPreMultiplied( false )
{
}
shader = Shader::New( mImpl->mCustomShader->mVertexShader.empty() ? VERTEX_SHADER : mImpl->mCustomShader->mVertexShader,
mImpl->mCustomShader->mFragmentShader.empty() ? FRAGMENT_SHADER : mImpl->mCustomShader->mFragmentShader,
mImpl->mCustomShader->mHints );
+ if( mImpl->mCustomShader->mVertexShader.empty() )
+ {
+ shader.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, FULL_TEXTURE_RECT );
+ shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
+ shader.RegisterProperty( ALPHA_BLENDING_UNIFORM_NAME, 1.f );
+ }
}
}
mImpl->mRenderer = mFactoryCache.GetRenderer( imageUrl );
if( !mImpl->mRenderer )
{
- Material material = mAtlasManager.Add(mTextureRect, imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
+ Vector4 atlasRect;
+ Material material = mAtlasManager.Add(atlasRect, imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
if( material )
{
Geometry geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
mImpl->mRenderer = Renderer::New( geometry, material );
- SetTextureRectUniform(mTextureRect);
+ mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
}
else // big image, atlasing is not applied
{
mImpl->mRenderer = CreateRenderer();
- mTextureRect = FULL_TEXTURE_RECT;
- SetTextureRectUniform(mTextureRect);
- ResourceImage image = Dali::ResourceImage::New( imageUrl );
+ ResourceImage image = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
image.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
Material material = mImpl->mRenderer.GetMaterial();
material.AddTexture( image, TEXTURE_UNIFORM_NAME );
mFactoryCache.SaveRenderer( imageUrl, mImpl->mRenderer );
}
- else
- {
- Property::Value textureRect = mImpl->mRenderer.GetProperty( mImpl->mRenderer.GetPropertyIndex(TEXTURE_RECT_UNIFORM_NAME) );
- textureRect.Get( mTextureRect );
- }
+
mImpl->mFlags |= Impl::IS_FROM_CACHE;
}
else
ResourceImage resourceImage = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
ApplyImageToSampler( resourceImage );
-
- // custom vertex shader does not need texture rect uniform
- if( mImpl->mCustomShader && !mImpl->mCustomShader->mVertexShader.empty() )
- {
- return;
- }
-
- mTextureRect = FULL_TEXTURE_RECT;
- SetTextureRectUniform( mTextureRect );
}
}
{
ApplyImageToSampler( image );
}
-
- // default shader or custom shader with the default image vertex shader
- if( !mImpl->mCustomShader || mImpl->mCustomShader->mVertexShader.empty() )
- {
- mTextureRect = FULL_TEXTURE_RECT;
- SetTextureRectUniform( mTextureRect );
- }
}
{
InitializeRenderer( mImage );
}
+
+ EnablePreMultipliedAlpha( mIsAlphaPreMultiplied );
}
void ImageRenderer::DoSetOffStage( Actor& actor )
{
shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
factoryCache.SaveShader( RendererFactoryCache::IMAGE_SHADER, shader );
+ shader.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, FULL_TEXTURE_RECT );
+ shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
+ shader.RegisterProperty( ALPHA_BLENDING_UNIFORM_NAME, 1.f );
}
return shader;
}
}
}
+void ImageRenderer::EnablePreMultipliedAlpha( bool preMultipled )
+{
+ mIsAlphaPreMultiplied = preMultipled;
+ if( mImpl->mRenderer )
+ {
+ Material material = mImpl->mRenderer.GetMaterial();
+
+ if( preMultipled )
+ {
+ material.SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
+ BlendingFactor::ONE, BlendingFactor::ONE );
+ if( !mImpl->mCustomShader || mImpl->mCustomShader->mVertexShader.empty())
+ {
+ material.RegisterProperty( ALPHA_BLENDING_UNIFORM_NAME, 0.f );
+ }
+ }
+ else
+ {
+ // using default blend func
+ material.SetBlendFunc( BlendingFactor::SRC_ALPHA, BlendingFactor::ONE_MINUS_SRC_ALPHA,
+ BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA );
+
+ Property::Index index = material.GetPropertyIndex( ALPHA_BLENDING_UNIFORM_NAME );
+ if( index != Property::INVALID_INDEX ) // only set value when the property already exist on the Material
+ {
+ material.SetProperty( index, 1.f );
+ }
+ }
+ }
+}
+
void ImageRenderer::ApplyImageToSampler( const Image& image )
{
if( image )
}
}
-void ImageRenderer::SetTextureRectUniform( const Vector4& textureRect )
+void ImageRenderer::CleanCache(const std::string& url)
{
- if( mImpl->mRenderer )
+ Material material = mImpl->mRenderer.GetMaterial();
+
+ Vector4 atlasRect( 0.f, 0.f, 1.f, 1.f );
+ Property::Index index = mImpl->mRenderer.GetPropertyIndex( ATLAS_RECT_UNIFORM_NAME );
+ if( index != Property::INVALID_INDEX )
{
- // Register/Set property.
- mImpl->mRenderer.RegisterProperty( TEXTURE_RECT_UNIFORM_NAME, textureRect );
+ Property::Value atlasRectValue = mImpl->mRenderer.GetProperty( index );
+ atlasRectValue.Get( atlasRect );
}
-}
-void ImageRenderer::CleanCache(const std::string& url)
-{
- Material material = mImpl->mRenderer.GetMaterial();
mImpl->mRenderer.Reset();
- if( mFactoryCache.CleanRendererCache( url ) )
+ if( mFactoryCache.CleanRendererCache( url ) && index != Property::INVALID_INDEX )
{
- mAtlasManager.Remove( material, mTextureRect );
+ mAtlasManager.Remove( material, atlasRect );
}
}
*/
void SetImage( Actor& actor, const Image& image );
+ /**
+ * @brief Set whether the Pre-multiplied Alpha Blending is required
+ *
+ * @param[in] preMultipled whether alpha is pre-multiplied.
+ */
+ void EnablePreMultipliedAlpha( bool preMultipled );
+
private:
/**
private:
Image mImage;
ImageAtlasManager& mAtlasManager;
- Vector4 mTextureRect;
std::string mImageUrl;
Dali::ImageDimensions mDesiredSize;
Dali::FittingMode::Type mFittingMode;
Dali::SamplingMode::Type mSamplingMode;
+ bool mIsAlphaPreMultiplied;
};
DALI_PROPERTY_REGISTRATION( Toolkit, ItemView, "minimumSwipeSpeed", FLOAT, MINIMUM_SWIPE_SPEED )
DALI_PROPERTY_REGISTRATION( Toolkit, ItemView, "minimumSwipeDistance", FLOAT, MINIMUM_SWIPE_DISTANCE )
-DALI_PROPERTY_REGISTRATION( Toolkit, ItemView, "wheelScrollDistanceStep", FLOAT, WHELL_SCROLL_DISTANCE_SPEED )
+DALI_PROPERTY_REGISTRATION( Toolkit, ItemView, "wheelScrollDistanceStep", FLOAT, WHEEL_SCROLL_DISTANCE_STEP )
DALI_PROPERTY_REGISTRATION( Toolkit, ItemView, "snapToItemEnabled", BOOLEAN, SNAP_TO_ITEM_ENABLED )
DALI_PROPERTY_REGISTRATION( Toolkit, ItemView, "refreshInterval", FLOAT, REFRESH_INTERVAL )
itemViewImpl.SetMinimumSwipeDistance( value.Get<float>() );
break;
}
- case Toolkit::ItemView::Property::WHELL_SCROLL_DISTANCE_SPEED:
+ case Toolkit::ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP:
{
itemViewImpl.SetWheelScrollDistanceStep( value.Get<float>() );
break;
value = itemViewImpl.GetMinimumSwipeDistance();
break;
}
- case Toolkit::ItemView::Property::WHELL_SCROLL_DISTANCE_SPEED:
+ case Toolkit::ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP:
{
value = itemViewImpl.GetWheelScrollDistanceStep();
break;
// Sound & haptic style
mFeedbackStyle = new FeedbackStyle();
-
}
StyleManager::~StyleManager()
}
}
-std::string StyleManager::GetDefaultFontFamily() const
+Orientation StyleManager::GetOrientation()
{
- return mDefaultFontFamily;
+ return mOrientation;
}
-Orientation StyleManager::GetOrientation()
+std::string StyleManager::GetDefaultFontFamily() const
{
- return mOrientation;
+ return mDefaultFontFamily;
}
void StyleManager::SetStyleConstant( const std::string& key, const Property::Value& value )
return false;
}
-void StyleManager::OnOrientationChanged( Orientation orientation )
+void StyleManager::RequestThemeChange( const std::string& themeFile )
{
- mOrientation = orientation;
- // TODO: if orientation changed, apply the new style to all controls
- // dont want to really do the whole load from file again if the bundle contains both portrait & landscape
+ mThemeFile = themeFile;
+
+ // need to do style change synchronously as app might create a UI control on the next line
SetTheme();
}
+void StyleManager::RequestDefaultTheme()
+{
+ RequestThemeChange( DEFAULT_THEME );
+}
+
+void StyleManager::ApplyThemeStyle( Toolkit::Control control )
+{
+ if( !mThemeBuilder )
+ {
+ RequestDefaultTheme();
+ }
+
+ if( mThemeBuilder )
+ {
+ ApplyStyle( mThemeBuilder, control );
+ }
+}
+
+void StyleManager::ApplyThemeStyleAtInit( Toolkit::Control control )
+{
+ ApplyThemeStyle( control );
+
+ if(mFeedbackStyle)
+ {
+ mFeedbackStyle->ObjectCreated( control );
+ }
+}
+
+void StyleManager::ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName )
+{
+ bool builderReady = false;
+
+ // First look in the cache
+ Toolkit::Builder builder = FindCachedBuilder( jsonFileName );
+ if( builder )
+ {
+ builderReady = true;
+ }
+ else
+ {
+ // Merge theme and style constants
+ Property::Map constants( mThemeBuilderConstants );
+ constants.Merge( mStyleBuilderConstants );
+
+ // Create it
+ builder = CreateBuilder( constants );
+
+ if( LoadJSON( builder, jsonFileName ) )
+ {
+ CacheBuilder( builder, jsonFileName );
+ builderReady = true;
+ }
+ }
+
+ // Apply the style to the control
+ if( builderReady )
+ {
+ builder.ApplyStyle( styleName, control );
+ }
+}
+
+Toolkit::StyleManager::StyleChangeSignalType& StyleManager::StyleChangeSignal()
+{
+ return mStyleChangeSignal;
+}
+
+
+void StyleManager::SetTheme()
+{
+ mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+
+ if( LoadJSON( mThemeBuilder, mThemeFile ) )
+ {
+ if(mFeedbackStyle)
+ {
+ mFeedbackStyle->StyleChanged( mThemeFile, StyleChange::THEME_CHANGE );
+ }
+
+ mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), StyleChange::THEME_CHANGE );
+ }
+ else
+ {
+ mThemeBuilder.Reset();
+ }
+}
+
+bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut )
+{
+ DALI_ASSERT_DEBUG( 0 != filename.length());
+
+ // as toolkit is platform agnostic, it cannot load files from filesystem
+ // ask style monitor to load the style sheet
+ if( mStyleMonitor )
+ {
+ return mStyleMonitor.LoadThemeFile( filename, stringOut );
+ }
+
+ return false;
+}
+
Toolkit::Builder StyleManager::CreateBuilder( const Property::Map& constants )
{
Toolkit::Builder builder = Toolkit::Builder::New();
}
}
-void StyleManager::ApplyThemeStyle( Toolkit::Control control )
-{
- if( !mThemeBuilder )
- {
- RequestDefaultTheme();
- }
-
- if( mThemeBuilder )
- {
- ApplyStyle( mThemeBuilder, control );
- }
-}
-
-void StyleManager::ApplyThemeStyleAtInit( Toolkit::Control control )
-{
- ApplyThemeStyle( control );
-
- if(mFeedbackStyle)
- {
- mFeedbackStyle->ObjectCreated( control );
- }
-}
-
-void StyleManager::ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName )
-{
- bool builderReady = false;
-
- // First look in the cache
- Toolkit::Builder builder = FindCachedBuilder( jsonFileName );
- if( builder )
- {
- builderReady = true;
- }
- else
- {
- // Merge theme and style constants
- Property::Map constants( mThemeBuilderConstants );
- constants.Merge( mStyleBuilderConstants );
-
- // Create it
- builder = CreateBuilder( constants );
-
- if( LoadJSON( builder, jsonFileName ) )
- {
- CacheBuilder( builder, jsonFileName );
- builderReady = true;
- }
- }
-
- // Apply the style to the control
- if( builderReady )
- {
- builder.ApplyStyle( styleName, control );
- }
-}
-
-bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut )
-{
- DALI_ASSERT_DEBUG( 0 != filename.length());
-
- // as toolkit is platform agnostic, it cannot load files from filesystem
- // ask style monitor to load the style sheet
- if( mStyleMonitor )
- {
- return mStyleMonitor.LoadThemeFile( filename, stringOut );
- }
-
- return false;
-}
-
-Toolkit::StyleManager::StyleChangeSignalType& StyleManager::StyleChangeSignal()
-{
- return mStyleChangeSignal;
-}
-
-void StyleManager::RequestThemeChange( const std::string& themeFile )
+void StyleManager::OnOrientationChanged( Orientation orientation )
{
- mThemeFile = themeFile;
-
- // need to do style change synchronously as app might create a UI control on the next line
+ mOrientation = orientation;
+ // TODO: if orientation changed, apply the new style to all controls
+ // dont want to really do the whole load from file again if the bundle contains both portrait & landscape
SetTheme();
}
-void StyleManager::RequestDefaultTheme()
-{
- RequestThemeChange( DEFAULT_THEME );
-}
-
-void StyleManager::SetTheme()
-{
- mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
-
- if( LoadJSON( mThemeBuilder, mThemeFile ) )
- {
- if(mFeedbackStyle)
- {
- mFeedbackStyle->StyleChanged( mThemeFile, StyleChange::THEME_CHANGE );
- }
-
- mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), StyleChange::THEME_CHANGE );
- }
- else
- {
- mThemeBuilder.Reset();
- }
-}
Toolkit::Builder StyleManager::FindCachedBuilder( const std::string& key )
{
class StyleManager : public Dali::BaseObject, public ConnectionTracker
{
public:
-
/**
* Singleton access
*
*/
StyleManager();
+protected:
+ /**
+ * @brief Destructor
+ */
+ virtual ~StyleManager();
+
+public: // Public API
+
/**
* @copydoc Toolkit::StyleManager::SetOrientationValue
*/
void RequestDefaultTheme();
/**
- * Determine if a theme change has been requested
- * @return Whether a theme request is pending
- */
- bool IsThemeRequestPending();
-
- /**
* @brief Apply the theme style to a control.
*
* @param[in] control The control to apply style.
*/
Toolkit::StyleManager::StyleChangeSignalType& StyleChangeSignal();
-protected:
-
- /**
- * @brief Destructor
- */
- virtual ~StyleManager();
-
-
-public:
+private:
+ typedef std::vector<std::string> StringList;
/**
* @brief Set the current theme. Called only once per event processing cycle.
*/
void SetTheme();
-private:
-
- typedef std::vector<std::string> StringList;
-
/**
* @brief Internal helper method to read a file from file system.
* @param filename The name of the file to read.
} // namespace Dali
#endif // __DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H__
-
HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
if( !grabHandle.actor )
{
- grabHandle.actor = ImageView::New( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
- GetImpl( grabHandle.actor).SetDepthIndex( DepthIndex::DECORATION );
- grabHandle.actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- // Area that Grab handle responds to, larger than actual handle so easier to move
-#ifdef DECORATOR_DEBUG
- grabHandle.actor.SetName( "GrabHandleActor" );
- if ( Dali::Internal::gLogFilter->IsEnabledFor( Debug::Verbose ) )
- {
- grabHandle.grabArea = Control::New();
- Toolkit::Control control = Toolkit::Control::DownCast( grabHandle.grabArea );
- control.SetBackgroundColor( Vector4( 1.0f, 1.0f, 1.0f, 0.5f ) );
- grabHandle.grabArea.SetName( "GrabArea" );
- }
- else
+ if( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] )
{
- grabHandle.grabArea = Actor::New();
- grabHandle.grabArea.SetName( "GrabArea" );
- }
+ grabHandle.actor = ImageView::New( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
+ GetImpl( grabHandle.actor).SetDepthIndex( DepthIndex::DECORATION );
+ grabHandle.actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+
+ // Area that Grab handle responds to, larger than actual handle so easier to move
+#ifdef DECORATOR_DEBUG
+ grabHandle.actor.SetName( "GrabHandleActor" );
+ if ( Dali::Internal::gLogFilter->IsEnabledFor( Debug::Verbose ) )
+ {
+ grabHandle.grabArea = Control::New();
+ Toolkit::Control control = Toolkit::Control::DownCast( grabHandle.grabArea );
+ control.SetBackgroundColor( Vector4( 1.0f, 1.0f, 1.0f, 0.5f ) );
+ grabHandle.grabArea.SetName( "GrabArea" );
+ }
+ else
+ {
+ grabHandle.grabArea = Actor::New();
+ grabHandle.grabArea.SetName( "GrabArea" );
+ }
#else
- grabHandle.grabArea = Actor::New();
+ grabHandle.grabArea = Actor::New();
#endif
- grabHandle.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
- grabHandle.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- grabHandle.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
- grabHandle.actor.Add( grabHandle.grabArea );
- grabHandle.actor.SetColor( mHandleColor );
+ grabHandle.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ grabHandle.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ grabHandle.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
+ grabHandle.actor.Add( grabHandle.grabArea );
+ grabHandle.actor.SetColor( mHandleColor );
- grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
- mTapDetector.Attach( grabHandle.grabArea );
- mPanGestureDetector.Attach( grabHandle.grabArea );
+ grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
+ mTapDetector.Attach( grabHandle.grabArea );
+ mPanGestureDetector.Attach( grabHandle.grabArea );
- mActiveLayer.Add( grabHandle.actor );
+ mActiveLayer.Add( grabHandle.actor );
+ }
}
- if( !grabHandle.actor.GetParent() )
+ if( grabHandle.actor && !grabHandle.actor.GetParent() )
{
mActiveLayer.Add( grabHandle.actor );
}
HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
if( !primary.actor )
{
- primary.actor = ImageView::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
+ if( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
+ {
+ primary.actor = ImageView::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
#ifdef DECORATOR_DEBUG
- primary.actor.SetName("SelectionHandleOne");
+ primary.actor.SetName("SelectionHandleOne");
#endif
- primary.actor.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); // Change to BOTTOM_RIGHT if Look'n'Feel requires handle above text.
- GetImpl( primary.actor ).SetDepthIndex( DepthIndex::DECORATION );
- primary.actor.SetColor( mHandleColor );
+ primary.actor.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); // Change to BOTTOM_RIGHT if Look'n'Feel requires handle above text.
+ GetImpl( primary.actor ).SetDepthIndex( DepthIndex::DECORATION );
+ primary.actor.SetColor( mHandleColor );
- primary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
+ primary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
#ifdef DECORATOR_DEBUG
- primary.grabArea.SetName("SelectionHandleOneGrabArea");
+ primary.grabArea.SetName("SelectionHandleOneGrabArea");
#endif
- primary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- primary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
- primary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- primary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
+ primary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ primary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ primary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ primary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
- mTapDetector.Attach( primary.grabArea );
- mPanGestureDetector.Attach( primary.grabArea );
- primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
+ mTapDetector.Attach( primary.grabArea );
+ mPanGestureDetector.Attach( primary.grabArea );
+ primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
- primary.actor.Add( primary.grabArea );
+ primary.actor.Add( primary.grabArea );
- CreateHandleMarker( primary, mHandleImages[LEFT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], LEFT_SELECTION_HANDLE );
+ CreateHandleMarker( primary, mHandleImages[LEFT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], LEFT_SELECTION_HANDLE );
+ }
}
- if( !primary.actor.GetParent() )
+ if( primary.actor && !primary.actor.GetParent() )
{
mActiveLayer.Add( primary.actor );
}
HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
if( !secondary.actor )
{
- secondary.actor = ImageView::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
+ if( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
+ {
+ secondary.actor = ImageView::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
#ifdef DECORATOR_DEBUG
- secondary.actor.SetName("SelectionHandleTwo");
+ secondary.actor.SetName("SelectionHandleTwo");
#endif
- secondary.actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); // Change to BOTTOM_LEFT if Look'n'Feel requires handle above text.
- GetImpl( secondary.actor ).SetDepthIndex( DepthIndex::DECORATION );
- secondary.actor.SetColor( mHandleColor );
+ secondary.actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); // Change to BOTTOM_LEFT if Look'n'Feel requires handle above text.
+ GetImpl( secondary.actor ).SetDepthIndex( DepthIndex::DECORATION );
+ secondary.actor.SetColor( mHandleColor );
- secondary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
+ secondary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
#ifdef DECORATOR_DEBUG
- secondary.grabArea.SetName("SelectionHandleTwoGrabArea");
+ secondary.grabArea.SetName("SelectionHandleTwoGrabArea");
#endif
- secondary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- secondary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
- secondary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- secondary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
+ secondary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ secondary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ secondary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ secondary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
- mTapDetector.Attach( secondary.grabArea );
- mPanGestureDetector.Attach( secondary.grabArea );
- secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
+ mTapDetector.Attach( secondary.grabArea );
+ mPanGestureDetector.Attach( secondary.grabArea );
+ secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
- secondary.actor.Add( secondary.grabArea );
+ secondary.actor.Add( secondary.grabArea );
- CreateHandleMarker( secondary, mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], RIGHT_SELECTION_HANDLE );
+ CreateHandleMarker( secondary, mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], RIGHT_SELECTION_HANDLE );
+ }
}
- if( !secondary.actor.GetParent() )
+ if( secondary.actor && !secondary.actor.GetParent() )
{
mActiveLayer.Add( secondary.actor );
}
// The SetGrabHandleImage() method will change the orientation.
const float yLocalPosition = grabHandle.verticallyFlipped ? grabHandle.position.y : grabHandle.position.y + grabHandle.lineHeight;
- grabHandle.actor.SetPosition( grabHandle.position.x + floor( 0.5f * mCursorWidth ),
- yLocalPosition ); // TODO : Fix for multiline.
+ if( grabHandle.actor )
+ {
+ grabHandle.actor.SetPosition( grabHandle.position.x + floor( 0.5f * mCursorWidth ),
+ yLocalPosition ); // TODO : Fix for multiline.
+ }
}
void SetSelectionHandlePosition( HandleType type )
if( flipHandle )
{
- if( !handle.horizontallyFlipped )
+ if( handle.actor && !handle.horizontallyFlipped )
{
// Change the anchor point to flip the image.
handle.actor.SetAnchorPoint( isPrimaryHandle ? AnchorPoint::TOP_LEFT : AnchorPoint::TOP_RIGHT );
}
else
{
- if( handle.horizontallyFlipped )
+ if( handle.actor && handle.horizontallyFlipped )
{
// Reset the anchor point.
handle.actor.SetAnchorPoint( isPrimaryHandle ? AnchorPoint::TOP_RIGHT : AnchorPoint::TOP_LEFT );
// The SetHandleImage() method will change the orientation.
const float yLocalPosition = handle.verticallyFlipped ? handle.position.y : handle.position.y + handle.lineHeight;
- handle.actor.SetPosition( handle.position.x,
- yLocalPosition ); // TODO : Fix for multiline.
+ if( handle.actor )
+ {
+ handle.actor.SetPosition( handle.position.x,
+ yLocalPosition ); // TODO : Fix for multiline.
+ }
}
void SetHandleImage( HandleType type )
mController.DecorationEvent( type, HANDLE_RELEASED, x, y );
}
- handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_RELEASED] );
+ if( handle.actor )
+ {
+ handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_RELEASED] );
+ }
handle.pressed = false;
mHandlePanning = false;
enum PropertyRange
{
PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices
+
+ ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX, ///< @since DALi 1.1.18
+ ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices, @since DALi 1.1.18
};
/**
{
enum
{
+ // Event side properties
RESOURCE_URL = PROPERTY_START_INDEX, ///< name "resourceUrl", @deprecated DALi 1.1.16 Use IMAGE instead. type string
IMAGE, ///< name "image", @see SetImage(), type string if it is a url, map otherwise
+ PRE_MULTIPLIED_ALPHA, ///< name "preMultipliedAlpha", @since DALi 1.1.18 type Boolean @pre image must be initialized.
+
+ // Animatable properties
+ PIXEL_AREA = ANIMATABLE_PROPERTY_START_INDEX, ///< name "pixelArea", @since DALi 1.1.18 type Vector4, Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].
};
};
// Event side properties
MINIMUM_SWIPE_SPEED = PROPERTY_START_INDEX, ///< Property, name "minimumSwipeSpeed", @see SetMinimumSwipeSpeed(), type float, @since DALi 1.1.18
MINIMUM_SWIPE_DISTANCE, ///< Property, name "minimumSwipeDistance", @see SetMinimumSwipeDistance(), type float, @since DALi 1.1.18
- WHELL_SCROLL_DISTANCE_SPEED, ///< Property, name "wheelScrollDistanceStep", @see SetWheelScrollDistanceStep(), type float, @since DALi 1.1.18
+ WHEEL_SCROLL_DISTANCE_STEP, ///< Property, name "wheelScrollDistanceStep", @see SetWheelScrollDistanceStep(), type float, @since DALi 1.1.18
SNAP_TO_ITEM_ENABLED, ///< Property, name "snapToItemEnabled", @see SetAnchoring(), type bool, @since DALi 1.1.18
REFRESH_INTERVAL, ///< Property, name "refreshInterval", @see SetRefreshInterval(), type float, @since DALi 1.1.18
*/
enum PropertyRange
{
- PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @since DALi 1.1.18
- PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices, @since DALi 1.1.18
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices
ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices
{
PrintVersion()
{
- std::cout << "DALi Toolkit: " << TOOLKIT_MAJOR_VERSION << "." << TOOLKIT_MINOR_VERSION << "." << TOOLKIT_MICRO_VERSION << " (" << TOOLKIT_BUILD_DATE << ")" << std::endl;
+ std::cerr << "DALi Toolkit: " << TOOLKIT_MAJOR_VERSION << "." << TOOLKIT_MINOR_VERSION << "." << TOOLKIT_MICRO_VERSION << " (" << TOOLKIT_BUILD_DATE << ")" << std::endl;
}
};
PrintVersion TOOLKIT_VERSION;