[dali_1.1.43] Merge branch 'devel/master' 64/80264/1
authorDavid Steele <david.steele@samsung.com>
Fri, 15 Jul 2016 11:27:49 +0000 (12:27 +0100)
committerDavid Steele <david.steele@samsung.com>
Fri, 15 Jul 2016 11:27:49 +0000 (12:27 +0100)
Change-Id: Ia6bf3df38e96cadaebb5899363461c84dd9e5e6d

124 files changed:
automated-tests/execute.sh
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp
automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-DebugRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
automated-tests/src/dali-toolkit/utc-Dali-JsonParser.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp
automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp
dali-toolkit/devel-api/builder/json-parser.cpp
dali-toolkit/devel-api/builder/tree-node.cpp
dali-toolkit/devel-api/builder/tree-node.h
dali-toolkit/devel-api/image-atlas/image-atlas.h
dali-toolkit/devel-api/shader-effects/dissolve-effect.h
dali-toolkit/devel-api/transition-effects/cube-transition-effect.cpp
dali-toolkit/devel-api/transition-effects/cube-transition-effect.h
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-actor.h
dali-toolkit/internal/controls/bubble-effect/bubble-effect.h
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.h
dali-toolkit/internal/controls/model3d-view/obj-loader.h
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/renderers/border/border-renderer.h
dali-toolkit/internal/controls/renderers/color/color-renderer.cpp
dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h
dali-toolkit/internal/controls/renderers/control-renderer-impl.h
dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp
dali-toolkit/internal/controls/renderers/gradient/gradient.cpp
dali-toolkit/internal/controls/renderers/gradient/gradient.h
dali-toolkit/internal/controls/renderers/image-atlas-manager.cpp
dali-toolkit/internal/controls/renderers/image-atlas-manager.h
dali-toolkit/internal/controls/renderers/image/image-renderer.cpp
dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.cpp
dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.h
dali-toolkit/internal/controls/renderers/renderer-factory-cache.cpp
dali-toolkit/internal/controls/renderers/renderer-factory-cache.h
dali-toolkit/internal/controls/renderers/svg/svg-rasterize-thread.h
dali-toolkit/internal/controls/renderers/svg/svg-renderer.cpp
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h
dali-toolkit/internal/controls/scrollable/scrollable-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/filters/blur-two-pass-filter.cpp
dali-toolkit/internal/filters/emboss-filter.cpp
dali-toolkit/internal/text/clipping/text-clipper.cpp
dali-toolkit/internal/text/cursor-helper-functions.cpp
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/decorator/text-decorator.h
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h
dali-toolkit/internal/text/rendering/atlas/atlas-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/atlas-manager.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-manager.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-shader.h
dali-toolkit/internal/text/rendering/vector-based/vector-based-renderer.cpp
dali-toolkit/internal/text/rendering/vector-based/vector-blob-atlas.cpp
dali-toolkit/internal/text/rendering/vector-based/vector-blob-atlas.h
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-scroller.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec
plugins/dali-script-v8/docs/content/actor.js
plugins/dali-script-v8/src/constants/constants-wrapper.cpp
plugins/dali-script-v8/src/events/event-object-generator.cpp
plugins/dali-script-v8/src/events/event-object-generator.h
plugins/dali-script-v8/src/object/property-buffer-api.h
plugins/dali-script-v8/src/object/property-buffer-wrapper.h
plugins/dali-script-v8/src/rendering/geometry-api.h
plugins/dali-script-v8/src/rendering/geometry-wrapper.cpp
plugins/dali-script-v8/src/rendering/geometry-wrapper.h
plugins/dali-script-v8/src/rendering/renderer-api.h
plugins/dali-script-v8/src/rendering/renderer-wrapper.h
plugins/dali-script-v8/src/rendering/sampler-api.h
plugins/dali-script-v8/src/rendering/sampler-wrapper.h
plugins/dali-script-v8/src/rendering/shader-api.h
plugins/dali-script-v8/src/rendering/shader-wrapper.h
plugins/dali-script-v8/src/rendering/texture-set-api.cpp
plugins/dali-script-v8/src/rendering/texture-set-api.h
plugins/dali-script-v8/src/rendering/texture-set-wrapper.h
plugins/dali-script-v8/src/signals/dali-any-javascript-converter.cpp
plugins/dali-script-v8/src/signals/signal-manager.cpp

index bc108fa..989560f 100755 (executable)
@@ -138,9 +138,7 @@ else
             ret=$?
             if [ $ret -ne 6 ] ; then
                 if [ $opt_debug -ne 0 ] ; then
-                    if [ $ret -eq 0 ] ; then
-                        gdb --args build/src/$mod/tct-$mod-core $1
-                    fi
+                    gdb --args build/src/$mod/tct-$mod-core $1
                 else
                     echo $output
                     if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi
index 978dc74..361fbf3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
  * limitations under the License.
  *
  */
+
+// CLASS HEADER
 #include "mesh-builder.h"
 
+// EXTERNAL INCLUDES
+#include <dali/devel-api/images/texture-set-image.h>
+
 namespace Dali
 {
 
@@ -28,10 +33,11 @@ TextureSet CreateTextureSet()
 {
   return TextureSet::New();
 }
+
 TextureSet CreateTextureSet( Image image )
 {
   TextureSet textureSet = TextureSet::New();
-  textureSet.SetImage( 0u, image );
+  TextureSetImage( textureSet, 0u, image );
   return textureSet;
 }
 
@@ -45,4 +51,25 @@ PropertyBuffer CreatePropertyBuffer()
   return vertexData;
 }
 
+Geometry CreateQuadGeometry(void)
+{
+  PropertyBuffer vertexData = CreatePropertyBuffer();
+  const float halfQuadSize = .5f;
+  struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
+  TexturedQuadVertex texturedQuadVertexData[4] = {
+    { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
+    { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
+    { Vector2(-halfQuadSize,  halfQuadSize), Vector2(0.f, 1.f) },
+    { Vector2( halfQuadSize,  halfQuadSize), Vector2(1.f, 1.f) } };
+  vertexData.SetData(texturedQuadVertexData, 4);
+
+  unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+
+  Geometry geometry = Geometry::New();
+  geometry.AddVertexBuffer( vertexData );
+  geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
+
+  return geometry;
+}
+
 } // namespace Dali
index e157338..d22f9c8 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef MESH_BUILDER_H
 #define MESH_BUILDER_H
+
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
  *
  */
 
+// EXTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
-#include <dali/devel-api/object/property-buffer.h>
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/texture-set.h>
-#include <dali/devel-api/rendering/sampler.h>
-#include <dali/devel-api/rendering/renderer.h>
 
 namespace Dali
 {
@@ -30,7 +27,9 @@ namespace Dali
 Shader CreateShader();
 TextureSet CreateTextureSet();
 TextureSet CreateTextureSet( Image image );
+Geometry CreateQuadGeometry();
 PropertyBuffer CreatePropertyBuffer();
+
 }
 
 #endif // MESH_BUILDER_H
index 9be97bc..f8d7bf8 100644 (file)
  *
  */
 
-// HEADER
+// CLASS HEADER
 #include "test-actor-utils.h"
-#include "mesh-builder.h"
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/devel-api/images/texture-set-image.h>
+
+// INTERNAL INCLUDES
+#include "mesh-builder.h"
 
 namespace Dali
 {
@@ -65,7 +67,7 @@ Actor CreateRenderableActor( Image texture )
 Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader )
 {
   // Create the geometry
-  Geometry geometry = Geometry::QUAD();
+  Geometry geometry = CreateQuadGeometry();
 
   // Create Shader
   Shader shader = Shader::New( vertexShader, fragmentShader );
@@ -81,7 +83,7 @@ Actor CreateRenderableActor( Image texture, const std::string& vertexShader, con
   if( texture )
   {
     TextureSet textureSet = TextureSet::New();
-    textureSet.SetImage( 0u, texture );
+    TextureSetImage( textureSet, 0u, texture );
     renderer.SetTextures( textureSet );
 
     // Set actor to the size of the texture if set
@@ -102,7 +104,7 @@ Image GetTexture( Actor actor )
       TextureSet textureSet = renderer.GetTextures();
       if( textureSet && textureSet.GetTextureCount() )
       {
-        image = textureSet.GetImage( 0u );
+        image = TextureGetImage( textureSet, 0u );
       }
     }
   }
index c5c5d0a..28953cb 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TEST_ACTOR_UTILS_H__
-#define __DALI_TEST_ACTOR_UTILS_H__
+#ifndef DALI_TEST_ACTOR_UTILS_H
+#define DALI_TEST_ACTOR_UTILS_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -58,4 +58,4 @@ Image GetTexture( Actor actor );
 
 } // namespace Dali
 
-#endif // __DALI_TEST_ACTOR_UTILS_H__
+#endif // DALI_TEST_ACTOR_UTILS_H
index 6b2c94a..acdc94a 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_BITMAP_LOADER_H__
-#define __DALI_TOOLKIT_BITMAP_LOADER_H__
+#ifndef DALI_TOOLKIT_BITMAP_LOADER_H
+#define DALI_TOOLKIT_BITMAP_LOADER_H
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * limitations under the License.
  */
 
-#define __DALI_BITMAP_LOADER_H__
+#define DALI_BITMAP_LOADER_H
 
 #include <string>
 #include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/images/pixel.h>
 #include <dali/public-api/images/image-operations.h>
+#include <dali/public-api/images/pixel.h>
+#include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/base-handle.h>
-#include <dali/devel-api/images/pixel-data.h>
 
 namespace Dali
 {
@@ -63,4 +63,4 @@ public: // Not intended for application developers
 
 } // Dali
 
-#endif /* __DALI_TOOLKIT_BITMAP_LOADER_H__ */
+#endif // DALI_TOOLKIT_BITMAP_LOADER_H
index 63c89d3..33a8744 100644 (file)
@@ -152,7 +152,7 @@ public:
   void GetFontMetrics( FontId fontId, FontMetrics& metrics ){}
   GlyphIndex GetGlyphIndex( FontId fontId, Character charcode ){return 0;}
   bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal ){return true;}
-  BufferImage CreateBitmap( FontId fontId, GlyphIndex glyphIndex ){return BufferImage();}
+  PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex ){return PixelData();}
   void CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob,
                          unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
   {
@@ -462,7 +462,7 @@ bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType typ
   return GetImplementation(*this).GetGlyphMetrics( array, size, horizontal );
 }
 
-BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
 {
   return GetImplementation(*this).CreateBitmap( fontId, glyphIndex );
 }
index 238f67f..6cdb503 100644 (file)
@@ -1282,6 +1282,16 @@ int UtcDaliAccessibilityManagerActionActivateSignalP(void)
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
+  Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
+  button.SetSize(480, 800);
+  Stage::GetCurrent().Add(button);
+  manager.SetFocusOrder( button, 1 );
+  manager.SetCurrentFocusActor( button );
+
   manager.ActionActivateSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
 
   Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
@@ -1530,11 +1540,11 @@ int UtcDaliAccessibilityManagerActionDownSignalP(void)
 
   manager.ActionDownSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
 
-  DummyControl dummyControl = DummyControl::New(true);
-  dummyControl.SetSize(480, 800);
-  manager.SetFocusOrder( dummyControl, 1 );
-  Stage::GetCurrent().Add( dummyControl );
-  manager.SetCurrentFocusActor( dummyControl );
+  Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
+  button.SetSize(480, 800);
+  Stage::GetCurrent().Add(button);
+  manager.SetFocusOrder( button, 1 );
+  manager.SetCurrentFocusActor( button );
 
   accessibilityAdaptor.HandleActionDownEvent();
 
@@ -2054,13 +2064,19 @@ int UtcDaliAccessibilityManagerActionZoomSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  AccessibilityManager manager = AccessibilityManager::Get();
+  DALI_TEST_CHECK( manager );
+
+  Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
+  button.SetSize(480, 800);
+  Stage::GetCurrent().Add(button);
+  manager.SetFocusOrder( button, 1 );
+  manager.SetCurrentFocusActor( button );
+
   Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
   Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
   accAdaptor.HandleActionEnableEvent();
 
-  AccessibilityManager manager = AccessibilityManager::Get();
-  DALI_TEST_CHECK( manager );
-
   manager.ActionZoomSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
 
   Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
index f17e30e..4c711f3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,7 +23,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 
 #include <dali.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
 
index ebfd376..2991aae 100644 (file)
 using namespace Dali;
 using namespace Toolkit;
 
+namespace BuilderControlProperty
+{
+
+enum
+{
+  INTEGER_PROPERTY = Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
+  MATRIX3_PROPERTY,
+  MATRIX_PROPERTY,
+  NONE_PROPERTY
+};
+
+namespace
+{
+
+BaseHandle Create()
+{
+  return Toolkit::Control::New();
+}
+
+int gSetPropertyCalledCount = 0;
+
+void SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
+{
+  ++gSetPropertyCalledCount;
+}
+
+Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex )
+{
+  return Property::Value();
+}
+
+} // unnamed namespace
+
+// Properties
+Dali::TypeRegistration typeRegistration( "BuilderControl", typeid( Toolkit::Control ), Create );
+
+Dali::PropertyRegistration propertyInteger( typeRegistration, "integerProperty", INTEGER_PROPERTY, Property::INTEGER, &SetProperty, &GetProperty );
+Dali::PropertyRegistration propertyMatrix3( typeRegistration, "matrix3Property", MATRIX3_PROPERTY, Property::MATRIX3, &SetProperty, &GetProperty );
+Dali::PropertyRegistration propertyMatrix(  typeRegistration, "matrixProperty",  MATRIX_PROPERTY,  Property::MATRIX,  &SetProperty, &GetProperty );
+Dali::PropertyRegistration propertyNone(    typeRegistration, "noneProperty",    NONE_PROPERTY,    Property::NONE,    &SetProperty, &GetProperty );
+
+}
+
 namespace
 {
 
@@ -78,12 +121,15 @@ int UtcDaliBuilderQuitSignal(void)
       "{"
          "\"stage\":"
          "[{"
-           "\"type\": \"Actor\","
+           "\"type\": \"Layer\","
            "\"size\": [100,100,1],"
            "\"parentOrigin\": \"TOP_LEFT\","
            "\"anchorPoint\": \"TOP_LEFT\","
+           "\"maximumSize\": [100,100],"
+           "\"orientation\": [10,10,10,10],"
+           "\"clippingBox\": [10,10,10,10],"
            "\"signals\": [{"
-             "\"name\": \"touched\","
+             "\"name\": \"touch\","
              "\"action\": \"quit\""
            "}]"
          "}]"
@@ -243,7 +289,7 @@ int UtcDaliBuilderAnimationP(void)
         "    \"size\": [200, 200, 1],"
         "    \"orientation\": [0, 0, 30],"
         "    \"signals\": [{"
-        "      \"name\": \"touched\","
+        "      \"name\": \"touch\","
         "      \"action\": \"play\","
         "      \"animation\": \"animate\""
         "    }]"
@@ -367,7 +413,7 @@ int UtcDaliBuilderAnimationN(void)
         "    \"size\": [200, 200, 1],"
         "    \"orientation\": [0, 0, 30],"
         "    \"signals\": [{"
-        "      \"name\": \"touched\","
+        "      \"name\": \"touch\","
         "      \"action\": \"play\","
         "      \"animation\": \"animate\""
         "    }]"
@@ -440,7 +486,7 @@ int UtcDaliBuilderConstantsP(void)
       "  \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
       "  \"sizeWidth\": \"{WIDTH}\","
       "  \"signals\": [{"
-      "    \"name\": \"touched\","
+      "    \"name\": \"touch\","
       "    \"action\": \"quit\""
       "  }]"
       "}]"
@@ -493,26 +539,41 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
       "    \"color\": [1,0,0,1],\n"
       "    \"actors\": {\n"
       "      \"childImage\": {\n"
-      "        \"color\": [0,1,0,1]\n"
+      "        \"color\": \"34\"\n"
       "      }\n"
       "    }\n"
       "  }\n"
       "},\n"
       "\"templates\":\n"
       "{\n"
+      "  \"imageViewTemplate\": { \n"
+      "    \"type\": \"ImageView\",\n"
+      "    \"styles\": [\"imageStyle\"]\n"
+      "  },\n"
       "  \"imageTree\": { \n"
       "    \"type\": \"ImageView\",\n"
       "    \"styles\": [\"imageStyle\"],\n"
       "    \"name\": \"image\",\n"
       "    \"size\": \"{SIZE}\",\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"quit\"\n"
       "    }],\n"
       "    \"actors\": [\n"
       "      {\n"
       "        \"type\":\"ImageView\",\n"
-      "        \"name\":\"childImage\" \n"
+      "        \"name\":\"childImage\", \n"
+      "        \"color\": \n"
+      "          {\n"
+      "            \"r\": 10,\n"
+      "            \"g\": 10,\n"
+      "            \"b\": 10,\n"
+      "            \"a\": 100\n"
+      "          }\n"
+      "      },\n"
+      "      {\n"
+      "        \"type\":\"imageViewTemplate\",\n"
+      "        \"name\":\"childImage2\"\n"
       "      }\n"
       "    ]\n"
       "  }\n"
@@ -530,7 +591,7 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
     " \"color\": [1,0,0,1],\n"
     " \"actors\": {\n"
     "   \"childImage\": {\n"
-    "     \"color\": [0,1,0,1]\n"
+    "     \"color\": \"#344353\"\n"
     "   }\n"
     " }\n"
     "}\n"
@@ -543,7 +604,7 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
     "  \"name\": \"image\",\n"
     "  \"size\": \"{SIZE}\",\n"
     "  \"signals\": [{\n"
-    "    \"name\": \"touched\",\n"
+    "    \"name\": \"touch\",\n"
     "    \"action\": \"quit\"\n"
     "  }],\n"
     "  \"actors\": [\n"
@@ -598,14 +659,14 @@ int UtcDaliBuilderRenderTasksP(void)
       "[\n"
       "  { \n"
       "    \"type\": \"CameraActor\",\n"
-      "    \"name\": \"image\"\n"
+      "    \"name\": \"camera\"\n"
       "  }, \n"
       "  { \n"
       "    \"type\": \"ImageView\",\n"
       "    \"name\": \"image\",\n"
       "    \"size\": [100,100,1],\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"quit\"\n"
       "    }],\n"
       "    \"actors\": [\n"
@@ -652,7 +713,7 @@ int UtcDaliBuilderChildActionP(void)
       "      \"name\": \"subActor\"\n"
       "    }],\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"hide\",\n"
       "      \"actor\": \"actor\",\n"
       "      \"childActor\": \"subActor\"\n"
@@ -708,7 +769,7 @@ int UtcDaliBuilderSetPropertyActionP(void)
       "      \"name\": \"subActor\"\n"
       "    }],\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"set\",\n"
       "      \"actor\": \"subActor\",\n"
       "      \"property\": \"visible\",\n"
@@ -765,7 +826,7 @@ int UtcDaliBuilderGenericActionP(void)
       "      \"name\": \"subActor\"\n"
       "    }],\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"hide\"\n"
       "    }]\n"
       "  }]\n"
@@ -819,13 +880,39 @@ int UtcDaliBuilderPropertyNotificationP(void)
       "      \"name\": \"subActor\"\n"
       "    }],\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"hide\"\n"
       "    }],\n"
       "    \"notifications\": [{\n"
       "      \"property\": \"visible\",\n"
       "      \"condition\": \"False\",\n"
       "      \"action\": \"show\"\n"
+      "    },\n"
+      "    {\n"
+      "      \"property\": \"positionX\",\n"
+      "      \"condition\": \"LessThan\",\n"
+      "      \"arg0\": 0.0,\n"
+      "      \"action\": \"show\"\n"
+      "    },\n"
+      "    {\n"
+      "      \"property\": \"positionY\",\n"
+      "      \"condition\": \"GreaterThan\",\n"
+      "      \"arg0\": 200.0,\n"
+      "      \"action\": \"show\"\n"
+      "    },\n"
+      "    {\n"
+      "      \"property\": \"positionZ\",\n"
+      "      \"condition\": \"Inside\",\n"
+      "      \"arg0\": 0.0,\n"
+      "      \"arg1\": 10.0,\n"
+      "      \"action\": \"show\"\n"
+      "    },\n"
+      "    {\n"
+      "      \"property\": \"positionZ\",\n"
+      "      \"condition\": \"Outside\",\n"
+      "      \"arg0\": 40.0,\n"
+      "      \"arg1\": 50.0,\n"
+      "      \"action\": \"show\"\n"
       "    }]\n"
       "  }]\n"
       "}\n"
@@ -863,6 +950,42 @@ int UtcDaliBuilderPropertyNotificationP(void)
   END_TEST;
 }
 
+int UtcDaliBuilderPropertyNotificationN(void)
+{
+  ToolkitTestApplication application;
+
+  // JSON with a quit event when the actor is touched
+  std::string json(
+      "{\n"
+      "  \"stage\":\n"
+      "  [{\n"
+      "    \"type\": \"Actor\",\n"
+      "    \"notifications\": [{\n"
+      "      \"property\": \"visible\",\n"
+      "      \"condition\": \"ErrorCondition\",\n"
+      "      \"action\": \"show\"\n"
+      "    }]\n"
+      "  }]\n"
+      "}\n"
+  );
+
+  try
+  {
+    Builder builder = Builder::New();
+    builder.LoadFromString( json );
+    builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+
+
 int UtcDaliBuilderCustomPropertyP(void)
 {
   ToolkitTestApplication application;
@@ -877,7 +1000,7 @@ int UtcDaliBuilderCustomPropertyP(void)
       "    \"name\": \"image\",\n"
       "    \"size\": [100,100,1],\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"quit\"\n"
       "    }],\n"
       "    \"properties\": {\n"
@@ -1010,7 +1133,7 @@ int UtcDaliBuilderLoadFromStringN(void)
            "\"parentOrigin\": \"TOP_LEFT\","
            "\"anchorPoint\": \"TOP_LEFT\","
            "\"signals\": [{"
-             "\"name\": \"touched\","
+             "\"name\": \"touch\","
              "\"action\": \"quit\""
            "}]"
          "}]"
@@ -1057,7 +1180,7 @@ int UtcDaliBuilderAddActorsP(void)
       "      \"visible\": false\n"
       "    }],\n"
       "    \"signals\": [{\n"
-      "      \"name\": \"touched\",\n"
+      "      \"name\": \"touch\",\n"
       "      \"action\": \"hide\",\n"
       "      \"actor\": \"actor\",\n"
       "      \"childActor\": \"subActor\"\n"
@@ -1277,6 +1400,36 @@ int UtcDaliBuilderPathConstraintsP(void)
     "              \"range\": [-300,300]\n"
     "            }\n"
     "          ]\n"
+    "        },\n"
+    "        {\n"
+    "          \"name\": \"offStage\",\n"
+    "          \"action\": \"removeConstraints\",\n"
+    "          \"constrainer\": \"constrainer0\",\n"
+    "          \"properties\":\n"
+    "          [\n"
+    "            {\n"
+    "              \"source\": \"Image1\",\n"
+    "              \"sourceProperty\": \"positionX\",\n"
+    "              \"target\": \"Image1\",\n"
+    "              \"targetProperty\": \"colorRed\",\n"
+    "              \"range\": [-300,300]\n"
+    "            }\n"
+    "          ]\n"
+    "        },\n"
+    "        {\n"
+    "          \"name\": \"offStage\",\n"
+    "          \"action\": \"removeConstraints\",\n"
+    "          \"constrainer\": \"constrainer1\",\n"
+    "          \"properties\":\n"
+    "          [\n"
+    "            {\n"
+    "              \"source\": \"Image1\",\n"
+    "              \"sourceProperty\": \"positionX\",\n"
+    "              \"target\": \"Image1\",\n"
+    "              \"targetProperty\": \"colorBlue\",\n"
+    "              \"range\": [-300,300]\n"
+    "            }\n"
+    "          ]\n"
     "        }\n"
     "      ]\n"
     "    }\n"
@@ -1393,6 +1546,18 @@ int UtcDaliBuilderPathConstraintsP(void)
   Dali::LinearConstrainer constrainer1_2 = builder.GetLinearConstrainer( "constrainer1" );
   DALI_TEST_CHECK( constrainer1 == constrainer1_2 );
 
+  // For coverage
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+  builder.AddActors( actor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  actor.GetChildAt( 0 ).Unparent();
+
   END_TEST;
 }
 
@@ -1586,3 +1751,112 @@ int UtcDaliBuilderMappingCycleCheck(void)
 
   END_TEST;
 }
+
+int UtcDaliBuilderTypeCasts(void)
+{
+  ToolkitTestApplication application;
+
+  std::string json(
+    "{"
+       "\"stage\":"
+       "[{"
+         "\"type\": \"Layer\","
+         "\"maximumSize\": { \"typeCast\":\"vector2\", \"value\":[100,15] },"
+         "\"position\":    { \"typeCast\":\"vector3\", \"value\":[100,10,1] },"
+         "\"color\":       { \"typeCast\":\"vector4\", \"value\":[0.5,0.5,0.5,1] },"
+         "\"sensitive\":   { \"typeCast\":\"boolean\", \"value\":false },"
+         "\"orientation\": { \"typeCast\":\"rotation\", \"value\":[10,10,10,10] },"
+         "\"colorMode\":   { \"typeCast\":\"string\", \"value\":\"USE_OWN_MULTIPLY_PARENT_COLOR\" },"
+         "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] }"
+      "}]"
+    "}"
+  );
+
+  Actor rootActor = Actor::New();
+  Stage::GetCurrent().Add( rootActor );
+
+  Builder builder = Builder::New();
+  builder.LoadFromString( json );
+  builder.AddActors( rootActor );
+
+  application.SendNotification();
+  application.Render();
+
+  Actor createdActor = rootActor.GetChildAt( 0 );
+  DALI_TEST_EQUALS( createdActor.GetMaximumSize(), Vector2(100.0f,15.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetCurrentPosition(), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetCurrentColor(), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.IsSensitive(), false, TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliBuilderBuilderControl(void)
+{
+  ToolkitTestApplication application;
+
+  std::string json(
+    "{"
+       "\"stage\":"
+       "[{"
+         "\"type\": \"BuilderControl\","
+         "\"integerProperty\": 10,"
+         "\"matrix3Property\": [ 1,2,3,4,5,6,7,8,9 ],"
+         "\"matrixProperty\":  [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 ],"
+         "\"noneProperty\": 10"
+      "}]"
+    "}"
+  );
+
+  Actor rootActor = Actor::New();
+  Stage::GetCurrent().Add( rootActor );
+
+  Builder builder = Builder::New();
+  builder.LoadFromString( json );
+  builder.AddActors( rootActor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( BuilderControlProperty::gSetPropertyCalledCount, 4, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliBuilderActionsWithParams(void)
+{
+  ToolkitTestApplication application;
+
+  // JSON with a quit event when the actor is touched
+  std::string json(
+      "{\n"
+      "\"stage\":\n"
+      "[\n"
+      "  { \n"
+      "    \"type\": \"ImageView\",\n"
+      "    \"name\": \"image\",\n"
+      "    \"size\": [100,100,1],\n"
+      "    \"signals\": [{\n"
+      "      \"name\": \"touch\",\n"
+      "      \"action\": \"show\",\n"
+      "      \"parameters\": {\n"
+      "        \"property1\" : 10,\n"
+      "        \"property2\" : [1,2],\n"
+      "        \"property3\" : [1,2,3],\n"
+      "        \"property4\" : [1,2,3,4]\n"
+      "      }\n"
+      "    }]\n"
+      "  }\n"
+      "]\n"
+      "}\n"
+  );
+
+  Builder builder = Builder::New();
+  builder.LoadFromString( json );
+  builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+
+  DALI_TEST_CHECK( true ); // For Coverage
+
+  END_TEST;
+}
index 80a8f70..5aff146 100644 (file)
@@ -64,28 +64,6 @@ struct CallbackFunctor
   bool* mCallbackFlag;
 };
 
-
-Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
-{
-  BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
-
-  // Create the image
-  PixelBuffer* pixbuf = imageData.GetBuffer();
-  unsigned int size = width * height;
-
-  for( size_t i = 0; i < size; i++ )
-    {
-      pixbuf[i*4+0] = 0xFF * color.r;
-      pixbuf[i*4+1] = 0xFF * color.g;
-      pixbuf[i*4+2] = 0xFF * color.b;
-      pixbuf[i*4+3] = 0xFF * color.a;
-    }
-
-  imageData.Update();
-
-  return imageData;
-}
-
 Dali::Integration::Point GetPointDownInside()
 {
   Dali::Integration::Point point;
@@ -707,3 +685,290 @@ int UtcDaliButtonSize(void)
   DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
   END_TEST;
 }
+
+int UtcDaliButtonSetSelectedBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetSelectedBackgroundImage( "TestImage.jpg");
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetSelectedBackgroundImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetSelectedBackgroundImage( "TestImage.jpg");
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetDisabledImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetDisabledImage( "TestImage.jpg");
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetDisabledImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetDisabledImage( "TestImage.jpg");
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetDisabledSelectedImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetDisabledSelectedImage( "TestImage.jpg");
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetDisabledSelectedImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetDisabledSelectedImage( "TestImage.jpg");
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetLabelP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetLabel( TextLabel::New("Hello") );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetLabelN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetLabel( TextLabel::New("Hello") );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetButtonImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetButtonImage( CreateBufferImage( 10, 10, Color::WHITE ) );
+    DALI_TEST_CHECK( ImageView::DownCast( button.GetButtonImage() ) );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetButtonImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetButtonImage( CreateBufferImage( 10, 10, Color::WHITE ) );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetSelectedImageWithImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetSelectedImage( CreateBufferImage( 10, 10, Color::WHITE ) );
+    DALI_TEST_CHECK( ImageView::DownCast( button.GetSelectedImage() ) );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetSelectedImageWithImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetSelectedImage( CreateBufferImage( 10, 10, Color::WHITE ) );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetSelectedColorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliButtonSetSelectedColorP");
+
+  PushButton pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
+
+  application.SendNotification();
+  application.Render();
+
+  const Vector4 SET_COLOR = Color::BLUE;
+
+  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+  pushButton.SetProperty( Button::Property::SELECTED_COLOR, SET_COLOR );
+
+  application.SendNotification();
+  application.Render();
+
+  Vector4 color = pushButton.GetProperty<Vector4>( Button::Property::SELECTED_COLOR );
+
+  DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetUnSelectedColorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliButtonSetUnSelectedColorP");
+
+  PushButton pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
+
+  application.SendNotification();
+  application.Render();
+
+  const Vector4 SET_COLOR = Color::BLUE;
+
+  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+  pushButton.SetProperty( Button::Property::UNSELECTED_COLOR, SET_COLOR );
+
+  application.SendNotification();
+  application.Render();
+
+  Vector4 color = pushButton.GetProperty<Vector4>( Button::Property::UNSELECTED_COLOR );
+
+  DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION );
+
+  END_TEST;
+}
+
index 43caadd..3518778 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -17,9 +17,9 @@
 #include <iostream>
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/texture-set.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/shader.h>
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 
 using namespace Dali;
index e759409..5efd46d 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
+#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <dali/public-api/images/buffer-image.h>
 
 
@@ -77,14 +78,14 @@ void Wait(ToolkitTestApplication& application, float durationToPass)
 class TransitionCompletedCallback : public Dali::ConnectionTracker
 {
 public:
-  TransitionCompletedCallback( bool& signalReceived, CubeTransitionEffect& effect, Image& image )
+  TransitionCompletedCallback( bool& signalReceived, CubeTransitionEffect& effect, Texture& image )
   : mSignalVerified( signalReceived ),
     mCurrentEffect( effect ),
     mActorTransitTo( image )
   {
   }
 
-  void Callback( CubeTransitionEffect effect, Image image )
+  void Callback( CubeTransitionEffect effect, Texture image )
   {
     tet_infoline( "Verifying TransitionCompletedSignal" );
 
@@ -101,7 +102,7 @@ public:
 
   bool&                  mSignalVerified;
   CubeTransitionEffect&  mCurrentEffect;
-  Image&                 mActorTransitTo;
+  Texture&               mActorTransitTo;
 };
 
 } // namespace
@@ -257,13 +258,13 @@ int UtcDaliCubeTransitionEffectGetRoot(void)
 
   unsigned int totalNum = NUM_ROWS*NUM_COLUMNS;
 
-  Image image = BufferImage::New( 40, 40 ) ;
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
 
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
   Stage::GetCurrent().Add( waveEffect );
-  waveEffect.SetCurrentImage( image );
-  waveEffect.SetTargetImage( image );
+  waveEffect.SetCurrentTexture( texture );
+  waveEffect.SetTargetTexture( texture );
 
   application.SendNotification();
   application.Render();
@@ -289,7 +290,7 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void)
   tet_infoline(" UtcDaliCubeTransitionEffectIsTransiting ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image image = BufferImage::New( 40, 40 ) ;
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
 
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
@@ -299,8 +300,8 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void)
   waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
   DALI_TEST_CHECK( !waveEffect.IsTransitioning() );
 
-  waveEffect.SetCurrentImage( image );
-  waveEffect.SetTargetImage( image );
+  waveEffect.SetCurrentTexture( texture );
+  waveEffect.SetTargetTexture( texture );
   //transition is started
   waveEffect.StartTransition();
   DALI_TEST_CHECK( waveEffect.IsTransitioning() );
@@ -316,8 +317,8 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void)
   crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
   DALI_TEST_CHECK( !crossEffect.IsTransitioning() );
 
-  crossEffect.SetCurrentImage( image );
-  crossEffect.SetTargetImage( image );
+  crossEffect.SetCurrentTexture( texture );
+  crossEffect.SetTargetTexture( texture );
   //transition is started
   crossEffect.StartTransition(false);
   DALI_TEST_CHECK( crossEffect.IsTransitioning() );
@@ -332,8 +333,8 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void)
   foldEffect.SetTransitionDuration( TRANSITION_DURATION );
   DALI_TEST_CHECK( !foldEffect.IsTransitioning() );
 
-  foldEffect.SetCurrentImage( image );
-  foldEffect.SetTargetImage( image );
+  foldEffect.SetCurrentTexture( texture );
+  foldEffect.SetTargetTexture( texture );
   //transition is started
   foldEffect.StartTransition(true);
   DALI_TEST_CHECK(foldEffect.IsTransitioning() );
@@ -345,17 +346,17 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void)
 }
 
 //Test common codes in base class
-int UtcDaliCubeTransitionEffectSetCurrentImage(void)
+int UtcDaliCubeTransitionEffectSetCurrentTexture(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliCubeTransitionEffectSetCurrentImage ");
+  tet_infoline(" UtcDaliCubeTransitionEffectSetCurrentTexture ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image image = BufferImage::New( 40, 40 ) ;
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
 
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
-  waveEffect.SetCurrentImage( image );
+  waveEffect.SetCurrentTexture( texture );
 
   Stage::GetCurrent().Add( waveEffect );
 
@@ -384,20 +385,19 @@ int UtcDaliCubeTransitionEffectSetCurrentImage(void)
 }
 
 //Test common codes in base class
-int UtcDaliCubeTransitionEffectSetTargetImage(void)
+int UtcDaliCubeTransitionEffectSetTargetTexture(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliCubeTransitionEffectSetTargetImage ");
+  tet_infoline(" UtcDaliCubeTransitionEffectSetTargetTexture ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image image = BufferImage::New( 30, 30 );
-
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
   Stage::GetCurrent().Add( waveEffect );
 
-  waveEffect.SetCurrentImage( image );
-  waveEffect.SetTargetImage( image );
+  waveEffect.SetCurrentTexture( texture );
+  waveEffect.SetTargetTexture( texture );
 
   Stage::GetCurrent().Add( waveEffect );
 
@@ -430,13 +430,18 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void)
   tet_infoline(" UtcDaliCubeTransitionWaveEffectStartTransition ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image image = ResourceImage::New( "Image.jpg" );
+
+  BitmapLoader loader = BitmapLoader::New( "Image.jpg" );
+  loader.Load();
+  PixelData pixelData = loader.GetPixelData();
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+  texture.Upload( pixelData );
 
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
   waveEffect.SetTransitionDuration( TRANSITION_DURATION );
   waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
-  waveEffect.SetCurrentImage( image );
+  waveEffect.SetCurrentTexture( texture );
 
   Stage::GetCurrent().Add( waveEffect );
 
@@ -448,27 +453,27 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void)
   Actor cube = waveEffect.GetChildAt(0).GetChildAt(0);
 
   //check the cube rotation value and color values just before the end of different transitions
-  waveEffect.SetTargetImage( image );
+  waveEffect.SetTargetTexture( texture );
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
-  waveEffect.SetTargetImage( image );
+  waveEffect.SetTargetTexture( texture );
   waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
-  waveEffect.SetTargetImage( image );
+  waveEffect.SetTargetTexture( texture );
   waveEffect.StartTransition(false);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
-  waveEffect.SetTargetImage( image );
+  waveEffect.SetTargetTexture( texture );
   waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
@@ -483,14 +488,19 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
   tet_infoline(" UtcDaliCubeTransitionCrossEffectStartTransition ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image image = ResourceImage::New( "Image.jpg" );
+
+  BitmapLoader loader = BitmapLoader::New( "Image.jpg" );
+  loader.Load();
+  PixelData pixelData = loader.GetPixelData();
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+  texture.Upload( pixelData );
 
   CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
   crossEffect.SetSize( VIEW_AREA_SIZE );
   crossEffect.SetTransitionDuration( TRANSITION_DURATION );
   crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
-  crossEffect.SetCurrentImage( image );
-  crossEffect.SetTargetImage( image );
+  crossEffect.SetCurrentTexture( texture );
+  crossEffect.SetTargetTexture( texture );
 
   Stage::GetCurrent().Add( crossEffect );
 
@@ -510,7 +520,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
 
-  crossEffect.SetTargetImage( image );
+  crossEffect.SetTargetTexture( texture );
   crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION );
@@ -519,7 +529,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
 
-  crossEffect.SetTargetImage( image );
+  crossEffect.SetTargetTexture( texture );
   crossEffect.StartTransition(false);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
@@ -527,7 +537,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
-  crossEffect.SetTargetImage( image );
+  crossEffect.SetTargetTexture( texture );
   crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION );
@@ -543,13 +553,12 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void)
   tet_infoline(" UtcDaliCubeTransitionFoldEffectStartTransition ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image image = BufferImage::New( 30, 30 );
-
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
   CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
   foldEffect.SetSize( VIEW_AREA_SIZE );
   foldEffect.SetTransitionDuration( TRANSITION_DURATION );
-  foldEffect.SetCurrentImage( image );
-  foldEffect.SetTargetImage( image );
+  foldEffect.SetCurrentTexture( texture );
+  foldEffect.SetTargetTexture( texture );
 
   Stage::GetCurrent().Add( foldEffect );
 
@@ -568,7 +577,7 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
-  foldEffect.SetTargetImage( image );
+  foldEffect.SetTargetTexture( texture );
   foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
@@ -577,7 +586,7 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
 
-  foldEffect.SetTargetImage( image );
+  foldEffect.SetTargetTexture( texture );
   foldEffect.StartTransition(false);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
@@ -585,7 +594,7 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(),FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
 
-  foldEffect.SetTargetImage( image );
+  foldEffect.SetTargetTexture( texture );
   foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_BEFORE_END_DURATION );
   DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  Vector3::YAXIS), EPISILON, TEST_LOCATION  );
@@ -601,9 +610,9 @@ int UtcDaliCubeTransitionEffectSignalTransitionCompleted(void)
   tet_infoline(" UtcDaliCubeTransitionEffectSignalTransitionCompleted ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image firstImage = BufferImage::New( 30, 30 );
-  Image secondImage = BufferImage::New( 20, 20 );
-  Image thirdImage = BufferImage::New( 40, 40 );
+  Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
+  Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
+  Texture thirdTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
 
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
@@ -624,61 +633,61 @@ int UtcDaliCubeTransitionEffectSignalTransitionCompleted(void)
 
   bool signalVerified = false;
   CubeTransitionEffect currentEffect;
-  Image actorTransitTo;
+  Texture actorTransitTo;
   TransitionCompletedCallback callback(signalVerified, currentEffect, actorTransitTo);
   waveEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
   crossEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
   foldEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
 
-  //check that the wave effect is used to transit to secondImage
+  //check that the wave effect is used to transit to secondTexture
   currentEffect = waveEffect;
-  actorTransitTo = secondImage;
-  waveEffect.SetCurrentImage( firstImage );
-  waveEffect.SetTargetImage( secondImage );
+  actorTransitTo = secondTexture;
+  waveEffect.SetCurrentTexture( firstTexture );
+  waveEffect.SetTargetTexture( secondTexture );
   waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_DURATION );
   DALI_TEST_CHECK(callback.mSignalVerified);
   callback.Reset();
 
-  //check that the wave effect is used to transit to thirdImage
-  actorTransitTo = thirdImage;
-  waveEffect.SetTargetImage( thirdImage );
+  //check that the wave effect is used to transit to thirdTexture
+  actorTransitTo = thirdTexture;
+  waveEffect.SetTargetTexture( thirdTexture );
   waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_DURATION );
   DALI_TEST_CHECK(callback.mSignalVerified);
   callback.Reset();
 
-  //check that the cross effect is used to transit to secondImage
+  //check that the cross effect is used to transit to secondTexture
   currentEffect = crossEffect;
-  actorTransitTo = secondImage;
-  crossEffect.SetCurrentImage( thirdImage );
-  crossEffect.SetTargetImage( secondImage );
+  actorTransitTo = secondTexture;
+  crossEffect.SetCurrentTexture( thirdTexture );
+  crossEffect.SetTargetTexture( secondTexture );
   crossEffect.StartTransition(true);
   Wait( application, TRANSITION_DURATION );
   DALI_TEST_CHECK(callback.mSignalVerified);
   callback.Reset();
 
-  //check that the cross effect is used to transit to firstImage
-  actorTransitTo = firstImage;
-  crossEffect.SetTargetImage( firstImage );
+  //check that the cross effect is used to transit to firstTexture
+  actorTransitTo = firstTexture;
+  crossEffect.SetTargetTexture( firstTexture );
   crossEffect.StartTransition(false);
   Wait( application, TRANSITION_DURATION );
   DALI_TEST_CHECK(callback.mSignalVerified);
   callback.Reset();
 
-  //check that the fold effect is used to transit to secondImage
+  //check that the fold effect is used to transit to secondTexture
   currentEffect = foldEffect;
-  actorTransitTo = secondImage;
-  foldEffect.SetCurrentImage( firstImage );
-  foldEffect.SetTargetImage( secondImage );
+  actorTransitTo = secondTexture;
+  foldEffect.SetCurrentTexture( firstTexture );
+  foldEffect.SetTargetTexture( secondTexture );
   foldEffect.StartTransition();
   Wait( application, TRANSITION_DURATION );
   DALI_TEST_CHECK( callback.mSignalVerified );
   callback.Reset();
 
-  //check that the fold effect is used to transit to thirdImage
-  actorTransitTo = thirdImage;
-  foldEffect.SetTargetImage( thirdImage );
+  //check that the fold effect is used to transit to thirdTexture
+  actorTransitTo = thirdTexture;
+  foldEffect.SetTargetTexture( thirdTexture );
   foldEffect.StartTransition( false );
   Wait( application, TRANSITION_DURATION );
   DALI_TEST_CHECK( callback.mSignalVerified );
@@ -691,8 +700,8 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void)
   tet_infoline(" UtcDaliCubeTransitionEffectPauseResumeTransition ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image firstImage = BufferImage::New( 30, 30 );
-  Image secondImage = BufferImage::New( 20, 20 );
+  Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
+  Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
 
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
@@ -713,16 +722,16 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void)
 
   bool signalVerified = false;
   CubeTransitionEffect currentEffect;
-  Image actorTransitTo;
+  Texture actorTransitTo;
   TransitionCompletedCallback callback(signalVerified, currentEffect, actorTransitTo);
   waveEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
   crossEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
   foldEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
 
   currentEffect = waveEffect;
-  actorTransitTo = secondImage;
-  waveEffect.SetCurrentImage( firstImage );
-  waveEffect.SetTargetImage( secondImage );
+  actorTransitTo = secondTexture;
+  waveEffect.SetCurrentTexture( firstTexture );
+  waveEffect.SetTargetTexture( secondTexture );
   // start transition; transit for 0.5*duration; pause for 0.5*duration;
   // resume for 0.25*duration; pause for 0.25*duration; resume for another 0.25*duration;
   // only until now the transition finished signal can be received
@@ -744,9 +753,9 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void)
   callback.Reset();
 
   currentEffect = crossEffect;
-  actorTransitTo = firstImage;
-  crossEffect.SetCurrentImage( secondImage );
-  crossEffect.SetTargetImage( firstImage );
+  actorTransitTo = firstTexture;
+  crossEffect.SetCurrentTexture( secondTexture );
+  crossEffect.SetTargetTexture( firstTexture );
   // start transition; transit for 0.25*duration; pause for 0.2*duration;
   // resume for 0.5*duration; pause for 0.2*duration; resume for another 0.25*duration;
   // only until now the transition finished signal can be received
@@ -768,9 +777,9 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void)
   callback.Reset();
 
   currentEffect = foldEffect;
-  actorTransitTo = secondImage;
-  foldEffect.SetCurrentImage( firstImage );
-  foldEffect.SetTargetImage( secondImage );
+  actorTransitTo = secondTexture;
+  foldEffect.SetCurrentTexture( firstTexture );
+  foldEffect.SetTargetTexture( secondTexture );
   // start transition; transit for 0.5*duration; pause for 0.5*duration;
   // resume for 0.25*duration; pause for 0.25*duration; resume for another 0.25*duration;
   // only until now the transition finished signal can be received
@@ -798,15 +807,15 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   tet_infoline(" UtcDaliCubeTransitionWaveEffectStopTransition ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image firstImage = BufferImage::New( 30, 30 );
-  Image secondImage = BufferImage::New( 20, 20 );
+  Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
+  Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
 
   CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
   waveEffect.SetSize( VIEW_AREA_SIZE );
   waveEffect.SetTransitionDuration( TRANSITION_DURATION );
   waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
-  waveEffect.SetCurrentImage( firstImage );
-  waveEffect.SetTargetImage( secondImage );
+  waveEffect.SetCurrentTexture( firstTexture );
+  waveEffect.SetTargetTexture( secondTexture );
 
   Stage::GetCurrent().Add( waveEffect );
 
@@ -826,7 +835,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  waveEffect.SetTargetImage( firstImage );
+  waveEffect.SetTargetTexture( firstTexture );
   waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_DURATION*0.4f );
   waveEffect.StopTransition();
@@ -836,7 +845,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  waveEffect.SetTargetImage( secondImage );
+  waveEffect.SetTargetTexture( secondTexture );
   waveEffect.StartTransition(false);
   Wait( application, TRANSITION_DURATION*0.6f );
   waveEffect.StopTransition();
@@ -846,7 +855,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  waveEffect.SetTargetImage( firstImage );
+  waveEffect.SetTargetTexture( firstTexture );
   waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_DURATION*0.8f );
   waveEffect.StopTransition();
@@ -864,15 +873,15 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   tet_infoline(" UtcDaliCubeTransitionCrossEffectStopTransition ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image firstImage = BufferImage::New( 30, 30 );
-  Image secondImage = BufferImage::New( 20, 20 );
+  Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
+  Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
 
   CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
   crossEffect.SetSize( VIEW_AREA_SIZE );
   crossEffect.SetTransitionDuration( TRANSITION_DURATION );
   crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
-  crossEffect.SetCurrentImage( firstImage );
-  crossEffect.SetTargetImage( secondImage );
+  crossEffect.SetCurrentTexture( firstTexture );
+  crossEffect.SetTargetTexture( secondTexture );
 
   Stage::GetCurrent().Add( crossEffect );
 
@@ -894,7 +903,7 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  crossEffect.SetTargetImage( firstImage );
+  crossEffect.SetTargetTexture( firstTexture );
   crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_DURATION*0.4f );
   crossEffect.StopTransition();
@@ -905,7 +914,7 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  crossEffect.SetTargetImage( secondImage );
+  crossEffect.SetTargetTexture( secondTexture );
   crossEffect.StartTransition(false);
   Wait( application, TRANSITION_DURATION*0.6f );
   crossEffect.StopTransition();
@@ -916,7 +925,7 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  crossEffect.SetTargetImage( firstImage );
+  crossEffect.SetTargetTexture( firstTexture );
   crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_DURATION*0.8f );
   crossEffect.StopTransition();
@@ -935,14 +944,14 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   tet_infoline(" UtcDaliCubeTransitionFoldEffectStopTransition ");
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
-  Image firstImage = BufferImage::New( 30, 30 );
-  Image secondImage = BufferImage::New( 20, 20 );
+  Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
+  Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
 
   CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
   foldEffect.SetSize( VIEW_AREA_SIZE );
   foldEffect.SetTransitionDuration( TRANSITION_DURATION );
-  foldEffect.SetCurrentImage( firstImage );
-  foldEffect.SetTargetImage( secondImage );
+  foldEffect.SetCurrentTexture( firstTexture );
+  foldEffect.SetTargetTexture( secondTexture );
 
   Stage::GetCurrent().Add( foldEffect );
 
@@ -965,7 +974,7 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  foldEffect.SetTargetImage( firstImage );
+  foldEffect.SetTargetTexture( firstTexture );
   foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_DURATION*0.4f );
   foldEffect.StopTransition();
@@ -976,7 +985,7 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  foldEffect.SetTargetImage( secondImage );
+  foldEffect.SetTargetTexture( secondTexture );
   foldEffect.StartTransition(false);
   Wait( application, TRANSITION_DURATION*0.6f );
   foldEffect.StopTransition();
@@ -987,7 +996,7 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
 
-  foldEffect.SetTargetImage( firstImage );
+  foldEffect.SetTargetTexture( firstTexture );
   foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_DURATION*0.8f );
   foldEffect.StopTransition();
index 52f16ed..3092aff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
  * limitations under the License.
  *
  */
+
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/geometry.h>
 
 #include <toolkit-environment-variable.h> // for setting environment variable: DALI_DEBUG_RENDERING
 
index 709282a..6348940 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,7 +23,7 @@
 
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/devel-api/scripting/scripting.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 #include <test-native-image.h>
 #include <sstream>
index b1fd832..d5c6af5 100644 (file)
 // Need to override adaptor classes for toolkit test harness, so include
 // test harness headers before dali headers.
 #include <dali-toolkit-test-suite-utils.h>
-
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/pan-gesture-event.h>
+
 
 using namespace Dali;
 using namespace Toolkit;
@@ -59,6 +61,48 @@ static void OnLayoutActivated()
   gOnLayoutActivatedCalled = true;
 }
 
+// Generate a PanGestureEvent to send to Core
+Integration::PanGestureEvent GeneratePan(
+    Gesture::State state,
+    const Vector2& previousPosition,
+    const Vector2& currentPosition,
+    unsigned long timeDelta,
+    unsigned int numberOfTouches = 1)
+{
+  Integration::PanGestureEvent pan(state);
+
+  pan.previousPosition = previousPosition;
+  pan.currentPosition = currentPosition;
+  pan.timeDelta = timeDelta;
+  pan.numberOfTouches = numberOfTouches;
+
+  return pan;
+}
+
+/**
+ * Helper to generate PanGestureEvent
+ *
+ * @param[in] application Application instance
+ * @param[in] state The Gesture State
+ * @param[in] pos The current position of touch.
+ */
+static void SendPan(ToolkitTestApplication& application, Gesture::State state, const Vector2& pos)
+{
+  static Vector2 last;
+
+  if( (state == Gesture::Started) ||
+      (state == Gesture::Possible) )
+  {
+    last.x = pos.x;
+    last.y = pos.y;
+  }
+
+  application.ProcessEvent(GeneratePan(state, last, pos, RENDER_FRAME_INTERVAL));
+
+  last.x = pos.x;
+  last.y = pos.y;
+}
+
 /*
  * Simulate time passed by.
  *
@@ -301,6 +345,7 @@ int UtcDaliItemViewDeactivateCurrentLayout(void)
 
   // Create a grid layout and add it to ItemView
   ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  gridLayout->SetOrientation(ControlOrientation::Down);
   view.AddLayout(*gridLayout);
 
   // Check there is no active layout at the moment
@@ -331,6 +376,7 @@ int UtcDaliItemViewGetItemAndGetItemId(void)
 
   // Create a grid layout and add it to ItemView
   ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  gridLayout->SetOrientation(ControlOrientation::Left);
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
@@ -355,6 +401,7 @@ int UtcDaliItemViewRemoveItem(void)
 
   // Create a grid layout and add it to ItemView
   ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  gridLayout->SetOrientation(ControlOrientation::Right);
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
@@ -386,9 +433,10 @@ int UtcDaliItemViewGetCurrentLayoutPosition(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
+  // Create a depth layout and add it to ItemView
+  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+  depthLayout->SetOrientation(ControlOrientation::Up);
+  view.AddLayout(*depthLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
@@ -489,14 +537,14 @@ int UtcDaliItemViewScrollToItem(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
   Vector3 vec(480.0f, 800.0f, 0.0f);
-  ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
 
   view.SetName("view actor");
   view.AddLayout(*layout);
   view.SetSize(vec);
 
   Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Up);
+  layout->SetOrientation(ControlOrientation::Down);
   view.ActivateLayout(0, vec, 0.0f);
 
   application.SendNotification();
@@ -580,9 +628,10 @@ int UtcDaliItemViewInsertItemP(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
+  // Create a depth layout and add it to ItemView
+  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH);
+  depthLayout->SetOrientation(ControlOrientation::Left);
+  view.AddLayout(*depthLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
@@ -612,9 +661,10 @@ int UtcDaliItemViewInsertItemsP(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
+  // Create a depth layout and add it to ItemView
+  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH);
+  depthLayout->SetOrientation(ControlOrientation::Right);
+  view.AddLayout(*depthLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
@@ -668,9 +718,9 @@ int UtcDaliItemViewReplaceItemP(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
+  // Create a spiral layout and add it to ItemView
+  ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+  view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
@@ -692,9 +742,10 @@ int UtcDaliItemViewReplaceItemsP(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
+  // Create a spiral layout and add it to ItemView
+  ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+  spiralLayout->SetOrientation( ControlOrientation::Down );
+  view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
@@ -729,9 +780,10 @@ int UtcDaliItemViewGetItemsRangeP(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
+  // Create a spiral layout and add it to ItemView
+  ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+  spiralLayout->SetOrientation( ControlOrientation::Left );
+  view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
@@ -753,9 +805,10 @@ int UtcDaliItemViewSetItemsAnchorPointP(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
+  // Create a spiral layout and add it to ItemView
+  ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+  spiralLayout->SetOrientation( ControlOrientation::Right );
+  view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
@@ -926,3 +979,126 @@ int UtcDaliItemViewSetGetProperty(void)
   END_TEST;
 }
 
+
+int UtcDaliItemViewOvershootVertical(void)
+{
+  ToolkitTestApplication application;
+  Dali::Stage stage = Dali::Stage::GetCurrent();
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+  stage.Add(view);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(stage.GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, true );
+  DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), true, TEST_LOCATION );
+
+  view.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, Vector2(30, 30) );
+
+  Wait(application);
+
+  // Do a pan starting from 100,100 and moving down
+  Vector2 pos(100.0f, 100.0f);
+  SendPan(application, Gesture::Possible, pos);
+  SendPan(application, Gesture::Started, pos);
+  pos.y += 5.0f;
+  Wait(application, 100);
+
+  for(int i = 0;i<200;i++)
+  {
+    SendPan(application, Gesture::Continuing, pos);
+    pos.y += 5.0f;
+    Wait(application);
+  }
+
+  SendPan(application, Gesture::Finished, pos);
+  Wait(application, 100);
+
+  // Do a pan starting from 100,100 and moving up
+  pos = Vector2(100.0f, 300.0f);
+  SendPan(application, Gesture::Possible, pos);
+  SendPan(application, Gesture::Started, pos);
+  pos.y -= 5.0f;
+  Wait(application, 100);
+
+  for(int i = 0;i<200;i++)
+  {
+    SendPan(application, Gesture::Continuing, pos);
+    pos.y -= 5.0f;
+    Wait(application);
+  }
+
+  SendPan(application, Gesture::Finished, pos);
+  Wait(application, 100);
+  END_TEST;
+}
+
+int UtcDaliItemViewOvershootHorizontal(void)
+{
+  ToolkitTestApplication application;
+  Dali::Stage stage = Dali::Stage::GetCurrent();
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+  view.AddLayout(*gridLayout);
+  stage.Add(view);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(stage.GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, true );
+  DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), true, TEST_LOCATION );
+
+  view.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, Vector2(30, 30) );
+
+  Wait(application);
+
+  // Do a pan starting from 100,100 and moving left
+  Vector2 pos(100.0f, 100.0f);
+  SendPan(application, Gesture::Possible, pos);
+  SendPan(application, Gesture::Started, pos);
+  pos.x -= 5.0f;
+  Wait(application, 100);
+
+  for(int i = 0;i<200;i++)
+  {
+    SendPan(application, Gesture::Continuing, pos);
+    pos.x -= 5.0f;
+    Wait(application);
+  }
+
+  SendPan(application, Gesture::Finished, pos);
+  Wait(application, 100);
+
+  // Do a pan starting from 100,100 and moving right
+  pos = Vector2(100.0f, 100.0f);
+  SendPan(application, Gesture::Possible, pos);
+  SendPan(application, Gesture::Started, pos);
+  pos.x += 5.0f;
+  Wait(application, 100);
+
+  for(int i = 0;i<200;i++)
+  {
+    SendPan(application, Gesture::Continuing, pos);
+    pos.x += 5.0f;
+    Wait(application);
+  }
+
+  SendPan(application, Gesture::Finished, pos);
+  Wait(application, 100);
+
+  END_TEST;
+}
index 1fafb16..258add1 100644 (file)
@@ -216,6 +216,13 @@ int UtcDaliJsonParserMethod01(void)
   DALI_TEST_CHECK( std::string((*iterObject).first) == std::string("key" ));
   DALI_TEST_CHECK( std::string(((*iterObject).second).GetString()) == std::string("value"));
 
+  ++iter;
+  DALI_TEST_CHECK(!( iter != root->CEnd() ));
+
+  ++iter; // Go past the end
+
+  iter++; // Use the other operator using the post increment operator
+
   tet_result(TET_PASS);
   END_TEST;
 }
@@ -623,6 +630,7 @@ int UtcDaliJsonParserMethod08(void)
   DALI_TEST_CHECK(1  == parser.GetErrorLineNumber());
   DALI_TEST_CHECK(53 == parser.GetErrorPosition());
   DALI_TEST_CHECK(11 == parser.GetErrorColumn());
+  DALI_TEST_CHECK("Missing Value" == parser.GetErrorDescription());
 
   tet_result(TET_PASS);
   END_TEST;
@@ -756,3 +764,62 @@ int UtcDaliJsonParserMerge1(void)
 
   END_TEST;
 }
+
+int UtcDaliJsonParserDownCast(void)
+{
+  BaseHandle handle = JsonParser::New();
+  JsonParser parser = JsonParser::DownCast( handle );
+  DALI_TEST_CHECK( parser );
+  END_TEST;
+}
+
+int UtcDaliJsonParserTreeNodeCount(void)
+{
+  std::string s1( ReplaceQuotes("                                       \
+{                                                                       \
+  'styles':                                                             \
+  {                                                                     \
+    'button':                                                           \
+    {                                                                   \
+      'backgroundColor':[0.8, 0.0, 1.0, 1.0],                           \
+      'foregroundColor':[1, 1, 1, 1]                                    \
+    }                                                                   \
+  }                                                                     \
+}                                                                       \
+"));
+
+  JsonParser parser = JsonParser::New();
+  parser.Parse( s1 );
+
+  const TreeNode* treeNode = parser.GetRoot();
+  DALI_TEST_EQUALS(1, treeNode->Count("styles"), TEST_LOCATION );
+  DALI_TEST_EQUALS(0, treeNode->Count("random"), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliJsonParserTreeNodeFind(void)
+{
+  std::string s1( ReplaceQuotes("\
+{                                         \
+  'string':'value2',                      \
+  'integer':2,                            \
+  'float':2.3,                            \
+  'boolean':true,                         \
+  'nil':null,                             \
+  'array':[1,2,3],                        \
+  'object':{'key':'value'}                \
+}                                         \
+"));
+
+  JsonParser parser = JsonParser::New();
+  parser.Parse( s1 );
+
+  const TreeNode* treeNode = parser.GetRoot();
+  const TreeNode* childNode = treeNode->Find("string");
+  DALI_TEST_CHECK( childNode );
+  const TreeNode* sameNode = childNode->Find("string");
+  DALI_TEST_EQUALS( sameNode, childNode, TEST_LOCATION );
+
+  END_TEST;
+}
index fe2ac1d..a191f43 100644 (file)
@@ -113,27 +113,6 @@ Dali::Integration::Point GetPointUpOutside()
   return point;
 }
 
-Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
-{
-  BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
-
-  // Create the image
-  PixelBuffer* pixbuf = imageData.GetBuffer();
-  unsigned int size = width * height;
-
-  for( size_t i = 0; i < size; i++ )
-    {
-      pixbuf[i*4+0] = 0xFF * color.r;
-      pixbuf[i*4+1] = 0xFF * color.g;
-      pixbuf[i*4+2] = 0xFF * color.b;
-      pixbuf[i*4+3] = 0xFF * color.a;
-    }
-
-  imageData.Update();
-
-  return imageData;
-}
-
 } //namespace
 
 int UtcDaliPushButtonConstructorP(void)
@@ -928,3 +907,276 @@ int UtcDaliPushButtonAlignmentLayout(void)
 
   END_TEST;
 }
+
+int UtcDaliPushButtonSetButtonImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetButtonImage( ImageView::New() );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetButtonImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetSelectedImage( ImageView::New() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetBackgroundImage( ImageView::New() );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetBackgroundImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetBackgroundImage( ImageView::New() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetSelectedImage( ImageView::New() );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetSelectedImage( ImageView::New() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetSelectedBackgroundImage( ImageView::New() );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedBackgroundImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetSelectedBackgroundImage( ImageView::New() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetDisabledBackgroundImage( ImageView::New() );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledBackgroundImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetDisabledBackgroundImage( ImageView::New() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetDisabledImage( ImageView::New() );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetDisabledImage( ImageView::New() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledSelectedImageP(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button = PushButton::New();
+  Stage::GetCurrent().Add( button );
+
+  try
+  {
+    button.SetDisabledSelectedImage( ImageView::New() );
+    DALI_TEST_CHECK( true );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( false );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledSelectedImageN(void)
+{
+  ToolkitTestApplication application;
+
+  PushButton button;
+
+  try
+  {
+    button.SetDisabledSelectedImage( ImageView::New() );
+    DALI_TEST_CHECK( false );
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
index 0e33b72..aef0a65 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -18,9 +18,9 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-event-thread-callback.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/texture-set.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/shader.h>
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 
 using namespace Dali;
index ff4f5b9..ea50a30 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <iostream>
 #include <stdlib.h>
+#include <string>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
@@ -117,6 +118,20 @@ static void OnPanFinished()
   gOnPanFinishedCalled = true;
 }
 
+struct CallbackFunctor
+{
+  CallbackFunctor(bool* callbackFlag)
+  : mCallbackFlag( callbackFlag )
+  {
+  }
+
+  void operator()()
+  {
+    *mCallbackFlag = true;
+  }
+  bool* mCallbackFlag;
+};
+
 /**
  * Invoked when the current scroll position of the scrollable content goes above or below the values
  * specified by SCROLL_POSITION_INTERVALS property.
@@ -212,9 +227,47 @@ int UtcDaliToolkitScrollBarNewP(void)
   DALI_TEST_CHECK( vertical );
   DALI_TEST_CHECK( vertical.GetScrollDirection() == ScrollBar::Vertical );
 
+  Property::Value value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
+  std::string scrollDirection = value.Get<std::string>();
+  DALI_TEST_EQUALS( scrollDirection, "Vertical", TEST_LOCATION );
+
   ScrollBar horizontal = ScrollBar::New(ScrollBar::Horizontal);
   DALI_TEST_CHECK( horizontal );
   DALI_TEST_CHECK( horizontal.GetScrollDirection() == ScrollBar::Horizontal );
+  value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
+  scrollDirection = value.Get<std::string>();
+  DALI_TEST_EQUALS( scrollDirection, "Horizontal", TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarCreateP(void)
+{
+  ToolkitTestApplication application;
+
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+  DALI_TEST_CHECK( typeRegistry );
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( "ScrollBar" );
+  DALI_TEST_CHECK( typeInfo );
+
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+
+  ScrollBar scrollBar = ScrollBar::DownCast( handle );
+  DALI_TEST_CHECK( scrollBar );
+
+  scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Vertical");
+  scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Fixed");
+
+  DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::Vertical, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Fixed, TEST_LOCATION );
+
+  scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Horizontal");
+  scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Variable");
+
+  DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::Horizontal, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Variable, TEST_LOCATION );
 
   END_TEST;
 }
@@ -704,6 +757,9 @@ int UtcDaliToolkitScrollBarSetIndicatorHeightPolicyP(void)
   scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
   scrollBar.SetIndicatorFixedHeight(50.0f);
 
+  Property::Value value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
+  DALI_TEST_EQUALS(value.Get<std::string>(), "Fixed", TEST_LOCATION );
+
   // Render and notify
   application.SendNotification();
   application.Render();
@@ -714,6 +770,8 @@ int UtcDaliToolkitScrollBarSetIndicatorHeightPolicyP(void)
 
   // Set the indicator height to be variable
   scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
+  value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
+  DALI_TEST_EQUALS(value.Get<std::string>(), "Variable", TEST_LOCATION );
 
   // Render and notify
   application.SendNotification();
@@ -1344,7 +1402,10 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
   Stage::GetCurrent().Add( scrollBar );
 
   // Connect the pan finished signal
+  ConnectionTracker connectionTracker;
+  bool panFinished = false;
   scrollBar.PanFinishedSignal().Connect( &OnPanFinished );
+  scrollBar.ConnectSignal( &connectionTracker, "panFinished", CallbackFunctor(&panFinished));
 
   // Render and notify
   application.SendNotification();
@@ -1375,6 +1436,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
   // Perform a swipe gesture on the indicator
   PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 20);
   DALI_TEST_EQUALS( gOnPanFinishedCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( panFinished, true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1398,7 +1460,10 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void)
   Stage::GetCurrent().Add( scrollBar );
 
   // Connect the pan finished signal
+  ConnectionTracker connectionTracker;
+  bool panFinished = false;
   scrollBar.PanFinishedSignal().Connect( &OnPanFinished );
+  scrollBar.ConnectSignal( &connectionTracker, "panFinished", CallbackFunctor(&panFinished));
 
   // Render and notify
   application.SendNotification();
@@ -1433,10 +1498,12 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void)
   // Perform a swipe gesture on the scroll bar but not on the indicator
   PerformGestureSwipe(application, Vector2(1.0f, 780.0f), Vector2(Vector2::YAXIS * -1.0f), 20);
   DALI_TEST_EQUALS( gOnPanFinishedCalled, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( panFinished, false, TEST_LOCATION );
 
   // Perform a swipe gesture on the indicator
   PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 20);
   DALI_TEST_EQUALS( gOnPanFinishedCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( panFinished, true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1454,9 +1521,12 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
   scrollBar.SetSize(20.0f, 800.0f, 0.0f);
 
   Stage::GetCurrent().Add( scrollBar );
+  ConnectionTracker connectionTracker;
 
   // Connect to the ScrollPositionIntervalReached signal
+  bool intervalReached = false;
   scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
+  scrollBar.ConnectSignal( &connectionTracker, "scrollPositionIntervalReached", CallbackFunctor(&intervalReached));
 
   // Render and notify
   application.SendNotification();
@@ -1509,9 +1579,11 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
 
   // Check that the signal callback is called
   DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( intervalReached, true, TEST_LOCATION );
 
   // Reset the flag
   gOnScrollPositionIntervalReachedSignalCalled = false;
+  intervalReached = false;
 
   // Rest and clear the animation
   animation.Clear();
@@ -1527,9 +1599,11 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
 
   // Check that the signal callback is called
   DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( intervalReached, true, TEST_LOCATION );
 
   // Reset the flag
   gOnScrollPositionIntervalReachedSignalCalled = false;
+  intervalReached = false;
 
   // Rest and clear the animation
   animation.Clear();
@@ -1545,6 +1619,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
 
   // Check that the signal callback is called
   DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( intervalReached, true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1635,5 +1710,3 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(void)
 
   END_TEST;
 }
-
-
index ee941cc..3b4038e 100644 (file)
@@ -44,10 +44,24 @@ static void TestCallback(BaseHandle handle)
   gObjectCreatedCallBackCalled = true;
 }
 
+struct CallbackFunctor
+{
+  CallbackFunctor(bool* callbackFlag)
+  : mCallbackFlag( callbackFlag )
+  {
+  }
+
+  void operator()()
+  {
+    *mCallbackFlag = true;
+  }
+  bool* mCallbackFlag;
+};
 
 const int MILLISECONDS_PER_SECOND = 1000;
 const int RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
 const int RENDER_ANIMATION_TEST_DURATION_MS = 1000;             ///< 1000ms to test animation
+
 const int RENDER_DELAY_SCROLL = 1000;                           ///< duration to wait for any scroll to complete.
 
 // For Clamp Signal testing...
@@ -311,10 +325,10 @@ int UtcDaliScrollViewDestructorP(void)
   END_TEST;
 }
 
-int UtcDaliToolkitScrollViewNewP(void)
+int UtcDaliToolkitScrollViewNewP1(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliToolkitScrollViewNewP");
+  tet_infoline(" UtcDaliToolkitScrollViewNewP1");
 
   ScrollView scrollView;
 
@@ -341,6 +355,25 @@ int UtcDaliToolkitScrollViewNewP(void)
   END_TEST;
 }
 
+int UtcDaliToolkitScrollViewNewP2(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewNewP2 - create thru type registry");
+
+  ScrollView scrollView;
+  DALI_TEST_CHECK( !scrollView );
+
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+  TypeInfo scrollViewType = typeRegistry.GetTypeInfo("ScrollView");
+  BaseHandle handle = scrollViewType.CreateInstance();
+  DALI_TEST_CHECK( handle );
+
+  scrollView = ScrollView::DownCast(handle);
+  DALI_TEST_CHECK( scrollView );
+
+  END_TEST;
+}
+
 int UtcDaliToolkitScrollViewDownCastP(void)
 {
   ToolkitTestApplication application;
@@ -394,6 +427,9 @@ int UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP(void)
 
   scrollView.SetWrapMode(true);
 
+  Property::Value wrapMode = scrollView.GetProperty( Toolkit::ScrollView::Property::WRAP_ENABLED );
+  DALI_TEST_EQUALS( wrapMode.Get<bool>(), true, TEST_LOCATION );
+
   const Vector2 target = Vector2(50.0f, 50.0f);
   const Vector2 target2 = Vector2(150.0f, 150.0f);
 
@@ -785,7 +821,7 @@ int UtcDaliToolkitScrollViewSignalsStartComplete(void)
   END_TEST;
 }
 
-int UtcDaliToolkitScrollViewSignalsUpdate(void)
+int UtcDaliToolkitScrollViewSignalsUpdate01(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliToolkitScrollViewSignalsUpdate");
@@ -845,6 +881,73 @@ int UtcDaliToolkitScrollViewSignalsUpdate(void)
   END_TEST;
 }
 
+int UtcDaliToolkitScrollViewSignalsUpdate02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSignalsUpdate");
+
+  gOnScrollStartCalled = false;
+  gOnScrollUpdateCalled = false;
+  gOnScrollCompleteCalled = false;
+
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  Vector2 stageSize = Stage::GetCurrent().GetSize();
+  scrollView.SetSize(stageSize);
+  scrollView.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollView.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+
+  // Position rulers.
+  RulerPtr rulerX = new DefaultRuler();
+  RulerPtr rulerY = new DefaultRuler();
+  rulerX->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
+  rulerY->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
+  scrollView.SetRulerX(rulerX);
+  scrollView.SetRulerY(rulerY);
+  Dali::ConnectionTracker tracker;
+  bool scrollStarted=false;
+  bool scrollUpdated=false;
+  bool scrollCompleted=false;
+  DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollStarted", CallbackFunctor(&scrollStarted) ));
+  DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollUpdated", CallbackFunctor(&scrollUpdated) ));
+  DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollCompleted", CallbackFunctor(&scrollCompleted) ));
+
+  Actor image = Actor::New();
+  image.SetSize(stageSize);
+  image.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  image.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  scrollView.Add(image);
+
+  Wait(application);
+
+  // Do a pan starting from 100,100 and moving down diagonally.
+  Vector2 pos(100.0f, 100.0f);
+  SendPan(application, Gesture::Possible, pos);
+  SendPan(application, Gesture::Started, pos);
+  pos.x += 5.0f;
+  pos.y += 5.0f;
+  Wait(application, 100);
+
+  for(int i = 0;i<20;i++)
+  {
+    SendPan(application, Gesture::Continuing, pos);
+    pos.x += 5.0f;
+    pos.y += 5.0f;
+    Wait(application);
+  }
+
+  SendPan(application, Gesture::Finished, pos);
+  Wait(application, RENDER_DELAY_SCROLL);
+
+  DALI_TEST_CHECK(scrollStarted);
+  DALI_TEST_CHECK(scrollUpdated);
+  DALI_TEST_CHECK(scrollCompleted);
+
+  Stage::GetCurrent().Remove( scrollView );
+
+  END_TEST;
+}
+
 static Vector2 PerformGestureDiagonalSwipe(ToolkitTestApplication& application, Vector2 start, Vector2 direction, int frames, bool finish = true)
 {
   gOnScrollStartCalled = false;
@@ -2285,6 +2388,9 @@ int UtcDaliToolkitScrollViewConstraintsWrap(void)
   Wait(application, RENDER_DELAY_SCROLL);
   DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
 
+  scrollView.Remove(a);
+  Wait(application);
+
   END_TEST;
 }
 
index 1ec25ce..fcfc821 100644 (file)
@@ -101,20 +101,27 @@ int UtcDaliSliderDownCast(void)
   END_TEST;
 }
 
-static bool gSliderValueChangedCallBackCalled;
+static bool gSliderValueChangedCallBackCalled=false;
 static bool OnSliderValueChanged( Slider slider, float value )
 {
   gSliderValueChangedCallBackCalled = true;
   return true;
 }
 
-static bool gSliderMarkCallBackCalled;
+static bool gSliderMarkCallBackCalled=false;
 static bool OnSliderMark( Slider slider, int value )
 {
   gSliderMarkCallBackCalled = true;
   return true;
 }
 
+static bool gSliderSlidingFinishedCallBackCalled=false;
+static bool OnSlidingFinished( Slider slider, float value )
+{
+  gSliderSlidingFinishedCallBackCalled = true;
+  return true;
+}
+
 int UtcDaliSliderSignals1(void)
 {
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
@@ -141,42 +148,55 @@ int UtcDaliSliderSignals1(void)
 
   slider.ValueChangedSignal().Connect( &OnSliderValueChanged );
   slider.MarkReachedSignal().Connect( &OnSliderMark );
+  slider.SlidingFinishedSignal().Connect( &OnSlidingFinished );
 
   application.SendNotification();
   application.Render();
 
   gSliderValueChangedCallBackCalled = false;
   gSliderMarkCallBackCalled = false;
+  gSliderSlidingFinishedCallBackCalled = false;
 
-  Dali::Integration::TouchEvent event;
-
-  event = Dali::Integration::TouchEvent();
-
-  Integration::Point pointDown;
-  pointDown.SetState( PointState::DOWN );
-  pointDown.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
-  event.AddPoint( pointDown );
+  {
+    Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
+    Integration::Point pointDown;
+    pointDown.SetState( PointState::DOWN );
+    pointDown.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+    event.AddPoint( pointDown );
+
+    application.ProcessEvent( event );
+    application.SendNotification();
+    application.Render();
+  }
 
   for( int i = 0; i < 5; ++i )
   {
+    Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
     Integration::Point pointMotion;
     pointMotion.SetState( PointState::MOTION );
     pointMotion.SetScreenPosition( Vector2( 10.0f + i * 10.0f, 10.0f ) );
     event.AddPoint( pointMotion );
-  }
-
-  Integration::Point pointUp;
-  pointUp.SetState( PointState::UP );
-  pointUp.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
-  event.AddPoint( pointUp );
 
-  application.ProcessEvent( event );
+    application.ProcessEvent( event );
+    application.SendNotification();
+    application.Render();
+  }
 
-  application.SendNotification();
-  application.Render();
+  {
+    Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
+    Integration::Point pointUp;
+    pointUp.SetState( PointState::UP );
+    pointUp.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+    event.AddPoint( pointUp );
+
+    application.ProcessEvent( event );
+    application.SendNotification();
+    application.Render();
+  }
 
   DALI_TEST_CHECK(gSliderValueChangedCallBackCalled);
   DALI_TEST_CHECK(gSliderMarkCallBackCalled);
+  DALI_TEST_CHECK(gSliderSlidingFinishedCallBackCalled);
   END_TEST;
 }
 
index 52f4f87..8e3e0cf 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <iostream>
 #include <stdlib.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/tap-gesture-event.h>
 #include <dali-toolkit-test-suite-utils.h>
index 65fa82e..a072343 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
 
 #include <iostream>
 #include <stdlib.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/tap-gesture-event.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/pan-gesture-event.h>
+#include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 
@@ -94,6 +97,8 @@ const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
 const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
 
 const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
+const float RENDER_FRAME_INTERVAL = 16.66f;
+
 const float TO_MILLISECONDS = 1000.f;
 const float TO_SECONDS = 1.f / TO_MILLISECONDS;
 
@@ -103,6 +108,105 @@ const float SCROLL_SPEED = 300.f;
 static bool gTextChangedCallBackCalled;
 static bool gMaxCharactersCallBackCalled;
 
+static void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
+{
+  Integration::ResourceRequest* request = platform.GetRequest();
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
+  Integration::ResourcePointer resource(bitmap);
+  bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height);
+
+  if(request)
+  {
+    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
+  }
+}
+
+static void LoadMarkerImages(ToolkitTestApplication& app, TextField textField)
+{
+  int width(40);
+  int height(40);
+  LoadBitmapResource( app.GetPlatform(), width, height );
+
+  Property::Map propertyMap;
+  propertyMap["filename"] = "image.png";
+  propertyMap["width"] = width;
+  propertyMap["height"] = height;
+  textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT, propertyMap );
+  textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT, propertyMap );
+  textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, propertyMap );
+  textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, propertyMap );
+  textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT, propertyMap );
+  textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT, propertyMap );
+  textField.SetProperty( Toolkit::TextField::Property::GRAB_HANDLE_IMAGE, propertyMap );
+  textField.SetProperty( Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE, propertyMap );
+}
+
+// Generate a PanGestureEvent to send to Core
+static Integration::PanGestureEvent GeneratePan(
+    Gesture::State state,
+    const Vector2& previousPosition,
+    const Vector2& currentPosition,
+    unsigned long timeDelta,
+    unsigned int numberOfTouches = 1)
+{
+  Integration::PanGestureEvent pan(state);
+
+  pan.previousPosition = previousPosition;
+  pan.currentPosition = currentPosition;
+  pan.timeDelta = timeDelta;
+  pan.numberOfTouches = numberOfTouches;
+
+  return pan;
+}
+
+/**
+ * Helper to generate PanGestureEvent
+ *
+ * @param[in] application Application instance
+ * @param[in] state The Gesture State
+ * @param[in] pos The current position of touch.
+ */
+static void SendPan(ToolkitTestApplication& application, Gesture::State state, const Vector2& pos)
+{
+  static Vector2 last;
+
+  if( (state == Gesture::Started) ||
+      (state == Gesture::Possible) )
+  {
+    last.x = pos.x;
+    last.y = pos.y;
+  }
+
+  application.ProcessEvent(GeneratePan(state, last, pos, 16));
+
+  last.x = pos.x;
+  last.y = pos.y;
+}
+
+/*
+ * Simulate time passed by.
+ *
+ * @note this will always process at least 1 frame (1/60 sec)
+ *
+ * @param application Test application instance
+ * @param duration Time to pass in milliseconds.
+ * @return The actual time passed in milliseconds
+ */
+static int Wait(ToolkitTestApplication& application, int duration = 0)
+{
+  int time = 0;
+
+  for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+  {
+    application.SendNotification();
+    application.Render(RENDER_FRAME_INTERVAL);
+    time += RENDER_FRAME_INTERVAL;
+  }
+
+  return time;
+}
+
+
 static void TestTextChangedCallback( TextField control )
 {
   tet_infoline(" TestTextChangedCallback");
@@ -133,6 +237,19 @@ Integration::TapGestureEvent GenerateTap(
   return tap;
 }
 
+
+Integration::LongPressGestureEvent GenerateLongPress(
+    Gesture::State state,
+    unsigned int numberOfTouches,
+    Vector2 point)
+{
+  Integration::LongPressGestureEvent longPress( state );
+
+  longPress.numberOfTouches = numberOfTouches;
+  longPress.point = point;
+  return longPress;
+}
+
 // Generate a KeyEvent to send to Core.
 Integration::KeyEvent GenerateKey( const std::string& keyName,
                                    const std::string& keyString,
@@ -693,6 +810,7 @@ int utcDaliTextFieldEvent02(void)
   TextField field = TextField::New();
   field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
   DALI_TEST_CHECK( field );
+  LoadMarkerImages(application, field);
 
   Stage::GetCurrent().Add( field );
 
@@ -844,6 +962,7 @@ int utcDaliTextFieldEvent03(void)
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  LoadMarkerImages(application, field);
 
   // Render and notify
   application.SendNotification();
@@ -880,3 +999,337 @@ int utcDaliTextFieldEvent03(void)
 
   END_TEST;
 }
+
+int utcDaliTextFieldEvent04(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldEvent04");
+
+  // Checks if the highlight actor is created.
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+  LoadMarkerImages(application, field);
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+
+  // Tap first to get the focus.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Double tap to select a word.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Tap grab handle
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 0.f, 40.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 0.f, 40.0f ) ) );
+  END_TEST;
+}
+
+int utcDaliTextFieldEvent05(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldEvent05");
+
+  // Checks dragging of cursor/grab handle
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+  LoadMarkerImages(application, field);
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+
+  // Tap first to get the focus.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Double tap to select a word.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // drag grab handle right
+  Vector2 pos(0.0f, 40.0f);
+  SendPan(application, Gesture::Possible, pos);
+  SendPan(application, Gesture::Started, pos);
+  pos.x += 5.0f;
+  Wait(application, 100);
+
+  for(int i = 0;i<20;i++)
+  {
+    SendPan(application, Gesture::Continuing, pos);
+    pos.x += 5.0f;
+    Wait(application);
+  }
+
+  SendPan(application, Gesture::Finished, pos);
+  Wait(application, RENDER_FRAME_INTERVAL);
+
+  Actor offscreenRoot = field.GetChildAt( 1u );
+  END_TEST;
+}
+
+int utcDaliTextFieldEvent06(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldEvent06");
+
+  // Checks Longpress when in edit mode
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+  LoadMarkerImages(application, field);
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::TEXT, "Thisisalongtextforthesizeofthetextfield." );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+
+  // Tap first to get the focus.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Long Press
+  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateLongPress( Gesture::Started,  1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
+
+int utcDaliTextFieldEvent07(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldEvent07");
+
+  // Checks Longpress to start edit mode
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+  LoadMarkerImages(application, field);
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::TEXT, "Thisisalongtextforthesizeofthetextfield." );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Long Press
+  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateLongPress( Gesture::Started,  1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
+
+int utcDaliTextFieldEvent08(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldEvent08");
+
+  // Checks Longpress when only place holder text
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+  LoadMarkerImages(application, field);
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Setting Placeholder Text" );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Long Press
+  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateLongPress( Gesture::Started,  1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
+
+int utcDaliTextFieldStyleWhilstSelected09(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldEvent09");
+
+  // Change font and styles whilst text is selected whilst word selected
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+  LoadMarkerImages(application, field);
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+
+  // Tap first to get the focus.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Double tap to select a word.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::INPUT_FONT_FAMILY, "Setting input font family" );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_FAMILY ), "Setting input font family", TEST_LOCATION );
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"bold\",\"slant\":\"italic\"}" );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), "{\"weight\":\"bold\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"width\":\"expanded\",\"slant\":\"italic\"}" );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), "{\"width\":\"expanded\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+  field.SetProperty( TextField::Property::INPUT_POINT_SIZE, 12.f );
+  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::INPUT_POINT_SIZE ), 12.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+  field.SetProperty( TextField::Property::TEXT_COLOR, Color::RED );
+  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::TEXT_COLOR ), Color::RED, TEST_LOCATION );
+
+  field.SetProperty( TextField::Property::FONT_STYLE, "{\"weight\":\"bold\",\"slant\":\"italic\"}" );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), "{\"weight\":\"bold\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+  field.SetProperty( TextField::Property::FONT_STYLE, "{\"width\":\"expanded\"}" );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), "{\"width\":\"expanded\"}", TEST_LOCATION );
+
+  END_TEST;
+}
index f6f9730..2cee1b5 100644 (file)
@@ -20,6 +20,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -105,3 +106,37 @@ int UtcDaliToolkitTextSelectionPopupDownCastP(void)
 
   END_TEST;
 }
+
+// TextSelectionToolBar is used TextSelectionPopup, below tests it individually
+
+int UtcDaliToolkitTextSelectionToolBarP(void)
+{
+
+  // Creates Toolbar, adds 2 options and a divider then resizes divider
+  ToolkitTestApplication application;
+
+  TextSelectionToolbar toolbar = TextSelectionToolbar::New();
+
+  toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size( 100.0f, 60.0f) );
+
+  Toolkit::PushButton option = Toolkit::PushButton::New();
+  option.SetName( "test-option" );
+  option.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  toolbar.AddOption( option );
+
+  Toolkit::Control divider = Toolkit::Control::New();
+  divider.SetSize( 2.0f, 0.0f );
+  divider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
+  toolbar.AddDivider( divider );
+
+  Toolkit::PushButton option2 = Toolkit::PushButton::New();
+  option2.SetName( "test-option-2" );
+  option2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  toolbar.AddOption( option2 );
+
+  Size newSize =  Size(3.0f, 0.0f);
+  toolbar.ResizeDividers( newSize );
+
+  DALI_TEST_CHECK( toolbar );
+  END_TEST;
+}
index b64b500..cc76ea3 100644 (file)
@@ -221,3 +221,21 @@ int UtcDaliVideoViewTypeRegistry(void)
 
   END_TEST;
 }
+
+int UtcDaliVideoViewMethodsForCoverage(void)
+{
+  ToolkitTestApplication application;
+
+  VideoView videoView = VideoView::New();
+  DALI_TEST_CHECK( videoView );
+
+  videoView.Play();
+  videoView.Pause();
+  videoView.Stop();
+  videoView.Forward(10);
+  videoView.Backward(10);
+  VideoView::VideoViewSignalType& signal = videoView.FinishedSignal();
+  DALI_TEST_EQUALS( 0, signal.GetConnectionCount(), TEST_LOCATION );
+
+  END_TEST;
+}
index 5e8c0ae..6bcb108 100644 (file)
@@ -54,7 +54,7 @@ JsonParser::~JsonParser()
 {
 }
 
-JsonParser DownCast( BaseHandle handle )
+JsonParser JsonParser::DownCast( BaseHandle handle )
 {
   return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
 }
index 8515280..302c7a2 100644 (file)
@@ -182,11 +182,6 @@ TreeNode::KeyNodePair TreeNode::ConstIterator::operator *()
   return KeyNodePair(mNode->mName, *mNode);
 }
 
-TreeNode::KeyNodePair TreeNode::ConstIterator::operator ->()
-{
-  return KeyNodePair(mNode->mName, *mNode);
-}
-
 bool TreeNode::ConstIterator::operator!=( const TreeNode::ConstIterator& rhs ) const
 {
   return mNode != rhs.mNode;
index 6da465a..3e47aea 100644 (file)
@@ -105,11 +105,6 @@ public:
      * pointer semantics
      */
     KeyNodePair operator*();
-
-    /*
-     * pointer semantics
-     */
-    KeyNodePair operator->();
   private:
     TreeNode* mNode;
   };
index 5ef9195..2bc97ae 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef __DALI_TOOLKIT_IMAGE_ATLAS_H__
-#define __DALI_TOOLKIT_IMAGE_ATLAS_H__
+#ifndef DALI_TOOLKIT_IMAGE_ATLAS_H
+#define DALI_TOOLKIT_IMAGE_ATLAS_H
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -24,7 +24,7 @@
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/images/image-operations.h>
 #include <dali/public-api/images/pixel.h>
-#include <dali/devel-api/images/pixel-data.h>
+#include <dali/public-api/images/pixel-data.h>
 
 namespace Dali
 {
@@ -153,4 +153,4 @@ public: // Not intended for developer use
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_IMAGE_ATLAS_H__ */
+#endif // DALI_TOOLKIT_IMAGE_ATLAS_H
index 99036fd..fdea5d0 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H__
-#define __DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H__
+#ifndef DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H_
+#define DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/shader.h>
 
 namespace Dali
 {
@@ -230,4 +230,4 @@ inline Property::Map CreateDissolveEffect( bool useHighPrecision = true )
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H__
+#endif // DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H
index de78244..6cd9de4 100644 (file)
@@ -76,14 +76,14 @@ bool CubeTransitionEffect::IsTransitioning()
   return GetImpl(*this).IsTransitioning();
 }
 
-void CubeTransitionEffect::SetCurrentImage( Image image )
+void CubeTransitionEffect::SetCurrentTexture( Texture texture )
 {
-  GetImpl(*this).SetCurrentImage( image );
+  GetImpl(*this).SetCurrentTexture( texture );
 }
 
-void CubeTransitionEffect::SetTargetImage( Image image )
+void CubeTransitionEffect::SetTargetTexture( Texture texture )
 {
-  GetImpl(*this).SetTargetImage( image );
+  GetImpl(*this).SetTargetTexture( texture );
 }
 
 void CubeTransitionEffect::StartTransition( bool toNextImage )
index 05546a9..df51440 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__
-#define __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__
+#ifndef DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
+#define DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -21,6 +21,9 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/rendering/texture.h>
+
 namespace Dali
 {
 
@@ -135,17 +138,17 @@ public:
   bool IsTransitioning();
 
   /**
-   * Set the current image to transition from
+   * Set the current texture to transition from
    * if using this same effect continually, only need to set once
-   * @param[in] image The current image
+   * @param[in] texture The current texture
    */
-  void SetCurrentImage(Image image);
+  void SetCurrentTexture( Texture texture );
 
   /**
-   * Set the target image to transit to
-   * @param[in] image The new Image showing on stage
+   * Set the target texture to transit to
+   * @param[in] texture The new Texture showing on stage
    */
-  void SetTargetImage(Image image);
+  void SetTargetTexture( Texture texture );
 
   /**
    * Activate the transition animation with horizontally left/right panGesture
@@ -184,13 +187,13 @@ public:
 public: //Signal
 
   //Transition animation completed signal
-  typedef Signal< void ( CubeTransitionEffect, Image ) > TransitionCompletedSignalType;
+  typedef Signal< void ( CubeTransitionEffect, Texture ) >  TransitionCompletedSignalType;
 
   /**
    * Signal emitted when the transition has completed animation
    * A callback of the following type may be connected
    * @code
-   *   void YourCallbackName( CubeTransitionEffect cubeEffect, Image currentImage );
+   *   void YourCallbackName( CubeTransitionEffect cubeEffect, Texture currentTexture );
    * @endcode
    * @return The Signal to connect to.
    */
@@ -218,4 +221,4 @@ public: // Not intended for developer use
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__ */
+#endif // DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
index a2c607f..e64289e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -28,7 +28,8 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
@@ -389,7 +390,7 @@ void BloomView::AllocateResources()
     rendererMap[ "shader" ] = customShader;
     mCompositeImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
     TextureSet textureSet = mCompositeImageView.GetRendererAt(0).GetTextures();
-    textureSet.SetImage( 1u, mBlurExtractTarget );
+    TextureSetImage( textureSet, 1u, mBlurExtractTarget );
 
     // set up target actor for rendering result, i.e. the blurred image
     mTargetImageView.SetImage(mOutputRenderTarget);
index 213a425..3033032 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H_
-#define __DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H_
+#ifndef DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H
+#define DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor.h>
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 namespace Dali
 {
@@ -151,4 +151,4 @@ private:
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H_ */
+#endif // DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H
index 9fc065a..6e265f6 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H_
-#define __DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H_
+#ifndef DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H
+#define DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <sstream>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/shader.h>
 
 namespace Dali
 {
@@ -128,4 +128,4 @@ inline Shader CreateBubbleShader( unsigned int numBubble )
 } // namespace Toolkit
 
 } // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H_ */
+#endif // DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H
index b13765b..2904ece 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -22,6 +22,7 @@
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/images/resource-image.h>
+#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/bubble-effect/bubble-actor.h>
@@ -143,8 +144,8 @@ void BubbleEmitter::OnInitialize()
   Shader bubbleShader = CreateBubbleShader (mNumBubblePerActor );
 
   mTextureSet = TextureSet::New();
-  mTextureSet.SetImage( 0u, mEffectImage );
-  mTextureSet.SetImage( 1u, mShapeImage );
+  TextureSetImage( mTextureSet, 0u, mEffectImage );
+  TextureSetImage( mTextureSet, 1u, mShapeImage );
 
   mBubbleActors.resize( mNumActor );
 
@@ -200,7 +201,7 @@ void BubbleEmitter::SetBackground( Image bgImage, const Vector3& hsvDelta )
 
 void BubbleEmitter::SetShapeImage( Image shapeImage )
 {
-  mTextureSet.SetImage( 1, shapeImage );
+  TextureSetImage( mTextureSet, 1, shapeImage );
 }
 
 void BubbleEmitter::SetBubbleScale( float scale )
index cbc1fc3..fecbd85 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/frame-buffer-image.h>
 #include <dali/public-api/render-tasks/render-task.h>
-#include <dali/devel-api/object/property-buffer.h>
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/sampler.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/property-buffer.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/sampler.h>
+#include <dali/public-api/rendering/shader.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -197,4 +197,4 @@ inline const Internal::BubbleEmitter& GetImpl(const Dali::Toolkit::BubbleEmitter
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H
index 30e84a9..fcd0468 100644 (file)
@@ -29,6 +29,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 
 /**
  * Button states and contents
@@ -527,46 +528,48 @@ void Button::SetupContent( Actor& actorToModify, Actor newActor )
   }
 }
 
-void Button::SetUnselectedColor( const Vector4& color )
+const Vector4 Button::GetUnselectedColor() const
+{
+  return mUnselectedColor;
+}
+
+void Button::SetColor( const Vector4& color, Button::PaintState selectedState )
 {
-  mUnselectedColor = color;
+  Actor& contentActor = mSelectedContent;
+  bool imageFileExists = false;
 
-  if( mUnselectedContent && !GetUnselectedImageFilename().empty() )
+  if ( selectedState == SelectedState || selectedState == DisabledSelectedState )
   {
-    // If there is existing unselected content, change the color on it directly.
-    mUnselectedContent.SetColor( mUnselectedColor );
+    mSelectedColor = color;
+    imageFileExists = !GetSelectedImageFilename().empty();
   }
   else
   {
-    // If there is no existing content, create a new actor to use for flat color.
-    Toolkit::Control unselectedContentActor = Toolkit::Control::New();
-    unselectedContentActor.SetBackgroundColor( mUnselectedColor );
-    SetupContent( mUnselectedContent, unselectedContentActor );
-    mUnselectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    mUnselectedColor = color;
+    contentActor = mUnselectedContent;
+    imageFileExists = !GetUnselectedImageFilename().empty();
   }
-}
-
-const Vector4 Button::GetUnselectedColor() const
-{
-  return mUnselectedColor;
-}
-
-void Button::SetSelectedColor( const Vector4& color )
-{
-  mSelectedColor = color;
 
-  if( mSelectedContent && !GetSelectedImageFilename().empty() )
+  if( contentActor &&  imageFileExists )
   {
     // If there is existing unselected content, change the color on it directly.
-    mSelectedContent.SetColor( mSelectedColor );
+    contentActor.SetColor( color );
   }
   else
   {
     // If there is no existing content, create a new actor to use for flat color.
-    Toolkit::Control selectedContentActor = Toolkit::Control::New();
-    selectedContentActor.SetBackgroundColor( mSelectedColor );
-    SetupContent( mSelectedContent, selectedContentActor );
-    mSelectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    Actor placementActor = Actor::New();
+    Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
+    Toolkit::ControlRenderer colorRenderer;
+
+    Property::Map map;
+    map["rendererType"] = "color";
+    map["mixColor"] = color;
+
+    colorRenderer = rendererFactory.CreateControlRenderer( map );
+    colorRenderer.SetOnStage( placementActor );
+    SetupContent( contentActor, placementActor );
+    contentActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   }
 }
 
@@ -722,32 +725,6 @@ std::string Button::GetSelectedImageFilename() const
   return std::string();
 }
 
-std::string Button::GetBackgroundImageFilename() const
-{
-  if( mBackgroundContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mBackgroundContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
-std::string Button::GetSelectedBackgroundImageFilename() const
-{
-  if( mSelectedBackgroundContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mSelectedBackgroundContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
 std::string Button::GetDisabledImageFilename() const
 {
   if( mDisabledContent )
@@ -761,32 +738,6 @@ std::string Button::GetDisabledImageFilename() const
   return std::string();
 }
 
-std::string Button::GetDisabledSelectedImageFilename() const
-{
-  if( mDisabledSelectedContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mDisabledSelectedContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
-std::string Button::GetDisabledBackgroundImageFilename() const
-{
-  if( mDisabledBackgroundContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mDisabledBackgroundContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
 bool Button::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool ret = false;
@@ -1438,13 +1389,13 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope
 
       case Toolkit::Button::Property::UNSELECTED_COLOR:
       {
-        GetImplementation( button ).SetUnselectedColor( value.Get< Vector4 >() );
+        GetImplementation( button ).SetColor( value.Get< Vector4 >(), UnselectedState );
         break;
       }
 
       case Toolkit::Button::Property::SELECTED_COLOR:
       {
-        GetImplementation( button ).SetSelectedColor( value.Get< Vector4 >() );
+        GetImplementation( button ).SetColor( value.Get< Vector4 >(), SelectedState );
         break;
       }
 
index 71a42fe..da2557f 100644 (file)
@@ -43,18 +43,6 @@ namespace Internal
 class Button : public Control
 {
 
-protected:
-
-  /**
-   * Construct a new Button.
-   */
-  Button();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~Button();
-
 public:
 
   /**
@@ -285,6 +273,42 @@ public: // Deprecated API
 
 protected:
 
+  enum ButtonState
+  {
+    ButtonUp,                                  ///< The button is up.
+    ButtonDown,                                ///< The button is down.
+  };
+
+  /**
+   * Button paint states.
+   */
+  enum PaintState
+  {
+    UnselectedState,              ///< The button is unselected.
+    SelectedState,                ///< The button is selected.
+    DisabledUnselectedState,      ///< The button is disabled and unselected.
+    DisabledSelectedState,        ///< The button is disabled and selected.
+  };
+
+  /**
+   * Enum to specify which decoration when getting and setting decorations.
+   */
+  enum DecorationState
+  {
+    UNSELECTED_DECORATION = 0,
+    SELECTED_DECORATION,
+    DECORATION_STATES
+  };
+
+  /**
+   * Construct a new Button.
+   */
+  Button();
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~Button();
   /**
    * @return A reference to the label actor.
    */
@@ -494,6 +518,7 @@ protected: // From Control
    */
   void OnStageDisconnection();
 
+
 private:
 
   /**
@@ -551,24 +576,18 @@ private:
   void SetupContent( Actor& actorToModify, Actor newActor );
 
   /**
-   * Sets the color of the unselected image.
-   * If no image exists, it is created.
-   * @param[in]  color The color to use.
-   */
-  void SetUnselectedColor( const Vector4& color );
-
-  /**
    * Gets the unselected content color.
    * @return     The currently used unselected color.
    */
   const Vector4 GetUnselectedColor() const;
 
   /**
-   * Sets the color of the selected image.
-   * If no image exists, it is created.
+   * Sets the color of button in selected or unselected state, if image also supplied this color will be appplied to it.
+   * If no visual exists, it is created.
    * @param[in]  color The color to use.
+   * @param[in]  selectedState The state to apply the color to, SelectedState or DisabledUnselectedState.
    */
-  void SetSelectedColor( const Vector4& color );
+  void SetColor( const Vector4& color, PaintState selectedState );
 
   /**
    * Gets the selected content color.
@@ -578,33 +597,6 @@ private:
 
 protected:
 
-  enum ButtonState
-  {
-    ButtonUp,                                  ///< The button is up.
-    ButtonDown,                                ///< The button is down.
-  };
-
-  /**
-   * Button paint states.
-   */
-  enum PaintState
-  {
-    UnselectedState,              ///< The button is unselected.
-    SelectedState,                ///< The button is selected.
-    DisabledUnselectedState,      ///< The button is disabled and unselected.
-    DisabledSelectedState,        ///< The button is disabled and selected.
-  };
-
-  /**
-   * Enum to specify which decoration when getting and setting decorations.
-   */
-  enum DecorationState
-  {
-    UNSELECTED_DECORATION = 0,
-    SELECTED_DECORATION,
-    DECORATION_STATES
-  };
-
   ButtonState GetState();
   PaintState GetPaintState();
   void SetDecoration( DecorationState state, Actor actor );
index ae4ac45..9d4d089 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -26,7 +26,8 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
@@ -439,7 +440,7 @@ void EffectsView::AllocateResources()
 
     mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
     TextureSet textureSet = TextureSet::New();
-    textureSet.SetImage( 0u,  mImagePostFilter);
+    TextureSetImage( textureSet, 0u,  mImagePostFilter );
     self.GetRendererAt( 0 ).SetTextures( textureSet );
     mRendererPostFilter.SetDepthIndex( DepthIndex::CONTENT );
 
index fc75b7a..2d75ede 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -27,6 +27,7 @@
 #include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/adaptor-framework/file-loader.h>
+#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/model3d-view/obj-loader.h>
@@ -43,6 +44,35 @@ namespace Internal
 namespace
 {
 
+// Texture indices are constants.
+enum TextureIndex
+{
+  DIFFUSE_TEXTURE_INDEX,
+  NORMAL_TEXTURE_INDEX,
+  GLOSS_TEXTURE_INDEX
+};
+
+/**
+ * @brief Loads a texture from a file.
+ * @param[in] imageUrl The URL of the file
+ * @return A texture if loading succeeds, an empty handle otherwise
+ */
+Texture LoadTexture( const char* imageUrl )
+{
+  Texture texture;
+  Dali::BitmapLoader loader = Dali::BitmapLoader::New( imageUrl );
+  loader.Load();
+  PixelData pixelData = loader.GetPixelData();
+  if( pixelData )
+  {
+    texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+    texture.Upload( pixelData );
+    texture.GenerateMipmaps();
+  }
+
+  return texture;
+}
+
 // Type registration
 BaseHandle Create()
 {
@@ -247,28 +277,9 @@ const char* NRMMAP_FRAGMENT_SHADER = MAKE_SHADER(
 
 using namespace Dali;
 
-void LookAt(Matrix& result, const Vector3& eye, const Vector3& target, const Vector3& up)
-{
-  Vector3 vZ = target - eye;
-  vZ.Normalize();
-
-  Vector3 vX = up.Cross(vZ);
-  vX.Normalize();
-
-  Vector3 vY = vZ.Cross(vX);
-  vY.Normalize();
-
-  result.SetInverseTransformComponents(vX, vY, vZ, eye);
-}
-
-
 Model3dView::Model3dView()
   : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
 {
-  mTexture0Url = "";
-  mTexture1Url = "";
-  mTexture2Url = "";
-
   mIlluminationType = Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP;
 
   mCameraFOV = Math::PI_OVER_180 * 45.f;
@@ -588,41 +599,54 @@ void Model3dView::CreateMaterial()
 void Model3dView::LoadTextures()
 {
   if( !mTextureSet )
-    return ;
-
-  if( (mTexture0Url != "") && (mIlluminationType != Toolkit::Model3dView::DIFFUSE) )
   {
-    std::string imgUrl = mImagesUrl + mTexture0Url;
-
-    //Load textures
-    Image tex0 = ResourceImage::New( imgUrl );
-    if( tex0 )
-    {
-      mTextureSet.SetImage( 0u, tex0 );
-    }
+    return;
   }
 
-  if( (mTexture1Url != "") && (mIlluminationType == Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP) )
+  Sampler sampler = Sampler::New();
+  sampler.SetFilterMode( FilterMode::LINEAR_MIPMAP_LINEAR, FilterMode::LINEAR_MIPMAP_LINEAR );
+
+  // Setup diffuse texture.
+  if( !mTexture0Url.empty() && ( mIlluminationType != Toolkit::Model3dView::DIFFUSE ) )
   {
-    std::string imgUrl = mImagesUrl + mTexture1Url;
+    std::string imageUrl = mImagesUrl + mTexture0Url;
 
     //Load textures
-    Image tex1 = ResourceImage::New( imgUrl );
-    if (tex1)
+    Texture diffuseTexture = LoadTexture( imageUrl.c_str() );
+    if( diffuseTexture )
     {
-      mTextureSet.SetImage( 1u, tex1 );
+      mTextureSet.SetTexture( DIFFUSE_TEXTURE_INDEX, diffuseTexture );
+      mTextureSet.SetSampler( DIFFUSE_TEXTURE_INDEX, sampler );
     }
   }
 
-  if( (mTexture2Url != "") && (mIlluminationType == Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP) )
+  if( mIlluminationType == Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP )
   {
-    std::string imgUrl = mImagesUrl + mTexture2Url;
+    // Setup normal map texture.
+    if( !mTexture1Url.empty() )
+    {
+      std::string imageUrl = mImagesUrl + mTexture1Url;
 
-    //Load textures
-    Image tex2 = ResourceImage::New( imgUrl );
-    if( tex2 )
+      //Load textures
+      Texture normalTexture = LoadTexture( imageUrl.c_str() );
+      if( normalTexture )
+      {
+        mTextureSet.SetTexture( NORMAL_TEXTURE_INDEX, normalTexture );
+        mTextureSet.SetSampler( NORMAL_TEXTURE_INDEX, sampler );
+      }
+    }
+    if( !mTexture2Url.empty() )
     {
-      mTextureSet.SetImage( 2u, tex2 );
+      // Setup gloss map texture.
+      std::string imageUrl = mImagesUrl + mTexture2Url;
+
+      //Load textures
+      Texture glossTexture = LoadTexture( imageUrl.c_str() );
+      if( glossTexture )
+      {
+        mTextureSet.SetTexture( GLOSS_TEXTURE_INDEX, glossTexture );
+        mTextureSet.SetSampler( GLOSS_TEXTURE_INDEX, sampler );
+      }
     }
   }
 }
index 9c24faa..51388f3 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H__
-#define __DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H__
+#ifndef DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H
+#define DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -201,4 +201,4 @@ inline const Toolkit::Internal::Model3dView& GetImpl( const Toolkit::Model3dView
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_MODEL_VIEW_H__
+#endif // DALI_TOOLKIT_INTERNAL_MODEL_VIEW_H
index a877bb9..5f4662d 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H__
-#define __DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H
+#define DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <limits>
 
 namespace Dali
@@ -171,4 +171,4 @@ private:
 
 
 
-#endif // __DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H__
+#endif // DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H
index 20c57c0..01a335c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -25,6 +25,7 @@
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/images/texture-set-image.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -291,7 +292,7 @@ void PageTurnView::Page::SetImage( Image image  )
     textureSet = TextureSet::New();
   }
 
-  textureSet.SetImage( 0u, image );
+  TextureSetImage( textureSet, 0u, image );
 }
 
 void PageTurnView::Page::UseEffect(Shader newShader)
index 1f4bc16..078859d 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/common/map-wrapper.h>
 #include <dali/public-api/actors/layer.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -454,4 +454,5 @@ inline const Toolkit::Internal::PageTurnView& GetImplementation(const Toolkit::P
 } // namespace Toolkit
 
 } // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H__ */
+
+#endif // DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H
index 56ff901..14eaf42 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
-#define __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
+#define DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -17,8 +17,9 @@
  * limitations under the License.
  *
  */
+
 // EXTERNAL INCLUDES
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
@@ -146,4 +147,4 @@ private:
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
index 3fd6a74..c09f86f 100644 (file)
@@ -119,7 +119,7 @@ void ColorRenderer::InitializeRenderer()
   Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
   if( !geometry )
   {
-    geometry =  Geometry::QUAD();
+    geometry =  RendererFactoryCache::CreateQuadGeometry();
     mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
   }
 
index 5092075..8349791 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,8 +20,9 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
+// INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
 
 namespace Dali
@@ -74,4 +75,4 @@ struct Internal::ControlRenderer::Impl
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H
index 3880b0b..a1e91e6 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H__
-#define __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
+#define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
  *
  */
 
-
 // EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
 #include <dali/public-api/images/image-operations.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/rendering/shader.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 #include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
+#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 #include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
 
 namespace Dali
@@ -251,4 +250,4 @@ inline Internal::ControlRenderer& GetImplementation(Toolkit::ControlRenderer& re
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H___ */
+#endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
index 637dd6b..952bd3b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -311,7 +311,7 @@ void GradientRenderer::InitializeRenderer()
   Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
   if( !geometry )
   {
-    geometry =  Geometry::QUAD();
+    geometry =  RendererFactoryCache::CreateQuadGeometry();
     mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
   }
 
@@ -326,8 +326,8 @@ void GradientRenderer::InitializeRenderer()
 
   //Set up the texture set
   TextureSet textureSet = TextureSet::New();
-  Dali::BufferImage lookupTexture = mGradient->GenerateLookupTexture();
-  textureSet.SetImage( 0u, lookupTexture );
+  Dali::Texture lookupTexture = mGradient->GenerateLookupTexture();
+  textureSet.SetTexture( 0u, lookupTexture );
   Dali::WrapMode::Type wrap = GetWrapMode( mGradient->GetSpreadMethod() );
   Sampler sampler = Sampler::New();
   sampler.SetWrapMode(  wrap, wrap  );
index d87d132..e070754 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -88,7 +88,7 @@ const Matrix3& Gradient::GetAlignmentTransform() const
  *  If the stops have not covered the whole zero to one range,
  *  the REPEAT spread behaves different from the two others in the lookup texture generation.
  */
-BufferImage Gradient::GenerateLookupTexture()
+Dali::Texture Gradient::GenerateLookupTexture()
 {
   std::sort( mGradientStops.Begin(), mGradientStops.End() );
 
@@ -133,8 +133,11 @@ BufferImage Gradient::GenerateLookupTexture()
    * Generate the pixels with the color transit from one stop to next.
    */
   unsigned int resolution = EstimateTextureResolution();
-  BufferImage texture = BufferImage::New( resolution, 1 );
-  PixelBuffer* pixels = texture.GetBuffer();
+
+  unsigned int bufferSize = resolution * 4u;
+  unsigned char* pixels = new unsigned char[ bufferSize ];
+  PixelData pixelData = PixelData::New( pixels, bufferSize, resolution, 1u, Pixel::RGBA8888, PixelData::DELETE_ARRAY );
+
   int segmentStart = 0;
   int segmentEnd = 0;
   int k = 0;
@@ -161,6 +164,9 @@ BufferImage Gradient::GenerateLookupTexture()
     segmentStart = segmentEnd;
   }
 
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, resolution, 1u );
+  texture.Upload( pixelData );
+
   // remove the stops added temporarily for generating the pixels, as the spread method might get changed later
   if( tempLastStop )
   {
index 36e6ee4..f08af99 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_GRADIENT_H__
-#define __DALI_TOOLKIT_INTERNAL_GRADIENT_H__
+#ifndef DALI_TOOLKIT_INTERNAL_GRADIENT_H
+#define DALI_TOOLKIT_INTERNAL_GRADIENT_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
  */
 
 //EXTERNAL INCLUDES
-#include <dali/public-api/math/matrix3.h>
-#include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/images/buffer-image.h>
+#include <dali/public-api/math/matrix3.h>
+#include <dali/public-api/object/ref-object.h>
+#include <dali/public-api/rendering/texture.h>
 
 namespace Dali
 {
@@ -130,9 +131,9 @@ public:
 
   /**
    * Generate the lookup texture with the gradient stops.
-   * @return the lookup texture which transit smoothly between stops.
+   * @return The lookup texture which transit smoothly between stops.
    */
-  BufferImage GenerateLookupTexture();
+  Dali::Texture GenerateLookupTexture();
 
 private:
 
@@ -176,4 +177,4 @@ protected:
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_GRADIENT_RENDERER_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_GRADIENT_RENDERER_H
index ab8ff18..9697e50 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -19,6 +19,7 @@
 #include "image-atlas-manager.h"
 
 // EXTERNAL HEADER
+#include <dali/devel-api/images/texture-set-image.h>
 #include <dali/public-api/images/resource-image.h>
 
 namespace Dali
@@ -141,7 +142,7 @@ void ImageAtlasManager::CreateNewAtlas()
   }
   mAtlasList.push_back( newAtlas );
   TextureSet textureSet = TextureSet::New();
-  textureSet.SetImage( 0u, newAtlas.GetAtlas() );
+  TextureSetImage( textureSet, 0u, newAtlas.GetAtlas() );
   mTextureSetList.push_back( textureSet );
 }
 
index abe0123..fa1271e 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H__
-#define __DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H__
+#ifndef DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H
+#define DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -21,7 +21,7 @@
 #include <string>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/ref-object.h>
-#include <dali/devel-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/texture-set.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/image-atlas/image-atlas.h>
@@ -144,4 +144,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_ATLAS_MANAGER_H__
+#endif // DALI_TOOLKIT_ATLAS_MANAGER_H
index 434eecf..058f2b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,6 +23,7 @@
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/images/native-image.h>
 #include <dali/devel-api/images/atlas.h>
+#include <dali/devel-api/images/texture-set-image.h>
 #include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <dali/integration-api/debug.h>
 
@@ -116,7 +117,7 @@ Geometry CreateGeometry( RendererFactoryCache& factoryCache, ImageDimensions gri
     geometry = factoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
     if( !geometry )
     {
-      geometry =  Geometry::QUAD();
+      geometry =  RendererFactoryCache::CreateQuadGeometry();
       factoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
     }
   }
@@ -465,7 +466,7 @@ TextureSet ImageRenderer::CreateTextureSet( Vector4& textureRect, const std::str
     {
       // use broken image
       textureSet = TextureSet::New();
-      textureSet.SetImage( 0u, RendererFactory::GetBrokenRendererImage() );
+      TextureSetImage( textureSet, 0u, RendererFactory::GetBrokenRendererImage() );
     }
     else
     {
@@ -475,7 +476,7 @@ TextureSet ImageRenderer::CreateTextureSet( Vector4& textureRect, const std::str
         Atlas image = Atlas::New( mPixels.GetWidth(), mPixels.GetHeight(), mPixels.GetPixelFormat() );
         image.Upload( mPixels, 0, 0 );
         textureSet = TextureSet::New();
-        textureSet.SetImage( 0u, image );
+        TextureSetImage( textureSet, 0u, image );
       }
     }
   }
@@ -487,7 +488,7 @@ TextureSet ImageRenderer::CreateTextureSet( Vector4& textureRect, const std::str
       ResourceImage resourceImage = Dali::ResourceImage::New( url, mDesiredSize, mFittingMode, mSamplingMode );
       resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
       textureSet = TextureSet::New();
-      textureSet.SetImage( 0u, resourceImage );
+      TextureSetImage( textureSet, 0u, resourceImage );
     }
   }
 
@@ -826,7 +827,7 @@ void ImageRenderer::ApplyImageToSampler( const Image& image )
       textureSet = TextureSet::New();
       mImpl->mRenderer.SetTextures( textureSet );
     }
-    textureSet.SetImage( 0u, image );
+    TextureSetImage( textureSet, 0u, image );
   }
 }
 
index 3f91eeb..677d5ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -22,6 +22,7 @@
 #include <dali/integration-api/platform-abstraction.h>
 #include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/images/resource-image.h>
+#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL IINCLUDES
 #include <dali-toolkit/internal/controls/renderers/renderer-factory-impl.h>
@@ -534,7 +535,7 @@ void NPatchRenderer::ApplyImageToSampler()
   TextureSet textureSet = mImpl->mRenderer.GetTextures();
   if( textureSet )
   {
-    textureSet.SetImage( 0u, mCroppedImage );
+    TextureSetImage( textureSet, 0u, mCroppedImage );
 
     if( mStretchPixelsX.Size() == 1 && mStretchPixelsY.Size() == 1 )
     {
index 44754d7..1832e61 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_N_PATCH_RENDERER_H__
-#define __DALI_TOOLKIT_INTERNAL_N_PATCH_RENDERER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_N_PATCH_RENDERER_H
+#define DALI_TOOLKIT_INTERNAL_N_PATCH_RENDERER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/images/image.h>
-#include <dali/public-api/images/nine-patch-image.h>
 #include <dali/public-api/images/image-operations.h>
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/shader.h>
-#include <dali/devel-api/rendering/sampler.h>
+#include <dali/public-api/images/nine-patch-image.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/sampler.h>
+#include <dali/public-api/rendering/shader.h>
 
 namespace Dali
 {
@@ -220,4 +220,4 @@ private:
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_N_PATCH_RENDERER_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_N_PATCH_RENDERER_H
index 3db2282..4fd7424 100644 (file)
@@ -153,6 +153,32 @@ Renderer RendererFactoryCache::GetDebugRenderer()
   return mDebugRenderer;
 }
 
+Geometry RendererFactoryCache::CreateQuadGeometry()
+{
+  const float halfWidth = 0.5f;
+  const float halfHeight = 0.5f;
+  struct QuadVertex { Vector2 position;};
+  QuadVertex quadVertexData[4] =
+  {
+      { Vector2(-halfWidth, -halfHeight) },
+      { Vector2(-halfWidth, halfHeight)  },
+      { Vector2( halfWidth, -halfHeight) },
+      { Vector2( halfWidth, halfHeight)  }
+  };
+
+  Property::Map quadVertexFormat;
+  quadVertexFormat["aPosition"] = Property::VECTOR2;
+  PropertyBuffer quadVertices = PropertyBuffer::New( quadVertexFormat );
+  quadVertices.SetData( quadVertexData, 4 );
+
+  // Create the geometry object
+  Geometry geometry = Geometry::New();
+  geometry.AddVertexBuffer( quadVertices );
+  geometry.SetGeometryType( Geometry::TRIANGLE_STRIP );
+
+  return geometry;
+}
+
 SvgRasterizeThread* RendererFactoryCache::GetSVGRasterizationThread()
 {
   if( !mSvgRasterizeThread )
index 8bffd15..8d5b18e 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_RENDERER_FACTORY_CACHE_H__
-#define __DALI_TOOLKIT_RENDERER_FACTORY_CACHE_H__
+#ifndef DALI_TOOLKIT_RENDERER_FACTORY_CACHE_H
+#define DALI_TOOLKIT_RENDERER_FACTORY_CACHE_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,9 +23,9 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/object/ref-object.h>
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/shader.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/shader.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/devel-api/object/weak-handle.h>
 
@@ -109,6 +109,12 @@ public:
    */
   void SaveShader( ShaderType type, Shader shader );
 
+  /*
+   * Greate the quad geometry.
+   * Quad geometry is shared by multiple kind of Renderer, so implement it in the factory-cache.
+   */
+  static Geometry CreateQuadGeometry();
+
   /**
    * Create the grid geometry.
    * @param[in] gridSize The size of the grid.
@@ -225,4 +231,4 @@ private:
 
 } // namespace Dali
 
-#endif /*__DALI_TOOLKIT_RENDERER_FACTORY_CACHE_H__ */
+#endif // DALI_TOOLKIT_RENDERER_FACTORY_CACHE_H
index 556a7e6..cbdf376 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H__
-#define __DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H__
+#ifndef DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H
+#define DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  */
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
 #include <dali/devel-api/threading/conditional-wait.h>
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/devel-api/threading/thread.h>
-#include <dali/devel-api/rendering/texture-set.h>
-#include <dali/devel-api/images/pixel-data.h>
 #include <dali/public-api/images/buffer-image.h>
+#include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/ref-object.h>
-#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
+#include <dali/public-api/rendering/texture-set.h>
 
 struct NSVGimage;
 struct NSVGrasterizer;
@@ -213,4 +213,4 @@ private:
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H__ */
+#endif // DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H
index 8fbf70a..8e50ecc 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/math/vector4.h>
 #include <dali/devel-api/images/atlas.h>
+#include <dali/devel-api/images/texture-set-image.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -96,7 +97,7 @@ void SvgRenderer::DoSetOnStage( Actor& actor )
   Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
   if( !geometry )
   {
-    geometry =  Geometry::QUAD();
+    geometry =  mFactoryCache.CreateQuadGeometry();
     mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
   }
   TextureSet textureSet = TextureSet::New();
@@ -230,7 +231,7 @@ void SvgRenderer::ApplyRasterizedImage( PixelData rasterizedPixelData )
 
       if( textureSet )
       {
-        textureSet.SetImage( 0u, texture );
+        TextureSetImage( textureSet, 0u, texture );
       }
     }
   }
index c06e400..1b9c422 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
 // EXTERNAL INCLUDES
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/object/property-buffer.h>
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/texture-set.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/property-buffer.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/shader.h>
+#include <dali/public-api/rendering/texture-set.h>
 
 namespace Dali
 {
index 5261f60..1eb7725 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BOUNCING_EFFECT_ACTOR_H__
-#define __DALI_TOOLKIT_INTERNAL_BOUNCING_EFFECT_ACTOR_H__
+#ifndef DALI_TOOLKIT_INTERNAL_BOUNCING_EFFECT_ACTOR_H
+#define DALI_TOOLKIT_INTERNAL_BOUNCING_EFFECT_ACTOR_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -66,4 +66,4 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex);
 } // namespace Dali
 
 
-#endif /* __DALI_TOOLKIT_INTERNAL_BOUNCING_EFFECT_ACTOR_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_BOUNCING_EFFECT_ACTOR_H
index 741b057..b7c1e57 100644 (file)
@@ -1441,16 +1441,6 @@ void ItemView::CalculateDomainSize(const Vector3& layoutSize)
   }
 }
 
-Vector2 ItemView::GetDomainSize() const
-{
-  Actor self = Self();
-
-  float minScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_Y);
-  float maxScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX_Y);
-
-  return Vector2(0.0f, fabs(GetScrollPosition(minScrollPosition, self.GetCurrentSize()) - GetScrollPosition(-maxScrollPosition, self.GetCurrentSize())));
-}
-
 bool ItemView::IsLayoutScrollable(const Vector3& layoutSize)
 {
   Actor self = Self();
index d8bbcac..5ae0112 100644 (file)
@@ -216,11 +216,6 @@ public:
   void ReplaceItems(const ItemContainer& replacementItems, float durationSeconds);
 
   /**
-   * @copydoc Toolkit::Scrollable::GetDomainSize
-   */
-  Vector2 GetDomainSize() const;
-
-  /**
    * @copydoc Toolkit::Scrollable::GetCurrentScrollPosition
    */
   Vector2 GetCurrentScrollPosition() const;
index 690704d..1d53111 100644 (file)
@@ -1176,19 +1176,6 @@ Vector2 ScrollView::GetCurrentScrollPosition() const
   return -GetPropertyPosition();
 }
 
-Vector2 ScrollView::GetDomainSize() const
-{
-  Vector3 size = Self().GetCurrentSize();
-
-  const RulerDomain& xDomain = GetRulerX()->GetDomain();
-  const RulerDomain& yDomain = GetRulerY()->GetDomain();
-
-  Vector2 domainSize;
-  domainSize.x = xDomain.max - xDomain.min - size.x;
-  domainSize.y = yDomain.max - yDomain.min - size.y;
-  return domainSize;
-}
-
 void ScrollView::TransformTo(const Vector2& position,
                              DirectionBias horizontalBias, DirectionBias verticalBias)
 {
index 63df8dc..b288720 100644 (file)
@@ -364,11 +364,6 @@ public:
   Vector2 GetCurrentScrollPosition() const;
 
   /**
-   * @copydoc Toolkit::Scrollable::GetDomainSize
-   */
-  Vector2 GetDomainSize() const;
-
-  /**
    * @copydoc ScrollTo(const Vector2&)
    */
   void TransformTo(const Vector2& position,
index 0d5d045..660606c 100644 (file)
@@ -55,12 +55,6 @@ public:
   void SetOvershootEnabled(bool enable);
 
   /**
-   * Gets the size of the domain (minimum/maximum extents for each axis to scroll to)
-   * @return the domain size
-   */
-  virtual Vector2 GetDomainSize() const = 0;
-
-  /**
    * Adds actor as an Overlay to Scrollable
    * This method is called by Add-on UI components
    * such as scroll bars, page indicators.
index 47a0790..1e1ccad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
 #include <cmath>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/stage.h>
-#include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/property-map.h>
+#include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
index 4763884..8f7916c 100644 (file)
@@ -52,10 +52,11 @@ namespace // unnamed namespace
 {
 
 #if defined(DEBUG_ENABLED)
-  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
 #endif
 
-  const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
+const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
+const float DEFAULT_SCROLL_SPEED = 1200.f; ///< The default scroll speed for the text editor in pixels/second.
 } // unnamed namespace
 
 namespace
@@ -928,10 +929,20 @@ void TextEditor::OnInitialize()
 
   mController->GetLayoutEngine().SetLayout( LayoutEngine::MULTI_LINE_BOX );
 
+  // Enables the text input.
   mController->EnableTextInput( mDecorator );
 
+  // Enables the vertical scrolling after the text input has been enabled.
+  mController->SetVerticalScrollEnabled( true );
+
+  // Disables the horizontal scrolling.
+  mController->SetHorizontalScrollEnabled( false );
+
   mController->SetMaximumNumberOfCharacters( std::numeric_limits<Length>::max() );
 
+  // Enable the smooth handle panning.
+  mController->SetSmoothHandlePanEnabled( true );
+
   // Forward input events to controller
   EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
   GetTapGestureDetector().SetMaximumTapsRequired( 2 );
@@ -948,8 +959,11 @@ void TextEditor::OnInitialize()
     mDecorator->SetBoundingBox( Rect<int>( 0.0f, 0.0f, stageSize.width, stageSize.height ) );
   }
 
-  // Flip vertically the 'left' selection handle
-  mDecorator->FlipHandleVertically( LEFT_SELECTION_HANDLE, true );
+  // Whether to flip the selection handles as soon as they cross.
+  mDecorator->FlipSelectionHandlesOnCrossEnabled( true );
+
+  // Set the default scroll speed.
+  mDecorator->SetScrollSpeed( DEFAULT_SCROLL_SPEED );
 
   // Fill-parent area by default
   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
index 69776fa..32fe824 100644 (file)
@@ -1114,8 +1114,18 @@ void TextField::OnInitialize()
 
   mController->GetLayoutEngine().SetLayout( LayoutEngine::SINGLE_LINE_BOX );
 
+  // Enables the text input.
   mController->EnableTextInput( mDecorator );
 
+  // Enables the horizontal scrolling after the text input has been enabled.
+  mController->SetHorizontalScrollEnabled( true );
+
+  // Disables the vertical scrolling.
+  mController->SetVerticalScrollEnabled( false );
+
+  // Disable the smooth handle panning.
+  mController->SetSmoothHandlePanEnabled( false );
+
   // Forward input events to controller
   EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
   GetTapGestureDetector().SetMaximumTapsRequired( 2 );
index ed8dada..b1dce92 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -24,9 +24,8 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/devel-api/rendering/renderer.h>
-
-// INTERNAL INCLUDES
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/images/texture-set-image.h>
 
 namespace Dali
 {
@@ -185,7 +184,7 @@ void BlurTwoPassFilter::Enable()
 
   // Add effect texture to blend-two-image custom shader
   TextureSet textureSet = mActorForBlending.GetRendererAt(0).GetTextures();
-  textureSet.SetImage( 1u, mInputImage );
+  TextureSetImage( textureSet, 1u, mInputImage );
 
   SetupCamera();
   CreateRenderTasks();
index c96d1bc..aeedd0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/images/texture-set-image.h>
+
+// INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 
 namespace Dali
@@ -128,12 +131,12 @@ void EmbossFilter::Enable()
   InitializeControlRenderer( mActorForComposite, mRendererForEmboss2, rendererMap );
 
   TextureSet textureSet1 = TextureSet::New();
-  textureSet1.SetImage( 0, mImageForEmboss1 );
+  TextureSetImage( textureSet1, 0, mImageForEmboss1 );
   mActorForComposite.GetRendererAt(0).SetTextures( textureSet1 );
   mActorForComposite.GetRendererAt(0).RegisterProperty( COLOR_UNIFORM_NAME, Color::BLACK );
 
   TextureSet textureSet2 = TextureSet::New();
-  textureSet2.SetImage( 0, mImageForEmboss2 );
+  TextureSetImage( textureSet2, 0, mImageForEmboss2 );
   mActorForComposite.GetRendererAt(1).SetTextures( textureSet2 );
   mActorForComposite.GetRendererAt(1).RegisterProperty( COLOR_UNIFORM_NAME, Color::WHITE );
 
index 2286a5b..11a8fc9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 namespace
 {
index 2b5e328..10c1e22 100644 (file)
@@ -558,7 +558,7 @@ void GetCursorPosition( VisualModelPtr visualModel,
                                      ( isFirstPositionOfLine && !isRightToLeftParagraph ) );
 
       cursorInfo.secondaryPosition.x = -glyphMetrics.xBearing + secondaryPosition.x + ( addGlyphAdvance ? glyphMetrics.advance : 0.f );
-      cursorInfo.secondaryPosition.y = cursorInfo.lineOffset + cursorInfo.lineHeight - cursorInfo.secondaryCursorHeight - line.descender - ( glyphMetrics.fontHeight - glyphMetrics.ascender );
+      cursorInfo.secondaryPosition.y = cursorInfo.lineOffset + cursorInfo.lineHeight - cursorInfo.secondaryCursorHeight;
 
       // Transform the cursor info from line's coords to text's coords.
       cursorInfo.secondaryPosition.x += line.alignmentOffset;
index 74fc924..a33a9bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
-
-#include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/actors/layer.h>
+#include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/property-notification.h>
-
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
@@ -93,17 +91,17 @@ const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight
 
 const Dali::Vector4 HANDLE_COLOR( 0.0f, (183.0f / 255.0f), (229.0f / 255.0f), 1.0f  );
 
-const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
-const float TO_MILLISECONDS = 1000.f;
-const float TO_SECONDS = 1.f / TO_MILLISECONDS;
+const unsigned int CURSOR_BLINK_INTERVAL = 500u; ///< Cursor blink interval in milliseconds.
+const float TO_MILLISECONDS = 1000.f;            ///< Converts from seconds to milliseconds.
+const float TO_SECONDS = 1.f / TO_MILLISECONDS;  ///< Converts from milliseconds to seconds.
 
-const unsigned int SCROLL_TICK_INTERVAL = 50u;
+const unsigned int SCROLL_TICK_INTERVAL = 50u; ///< Scroll interval in milliseconds.
+const float SCROLL_THRESHOLD = 10.f;           ///< Threshold in pixels close to the edges of the decorator boundaries from where the scroll timer starts to emit signals.
+const float SCROLL_SPEED = 300.f;              ///< The scroll speed in pixels/second.
 
-const float SCROLL_THRESHOLD = 10.f;
-const float SCROLL_SPEED = 300.f;
-const float SCROLL_DISTANCE = SCROLL_SPEED * SCROLL_TICK_INTERVAL * TO_SECONDS;
+const float SCROLL_DISTANCE = SCROLL_SPEED * SCROLL_TICK_INTERVAL * TO_SECONDS; ///< Distance in pixels scrolled in one second.
 
-const float CURSOR_WIDTH = 1.f;
+const float CURSOR_WIDTH = 1.f; ///< The cursor's width in pixels.
 
 /**
  * structure to hold coordinates of each quad, which will make up the mesh.
@@ -208,6 +206,7 @@ struct Decorator::Impl : public ConnectionTracker
   {
     HandleImpl()
     : position(),
+      globalPosition(),
       size(),
       lineHeight( 0.0f ),
       grabDisplacementX( 0.f ),
@@ -226,6 +225,7 @@ struct Decorator::Impl : public ConnectionTracker
     ImageView markerActor;
 
     Vector2 position;
+    Vector2 globalPosition;
     Size    size;
     float   lineHeight;              ///< Not the handle height
     float   grabDisplacementX;
@@ -277,10 +277,12 @@ struct Decorator::Impl : public ConnectionTracker
     mFlipSelectionHandlesOnCross( false ),
     mFlipLeftSelectionHandleDirection( false ),
     mFlipRightSelectionHandleDirection( false ),
-    mHandlePanning( false ),
-    mHandleCurrentCrossed( false ),
-    mHandlePreviousCrossed( false ),
-    mNotifyEndOfScroll( false )
+    mIsHandlePanning( false ),
+    mIsHandleCurrentlyCrossed( false ),
+    mIsHandlePreviouslyCrossed( false ),
+    mNotifyEndOfScroll( false ),
+    mHorizontalScrollingEnabled( false ),
+    mVerticalScrollingEnabled( false )
   {
     mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
     mHighlightShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
@@ -304,7 +306,10 @@ struct Decorator::Impl : public ConnectionTracker
     if( mPrimaryCursor )
     {
       const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
-      mPrimaryCursorVisible = ( cursor.position.x + mCursorWidth <= mControlSize.width ) && ( cursor.position.x >= 0.f );
+      mPrimaryCursorVisible = ( ( cursor.position.x + mCursorWidth <= mControlSize.width ) &&
+                                ( cursor.position.x >= 0.f ) &&
+                                ( cursor.position.y + cursor.cursorHeight <= mControlSize.height ) &&
+                                ( cursor.position.y >= 0.f ) );
       if( mPrimaryCursorVisible )
       {
         mPrimaryCursor.SetPosition( cursor.position.x,
@@ -316,7 +321,10 @@ struct Decorator::Impl : public ConnectionTracker
     if( mSecondaryCursor )
     {
       const CursorImpl& cursor = mCursor[SECONDARY_CURSOR];
-      mSecondaryCursorVisible = ( cursor.position.x + mCursorWidth <= mControlSize.width ) && ( cursor.position.x >= 0.f );
+      mSecondaryCursorVisible = ( ( cursor.position.x + mCursorWidth <= mControlSize.width ) &&
+                                  ( cursor.position.x >= 0.f ) &&
+                                  ( cursor.position.y + cursor.cursorHeight <= mControlSize.height ) &&
+                                  ( cursor.position.y >= 0.f ) );
       if( mSecondaryCursorVisible )
       {
         mSecondaryCursor.SetPosition( cursor.position.x,
@@ -331,7 +339,10 @@ struct Decorator::Impl : public ConnectionTracker
     bool newGrabHandlePosition = false;
     if( grabHandle.active )
     {
-      const bool isVisible = ( grabHandle.position.x + floor( 0.5f * mCursorWidth ) <= mControlSize.width ) && ( grabHandle.position.x >= 0.f );
+      const bool isVisible = ( ( grabHandle.position.x + floor( 0.5f * mCursorWidth ) <= mControlSize.width ) &&
+                               ( grabHandle.position.x >= 0.f ) &&
+                               ( grabHandle.position.y <= mControlSize.height - grabHandle.lineHeight ) &&
+                               ( grabHandle.position.y >= 0.f ) );
 
       if( isVisible )
       {
@@ -363,8 +374,14 @@ struct Decorator::Impl : public ConnectionTracker
     bool newSecondaryHandlePosition = false;
     if( primary.active || secondary.active )
     {
-      const bool isPrimaryVisible = ( primary.position.x <= mControlSize.width ) && ( primary.position.x >= 0.f );
-      const bool isSecondaryVisible = ( secondary.position.x <= mControlSize.width ) && ( secondary.position.x >= 0.f );
+      const bool isPrimaryVisible = ( ( primary.position.x <= mControlSize.width ) &&
+                                      ( primary.position.x >= 0.f ) &&
+                                      ( primary.position.y <= mControlSize.height - primary.lineHeight ) &&
+                                      ( primary.position.y >= 0.f ) );
+      const bool isSecondaryVisible = ( ( secondary.position.x <= mControlSize.width ) &&
+                                        ( secondary.position.x >= 0.f ) &&
+                                        ( secondary.position.y <= mControlSize.height - secondary.lineHeight ) &&
+                                        ( secondary.position.y >= 0.f ) );
 
       if( isPrimaryVisible || isSecondaryVisible )
       {
@@ -623,11 +640,18 @@ struct Decorator::Impl : public ConnectionTracker
 
   void SetupGestures()
   {
+    // Will consume tap gestures on handles.
     mTapDetector = TapGestureDetector::New();
-    mTapDetector.DetectedSignal().Connect( this, &Decorator::Impl::OnTap );
 
-    mPanGestureDetector = PanGestureDetector::New();
-    mPanGestureDetector.DetectedSignal().Connect( this, &Decorator::Impl::OnPan );
+    // Will consume double tap gestures on handles.
+    mTapDetector.SetMaximumTapsRequired( 2u );
+
+    // Will consume long press gestures on handles.
+    mLongPressDetector = LongPressGestureDetector::New();
+
+    // Detects pan gestures on handles.
+    mPanDetector = PanGestureDetector::New();
+    mPanDetector.DetectedSignal().Connect( this, &Decorator::Impl::OnPan );
   }
 
   void CreateActiveLayer()
@@ -695,8 +719,15 @@ struct Decorator::Impl : public ConnectionTracker
         grabHandle.actor.SetColor( mHandleColor );
 
         grabHandle.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
-        mTapDetector.Attach( grabHandle.grabArea );
-        mPanGestureDetector.Attach( grabHandle.grabArea );
+
+        // The grab handle's actor is attached to the tap and long press detectors in order to consume these events.
+        // Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
+        mTapDetector.Attach( grabHandle.actor );
+        mLongPressDetector.Attach( grabHandle.actor );
+
+        // The grab handle's area is attached to the pan detector.
+        // The OnPan() method is connected to the signals emitted by the pan detector.
+        mPanDetector.Attach( grabHandle.grabArea );
 
         mActiveLayer.Add( grabHandle.actor );
       }
@@ -755,10 +786,17 @@ struct Decorator::Impl : public ConnectionTracker
         primary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
         primary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
 
-        mTapDetector.Attach( primary.grabArea );
-        mPanGestureDetector.Attach( primary.grabArea );
         primary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
 
+        // The handle's actor is attached to the tap and long press detectors in order to consume these events.
+        // Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
+        mTapDetector.Attach( primary.actor );
+        mLongPressDetector.Attach( primary.actor );
+
+        // The handle's area is attached to the pan detector.
+        // The OnPan() method is connected to the signals emitted by the pan detector.
+        mPanDetector.Attach( primary.grabArea );
+
         primary.actor.Add( primary.grabArea );
 
         CreateHandleMarker( primary, mHandleImages[LEFT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], LEFT_SELECTION_HANDLE );
@@ -792,10 +830,17 @@ struct Decorator::Impl : public ConnectionTracker
         secondary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
         secondary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
 
-        mTapDetector.Attach( secondary.grabArea );
-        mPanGestureDetector.Attach( secondary.grabArea );
         secondary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
 
+        // The handle's actor is attached to the tap and long press detectors in order to consume these events.
+        // Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
+        mTapDetector.Attach( secondary.actor );
+        mLongPressDetector.Attach( secondary.actor );
+
+        // The handle's area is attached to the pan detector.
+        // The OnPan() method is connected to the signals emitted by the pan detector.
+        mPanDetector.Attach( secondary.grabArea );
+
         secondary.actor.Add( secondary.grabArea );
 
         CreateHandleMarker( secondary, mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], RIGHT_SELECTION_HANDLE  );
@@ -816,8 +861,8 @@ struct Decorator::Impl : public ConnectionTracker
     // The grab handle position in world coords.
     // The active layer's world position is the center of the active layer. The origin of the
     // coord system of the handles is the top left of the active layer.
-    position.x = parentWorldPosition.x - 0.5f * mControlSize.width + handle.position.x;
-    position.y = parentWorldPosition.y - 0.5f * mControlSize.height + handle.position.y;
+    position.x = parentWorldPosition.x - 0.5f * mControlSize.width + handle.position.x + ( mSmoothHandlePanEnabled ? handle.grabDisplacementX : 0.f );
+    position.y = parentWorldPosition.y - 0.5f * mControlSize.height + handle.position.y + ( mSmoothHandlePanEnabled ? handle.grabDisplacementY : 0.f );
   }
 
   void SetGrabHandlePosition()
@@ -849,8 +894,8 @@ struct Decorator::Impl : public ConnectionTracker
 
     if( grabHandle.actor )
     {
-      grabHandle.actor.SetPosition( grabHandle.position.x + floor( 0.5f * mCursorWidth ),
-                                    yLocalPosition ); // TODO : Fix for multiline.
+      grabHandle.actor.SetPosition( grabHandle.position.x + floor( 0.5f * mCursorWidth ) + ( mSmoothHandlePanEnabled ? grabHandle.grabDisplacementX : 0.f ),
+                                    yLocalPosition + ( mSmoothHandlePanEnabled ? grabHandle.grabDisplacementY : 0.f ) );
     }
   }
 
@@ -875,18 +920,21 @@ struct Decorator::Impl : public ConnectionTracker
 
     // Whether to flip the handles if they are crossed.
     bool crossFlip = false;
-    if( mFlipSelectionHandlesOnCross || !mHandlePanning )
+    if( mFlipSelectionHandlesOnCross || !mIsHandlePanning )
     {
-      crossFlip = mHandleCurrentCrossed;
+      crossFlip = mIsHandleCurrentlyCrossed;
     }
 
+    // Whether the handle was crossed before start the panning.
+    const bool isHandlePreviouslyCrossed = mFlipSelectionHandlesOnCross ? false : mIsHandlePreviouslyCrossed;
+
     // Does not flip if both conditions are true (double flip)
-    flipHandle = flipHandle != ( crossFlip || mHandlePreviousCrossed );
+    flipHandle = flipHandle != ( crossFlip || isHandlePreviouslyCrossed );
 
     // Will flip the handles vertically if the user prefers it.
     bool verticallyFlippedPreferred = handle.verticallyFlippedPreferred;
 
-    if( crossFlip || mHandlePreviousCrossed )
+    if( crossFlip || isHandlePreviouslyCrossed )
     {
       if( isPrimaryHandle )
       {
@@ -939,8 +987,8 @@ struct Decorator::Impl : public ConnectionTracker
 
     if( handle.actor )
     {
-      handle.actor.SetPosition( handle.position.x,
-                                yLocalPosition ); // TODO : Fix for multiline.
+      handle.actor.SetPosition( handle.position.x + ( mSmoothHandlePanEnabled ? handle.grabDisplacementX : 0.f ),
+                                yLocalPosition + ( mSmoothHandlePanEnabled ? handle.grabDisplacementY : 0.f ) );
     }
   }
 
@@ -1085,45 +1133,57 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
-  void OnTap( Actor actor, const TapGesture& tap )
-  {
-    if( actor == mHandle[GRAB_HANDLE].actor )
-    {
-      // TODO
-    }
-  }
-
   void DoPan( HandleImpl& handle, HandleType type, const PanGesture& gesture )
   {
     if( Gesture::Started == gesture.state )
     {
       handle.grabDisplacementX = handle.grabDisplacementY = 0.f;
+
+      handle.globalPosition.x = handle.position.x;
+      handle.globalPosition.y = handle.position.y;
     }
 
     handle.grabDisplacementX += gesture.displacement.x;
     handle.grabDisplacementY += ( handle.verticallyFlipped ? -gesture.displacement.y : gesture.displacement.y );
 
-    const float x = handle.position.x + handle.grabDisplacementX;
-    const float y = handle.position.y + handle.lineHeight*0.5f + handle.grabDisplacementY;
+    const float x = handle.globalPosition.x + handle.grabDisplacementX;
+    const float y = handle.globalPosition.y + handle.grabDisplacementY + 0.5f * handle.lineHeight;
+    const float yVerticallyFlippedCorrected = y - ( handle.verticallyFlipped ? handle.lineHeight : 0.f );
 
-    if( Gesture::Started    == gesture.state ||
-        Gesture::Continuing == gesture.state )
+    if( ( Gesture::Started    == gesture.state ) ||
+        ( Gesture::Continuing == gesture.state ) )
     {
       Vector2 targetSize;
       mController.GetTargetSize( targetSize );
 
-      if( x < mScrollThreshold )
+      if( mHorizontalScrollingEnabled &&
+          ( x < mScrollThreshold ) )
       {
         mScrollDirection = SCROLL_RIGHT;
         mHandleScrolling = type;
         StartScrollTimer();
       }
-      else if( x > targetSize.width - mScrollThreshold )
+      else if( mHorizontalScrollingEnabled &&
+               ( x > targetSize.width - mScrollThreshold ) )
       {
         mScrollDirection = SCROLL_LEFT;
         mHandleScrolling = type;
         StartScrollTimer();
       }
+      else if( mVerticalScrollingEnabled &&
+               ( yVerticallyFlippedCorrected < mScrollThreshold ) )
+      {
+        mScrollDirection = SCROLL_TOP;
+        mHandleScrolling = type;
+        StartScrollTimer();
+      }
+      else if( mVerticalScrollingEnabled &&
+               ( yVerticallyFlippedCorrected + handle.lineHeight > targetSize.height - mScrollThreshold ) )
+      {
+        mScrollDirection = SCROLL_BOTTOM;
+        mHandleScrolling = type;
+        StartScrollTimer();
+      }
       else
       {
         mHandleScrolling = HANDLE_TYPE_COUNT;
@@ -1131,10 +1191,10 @@ struct Decorator::Impl : public ConnectionTracker
         mController.DecorationEvent( type, HANDLE_PRESSED, x, y );
       }
 
-      mHandlePanning = true;
+      mIsHandlePanning = true;
     }
-    else if( Gesture::Finished  == gesture.state ||
-             Gesture::Cancelled == gesture.state )
+    else if( ( Gesture::Finished  == gesture.state ) ||
+             ( Gesture::Cancelled == gesture.state ) )
     {
       if( mScrollTimer &&
           ( mScrollTimer.IsRunning() || mNotifyEndOfScroll ) )
@@ -1155,7 +1215,7 @@ struct Decorator::Impl : public ConnectionTracker
       }
       handle.pressed = false;
 
-      mHandlePanning = false;
+      mIsHandlePanning = false;
     }
   }
 
@@ -1181,20 +1241,22 @@ struct Decorator::Impl : public ConnectionTracker
 
   bool OnGrabHandleTouched( Actor actor, const TouchData& touch )
   {
+    HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+
     // Switch between pressed/release grab-handle images
     if( touch.GetPointCount() > 0 &&
-        mHandle[GRAB_HANDLE].actor )
+        grabHandle.actor )
     {
       const PointState::Type state = touch.GetState( 0 );
 
       if( PointState::DOWN == state )
       {
-        mHandle[GRAB_HANDLE].pressed = true;
+        grabHandle.pressed = true;
       }
       else if( ( PointState::UP == state ) ||
                ( PointState::INTERRUPTED == state ) )
       {
-        mHandle[GRAB_HANDLE].pressed = false;
+        grabHandle.pressed = false;
       }
 
       SetHandleImage( GRAB_HANDLE );
@@ -1206,22 +1268,24 @@ struct Decorator::Impl : public ConnectionTracker
 
   bool OnHandleOneTouched( Actor actor, const TouchData& touch )
   {
+    HandleImpl& primarySelectionHandle = mHandle[LEFT_SELECTION_HANDLE];
+
     // Switch between pressed/release selection handle images
     if( touch.GetPointCount() > 0 &&
-        mHandle[LEFT_SELECTION_HANDLE].actor )
+        primarySelectionHandle.actor )
     {
       const PointState::Type state = touch.GetState( 0 );
 
       if( PointState::DOWN == state )
       {
-        mHandle[LEFT_SELECTION_HANDLE].pressed = true;
+        primarySelectionHandle.pressed = true;
       }
       else if( ( PointState::UP == state ) ||
                ( PointState::INTERRUPTED == state ) )
       {
-        mHandle[LEFT_SELECTION_HANDLE].pressed = false;
-        mHandlePreviousCrossed = mHandleCurrentCrossed;
-        mHandlePanning = false;
+        primarySelectionHandle.pressed = false;
+        mIsHandlePreviouslyCrossed = mIsHandleCurrentlyCrossed;
+        mIsHandlePanning = false;
       }
 
       SetHandleImage( LEFT_SELECTION_HANDLE );
@@ -1233,22 +1297,24 @@ struct Decorator::Impl : public ConnectionTracker
 
   bool OnHandleTwoTouched( Actor actor, const TouchData& touch )
   {
+    HandleImpl& secondarySelectionHandle = mHandle[RIGHT_SELECTION_HANDLE];
+
     // Switch between pressed/release selection handle images
     if( touch.GetPointCount() > 0 &&
-        mHandle[RIGHT_SELECTION_HANDLE].actor )
+        secondarySelectionHandle.actor )
     {
       const PointState::Type state = touch.GetState( 0 );
 
       if( PointState::DOWN == state )
       {
-        mHandle[RIGHT_SELECTION_HANDLE].pressed = true;
+        secondarySelectionHandle.pressed = true;
       }
       else if( ( PointState::UP == state ) ||
                ( PointState::INTERRUPTED == state ) )
       {
-        mHandle[RIGHT_SELECTION_HANDLE].pressed = false;
-        mHandlePreviousCrossed = mHandleCurrentCrossed;
-        mHandlePanning = false;
+        secondarySelectionHandle.pressed = false;
+        mIsHandlePreviouslyCrossed = mIsHandleCurrentlyCrossed;
+        mIsHandlePanning = false;
       }
 
       SetHandleImage( RIGHT_SELECTION_HANDLE );
@@ -1626,10 +1692,39 @@ struct Decorator::Impl : public ConnectionTracker
   {
     if( HANDLE_TYPE_COUNT != mHandleScrolling )
     {
+      float x = 0.f;
+      float y = 0.f;
+
+      switch( mScrollDirection )
+      {
+        case SCROLL_RIGHT:
+        {
+          x = mScrollDistance;
+          break;
+        }
+        case SCROLL_LEFT:
+        {
+          x = -mScrollDistance;
+          break;
+        }
+        case SCROLL_TOP:
+        {
+          y = mScrollDistance;
+          break;
+        }
+        case SCROLL_BOTTOM:
+        {
+          y = -mScrollDistance;
+          break;
+        }
+        default:
+          break;
+      }
+
       mController.DecorationEvent( mHandleScrolling,
                                    HANDLE_SCROLLING,
-                                   mScrollDirection == SCROLL_RIGHT ? mScrollDistance : -mScrollDistance,
-                                   0.f );
+                                   x,
+                                   y );
     }
 
     return true;
@@ -1637,8 +1732,10 @@ struct Decorator::Impl : public ConnectionTracker
 
   ControllerInterface& mController;
 
-  TapGestureDetector  mTapDetector;
-  PanGestureDetector  mPanGestureDetector;
+  TapGestureDetector       mTapDetector;
+  PanGestureDetector       mPanDetector;
+  LongPressGestureDetector mLongPressDetector;
+
   Timer               mCursorBlinkTimer;          ///< Timer to signal cursor to blink
   Timer               mScrollTimer;               ///< Timer used to scroll the text when the grab handle is moved close to the edges.
 
@@ -1693,10 +1790,13 @@ struct Decorator::Impl : public ConnectionTracker
   bool                mFlipSelectionHandlesOnCross       : 1; ///< Whether to flip the selection handles as soon as they cross.
   bool                mFlipLeftSelectionHandleDirection  : 1; ///< Whether to flip the left selection handle image because of the character's direction.
   bool                mFlipRightSelectionHandleDirection : 1; ///< Whether to flip the right selection handle image because of the character's direction.
-  bool                mHandlePanning                     : 1; ///< Whether any of the handles is moving.
-  bool                mHandleCurrentCrossed              : 1; ///< Whether the handles are crossed.
-  bool                mHandlePreviousCrossed             : 1; ///< Whether the handles where crossed at the last handle touch up.
+  bool                mIsHandlePanning                   : 1; ///< Whether any of the handles is moving.
+  bool                mIsHandleCurrentlyCrossed          : 1; ///< Whether the handles are crossed.
+  bool                mIsHandlePreviouslyCrossed         : 1; ///< Whether the handles where crossed at the last handle touch up.
   bool                mNotifyEndOfScroll                 : 1; ///< Whether to notify the end of the scroll.
+  bool                mHorizontalScrollingEnabled        : 1; ///< Whether the horizontal scrolling is enabled.
+  bool                mVerticalScrollingEnabled          : 1; ///< Whether the vertical scrolling is enabled.
+  bool                mSmoothHandlePanEnabled            : 1; ///< Whether to pan smoothly the handles.
 };
 
 DecoratorPtr Decorator::New( ControllerInterface& controller,
@@ -1740,18 +1840,22 @@ unsigned int Decorator::GetActiveCursor() const
 
 void Decorator::SetPosition( Cursor cursor, float x, float y, float cursorHeight, float lineHeight )
 {
-  mImpl->mCursor[cursor].position.x = x;
-  mImpl->mCursor[cursor].position.y = y;
-  mImpl->mCursor[cursor].cursorHeight = cursorHeight;
-  mImpl->mCursor[cursor].lineHeight = lineHeight;
+  Impl::CursorImpl& cursorImpl = mImpl->mCursor[cursor];
+
+  cursorImpl.position.x = x;
+  cursorImpl.position.y = y;
+  cursorImpl.cursorHeight = cursorHeight;
+  cursorImpl.lineHeight = lineHeight;
 }
 
 void Decorator::GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const
 {
-  x = mImpl->mCursor[cursor].position.x;
-  y = mImpl->mCursor[cursor].position.y;
-  cursorHeight = mImpl->mCursor[cursor].cursorHeight;
-  lineHeight = mImpl->mCursor[cursor].lineHeight;
+  const Impl::CursorImpl& cursorImpl = mImpl->mCursor[cursor];
+
+  x = cursorImpl.position.x;
+  y = cursorImpl.position.y;
+  cursorHeight = cursorImpl.cursorHeight;
+  lineHeight = cursorImpl.lineHeight;
 }
 
 const Vector2& Decorator::GetPosition( Cursor cursor ) const
@@ -1839,7 +1943,7 @@ void Decorator::SetHandleActive( HandleType handleType, bool active )
   {
     if( ( LEFT_SELECTION_HANDLE == handleType ) || ( RIGHT_SELECTION_HANDLE == handleType ) )
     {
-      mImpl->mHandlePreviousCrossed = false;
+      mImpl->mIsHandlePreviouslyCrossed = false;
     }
 
     // TODO: this is a work-around.
@@ -1886,12 +1990,15 @@ void Decorator::SetPosition( HandleType handleType, float x, float y, float heig
   // Adjust handle's displacement
   Impl::HandleImpl& handle = mImpl->mHandle[handleType];
 
-  handle.grabDisplacementX -= x - handle.position.x;
-  handle.grabDisplacementY -= y - handle.position.y;
-
   handle.position.x = x;
   handle.position.y = y;
   handle.lineHeight = height;
+
+  if( mImpl->mSmoothHandlePanEnabled )
+  {
+    handle.grabDisplacementX = 0.f;
+    handle.grabDisplacementY = 0.f;
+  }
 }
 
 void Decorator::GetPosition( HandleType handleType, float& x, float& y, float& height ) const
@@ -1925,7 +2032,7 @@ void Decorator::FlipSelectionHandlesOnCrossEnabled( bool enable )
 
 void Decorator::SetSelectionHandleFlipState( bool indicesSwapped, bool left, bool right )
 {
-  mImpl->mHandleCurrentCrossed = indicesSwapped;
+  mImpl->mIsHandleCurrentlyCrossed = indicesSwapped;
   mImpl->mFlipLeftSelectionHandleDirection = left;
   mImpl->mFlipRightSelectionHandleDirection = right;
 }
@@ -2015,6 +2122,36 @@ void Decorator::NotifyEndOfScroll()
   mImpl->NotifyEndOfScroll();
 }
 
+void Decorator::SetHorizontalScrollEnabled( bool enable )
+{
+  mImpl->mHorizontalScrollingEnabled = enable;
+}
+
+bool Decorator::IsHorizontalScrollEnabled() const
+{
+  return mImpl->mHorizontalScrollingEnabled;
+}
+
+void Decorator::SetVerticalScrollEnabled( bool enable )
+{
+  mImpl->mVerticalScrollingEnabled = enable;
+}
+
+bool Decorator::IsVerticalScrollEnabled() const
+{
+  return mImpl->mVerticalScrollingEnabled;
+}
+
+void Decorator::SetSmoothHandlePanEnabled( bool enable )
+{
+  mImpl->mSmoothHandlePanEnabled = enable;
+}
+
+bool Decorator::IsSmoothHandlePanEnabled() const
+{
+  return mImpl->mSmoothHandlePanEnabled;
+}
+
 Decorator::~Decorator()
 {
   delete mImpl;
index 4bcd012..c52b7d0 100644 (file)
@@ -284,7 +284,7 @@ public:
   /**
    * @brief Retrieves the blink-interval for a cursor.
    *
-   * @return The cursor blink-interval.
+   * @return The cursor blink-interval in seconds.
    */
   float GetCursorBlinkInterval() const;
 
@@ -298,7 +298,7 @@ public:
   /**
    * @brief Retrieves the blink-duration for a cursor.
    *
-   * @return The cursor blink-duration.
+   * @return The cursor blink-duration in seconds.
    */
   float GetCursorBlinkDuration() const;
 
@@ -501,14 +501,14 @@ public:
    * It defines a square area inside the control, close to the edge.
    * When the cursor enters this area, the decorator starts to send scroll events.
    *
-   * @param[in] threshold The scroll threshold.
+   * @param[in] threshold The scroll threshold in pixels.
    */
   void SetScrollThreshold( float threshold );
 
   /**
    * @brief Retrieves the scroll threshold.
    *
-   * @retunr The scroll threshold.
+   * @retunr The scroll threshold in pixels.
    */
   float GetScrollThreshold() const;
 
@@ -517,14 +517,14 @@ public:
    *
    * Is the distance the text is going to be scrolled during a scroll interval.
    *
-   * @param[in] speed The scroll speed.
+   * @param[in] speed The scroll speed in pixels/second.
    */
   void SetScrollSpeed( float speed );
 
   /**
    * @brief Retrieves the scroll speed.
    *
-   * @return The scroll speed.
+   * @return The scroll speed in pixels/second.
    */
   float GetScrollSpeed() const;
 
@@ -533,6 +533,36 @@ public:
    */
   void NotifyEndOfScroll();
 
+  /**
+   * @copydoc Text::Controller::SetHorizontalScrollEnabled()
+   */
+  void SetHorizontalScrollEnabled( bool enable );
+
+  /**
+   * @copydoc Text::Controller::IsHorizontalScrollEnabled()
+   */
+  bool IsHorizontalScrollEnabled() const;
+
+  /**
+   * @copydoc Text::Controller::SetVerticalScrollEnabled()
+   */
+  void SetVerticalScrollEnabled( bool enable );
+
+  /**
+   * @copydoc Text::Controller::IsVerticalScrollEnabled()
+   */
+  bool IsVerticalScrollEnabled() const;
+
+  /**
+   * @copydoc Text::Controller::SetSmoothHandlePanEnabled()
+   */
+  void SetSmoothHandlePanEnabled( bool enable );
+
+  /**
+   * @copydoc Text::Controller::IsSmoothHandlePanEnabled()
+   */
+  bool IsSmoothHandlePanEnabled() const;
+
 protected:
 
   /**
index 1a72243..8b491b0 100644 (file)
@@ -593,7 +593,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
           if( isValidFont &&
               isEmojiScript )
           {
-            const BufferImage bitmap = fontClient.CreateBitmap( fontId, glyphIndex );
+            const PixelData bitmap = fontClient.CreateBitmap( fontId, glyphIndex );
 
             // For color emojis, the font is valid if the bitmap is RGBA.
             isValidFont = bitmap && ( Pixel::BGRA8888 == bitmap.GetPixelFormat() );
index f40b3a4..8532b93 100644 (file)
@@ -89,7 +89,7 @@ AtlasGlyphManager::AtlasGlyphManager()
 }
 
 void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
-                             const BufferImage& bitmap,
+                             const PixelData& bitmap,
                              Dali::Toolkit::AtlasManager::AtlasSlot& slot )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "Added glyph, font: %d index: %d\n", glyph.fontId, glyph.index );
@@ -97,9 +97,9 @@ void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
   if ( mAtlasManager.Add( bitmap, slot ) )
   {
     // A new atlas was created so set the texture set details for the atlas
-    Dali::Atlas atlas = mAtlasManager.GetAtlasContainer( slot.mAtlasId );
+    Dali::Texture atlas = mAtlasManager.GetAtlasContainer( slot.mAtlasId );
     TextureSet textureSet = TextureSet::New();
-    textureSet.SetImage( 0u, atlas );
+    textureSet.SetTexture( 0u, atlas );
     mAtlasManager.SetTextures( slot.mAtlasId, textureSet );
   }
 
index 90210f2..b72b649 100644 (file)
@@ -70,7 +70,7 @@ public:
    * @copydoc Toolkit::AtlasGlyphManager::Add
    */
   void Add( const Text::GlyphInfo& glyph,
-            const BufferImage& bitmap,
+            const PixelData& bitmap,
             Dali::Toolkit::AtlasManager::AtlasSlot& slot );
 
   /**
index abcd391..6858f26 100644 (file)
@@ -69,7 +69,7 @@ AtlasGlyphManager::AtlasGlyphManager(Internal::AtlasGlyphManager *impl)
 }
 
 void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
-                             const BufferImage& bitmap,
+                             const PixelData& bitmap,
                              AtlasManager::AtlasSlot& slot )
 {
   GetImplementation(*this).Add( glyph, bitmap, slot );
index 3831589..3ba54de 100644 (file)
@@ -84,7 +84,7 @@ public:
    * @param[out] slot information returned by atlas manager for addition
    */
   void Add( const Text::GlyphInfo& glyph,
-            const BufferImage& bitmap,
+            const PixelData& bitmap,
             AtlasManager::AtlasSlot& slot );
 
   /**
index 8d3ae1b..bc3a70a 100644 (file)
@@ -41,7 +41,6 @@ namespace
   const uint32_t DEFAULT_BLOCK_HEIGHT( 16u );
   const uint32_t SINGLE_PIXEL_PADDING( 1u );
   const uint32_t DOUBLE_PIXEL_PADDING( SINGLE_PIXEL_PADDING << 1 );
-  const uint32_t FILLED_PIXEL( -1 );
   Toolkit::AtlasManager::AtlasSize EMPTY_SIZE;
 }
 
@@ -79,8 +78,7 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasMa
     return 0;
   }
 
-  Dali::Atlas atlas = Dali::Atlas::New( width, height, pixelformat );
-  atlas.Clear( Vector4::ZERO );
+  Dali::Texture atlas = Dali::Texture::New( TextureType::TEXTURE_2D, pixelformat, width, height );
   AtlasDescriptor atlasDescriptor;
   atlasDescriptor.mAtlas = atlas;
   atlasDescriptor.mSize = size;
@@ -88,35 +86,21 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasMa
   atlasDescriptor.mTotalBlocks = ( ( width - 1u ) / blockWidth ) * ( ( height - 1u ) / blockHeight );
   atlasDescriptor.mAvailableBlocks = atlasDescriptor.mTotalBlocks;
 
-  atlasDescriptor.mHorizontalStrip = BufferImage::New( blockWidth, SINGLE_PIXEL_PADDING, pixelformat );
-  atlasDescriptor.mVerticalStrip = BufferImage::New( SINGLE_PIXEL_PADDING, blockHeight - DOUBLE_PIXEL_PADDING, pixelformat );
-
-  PixelBuffer* buffer = atlasDescriptor.mHorizontalStrip.GetBuffer();
-  if( buffer == NULL )
-  {
-    DALI_LOG_ERROR("atlasDescriptor.mHorizontalStrip.GetBuffer() returns NULL\n");
-    return 0;
-  }
-  memset( buffer, 0, atlasDescriptor.mHorizontalStrip.GetBufferSize() );
-
-  buffer = atlasDescriptor.mVerticalStrip.GetBuffer();
-  if( buffer == NULL )
-  {
-    DALI_LOG_ERROR("atlasDescriptor.mVerticalStrip.GetBuffer() returns NULL\n");
-    return 0;
-  }
-  memset( buffer, 0, atlasDescriptor.mVerticalStrip.GetBufferSize() );
-
-  BufferImage filledPixelImage = BufferImage::New( 1u, 1u, pixelformat );
-  buffer = filledPixelImage.GetBuffer();
-  if( buffer == NULL)
-  {
-    DALI_LOG_ERROR("filledPixelImage.GetBuffer() returns NULL\n");
-    return 0;
-  }
-
-  memset( buffer, 0xFF, filledPixelImage.GetBufferSize() );
-  atlas.Upload( filledPixelImage, 0, 0 );
+  unsigned int bufferSize(  blockWidth * SINGLE_PIXEL_PADDING * Dali::Pixel::GetBytesPerPixel(pixelformat) );
+  unsigned char* bufferHorizontalStrip = new unsigned char[bufferSize];
+  memset( bufferHorizontalStrip, 0, bufferSize );
+  atlasDescriptor.mHorizontalStrip = PixelData::New( bufferHorizontalStrip, bufferSize, blockWidth, SINGLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
+
+  bufferSize = SINGLE_PIXEL_PADDING * (blockHeight - DOUBLE_PIXEL_PADDING) * Dali::Pixel::GetBytesPerPixel(pixelformat);
+  unsigned char* bufferVerticalStrip = new unsigned char[bufferSize];
+  memset( bufferVerticalStrip, 0, bufferSize );
+  atlasDescriptor.mVerticalStrip = PixelData::New( bufferVerticalStrip, bufferSize, SINGLE_PIXEL_PADDING, blockHeight - DOUBLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
+
+  bufferSize = Dali::Pixel::GetBytesPerPixel(pixelformat);
+  unsigned char* buffer = new unsigned char[bufferSize];
+  memset( buffer, 0xFF, bufferSize );
+  PixelData filledPixelImage = PixelData::New( buffer, bufferSize, 1u, 1u, pixelformat, PixelData::DELETE_ARRAY );
+  atlas.Upload( filledPixelImage, 0u, 0u, 0u, 0u, 1u, 1u );
   mAtlasList.push_back( atlasDescriptor );
   return mAtlasList.size();
 }
@@ -126,7 +110,7 @@ void AtlasManager::SetAddPolicy( Toolkit::AtlasManager::AddFailPolicy policy )
   mAddFailPolicy = policy;
 }
 
-bool AtlasManager::Add( const BufferImage& image,
+bool AtlasManager::Add( const PixelData& image,
                         Toolkit::AtlasManager::AtlasSlot& slot,
                         Toolkit::AtlasManager::AtlasId atlas )
 {
@@ -245,7 +229,7 @@ AtlasManager::SizeType AtlasManager::CheckAtlas( SizeType atlas,
   return result;
 }
 
-void AtlasManager::UploadImage( const BufferImage& image,
+void AtlasManager::UploadImage( const PixelData& image,
                                 const AtlasSlotDescriptor& desc )
 {
   // Get the atlas to upload the image to
@@ -271,25 +255,30 @@ void AtlasManager::UploadImage( const BufferImage& image,
   SizeType height = image.GetHeight();
 
   // Blit image 1 pixel to the right and down into the block to compensate for texture filtering
-  if ( !mAtlasList[ atlas ].mAtlas.Upload( image,
+  if ( !mAtlasList[ atlas ].mAtlas.Upload( image, 0u, 0u,
                                            blockOffsetX + SINGLE_PIXEL_PADDING,
-                                           blockOffsetY + SINGLE_PIXEL_PADDING ) )
+                                           blockOffsetY + SINGLE_PIXEL_PADDING,
+                                           width, height) )
   {
     DALI_LOG_ERROR("Uploading image to Atlas Failed!.\n");
   }
 
   // Blit top strip
-  if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip,
+  if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip, 0u, 0u,
                                            blockOffsetX,
-                                           blockOffsetY ) )
+                                           blockOffsetY,
+                                           mAtlasList[ atlas ].mHorizontalStrip.GetWidth(),
+                                           mAtlasList[ atlas ].mHorizontalStrip.GetHeight()) )
   {
     DALI_LOG_ERROR("Uploading top strip to Atlas Failed!\n");
   }
 
   // Blit left strip
-  if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip,
+  if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip, 0u, 0u,
                                            blockOffsetX,
-                                           blockOffsetY + SINGLE_PIXEL_PADDING ) )
+                                           blockOffsetY + SINGLE_PIXEL_PADDING,
+                                           mAtlasList[ atlas ].mVerticalStrip.GetWidth(),
+                                           mAtlasList[ atlas ].mVerticalStrip.GetHeight() ) )
   {
     DALI_LOG_ERROR("Uploading left strip to Atlas Failed!\n");
   }
@@ -297,9 +286,11 @@ void AtlasManager::UploadImage( const BufferImage& image,
   // Blit bottom strip
   if ( blockOffsetY + height + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mHeight )
   {
-    if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip,
+    if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip, 0u, 0u,
                                              blockOffsetX,
-                                             blockOffsetY + height + SINGLE_PIXEL_PADDING ) )
+                                             blockOffsetY + height + SINGLE_PIXEL_PADDING,
+                                             mAtlasList[ atlas ].mHorizontalStrip.GetWidth(),
+                                             mAtlasList[ atlas ].mHorizontalStrip.GetHeight() ) )
     {
       DALI_LOG_ERROR("Uploading bottom strip to Atlas Failed!.\n");
     }
@@ -308,9 +299,11 @@ void AtlasManager::UploadImage( const BufferImage& image,
   // Blit right strip
   if ( blockOffsetX + width + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mWidth )
   {
-    if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip,
+    if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip, 0u, 0u,
                                              blockOffsetX + width + SINGLE_PIXEL_PADDING,
-                                             blockOffsetY + SINGLE_PIXEL_PADDING ) )
+                                             blockOffsetY + SINGLE_PIXEL_PADDING,
+                                             mAtlasList[ atlas ].mVerticalStrip.GetWidth(),
+                                             mAtlasList[ atlas ].mVerticalStrip.GetHeight() ) )
     {
       DALI_LOG_ERROR("Uploading right strip to Atlas Failed!.\n");
     }
@@ -349,10 +342,10 @@ void AtlasManager::GenerateMeshData( ImageId id,
   }
 }
 
-Dali::Atlas AtlasManager::GetAtlasContainer( AtlasId atlas ) const
+Dali::Texture AtlasManager::GetAtlasContainer( AtlasId atlas ) const
 {
   DALI_ASSERT_DEBUG( atlas && atlas <= mAtlasList.size() );
-  Dali::Atlas atlasContainer;
+  Dali::Texture atlasContainer;
   if ( atlas && atlas-- <= mAtlasList.size() )
   {
     atlasContainer = mAtlasList[ atlas ].mAtlas;
index e86bda1..863bba9 100644 (file)
@@ -59,11 +59,11 @@ public:
    */
   struct AtlasDescriptor
   {
-    Dali::Atlas mAtlas;                                                 // atlas image
+    Dali::Texture mAtlas;                                                 // atlas image
     Toolkit::AtlasManager::AtlasSize mSize;                             // size of atlas
     Pixel::Format mPixelFormat;                                         // pixel format used by atlas
-    BufferImage mHorizontalStrip;                                       // Image used to pad upload
-    BufferImage mVerticalStrip;                                         // Image used to pad upload
+    PixelData mHorizontalStrip;                                       // Image used to pad upload
+    PixelData mVerticalStrip;                                         // Image used to pad upload
     TextureSet mTextureSet;                                             // Texture set used for atlas texture
     SizeType mTotalBlocks;                                              // total number of blocks in atlas
     SizeType mAvailableBlocks;                                          // number of blocks available in atlas
@@ -101,7 +101,7 @@ public:
   /**
    * @copydoc Toolkit::AtlasManager::Add
    */
-  bool Add( const BufferImage& image,
+  bool Add( const PixelData& image,
             Toolkit::AtlasManager::AtlasSlot& slot,
             Toolkit::AtlasManager::AtlasId atlas );
 
@@ -121,7 +121,7 @@ public:
   /**
    * @copydoc Toolkit::AtlasManager::GetAtlasContainer
    */
-  Dali::Atlas GetAtlasContainer( AtlasId atlas ) const;
+  Dali::Texture GetAtlasContainer( AtlasId atlas ) const;
 
   /**
    * @copydoc Toolkit::AtlasManager::GetAtlas
@@ -185,7 +185,7 @@ private:
                        SizeType height,
                        Pixel::Format pixelFormat );
 
-  void UploadImage( const BufferImage& image,
+  void UploadImage( const PixelData& image,
                     const AtlasSlotDescriptor& desc );
 
 };
index d28b586..510da05 100644 (file)
@@ -55,7 +55,7 @@ void AtlasManager::SetAddPolicy( AddFailPolicy policy )
   GetImplementation(*this).SetAddPolicy( policy );
 }
 
-bool AtlasManager::Add( const BufferImage& image,
+bool AtlasManager::Add( const PixelData& image,
                         AtlasManager::AtlasSlot& slot,
                         AtlasManager::AtlasId atlas )
 {
@@ -78,7 +78,7 @@ void AtlasManager::GenerateMeshData( ImageId id,
                                              addReference );
 }
 
-Dali::Atlas AtlasManager::GetAtlasContainer( AtlasId atlas ) const
+Dali::Texture AtlasManager::GetAtlasContainer( AtlasId atlas ) const
 {
   return GetImplementation(*this).GetAtlasContainer( atlas );
 }
index df86ac1..00fdc7a 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_ATLAS_MANAGER_H__
-#define __DALI_TOOLKIT_ATLAS_MANAGER_H__
+#ifndef DALI_TOOLKIT_ATLAS_MANAGER_H
+#define DALI_TOOLKIT_ATLAS_MANAGER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -21,8 +21,8 @@
 #include <stdint.h>
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/images/buffer-image.h>
+#include <dali/public-api/rendering/texture-set.h>
 #include <dali/devel-api/images/atlas.h>
-#include <dali/devel-api/rendering/texture-set.h>
 
 namespace Dali
 {
@@ -157,13 +157,13 @@ public:
    *          If an add is made before an atlas is created under this policy,
    *          then a default size atlas will be created
    *
-   * @param[in] image reference to a bitmapimage
+   * @param[in] image PixelData object containing the image data
    * @param[out] slot result of add operation
    * @param[in] atlas optional preferred atlas
    *
    * @return true if a new atlas was created
    */
-  bool Add( const BufferImage& image,
+  bool Add( const PixelData& image,
             AtlasSlot& slot,
             AtlasId atlas = 0 );
 
@@ -196,7 +196,7 @@ public:
    *
    * @return Atlas Handle
    */
-  Dali::Atlas GetAtlasContainer( AtlasId atlas ) const;
+  Dali::Texture GetAtlasContainer( AtlasId atlas ) const;
 
   /**
    * @brief Get the Id of the atlas containing an image
@@ -283,4 +283,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_ATLAS_MANAGER_H__
+#endif // DALI_TOOLKIT_ATLAS_MANAGER_H
index f2e5596..437758c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
 #include <dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h>
 
 // EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
@@ -289,7 +289,7 @@ struct AtlasRenderer::Impl
           }
 
           // Create a new image for the glyph
-          BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
+          PixelData bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
           if( bitmap )
           {
             MaxBlockSize& blockSize = mBlockSizes[currentBlockSize];
index b3bbcf7..a7d2061 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_TEXT_GLYPHY_SHADER_H__
-#define __DALI_TOOLKIT_TEXT_GLYPHY_SHADER_H__
+#ifndef DALI_TOOLKIT_TEXT_GLYPHY_SHADER_H
+#define DALI_TOOLKIT_TEXT_GLYPHY_SHADER_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -20,7 +20,7 @@
 
 // INTERNEL INCLUDES
 #include <dali/public-api/math/vector4.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/shader.h>
 
 namespace Dali
 {
@@ -71,4 +71,4 @@ private: // Not intended for application developer
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_GLYPHY_SHADER_H__
+#endif // DALI_TOOLKIT_TEXT_GLYPHY_SHADER_H
index 73fb666..b183524 100644 (file)
 #include <dali-toolkit/internal/text/rendering/vector-based/vector-based-renderer.h>
 
 // EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/glyph-run.h>
index 360cedf..d9c0a7c 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-toolkit/internal/text/rendering/vector-based/vector-blob-atlas.h>
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/images/texture-set-image.h>
 #include <dali/integration-api/debug.h>
 
 namespace
@@ -78,7 +79,7 @@ VectorBlobAtlas::VectorBlobAtlas( unsigned int textureWidth,
   mAtlasTexture = BufferImage::New( textureWidth, textureHeight, Pixel::RGBA8888 );
 
   mTextureSet = TextureSet::New();
-  mTextureSet.SetImage( 0, mAtlasTexture );
+  TextureSetImage( mTextureSet, 0, mAtlasTexture );
 }
 
 bool VectorBlobAtlas::IsFull() const
index 13b226d..14af3bb 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_TEXT_VECTOR_BLOB_ATLAS_H__
-#define __DALI_TOOLKIT_TEXT_VECTOR_BLOB_ATLAS_H__
+#ifndef DALI_TOOLKIT_TEXT_VECTOR_BLOB_ATLAS_H
+#define DALI_TOOLKIT_TEXT_VECTOR_BLOB_ATLAS_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/images/buffer-image.h>
-#include <dali/devel-api/rendering/texture-set.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/object/ref-object.h>
+#include <dali/public-api/rendering/shader.h>
+#include <dali/public-api/rendering/texture-set.h>
 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
 
 // INTERNAL INCLUDES
@@ -182,4 +182,4 @@ private:
 
 } // namespace Dali
 
-#endif //  __DALI_TOOLKIT_TEXT_VECTOR_BLOB_ATLAS_H__
+#endif // DALI_TOOLKIT_TEXT_VECTOR_BLOB_ATLAS_H
index aad550c..9a57431 100644 (file)
@@ -79,6 +79,7 @@ EventData::EventData( DecoratorPtr decorator )
   mRightSelectionPosition( 0u ),
   mPreEditStartPosition( 0u ),
   mPreEditLength( 0u ),
+  mCursorHookPositionX( 0.f ),
   mIsShowingPlaceholderText( false ),
   mPreEditFlag( false ),
   mDecoratorUpdated( false ),
@@ -86,11 +87,11 @@ EventData::EventData( DecoratorPtr decorator )
   mGrabHandleEnabled( true ),
   mGrabHandlePopupEnabled( true ),
   mSelectionEnabled( true ),
-  mHorizontalScrollingEnabled( true ),
-  mVerticalScrollingEnabled( false ),
   mUpdateCursorPosition( false ),
+  mUpdateGrabHandlePosition( false ),
   mUpdateLeftSelectionPosition( false ),
   mUpdateRightSelectionPosition( false ),
+  mUpdateHighlightBox( false ),
   mScrollAfterUpdatePosition( false ),
   mScrollAfterDelete( false ),
   mAllTextSelected( false ),
@@ -162,8 +163,7 @@ bool Controller::Impl::ProcessInputEvents()
   }
 
   if( mEventData->mUpdateCursorPosition ||
-      mEventData->mUpdateLeftSelectionPosition ||
-      mEventData->mUpdateRightSelectionPosition )
+      mEventData->mUpdateHighlightBox )
   {
     NotifyImfManager();
   }
@@ -173,9 +173,17 @@ bool Controller::Impl::ProcessInputEvents()
   {
     // Updates the cursor position and scrolls the text to make it visible.
     CursorInfo cursorInfo;
+    // Calculate the cursor position from the new cursor index.
     GetCursorPosition( mEventData->mPrimaryCursorPosition,
                        cursorInfo );
 
+    if( mEventData->mUpdateCursorHookPosition )
+    {
+      // Update the cursor hook position. Used to move the cursor with the keys 'up' and 'down'.
+      mEventData->mCursorHookPositionX = cursorInfo.primaryPosition.x;
+      mEventData->mUpdateCursorHookPosition = false;
+    }
+
     // Scroll first the text after delete ...
     if( mEventData->mScrollAfterDelete )
     {
@@ -185,7 +193,8 @@ bool Controller::Impl::ProcessInputEvents()
     // ... then, text can be scrolled to make the cursor visible.
     if( mEventData->mScrollAfterUpdatePosition )
     {
-      ScrollToMakePositionVisible( cursorInfo.primaryPosition );
+      const Vector2 currentCursorPosition( cursorInfo.primaryPosition.x, cursorInfo.lineOffset );
+      ScrollToMakePositionVisible( currentCursorPosition, cursorInfo.lineHeight );
     }
     mEventData->mScrollAfterUpdatePosition = false;
     mEventData->mScrollAfterDelete = false;
@@ -194,36 +203,31 @@ bool Controller::Impl::ProcessInputEvents()
 
     mEventData->mDecoratorUpdated = true;
     mEventData->mUpdateCursorPosition = false;
+    mEventData->mUpdateGrabHandlePosition = false;
   }
   else
   {
-    bool leftScroll = false;
-    bool rightScroll = false;
-
     CursorInfo leftHandleInfo;
     CursorInfo rightHandleInfo;
 
-    if( mEventData->mUpdateLeftSelectionPosition )
+    if( mEventData->mUpdateHighlightBox )
     {
       GetCursorPosition( mEventData->mLeftSelectionPosition,
                          leftHandleInfo );
 
-      if( mEventData->mScrollAfterUpdatePosition )
-      {
-        ScrollToMakePositionVisible( leftHandleInfo.primaryPosition );
-        leftScroll = true;
-      }
-    }
-
-    if( mEventData->mUpdateRightSelectionPosition )
-    {
       GetCursorPosition( mEventData->mRightSelectionPosition,
                          rightHandleInfo );
 
-      if( mEventData->mScrollAfterUpdatePosition )
+      if( mEventData->mScrollAfterUpdatePosition && mEventData->mUpdateLeftSelectionPosition )
       {
-        ScrollToMakePositionVisible( rightHandleInfo.primaryPosition );
-        rightScroll = true;
+        const Vector2 currentCursorPosition( leftHandleInfo.primaryPosition.x, leftHandleInfo.lineOffset );
+        ScrollToMakePositionVisible( currentCursorPosition, leftHandleInfo.lineHeight );
+       }
+
+      if( mEventData->mScrollAfterUpdatePosition && mEventData->mUpdateRightSelectionPosition )
+      {
+        const Vector2 currentCursorPosition( rightHandleInfo.primaryPosition.x, rightHandleInfo.lineOffset );
+        ScrollToMakePositionVisible( currentCursorPosition, rightHandleInfo.lineHeight );
       }
     }
 
@@ -234,6 +238,7 @@ bool Controller::Impl::ProcessInputEvents()
 
       SetPopupButtons();
       mEventData->mDecoratorUpdated = true;
+      mEventData->mUpdateLeftSelectionPosition = false;
     }
 
     if( mEventData->mUpdateRightSelectionPosition )
@@ -243,20 +248,19 @@ bool Controller::Impl::ProcessInputEvents()
 
       SetPopupButtons();
       mEventData->mDecoratorUpdated = true;
+      mEventData->mUpdateRightSelectionPosition = false;
     }
 
-    if( mEventData->mUpdateLeftSelectionPosition || mEventData->mUpdateRightSelectionPosition )
+    if( mEventData->mUpdateHighlightBox )
     {
       RepositionSelectionHandles();
 
       mEventData->mUpdateLeftSelectionPosition = false;
       mEventData->mUpdateRightSelectionPosition = false;
+      mEventData->mUpdateHighlightBox = false;
     }
 
-    if( leftScroll || rightScroll )
-    {
-      mEventData->mScrollAfterUpdatePosition = false;
-    }
+    mEventData->mScrollAfterUpdatePosition = false;
   }
 
   if( mEventData->mUpdateInputStyle )
@@ -1075,11 +1079,69 @@ void Controller::Impl::OnCursorKeyEvent( const Event& event )
   }
   else if( Dali::DALI_KEY_CURSOR_UP == keyCode )
   {
-    // TODO
+    // Get first the line index of the current cursor position index.
+    CharacterIndex characterIndex = 0u;
+
+    if( mEventData->mPrimaryCursorPosition > 0u )
+    {
+      characterIndex = mEventData->mPrimaryCursorPosition - 1u;
+    }
+
+    const LineIndex lineIndex = mVisualModel->GetLineOfCharacter( characterIndex );
+
+    if( lineIndex > 0u )
+    {
+      // Retrieve the cursor position info.
+      CursorInfo cursorInfo;
+      GetCursorPosition( mEventData->mPrimaryCursorPosition,
+                         cursorInfo );
+
+      // Get the line above.
+      const LineRun& line = *( mVisualModel->mLines.Begin() + ( lineIndex - 1u ) );
+
+      // Get the next hit 'y' point.
+      const float hitPointY = cursorInfo.lineOffset - 0.5f * ( line.ascender - line.descender );
+
+      // Use the cursor hook position 'x' and the next hit 'y' position to calculate the new cursor index.
+      mEventData->mPrimaryCursorPosition = Text::GetClosestCursorIndex( mVisualModel,
+                                                                        mLogicalModel,
+                                                                        mMetrics,
+                                                                        mEventData->mCursorHookPositionX,
+                                                                        hitPointY );
+    }
   }
   else if(   Dali::DALI_KEY_CURSOR_DOWN == keyCode )
   {
-    // TODO
+    // Get first the line index of the current cursor position index.
+    CharacterIndex characterIndex = 0u;
+
+    if( mEventData->mPrimaryCursorPosition > 0u )
+    {
+      characterIndex = mEventData->mPrimaryCursorPosition - 1u;
+    }
+
+    const LineIndex lineIndex = mVisualModel->GetLineOfCharacter( characterIndex );
+
+    if( lineIndex + 1u < mVisualModel->mLines.Count() )
+    {
+      // Retrieve the cursor position info.
+      CursorInfo cursorInfo;
+      GetCursorPosition( mEventData->mPrimaryCursorPosition,
+                         cursorInfo );
+
+      // Get the line below.
+      const LineRun& line = *( mVisualModel->mLines.Begin() + lineIndex + 1u );
+
+      // Get the next hit 'y' point.
+      const float hitPointY = cursorInfo.lineOffset + cursorInfo.lineHeight + 0.5f * ( line.ascender - line.descender );
+
+      // Use the cursor hook position 'x' and the next hit 'y' position to calculate the new cursor index.
+      mEventData->mPrimaryCursorPosition = Text::GetClosestCursorIndex( mVisualModel,
+                                                                        mLogicalModel,
+                                                                        mMetrics,
+                                                                        mEventData->mCursorHookPositionX,
+                                                                        hitPointY );
+    }
   }
 
   mEventData->mUpdateCursorPosition = true;
@@ -1101,6 +1163,9 @@ void Controller::Impl::OnTapEvent( const Event& event )
         const float xPosition = event.p2.mFloat - mScrollPosition.x;
         const float yPosition = event.p3.mFloat - mScrollPosition.y;
 
+        // Keep the tap 'x' position. Used to move the cursor.
+        mEventData->mCursorHookPositionX = xPosition;
+
         mEventData->mPrimaryCursorPosition = Text::GetClosestCursorIndex( mVisualModel,
                                                                           mLogicalModel,
                                                                           mMetrics,
@@ -1116,6 +1181,7 @@ void Controller::Impl::OnTapEvent( const Event& event )
       }
 
       mEventData->mUpdateCursorPosition = true;
+      mEventData->mUpdateGrabHandlePosition = true;
       mEventData->mScrollAfterUpdatePosition = true;
       mEventData->mUpdateInputStyle = true;
 
@@ -1142,27 +1208,27 @@ void Controller::Impl::OnPanEvent( const Event& event )
   if( ( Gesture::Started == state ) ||
       ( Gesture::Continuing == state ) )
   {
-    const Vector2& actualSize = mVisualModel->GetLayoutSize();
-    const Vector2 currentScroll = mScrollPosition;
-
-    if( mEventData->mHorizontalScrollingEnabled )
+    if( mEventData->mDecorator )
     {
-      const float displacementX = event.p2.mFloat;
-      mScrollPosition.x += displacementX;
+      const Vector2& layoutSize = mVisualModel->GetLayoutSize();
+      const Vector2 currentScroll = mScrollPosition;
 
-      ClampHorizontalScroll( actualSize );
-    }
+      if( mEventData->mDecorator->IsHorizontalScrollEnabled() )
+      {
+        const float displacementX = event.p2.mFloat;
+        mScrollPosition.x += displacementX;
 
-    if( mEventData->mVerticalScrollingEnabled )
-    {
-      const float displacementY = event.p3.mFloat;
-      mScrollPosition.y += displacementY;
+        ClampHorizontalScroll( layoutSize );
+      }
 
-      ClampVerticalScroll( actualSize );
-    }
+      if( mEventData->mDecorator->IsVerticalScrollEnabled() )
+      {
+        const float displacementY = event.p3.mFloat;
+        mScrollPosition.y += displacementY;
+
+        ClampVerticalScroll( layoutSize );
+      }
 
-    if( mEventData->mDecorator )
-    {
       mEventData->mDecorator->UpdatePositions( mScrollPosition - currentScroll );
     }
   }
@@ -1189,6 +1255,7 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
   const unsigned int state = event.p1.mUint;
   const bool handleStopScrolling = ( HANDLE_STOP_SCROLLING == state );
+  const bool isSmoothHandlePanEnabled = mEventData->mDecorator->IsSmoothHandlePanEnabled();
 
   if( HANDLE_PRESSED == state )
   {
@@ -1196,6 +1263,7 @@ void Controller::Impl::OnHandleEvent( const Event& event )
     const float xPosition = event.p2.mFloat - mScrollPosition.x;
     const float yPosition = event.p3.mFloat - mScrollPosition.y;
 
+    // Need to calculate the handle's new position.
     const CharacterIndex handleNewPosition = Text::GetClosestCursorIndex( mVisualModel,
                                                                           mLogicalModel,
                                                                           mMetrics,
@@ -1208,9 +1276,15 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
       if( handleNewPosition != mEventData->mPrimaryCursorPosition )
       {
-        mEventData->mPrimaryCursorPosition = handleNewPosition;
+        // Updates the cursor position if the handle's new position is different than the current one.
         mEventData->mUpdateCursorPosition = true;
+        // Does not update the grab handle position if the smooth panning is enabled. (The decorator does it smooth).
+        mEventData->mUpdateGrabHandlePosition = !isSmoothHandlePanEnabled;
+        mEventData->mPrimaryCursorPosition = handleNewPosition;
       }
+
+      // Updates the decorator if the soft handle panning is enabled. It triggers a relayout in the decorator and the new position of the handle is set.
+      mEventData->mDecoratorUpdated = isSmoothHandlePanEnabled;
     }
     else if( Event::LEFT_SELECTION_HANDLE_EVENT == event.type )
     {
@@ -1219,10 +1293,15 @@ void Controller::Impl::OnHandleEvent( const Event& event )
       if( ( handleNewPosition != mEventData->mLeftSelectionPosition ) &&
           ( handleNewPosition != mEventData->mRightSelectionPosition ) )
       {
+        // Updates the highlight box if the handle's new position is different than the current one.
+        mEventData->mUpdateHighlightBox = true;
+        // Does not update the selection handle position if the smooth panning is enabled. (The decorator does it smooth).
+        mEventData->mUpdateLeftSelectionPosition = !isSmoothHandlePanEnabled;
         mEventData->mLeftSelectionPosition = handleNewPosition;
-
-        mEventData->mUpdateLeftSelectionPosition = true;
       }
+
+      // Updates the decorator if the soft handle panning is enabled. It triggers a relayout in the decorator and the new position of the handle is set.
+      mEventData->mDecoratorUpdated = isSmoothHandlePanEnabled;
     }
     else if( Event::RIGHT_SELECTION_HANDLE_EVENT == event.type )
     {
@@ -1231,17 +1310,22 @@ void Controller::Impl::OnHandleEvent( const Event& event )
       if( ( handleNewPosition != mEventData->mRightSelectionPosition ) &&
           ( handleNewPosition != mEventData->mLeftSelectionPosition ) )
       {
+        // Updates the highlight box if the handle's new position is different than the current one.
+        mEventData->mUpdateHighlightBox = true;
+        // Does not update the selection handle position if the smooth panning is enabled. (The decorator does it smooth).
+        mEventData->mUpdateRightSelectionPosition = !isSmoothHandlePanEnabled;
         mEventData->mRightSelectionPosition = handleNewPosition;
-
-        mEventData->mUpdateRightSelectionPosition = true;
       }
+
+      // Updates the decorator if the soft handle panning is enabled. It triggers a relayout in the decorator and the new position of the handle is set.
+      mEventData->mDecoratorUpdated = isSmoothHandlePanEnabled;
     }
   } // end ( HANDLE_PRESSED == state )
   else if( ( HANDLE_RELEASED == state ) ||
            handleStopScrolling )
   {
     CharacterIndex handlePosition = 0u;
-    if( handleStopScrolling )
+    if( handleStopScrolling || isSmoothHandlePanEnabled )
     {
       // Convert from decorator's coords to text's coords.
       const float xPosition = event.p2.mFloat - mScrollPosition.x;
@@ -1257,6 +1341,7 @@ void Controller::Impl::OnHandleEvent( const Event& event )
     if( Event::GRAB_HANDLE_EVENT == event.type )
     {
       mEventData->mUpdateCursorPosition = true;
+      mEventData->mUpdateGrabHandlePosition = true;
       mEventData->mUpdateInputStyle = true;
 
       if( !IsClipboardEmpty() )
@@ -1264,9 +1349,9 @@ void Controller::Impl::OnHandleEvent( const Event& event )
         ChangeState( EventData::EDITING_WITH_PASTE_POPUP ); // Moving grabhandle will show Paste Popup
       }
 
-      if( handleStopScrolling )
+      if( handleStopScrolling || isSmoothHandlePanEnabled )
       {
-        mEventData->mScrollAfterUpdatePosition = mEventData->mPrimaryCursorPosition != handlePosition;
+        mEventData->mScrollAfterUpdatePosition = true;
         mEventData->mPrimaryCursorPosition = handlePosition;
       }
     }
@@ -1274,12 +1359,15 @@ void Controller::Impl::OnHandleEvent( const Event& event )
     {
       ChangeState( EventData::SELECTING );
 
-      if( handleStopScrolling )
+      mEventData->mUpdateHighlightBox = true;
+      mEventData->mUpdateLeftSelectionPosition = true;
+
+      if( handleStopScrolling || isSmoothHandlePanEnabled )
       {
-        mEventData->mUpdateLeftSelectionPosition = ( mEventData->mRightSelectionPosition != handlePosition );
-        mEventData->mScrollAfterUpdatePosition = mEventData->mUpdateLeftSelectionPosition;
+        mEventData->mScrollAfterUpdatePosition = true;
 
-        if( mEventData->mUpdateLeftSelectionPosition )
+        if( ( handlePosition != mEventData->mRightSelectionPosition ) &&
+            ( handlePosition != mEventData->mLeftSelectionPosition ) )
         {
           mEventData->mLeftSelectionPosition = handlePosition;
         }
@@ -1289,11 +1377,14 @@ void Controller::Impl::OnHandleEvent( const Event& event )
     {
       ChangeState( EventData::SELECTING );
 
-      if( handleStopScrolling )
+      mEventData->mUpdateHighlightBox = true;
+      mEventData->mUpdateRightSelectionPosition = true;
+
+      if( handleStopScrolling || isSmoothHandlePanEnabled )
       {
-        mEventData->mUpdateRightSelectionPosition = ( mEventData->mLeftSelectionPosition != handlePosition );
-        mEventData->mScrollAfterUpdatePosition = mEventData->mUpdateRightSelectionPosition;
-        if( mEventData->mUpdateRightSelectionPosition )
+        mEventData->mScrollAfterUpdatePosition = true;
+        if( ( handlePosition != mEventData->mRightSelectionPosition ) &&
+            ( handlePosition != mEventData->mLeftSelectionPosition ) )
         {
           mEventData->mRightSelectionPosition = handlePosition;
         }
@@ -1305,12 +1396,15 @@ void Controller::Impl::OnHandleEvent( const Event& event )
   else if( HANDLE_SCROLLING == state )
   {
     const float xSpeed = event.p2.mFloat;
-    const Vector2& actualSize = mVisualModel->GetLayoutSize();
+    const float ySpeed = event.p3.mFloat;
+    const Vector2& layoutSize = mVisualModel->GetLayoutSize();
     const Vector2 currentScrollPosition = mScrollPosition;
 
     mScrollPosition.x += xSpeed;
+    mScrollPosition.y += ySpeed;
 
-    ClampHorizontalScroll( actualSize );
+    ClampHorizontalScroll( layoutSize );
+    ClampVerticalScroll( layoutSize );
 
     bool endOfScroll = false;
     if( Vector2::ZERO == ( currentScrollPosition - mScrollPosition ) )
@@ -1324,6 +1418,7 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
     // Set the position of the handle.
     const bool scrollRightDirection = xSpeed > 0.f;
+    const bool scrollBottomDirection = ySpeed > 0.f;
     const bool leftSelectionHandleEvent = Event::LEFT_SELECTION_HANDLE_EVENT == event.type;
     const bool rightSelectionHandleEvent = Event::RIGHT_SELECTION_HANDLE_EVENT == event.type;
 
@@ -1331,10 +1426,22 @@ void Controller::Impl::OnHandleEvent( const Event& event )
     {
       ChangeState( EventData::GRAB_HANDLE_PANNING );
 
+      // Get the grab handle position in decorator coords.
       Vector2 position = mEventData->mDecorator->GetPosition( GRAB_HANDLE );
 
-      // Position the grag handle close to either the left or right edge.
-      position.x = scrollRightDirection ? 0.f : mVisualModel->mControlSize.width;
+      if( mEventData->mDecorator->IsHorizontalScrollEnabled() )
+      {
+        // Position the grag handle close to either the left or right edge.
+        position.x = scrollRightDirection ? 0.f : mVisualModel->mControlSize.width;
+      }
+
+      if( mEventData->mDecorator->IsVerticalScrollEnabled() )
+      {
+        position.x = mEventData->mCursorHookPositionX;
+
+        // Position the grag handle close to either the top or bottom edge.
+        position.y = scrollBottomDirection ? 0.f : mVisualModel->mControlSize.height;
+      }
 
       // Get the new handle position.
       // The grab handle's position is in decorator's coords. Need to transforms to text's coords.
@@ -1344,22 +1451,38 @@ void Controller::Impl::OnHandleEvent( const Event& event )
                                                                          position.x - mScrollPosition.x,
                                                                          position.y - mScrollPosition.y );
 
-      mEventData->mUpdateCursorPosition = mEventData->mPrimaryCursorPosition != handlePosition;
-      mEventData->mScrollAfterUpdatePosition = mEventData->mUpdateCursorPosition;
-      mEventData->mPrimaryCursorPosition = handlePosition;
+      if( mEventData->mPrimaryCursorPosition != handlePosition )
+      {
+        mEventData->mUpdateCursorPosition = true;
+        mEventData->mUpdateGrabHandlePosition = !isSmoothHandlePanEnabled;
+        mEventData->mScrollAfterUpdatePosition = true;
+        mEventData->mPrimaryCursorPosition = handlePosition;
+      }
       mEventData->mUpdateInputStyle = mEventData->mUpdateCursorPosition;
+
+      // Updates the decorator if the soft handle panning is enabled.
+      mEventData->mDecoratorUpdated = isSmoothHandlePanEnabled;
     }
     else if( leftSelectionHandleEvent || rightSelectionHandleEvent )
     {
-      // TODO: This is recalculating the selection box every time the text is scrolled with the selection handles.
-      //       Think if something can be done to save power.
-
       ChangeState( EventData::SELECTION_HANDLE_PANNING );
 
+      // Get the selection handle position in decorator coords.
       Vector2 position = mEventData->mDecorator->GetPosition( leftSelectionHandleEvent ? Text::LEFT_SELECTION_HANDLE : Text::RIGHT_SELECTION_HANDLE );
 
-      // Position the selection handle close to either the left or right edge.
-      position.x = scrollRightDirection ? 0.f : mVisualModel->mControlSize.width;
+      if( mEventData->mDecorator->IsHorizontalScrollEnabled() )
+      {
+        // Position the selection handle close to either the left or right edge.
+        position.x = scrollRightDirection ? 0.f : mVisualModel->mControlSize.width;
+      }
+
+      if( mEventData->mDecorator->IsVerticalScrollEnabled() )
+      {
+        position.x = mEventData->mCursorHookPositionX;
+
+        // Position the grag handle close to either the top or bottom edge.
+        position.y = scrollBottomDirection ? 0.f : mVisualModel->mControlSize.height;
+      }
 
       // Get the new handle position.
       // The selection handle's position is in decorator's coords. Need to transform to text's coords.
@@ -1372,18 +1495,23 @@ void Controller::Impl::OnHandleEvent( const Event& event )
       if( leftSelectionHandleEvent )
       {
         const bool differentHandles = ( mEventData->mLeftSelectionPosition != handlePosition ) && ( mEventData->mRightSelectionPosition != handlePosition );
-        mEventData->mUpdateLeftSelectionPosition = endOfScroll || differentHandles;
-        if( differentHandles )
+
+        if( differentHandles || endOfScroll )
         {
+          mEventData->mUpdateHighlightBox = true;
+          mEventData->mUpdateLeftSelectionPosition = !isSmoothHandlePanEnabled;
+          mEventData->mUpdateRightSelectionPosition = isSmoothHandlePanEnabled;
           mEventData->mLeftSelectionPosition = handlePosition;
         }
       }
       else
       {
         const bool differentHandles = ( mEventData->mRightSelectionPosition != handlePosition ) && ( mEventData->mLeftSelectionPosition != handlePosition );
-        mEventData->mUpdateRightSelectionPosition = endOfScroll || differentHandles;
-        if( differentHandles )
+        if( differentHandles || endOfScroll )
         {
+          mEventData->mUpdateHighlightBox = true;
+          mEventData->mUpdateRightSelectionPosition = !isSmoothHandlePanEnabled;
+          mEventData->mUpdateLeftSelectionPosition = isSmoothHandlePanEnabled;
           mEventData->mRightSelectionPosition = handlePosition;
         }
       }
@@ -1392,7 +1520,7 @@ void Controller::Impl::OnHandleEvent( const Event& event )
       {
         RepositionSelectionHandles();
 
-        mEventData->mScrollAfterUpdatePosition = true;
+        mEventData->mScrollAfterUpdatePosition = !isSmoothHandlePanEnabled;
       }
     }
     mEventData->mDecoratorUpdated = true;
@@ -1419,6 +1547,7 @@ void Controller::Impl::OnSelectEvent( const Event& event )
 
     mEventData->mUpdateLeftSelectionPosition = true;
     mEventData->mUpdateRightSelectionPosition = true;
+    mEventData->mUpdateHighlightBox = true;
     mEventData->mUpdateCursorPosition = false;
 
     mEventData->mScrollAfterUpdatePosition = ( mEventData->mLeftSelectionPosition != mEventData->mRightSelectionPosition );
@@ -1443,6 +1572,7 @@ void Controller::Impl::OnSelectAllEvent()
     mEventData->mScrollAfterUpdatePosition = true;
     mEventData->mUpdateLeftSelectionPosition = true;
     mEventData->mUpdateRightSelectionPosition = true;
+    mEventData->mUpdateHighlightBox = true;
   }
 }
 
@@ -1486,9 +1616,15 @@ void Controller::Impl::RetrieveSelection( std::string& selectedText, bool delete
       Vector<Character>::Iterator last  = first + lengthOfSelectedText;
       utf32Characters.Erase( first, last );
 
-      // Scroll after delete.
+      // Will show the cursor at the first character of the selection.
       mEventData->mPrimaryCursorPosition = handlesCrossed ? mEventData->mRightSelectionPosition : mEventData->mLeftSelectionPosition;
     }
+    else
+    {
+      // Will show the cursor at the last character of the selection.
+      mEventData->mPrimaryCursorPosition = handlesCrossed ? mEventData->mLeftSelectionPosition : mEventData->mRightSelectionPosition;
+    }
+
     mEventData->mDecoratorUpdated = true;
   }
 }
@@ -1557,8 +1693,6 @@ void Controller::Impl::RepositionSelectionHandles()
   const CharacterIndex* const glyphToCharacterBuffer = mVisualModel->mGlyphsToCharacters.Begin();
   const CharacterDirection* const modelCharacterDirectionsBuffer = ( 0u != mLogicalModel->mCharacterDirections.Count() ) ? mLogicalModel->mCharacterDirections.Begin() : NULL;
 
-  // TODO: Better algorithm to create the highlight box.
-
   const bool isLastCharacter = selectionEnd >= mLogicalModel->mText.Count();
   const CharacterDirection startDirection = ( ( NULL == modelCharacterDirectionsBuffer ) ? false : *( modelCharacterDirectionsBuffer + selectionStart ) );
   const CharacterDirection endDirection = ( ( NULL == modelCharacterDirectionsBuffer ) ? false : *( modelCharacterDirectionsBuffer + ( selectionEnd - ( isLastCharacter ? 1u : 0u ) ) ) );
@@ -1604,6 +1738,8 @@ void Controller::Impl::RepositionSelectionHandles()
   // The line's vertical offset of all the lines before the line where the first glyph is laid-out.
   selectionBoxInfo->lineOffset = CalculateLineOffset( mVisualModel->mLines,
                                                       firstLineIndex );
+  selectionBoxInfo->lineOffset += mScrollPosition.y;
+
   lineRun += firstLineIndex;
 
   // The line height is the addition of the line ascender and the line descender.
@@ -1645,7 +1781,7 @@ void Controller::Impl::RepositionSelectionHandles()
 
       const float xPosition = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x + glyphAdvance * static_cast<float>( isCurrentRightToLeft ? ( numberOfCharactersStart - interGlyphIndex - numberOfCharacters ) : interGlyphIndex );
       const float xPositionAdvance = xPosition + static_cast<float>( numberOfCharacters ) * glyphAdvance;
-      const float yPosition = selectionBoxInfo->lineOffset + mScrollPosition.y;
+      const float yPosition = selectionBoxInfo->lineOffset;
 
       // Store the min and max 'x' for each line.
       selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, xPosition );
@@ -1677,7 +1813,7 @@ void Controller::Impl::RepositionSelectionHandles()
 
       const float xPosition = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x + ( isCurrentRightToLeft ? ( glyphAdvance * static_cast<float>( numberOfCharacters ) ) : 0.f );
       const float xPositionAdvance = xPosition + static_cast<float>( interGlyphIndex ) * glyphAdvance;
-      const float yPosition = selectionBoxInfo->lineOffset + mScrollPosition.y;
+      const float yPosition = selectionBoxInfo->lineOffset;
 
       // Store the min and max 'x' for each line.
       selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, xPosition );
@@ -1694,7 +1830,7 @@ void Controller::Impl::RepositionSelectionHandles()
 
     const float xPosition = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x;
     const float xPositionAdvance = xPosition + glyph.advance;
-    const float yPosition = selectionBoxInfo->lineOffset + mScrollPosition.y;
+    const float yPosition = selectionBoxInfo->lineOffset;
 
     // Store the min and max 'x' for each line.
     selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, xPosition );
@@ -1717,19 +1853,22 @@ void Controller::Impl::RepositionSelectionHandles()
       ++lineIndex;
       if( lineIndex < firstLineIndex + numberOfLines )
       {
-        // Get the selection box info for the next line.
+        // Keep the offset and height of the current selection box.
         const float currentLineOffset = selectionBoxInfo->lineOffset;
+        const float currentLineHeight = selectionBoxInfo->lineHeight;
+
+        // Get the selection box info for the next line.
         ++selectionBoxInfo;
 
         selectionBoxInfo->minX = MAX_FLOAT;
         selectionBoxInfo->maxX = MIN_FLOAT;
 
+        // Update the line's vertical offset.
+        selectionBoxInfo->lineOffset = currentLineOffset + currentLineHeight;
+
         // The line height is the addition of the line ascender and the line descender.
         // However, the line descender has a negative value, hence the subtraction.
         selectionBoxInfo->lineHeight = lineRun->ascender - lineRun->descender;
-
-        // Update the line's vertical offset.
-        selectionBoxInfo->lineOffset = currentLineOffset + selectionBoxInfo->lineHeight;
       }
     }
   }
@@ -1811,27 +1950,30 @@ void Controller::Impl::RepositionSelectionHandles()
     }
   }
 
+  if( !mEventData->mDecorator->IsSmoothHandlePanEnabled() )
+  {
+    CursorInfo primaryCursorInfo;
+    GetCursorPosition( mEventData->mLeftSelectionPosition,
+                       primaryCursorInfo );
 
-  CursorInfo primaryCursorInfo;
-  GetCursorPosition( mEventData->mLeftSelectionPosition,
-                     primaryCursorInfo );
+    const Vector2 primaryPosition = primaryCursorInfo.primaryPosition + mScrollPosition;
 
-  CursorInfo secondaryCursorInfo;
-  GetCursorPosition( mEventData->mRightSelectionPosition,
-                     secondaryCursorInfo );
+    mEventData->mDecorator->SetPosition( LEFT_SELECTION_HANDLE,
+                                         primaryPosition.x,
+                                         primaryCursorInfo.lineOffset + mScrollPosition.y,
+                                         primaryCursorInfo.lineHeight );
 
-  const Vector2 primaryPosition = primaryCursorInfo.primaryPosition + mScrollPosition;
-  const Vector2 secondaryPosition = secondaryCursorInfo.primaryPosition + mScrollPosition;
+    CursorInfo secondaryCursorInfo;
+    GetCursorPosition( mEventData->mRightSelectionPosition,
+                       secondaryCursorInfo );
 
-  mEventData->mDecorator->SetPosition( LEFT_SELECTION_HANDLE,
-                                       primaryPosition.x,
-                                       primaryCursorInfo.lineOffset + mScrollPosition.y,
-                                       primaryCursorInfo.lineHeight );
+    const Vector2 secondaryPosition = secondaryCursorInfo.primaryPosition + mScrollPosition;
 
-  mEventData->mDecorator->SetPosition( RIGHT_SELECTION_HANDLE,
-                                       secondaryPosition.x,
-                                       secondaryCursorInfo.lineOffset + mScrollPosition.y,
-                                       secondaryCursorInfo.lineHeight );
+    mEventData->mDecorator->SetPosition( RIGHT_SELECTION_HANDLE,
+                                         secondaryPosition.x,
+                                         secondaryCursorInfo.lineOffset + mScrollPosition.y,
+                                         secondaryCursorInfo.lineHeight );
+  }
 
   // Cursor to be positioned at end of selection so if selection interrupted and edit mode restarted the cursor will be at end of selection
   mEventData->mPrimaryCursorPosition = ( indicesSwapped ) ? mEventData->mLeftSelectionPosition : mEventData->mRightSelectionPosition;
@@ -2213,6 +2355,9 @@ CharacterIndex Controller::Impl::CalculateNewCursorIndex( CharacterIndex index )
     cursorIndex += numberOfCharacters;
   }
 
+  // Will update the cursor hook position.
+  mEventData->mUpdateCursorHookPosition = true;
+
   return cursorIndex;
 }
 
@@ -2236,11 +2381,14 @@ void Controller::Impl::UpdateCursorPosition( const CursorInfo& cursorInfo )
                                        cursorInfo.lineHeight );
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Primary cursor position: %f,%f\n", cursorPosition.x, cursorPosition.y );
 
-  // Sets the grab handle position.
-  mEventData->mDecorator->SetPosition( GRAB_HANDLE,
-                                       cursorPosition.x,
-                                       cursorInfo.lineOffset + mScrollPosition.y,
-                                       cursorInfo.lineHeight );
+  if( mEventData->mUpdateGrabHandlePosition )
+  {
+    // Sets the grab handle position.
+    mEventData->mDecorator->SetPosition( GRAB_HANDLE,
+                                         cursorPosition.x,
+                                         cursorInfo.lineOffset + mScrollPosition.y,
+                                         cursorInfo.lineHeight );
+  }
 
   if( cursorInfo.isSecondaryCursor )
   {
@@ -2330,24 +2478,37 @@ void Controller::Impl::ClampVerticalScroll( const Vector2& actualSize )
   }
 }
 
-void Controller::Impl::ScrollToMakePositionVisible( const Vector2& position )
+void Controller::Impl::ScrollToMakePositionVisible( const Vector2& position, float lineHeight )
 {
-  const float cursorWidth = mEventData->mDecorator ? mEventData->mDecorator->GetCursorWidth() : 0.f;
+  const float cursorWidth = mEventData->mDecorator ? static_cast<float>( mEventData->mDecorator->GetCursorWidth() ) : 0.f;
 
   // position is in actor's coords.
-  const float positionEnd = position.x + cursorWidth;
+  const float positionEndX = position.x + cursorWidth;
+  const float positionEndY = position.y + lineHeight;
 
   // Transform the position to decorator coords.
-  const float decoratorPositionBegin = position.x + mScrollPosition.x;
-  const float decoratorPositionEnd = positionEnd + mScrollPosition.x;
+  const float decoratorPositionBeginX = position.x + mScrollPosition.x;
+  const float decoratorPositionEndX = positionEndX + mScrollPosition.x;
+
+  const float decoratorPositionBeginY = position.y + mScrollPosition.y;
+  const float decoratorPositionEndY = positionEndY + mScrollPosition.y;
 
-  if( decoratorPositionBegin < 0.f )
+  if( decoratorPositionBeginX < 0.f )
   {
     mScrollPosition.x = -position.x;
   }
-  else if( decoratorPositionEnd > mVisualModel->mControlSize.width )
+  else if( decoratorPositionEndX > mVisualModel->mControlSize.width )
+  {
+    mScrollPosition.x = mVisualModel->mControlSize.width - positionEndX;
+  }
+
+  if( decoratorPositionBeginY < 0.f )
+  {
+    mScrollPosition.y = -position.y;
+  }
+  else if( decoratorPositionEndY > mVisualModel->mControlSize.height )
   {
-    mScrollPosition.x = mVisualModel->mControlSize.width - positionEnd;
+    mScrollPosition.y = mVisualModel->mControlSize.height - positionEndY;
   }
 }
 
@@ -2358,11 +2519,13 @@ void Controller::Impl::ScrollTextToMatchCursor( const CursorInfo& cursorInfo )
 
   // Calculate the offset to match the cursor position before the character was deleted.
   mScrollPosition.x = currentCursorPosition.x - cursorInfo.primaryPosition.x;
+  mScrollPosition.y = currentCursorPosition.y - cursorInfo.lineOffset;
 
   ClampHorizontalScroll( mVisualModel->GetLayoutSize() );
+  ClampVerticalScroll( mVisualModel->GetLayoutSize() );
 
   // Makes the new cursor position visible if needed.
-  ScrollToMakePositionVisible( cursorInfo.primaryPosition );
+  ScrollToMakePositionVisible( cursorInfo.primaryPosition, cursorInfo.lineHeight );
 }
 
 void Controller::Impl::RequestRelayout()
index 003aec5..99693ad 100644 (file)
@@ -126,6 +126,8 @@ struct EventData
   CharacterIndex     mPreEditStartPosition;    ///< Used to remove the pre-edit text if necessary.
   Length             mPreEditLength;           ///< Used to remove the pre-edit text if necessary.
 
+  float              mCursorHookPositionX;     ///< Used to move the cursor with the keys or when scrolling the text vertically with the handles.
+
   bool mIsShowingPlaceholderText        : 1;   ///< True if the place-holder text is being displayed.
   bool mPreEditFlag                     : 1;   ///< True if the model contains text in pre-edit state.
   bool mDecoratorUpdated                : 1;   ///< True if the decorator was updated during event processing.
@@ -133,11 +135,12 @@ struct EventData
   bool mGrabHandleEnabled               : 1;   ///< True if grab handle is enabled.
   bool mGrabHandlePopupEnabled          : 1;   ///< True if the grab handle popu-up should be shown.
   bool mSelectionEnabled                : 1;   ///< True if selection handles, highlight etc. are enabled.
-  bool mHorizontalScrollingEnabled      : 1;   ///< True if horizontal scrolling is enabled.
-  bool mVerticalScrollingEnabled        : 1;   ///< True if vertical scrolling is enabled.
+  bool mUpdateCursorHookPosition        : 1;   ///< True if the cursor hook position must be updated. Used to move the cursor with the keys 'up' and 'down'.
   bool mUpdateCursorPosition            : 1;   ///< True if the visual position of the cursor must be recalculated.
+  bool mUpdateGrabHandlePosition        : 1;   ///< True if the visual position of the grab handle must be recalculated.
   bool mUpdateLeftSelectionPosition     : 1;   ///< True if the visual position of the left selection handle must be recalculated.
   bool mUpdateRightSelectionPosition    : 1;   ///< True if the visual position of the right selection handle must be recalculated.
+  bool mUpdateHighlightBox              : 1;   ///< True if the text selection high light box must be updated.
   bool mScrollAfterUpdatePosition       : 1;   ///< Whether to scroll after the cursor position is updated.
   bool mScrollAfterDelete               : 1;   ///< Whether to scroll after delete characters.
   bool mAllTextSelected                 : 1;   ///< True if the selection handles are selecting all the text.
@@ -647,11 +650,12 @@ struct Controller::Impl
    * @pre mEventData must not be NULL. (there is a text-input or selection capabilities).
    *
    * @param[in] position A position in text coords.
+   * @param[in] lineHeight The line height for the given position.
    *
    * This method is called after inserting text, moving the cursor with the grab handle or the keypad,
    * or moving the selection handles.
    */
-  void ScrollToMakePositionVisible( const Vector2& position );
+  void ScrollToMakePositionVisible( const Vector2& position, float lineHeight );
 
   /**
    * @brief Scrolls the text to make the cursor visible.
index 3abcccd..1cf95fd 100644 (file)
@@ -93,6 +93,7 @@ FontDescriptionRun& UpdateSelectionFontStyleRun( EventData* eventData,
   // Recalculate the selection highlight as the metrics may have changed.
   eventData->mUpdateLeftSelectionPosition = true;
   eventData->mUpdateRightSelectionPosition = true;
+  eventData->mUpdateHighlightBox = true;
 
   return fontDescriptionRun;
 }
@@ -193,6 +194,69 @@ float Controller::GetAutoScrollLineAlignment() const
   return offset;
 }
 
+void Controller::SetHorizontalScrollEnabled( bool enable )
+{
+  if( ( NULL != mImpl->mEventData ) &&
+      mImpl->mEventData->mDecorator )
+  {
+    mImpl->mEventData->mDecorator->SetHorizontalScrollEnabled( enable );
+  }
+}
+
+bool Controller::IsHorizontalScrollEnabled() const
+{
+  if( ( NULL != mImpl->mEventData ) &&
+      mImpl->mEventData->mDecorator )
+  {
+    return mImpl->mEventData->mDecorator->IsHorizontalScrollEnabled();
+  }
+
+  return false;
+}
+
+void Controller::SetVerticalScrollEnabled( bool enable )
+{
+  if( ( NULL != mImpl->mEventData ) &&
+      mImpl->mEventData->mDecorator )
+  {
+    if( mImpl->mEventData->mDecorator )
+    {
+      mImpl->mEventData->mDecorator->SetVerticalScrollEnabled( enable );
+    }
+  }
+}
+
+bool Controller::IsVerticalScrollEnabled() const
+{
+  if( ( NULL != mImpl->mEventData ) &&
+      mImpl->mEventData->mDecorator )
+  {
+    return mImpl->mEventData->mDecorator->IsVerticalScrollEnabled();
+  }
+
+  return false;
+}
+
+void Controller::SetSmoothHandlePanEnabled( bool enable )
+{
+  if( ( NULL != mImpl->mEventData ) &&
+      mImpl->mEventData->mDecorator )
+  {
+    mImpl->mEventData->mDecorator->SetSmoothHandlePanEnabled( enable );
+  }
+}
+
+bool Controller::IsSmoothHandlePanEnabled() const
+{
+  if( ( NULL != mImpl->mEventData ) &&
+      mImpl->mEventData->mDecorator )
+  {
+    return mImpl->mEventData->mDecorator->IsSmoothHandlePanEnabled();
+  }
+
+  return false;
+}
+
 void Controller::SetText( const std::string& text )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" );
@@ -874,6 +938,7 @@ void Controller::SetInputFontFamily( const std::string& fontFamily )
       // As the font changes, recalculate the handle positions is needed.
       mImpl->mEventData->mUpdateLeftSelectionPosition = true;
       mImpl->mEventData->mUpdateRightSelectionPosition = true;
+      mImpl->mEventData->mUpdateHighlightBox = true;
       mImpl->mEventData->mScrollAfterUpdatePosition = true;
     }
   }
@@ -947,6 +1012,7 @@ void Controller::SetInputFontWeight( FontWeight weight )
       // As the font might change, recalculate the handle positions is needed.
       mImpl->mEventData->mUpdateLeftSelectionPosition = true;
       mImpl->mEventData->mUpdateRightSelectionPosition = true;
+      mImpl->mEventData->mUpdateHighlightBox = true;
       mImpl->mEventData->mScrollAfterUpdatePosition = true;
     }
   }
@@ -1000,6 +1066,7 @@ void Controller::SetInputFontWidth( FontWidth width )
       // As the font might change, recalculate the handle positions is needed.
       mImpl->mEventData->mUpdateLeftSelectionPosition = true;
       mImpl->mEventData->mUpdateRightSelectionPosition = true;
+      mImpl->mEventData->mUpdateHighlightBox = true;
       mImpl->mEventData->mScrollAfterUpdatePosition = true;
     }
   }
@@ -1053,6 +1120,7 @@ void Controller::SetInputFontSlant( FontSlant slant )
       // As the font might change, recalculate the handle positions is needed.
       mImpl->mEventData->mUpdateLeftSelectionPosition = true;
       mImpl->mEventData->mUpdateRightSelectionPosition = true;
+      mImpl->mEventData->mUpdateHighlightBox = true;
       mImpl->mEventData->mScrollAfterUpdatePosition = true;
     }
   }
@@ -1105,6 +1173,7 @@ void Controller::SetInputFontPointSize( float size )
       // As the font might change, recalculate the handle positions is needed.
       mImpl->mEventData->mUpdateLeftSelectionPosition = true;
       mImpl->mEventData->mUpdateRightSelectionPosition = true;
+      mImpl->mEventData->mUpdateHighlightBox = true;
       mImpl->mEventData->mScrollAfterUpdatePosition = true;
     }
   }
@@ -2313,6 +2382,7 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y )
         }
         else
         {
+          // Show cursor and grabhandle on first tap, this matches the behaviour of tapping when already editing
           mImpl->ChangeState( EventData::EDITING_WITH_GRAB_HANDLE );
         }
         relayoutNeeded = true;
@@ -2363,7 +2433,6 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y )
 }
 
 void Controller::PanEvent( Gesture::State state, const Vector2& displacement )
-        // Show cursor and grabhandle on first tap, this matches the behaviour of tapping when already editing
 {
   DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected PanEvent" );
 
@@ -2570,7 +2639,10 @@ void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Butt
     case Toolkit::TextSelectionPopup::COPY:
     {
       mImpl->SendSelectionToClipboard( false ); // Text not modified
-      mImpl->RequestRelayout(); // Handles, Selection Highlight, Popup
+
+      mImpl->mEventData->mUpdateCursorPosition = true;
+
+      mImpl->RequestRelayout(); // Cursor, Handles, Selection Highlight, Popup
       break;
     }
     case Toolkit::TextSelectionPopup::PASTE:
index 8517ca5..304ad2f 100644 (file)
@@ -188,6 +188,48 @@ public:
   float GetAutoScrollLineAlignment() const;
 
   /**
+   * @brief Enables the horizontal scrolling.
+   *
+   * @param[in] enable Whether to enable the horizontal scrolling.
+   */
+  void SetHorizontalScrollEnabled( bool enable );
+
+  /**
+   * @brief Retrieves whether the horizontal scrolling is enabled.
+   *
+   * @return @e true if the horizontal scrolling is enabled, otherwise it returns @e false.
+   */
+  bool IsHorizontalScrollEnabled() const;
+
+  /**
+   * @brief Enables the vertical scrolling.
+   *
+   * @param[in] enable Whether to enable the vertical scrolling.
+   */
+  void SetVerticalScrollEnabled( bool enable );
+
+  /**
+   * @brief Retrieves whether the verticall scrolling is enabled.
+   *
+   * @return @e true if the vertical scrolling is enabled, otherwise it returns @e false.
+   */
+  bool IsVerticalScrollEnabled() const;
+
+  /**
+   * @brief Enables the smooth handle panning.
+   *
+   * @param[in] enable Whether to enable the smooth handle panning.
+   */
+  void SetSmoothHandlePanEnabled( bool enable );
+
+  /**
+   * @brief Retrieves whether the smooth handle panning is enabled.
+   *
+   * @return @e true if the smooth handle panning is enabled.
+   */
+  bool IsSmoothHandlePanEnabled() const;
+
+  /**
    * @brief Replaces any text previously set.
    *
    * @note This will be converted into UTF-32 when stored in the text model.
index 3c9b450..d1a5d2f 100644 (file)
 #include <dali-toolkit/internal/text/text-scroller.h>
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/sampler.h>
-#include <dali/devel-api/rendering/shader.h>
-#include <dali/integration-api/debug.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/frame-buffer-image.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/sampler.h>
+#include <dali/public-api/rendering/shader.h>
+#include <dali/devel-api/images/texture-set-image.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/text-scroller-interface.h>
@@ -171,7 +172,7 @@ void CreateRenderer( FrameBufferImage frameBufferImage, Dali::Renderer& renderer
   sampler.SetFilterMode(FilterMode::NEAREST, FilterMode::NEAREST );
 
   TextureSet textureSet = TextureSet::New();
-  textureSet.SetImage( 0u, frameBufferImage );
+  TextureSetImage( textureSet, 0u, frameBufferImage );
   textureSet.SetSampler( 0u, sampler );
 
   Geometry meshGeometry;
index 6d904b5..ed71b14 100644 (file)
@@ -25,6 +25,9 @@
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 #include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
+
 namespace Dali
 {
 
@@ -245,14 +248,14 @@ void CubeTransitionEffect::OnStageConnection( int depth )
 {
   Control::OnStageConnection( depth );
 
-  Geometry geometry = Geometry::QUAD();
+  Geometry geometry = RendererFactoryCache::CreateQuadGeometry();
   Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
 
   TextureSet textureSet = TextureSet::New();
 
-  if( mCurrentImage )
+  if( mCurrentTexture )
   {
-    textureSet.SetImage( 0u, mCurrentImage );
+    textureSet.SetTexture( 0u, mCurrentTexture );
   }
   mCurrentRenderer = Renderer::New( geometry, shader );
   mCurrentRenderer.SetTextures( textureSet );
@@ -311,24 +314,25 @@ bool CubeTransitionEffect::IsTransitioning()
   return mIsAnimating;
 }
 
-void CubeTransitionEffect::SetCurrentImage( Image image )
+void CubeTransitionEffect::SetCurrentTexture( Texture texture )
 {
-  mCurrentImage = image;
+  mCurrentTexture = texture;
+
   if( mCurrentRenderer )
   {
     TextureSet textureSet = mCurrentRenderer.GetTextures();
-    textureSet.SetImage( 0u, mCurrentImage );
+    textureSet.SetTexture( 0u, mCurrentTexture);
   }
 }
 
-void CubeTransitionEffect::SetTargetImage( Image image )
+void CubeTransitionEffect::SetTargetTexture( Texture texture )
 {
-  mTargetImage = image;
+  mTargetTexture = texture;
 
   if( mTargetRenderer )
   {
     TextureSet textureSet = mTargetRenderer.GetTextures();
-    textureSet.SetImage( 0u, mTargetImage );
+    textureSet.SetTexture( 0u, mTargetTexture );
   }
 }
 
@@ -355,9 +359,9 @@ void CubeTransitionEffect::StartTransition( Vector2 panPosition, Vector2 panDisp
 
   //create the target renderer
   TextureSet textureSet = TextureSet::New();
-  if( mTargetImage )
+  if( mTargetTexture )
   {
-    textureSet.SetImage( 0u, mTargetImage );
+    textureSet.SetTexture( 0u, mTargetTexture );
   }
   Geometry geometry = mCurrentRenderer.GetGeometry();
   Shader shader( mCurrentRenderer.GetShader() );
@@ -467,13 +471,13 @@ void CubeTransitionEffect::OnTransitionFinished(Animation& source)
 
   std::swap( mCurrentTiles, mTargetTiles );
   std::swap( mCurrentRenderer, mTargetRenderer );
-  std::swap( mCurrentImage, mTargetImage );
+  std::swap( mCurrentTexture, mTargetTexture );
 
   ResetToInitialState();
 
   //Emit signal
   Toolkit::CubeTransitionEffect handle( GetOwner() );
-  mTransitionCompletedSignal.Emit( handle, mCurrentImage );
+  mTransitionCompletedSignal.Emit( handle, mCurrentTexture );
 }
 
 Toolkit::CubeTransitionEffect::TransitionCompletedSignalType& CubeTransitionEffect::TransitionCompletedSignal()
index 35319bf..5eda6b2 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__
+#ifndef DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H
+#define DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
@@ -76,14 +76,14 @@ public:
   bool IsTransitioning();
 
   /**
-   * @copydoc Toolkit::CubeTransitionEffect::SetFirstImage
+   * @copydoc Toolkit::CubeTransitionEffect::SetCurrentTexture
    */
-  void SetCurrentImage( Image image );
+  void SetCurrentTexture( Texture texture );
 
   /**
-   * @copydoc Toolkit::CubeTransitionEffect::SetTargetImage
+   * @copydoc Toolkit::CubeTransitionEffect::SetTargetTexture
    */
-  void SetTargetImage( Image image );
+  void SetTargetTexture( Texture texture );
 
   /**
    * @copydoc Toolkit::CubeTransitionEffect::StartTransition(bool)
@@ -214,8 +214,9 @@ protected:
   Renderer                   mCurrentRenderer;
   Renderer                   mTargetRenderer;
 
-  Image                      mCurrentImage;
-  Image                      mTargetImage;
+  Texture                    mCurrentTexture;
+  Texture                    mTargetTexture;
+
   Animation                  mAnimation;
 
   Vector2                    mTileSize;
@@ -261,4 +262,4 @@ inline const Internal::CubeTransitionEffect& GetImpl(const Dali::Toolkit::CubeTr
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H
index 0a2c3c8..e47001a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -25,9 +25,9 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
index 4779d58..2353cea 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_CONTROL_IMPL_H__
-#define __DALI_TOOLKIT_CONTROL_IMPL_H__
+#ifndef DALI_TOOLKIT_CONTROL_IMPL_H
+#define DALI_TOOLKIT_CONTROL_IMPL_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -698,4 +698,4 @@ DALI_IMPORT_API const Internal::Control& GetImplementation( const Dali::Toolkit:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_CONTROL_IMPL_H__
+#endif // DALI_TOOLKIT_CONTROL_IMPL_H
index d087913..0f27e3b 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 42;
+const unsigned int TOOLKIT_MICRO_VERSION = 43;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 682ae40..fead10f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.42
+Version:    1.1.43
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
@@ -37,12 +37,6 @@ BuildRequires:  dali-adaptor-devel
   %define dali_toolkit_profile MOBILE
 %endif
 
-%if 0%{?enable_coverage}
-CXXFLAGS+=" -fprofile-arcs -ftest-coverage --coverage "
-LDFLAGS+=" -fprofile-arcs -ftest-coverage --coverage -lgcov "
-%endif
-
-
 %description
 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
 user interface functionality.
@@ -88,6 +82,11 @@ PREFIX="/usr"
 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
 
+%if 0%{?enable_coverage}
+CXXFLAGS+=" --coverage "
+LDFLAGS+=" --coverage "
+%endif
+
 libtoolize --force
 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
 autoreconf --install
index 9b4b4ff..5ad2180 100644 (file)
@@ -73,7 +73,7 @@ The actor provides the following call back events
 
 | Name            | Description                            | Parameters passed to call back |
 |-----------------|----------------------------------------|--------------------------|
-|touched          | touch event                            | (actor, touchEvent )     |
+|touch            | touch                                  | (actor, touchData )      |
 |hovered          | mouse or pointer hovering over actor   | (actor, hoverEvent)      |
 |mouseWheelEvent  | mouse wheel events                     | (actor, wheelEvent)      |
 |onStage          | actor has been moved on stage          | (actor)                  |
@@ -83,38 +83,42 @@ The actor provides the following call back events
 #### Touch event
 
 Used to detect multiple touch events on the actor. The state of each touch point can be:
-+ "down"        = touch down
-+ "up"          = Touch up
-+ "motion"      = Finger dragged or hovered
-+ "leave"       =  Leave the boundary of an actor
-+ "stationary"  = No change from last event.  Useful when a multi-point event occurs where
-all points are sent but indicates that this particular point has not changed since the last time
-+ "interrupted"  = A system event has occurred which has interrupted the touch or hover event sequence
++ "DOWN"        = touch down
++ "UP"          = Touch up
++ "MOTION"      = Finger dragged or hovered
++ "LEAVE"       = Leave the boundary of an actor
++ "STATIONARY"  = No change from last event.  Useful when a multi-point event occurs where
+                  all points are sent but indicates that this particular point has not changed
+                  since the last time
++ "INTERRUPTED" = A system event has occurred which has interrupted the touch or hover event sequence
 
 
 
 ```
-touchEvent = {
+touchData = {
   
   pointCount: int,  // number of points touched ( multi-touch )
   time: int,        // The time in milliseconds that the touch event occurred.
-  points = [ touchPoints ],    // array of TouchPoints, to support
+  points = [ Points ],    // array of Points
   
-  TouchPoint = {
-  
-    "deviceId" : int,      // Each touch point has a unique device ID
-    "state" : string,      // touch state ="down,up,motion,leave,stationary, interrupted }
-    "sourceActor" : actor, // the actor that is emitting the callback (the actor that is hit maybe a child of it)
-    "hitActor" : actor,    // actor that was hit
-    "local" :  {x,y},      // co-ordinates of top left of hit actor (local.x, local.y)
-    "screen" : {x,y}       // co-ordinates of top left of hit actor (screen.x, screen.y)
-    }
+  Point = {
+    "deviceId" : int,        // Each touch point has a unique device ID
+    "state" : string,        // touch state ="DOWN","UP","MOTION","LEAVE","STATIONARY","INTERRUPTED"
+    "sourceActor" : actor,   // the actor that is emitting the callback (the actor that is hit maybe a child of it)
+    "hitActor" : actor,      // actor that was hit
+    "local" :  {x,y},        // co-ordinates of top left of hit actor (local.x, local.y)
+    "screen" : {x,y},        // co-ordinates of top left of hit actor (screen.x, screen.y)
+    "radius" : float,        // radius of the press point (average of both the horizontal & vertical radii)
+    "ellipseRadius" : {x,y}, // both the horizontal and the vertical radii of the press point
+    "pressure" : float,      // the touch pressure
+    "angle" : float          // angle of the press point relative to the Y-Axis (in degrees)
+  }
 }
 
-function OnPressed( actor, touchEvent )
+function onPressed( actor, touchData )
 {
-  var firstPoint = touchEvent.points[0];
-  log("first touch point = " + firstPoint.screen.x + "," +firstPoint.screen.x + "actor= "+firstPoint.hitActor );
+  var firstPoint = touchData.points[0];
+  log("first touch point = " + firstPoint.screen.x + "," + firstPoint.screen.x + "actor= " + firstPoint.hitActor );
   
   var anim = new dali.Animation( 4 );
   var rotation = new dali.Rotation( 90, 0, 0 ); // pitch, yaw, roll
@@ -124,7 +128,7 @@ function OnPressed( actor, touchEvent )
 }
   
 // connect to touch events
-myActor.on( "touched", onPressed );
+myActor.on( "touch", onPressed );
 
 ```
 
@@ -138,7 +142,12 @@ hoverEvent = {
   points[]    // array of TouchPoints
   
   TouchPoint = {
-      // See touchEvent TouchPoint object
+    "deviceId" : int,      // Each touch point has a unique device ID
+    "state" : string,      // touch state ="down,up,motion,leave,stationary, interrupted }
+    "sourceActor" : actor, // the actor that is emitting the callback (the actor that is hit maybe a child of it)
+    "hitActor" : actor,    // actor that was hit
+    "local" :  {x,y},      // co-ordinates of top left of hit actor (local.x, local.y)
+    "screen" : {x,y}       // co-ordinates of top left of hit actor (screen.x, screen.y)
   }
 }
 ```
@@ -487,9 +496,9 @@ WORLD_COLOR
 
 /**
  * Actors sensitive flag
- * brief Sets whether an actor should emit touch event signals; @see SignalTouched().
+ * brief Sets whether an actor should emit touch event signals; @see SignalTouch().
  *
- * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouched(),
+ * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
  * the touch event signal will be emitted.
  *
  * If the application wishes to temporarily disable the touch event signal emission, then they can do so by calling
index eab1614..15252da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -33,8 +33,8 @@
 #include <dali/public-api/actors/sampling.h>
 #include <dali/public-api/render-tasks/render-task.h>
 #include <dali/public-api/common/loading-state.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
 
index e90fe8c..e9d8955 100644 (file)
@@ -32,13 +32,33 @@ namespace V8Plugin
 namespace
 {
 
-struct PointState
+struct TouchDataPointState
+{
+  PointState::Type state;
+  const char* name;
+};
+
+const TouchDataPointState TouchDataPointStateLookup[]=
+{
+    { PointState::DOWN,         "DOWN"        },
+    { PointState::UP,           "UP"          },
+    { PointState::MOTION,       "MOTION"      },
+    { PointState::LEAVE,        "LEAVE"       },
+    { PointState::STATIONARY,   "STATIONARY"  },
+    { PointState::INTERRUPTED,  "INTERRUPT"   },
+    { PointState::STARTED,      "STARTED"     },
+    { PointState::FINISHED,     "FINISHED"    },
+};
+
+const unsigned int TouchDataPointStateLookupCount = sizeof(TouchDataPointStateLookup)/sizeof(TouchDataPointStateLookup[0]);
+
+struct TouchPointState
 {
   TouchPoint::State state;
   const char* name;
 };
 
-const PointState PointStateLookup[]=
+const TouchPointState PointStateLookup[]=
 {
     { TouchPoint::Down,         "down"        },       /**< Screen touched */
     { TouchPoint::Up,           "up"          },       /**< Touch stopped */
@@ -70,6 +90,19 @@ const GestureState GestureStateLookup[]=
 
 const unsigned int GestureStateLookupCount = sizeof(GestureStateLookup)/sizeof(GestureStateLookup[0]);
 
+const char* GetTouchDataPointStateName( PointState::Type state )
+{
+  // could use the enum as index, but dali-core may change, so for now just do a lookup
+  for( unsigned int i = 0; i < TouchDataPointStateLookupCount; i++ )
+  {
+    if( TouchDataPointStateLookup[i].state == state )
+    {
+      return TouchDataPointStateLookup[i].name;
+    }
+  }
+  return "error point state not found";
+}
+
 const char* GetTouchPointStateName( TouchPoint::State state )
 {
   // could use the enum as index, but dali-core may change, so for now just do a lookup
@@ -146,21 +179,25 @@ v8::Local<v8::Object> CreateTouchPoint( v8::Isolate* isolate, const TouchPoint&
 } // un-named namespace
 
 
-v8::Handle<v8::Object> EventObjectGenerator::CreateTouchEvent( v8::Isolate* isolate, const TouchEvent& touchEvent)
+v8::Handle<v8::Object> EventObjectGenerator::CreateTouchData( v8::Isolate* isolate, const TouchData& touch )
 {
   // we are creating a touch event object that looks like this
   //
   //  event.pointCount = points touched
   //  event.time       = The time (in ms) that the touch event occurred.
-  //  event.point[]    = array of TouchPoints
+  //  event.point[]    = array of Points
   //
-  // A TouchPoint =
+  // A Point =
   //   { "deviceId",  int }  Each touch point has a unique device ID
   //   { "state",   string } touch state ="Down,Up,Motion,Leave,Stationary, Interrupted }
   //   { "sourceActor", actor }  the actor that is emitting the callback (the actor that is hit maybe a child of it)
   //   { "hitActor", actor } actor that was hit
   //   { "local",  {x,y} } co-ordinates of top left of hit actor
   //   { "screen", {x,y} } co-ordinates of top left of hit actor
+  //   { "radius", float } radius of the press point (average of both the horizontal & vertical radii)
+  //   { "ellipseRadius", {x,y} } both the horizontal and the vertical radii of the press point
+  //   { "pressure", float } the touch pressure
+  //   { "angle", float } angle of the press point relative to the Y-Axis
   //
 
   v8::EscapableHandleScope handleScope( isolate );
@@ -168,19 +205,64 @@ v8::Handle<v8::Object> EventObjectGenerator::CreateTouchEvent( v8::Isolate* isol
   v8::Local<v8::Object> touchObject = v8::Object::New( isolate );
 
   // Set the pointCount
-  touchObject->Set( v8::String::NewFromUtf8( isolate, "pointCount" ), v8::Integer::New( isolate, touchEvent.GetPointCount() ) );
+  touchObject->Set( v8::String::NewFromUtf8( isolate, "pointCount" ), v8::Integer::New( isolate, touch.GetPointCount() ) );
 
   // Set the time
-  touchObject->Set( v8::String::NewFromUtf8( isolate, "time" ), v8::Number::New( isolate, touchEvent.time ) );
+  touchObject->Set( v8::String::NewFromUtf8( isolate, "time" ), v8::Number::New( isolate, touch.GetTime() ) );
 
   // Set the emitting actor
   // touchObject->Set( v8::String::NewFromUtf8( isolate, "sourceActor" ), ActorWrapper::WrapActor(isolate, emittingActor));
 
   // Create the array of touch points
-  v8::Local < v8::Array > pointArrayObject = v8::Array::New( isolate, touchEvent.GetPointCount() );
-  for( unsigned int i = 0 ; i < touchEvent.GetPointCount() ; ++i )
+  v8::Local < v8::Array > pointArrayObject = v8::Array::New( isolate, touch.GetPointCount() );
+  for( unsigned int i = 0 ; i < touch.GetPointCount() ; ++i )
   {
-    v8::Local < v8::Object > pointObject = CreateTouchPoint( isolate, touchEvent.points[i] );
+    v8::Local<v8::Object> pointObject = v8::Object::New( isolate );
+
+    // set device id
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "deviceId" ), v8::Integer::New( isolate, touch.GetDeviceId( i ) ) );
+
+    // set state
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "state" ), v8::String::NewFromUtf8( isolate, GetTouchDataPointStateName( touch.GetState( i ) ) ) );
+
+    Actor hitActor = touch.GetHitActor( i );
+    if( hitActor )
+    {
+      // set the hit actor
+      pointObject->Set( v8::String::NewFromUtf8( isolate, "hitActor" ), ActorWrapper::WrapActor( isolate, hitActor ) );
+    }
+
+    // set the local co-ordinates
+    const Vector2& local = touch.GetLocalPosition( i );
+    v8::Local<v8::Object> localPointObject = v8::Object::New( isolate );
+    localPointObject->Set( v8::String::NewFromUtf8( isolate, "x" ), v8::Integer::New( isolate, local.x ) );
+    localPointObject->Set( v8::String::NewFromUtf8( isolate, "y" ), v8::Integer::New( isolate, local.y ) );
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "local" ),  localPointObject );
+
+    // set the screen co-ordinates
+    const Vector2& screen = touch.GetScreenPosition( i );
+    v8::Local<v8::Object> screenPointObject = v8::Object::New( isolate );
+    screenPointObject->Set( v8::String::NewFromUtf8( isolate, "x" ), v8::Integer::New( isolate, screen.x ) );
+    screenPointObject->Set( v8::String::NewFromUtf8( isolate, "y" ), v8::Integer::New( isolate, screen.y ) );
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "screen" ), screenPointObject );
+
+    // set the radius
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "radius" ), v8::Integer::New( isolate, touch.GetRadius( i ) ) );
+
+    // set the ellipse Radius
+    const Vector2& ellipse = touch.GetEllipseRadius( i );
+    v8::Local<v8::Object> ellipseObject = v8::Object::New( isolate );
+    ellipseObject->Set( v8::String::NewFromUtf8( isolate, "x" ), v8::Integer::New( isolate, ellipse.x ) );
+    ellipseObject->Set( v8::String::NewFromUtf8( isolate, "y" ), v8::Integer::New( isolate, ellipse.y ) );
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "ellipseRadius" ),  ellipseObject );
+
+    // set the pressure
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "pressure" ), v8::Integer::New( isolate, touch.GetPressure( i ) ) );
+
+    // set the angle
+    pointObject->Set( v8::String::NewFromUtf8( isolate, "angle" ), v8::Integer::New( isolate, touch.GetAngle( i ).degree ) );
+
+    // add the point
     pointArrayObject->Set( v8::Number::New( isolate, i ), pointObject  );
   }
 
index d1d6296..0bbd47a 100644 (file)
@@ -21,7 +21,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/events/hover-event.h>
 #include <dali/public-api/events/wheel-event.h>
 #include <dali/public-api/events/key-event.h>
@@ -42,7 +42,7 @@ namespace V8Plugin
 namespace EventObjectGenerator
 {
 
-  v8::Handle<v8::Object> CreateTouchEvent( v8::Isolate* isolate, const TouchEvent& touchEvent);
+  v8::Handle<v8::Object> CreateTouchData( v8::Isolate* isolate, const TouchData& touch );
   v8::Handle<v8::Object> CreateHoverEvent( v8::Isolate* isolate, const HoverEvent& hoverEvent);
   v8::Handle<v8::Object> CreateWheelEvent( v8::Isolate* isolate, const WheelEvent& wheelEvent);
   v8::Handle<v8::Object> CreateKeyEvent( v8::Isolate* isolate, const KeyEvent& keyEvent);
index 39b1707..c76607c 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_PROPERTY_BUFFER_API_H__
-#define __DALI_V8PLUGIN_PROPERTY_BUFFER_API_H__
+#ifndef DALI_V8PLUGIN_PROPERTY_BUFFER_API_H
+#define DALI_V8PLUGIN_PROPERTY_BUFFER_API_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/object/property-buffer.h>
+#include <dali/public-api/rendering/property-buffer.h>
 
 
 namespace Dali
@@ -61,10 +61,10 @@ namespace PropertyBufferApi
    */
   void SetData( const v8::FunctionCallbackInfo< v8::Value >& args );
 
-}; // namespace PropertyBufferApi
+} // namespace PropertyBufferApi
 
 } // namespace V8Plugin
 
 } // namespace Dali
 
-#endif // header __DALI_V8PLUGIN_PROPERTY_BUFFER_API_H__
+#endif // DALI_V8PLUGIN_PROPERTY_BUFFER_API_H
index 7cb8b84..914b9a9 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_PROPERTY_BUFFER_WRAPPER_H__
-#define __DALI_V8PLUGIN_PROPERTY_BUFFER_WRAPPER_H__
+#ifndef DALI_V8PLUGIN_PROPERTY_BUFFER_WRAPPER_H
+#define DALI_V8PLUGIN_PROPERTY_BUFFER_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/object/property-buffer.h>
+#include <dali/public-api/rendering/property-buffer.h>
 
 // INTERNAL INCLUDES
 #include <shared/base-wrapped-object.h>
@@ -54,7 +54,7 @@ public:
    */
   virtual ~PropertyBufferWrapper()
   {
-  };
+  }
 
   /**
    * @brief Creates a new PropertyBuffer wrapped inside a Javascript Object.
@@ -92,4 +92,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_V8PLUGIN_PROPERTY_BUFFER_WRAPPER_H__
+#endif // DALI_V8PLUGIN_PROPERTY_BUFFER_WRAPPER_H
index 2a8778f..6b994fb 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_GEOMETRY_API_H__
-#define __DALI_V8PLUGIN_GEOMETRY_API_H__
+#ifndef DALI_V8PLUGIN_GEOMETRY_API_H
+#define DALI_V8PLUGIN_GEOMETRY_API_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
 
 
 namespace Dali
@@ -70,4 +70,4 @@ namespace GeometryApi
 
 } // namespace Dali
 
-#endif // header __DALI_V8PLUGIN_GEOMETRY_API_H__
+#endif // DALI_V8PLUGIN_GEOMETRY_API_H
index f57abfe..e4f6498 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
index 6272ffc..8608d92 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_GEOMETRY_WRAPPER_H__
-#define __DALI_V8PLUGIN_GEOMETRY_WRAPPER_H__
+#ifndef DALI_V8PLUGIN_GEOMETRY_WRAPPER_H
+#define DALI_V8PLUGIN_GEOMETRY_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
 
 // INTERNAL INCLUDES
 #include <object/handle-wrapper.h>
@@ -104,4 +104,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_V8PLUGIN_GEOMETRY_WRAPPER_H__
+#endif // DALI_V8PLUGIN_GEOMETRY_WRAPPER_H
index 033729d..e65d3d8 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_RENDERER_API_H__
-#define __DALI_V8PLUGIN_RENDERER_API_H__
+#ifndef DALI_V8PLUGIN_RENDERER_API_H
+#define DALI_V8PLUGIN_RENDERER_API_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 
 namespace Dali
@@ -68,4 +68,4 @@ namespace RendererApi
 
 } // namespace Dali
 
-#endif // header __DALI_V8PLUGIN_RENDERER_API_H__
+#endif // DALI_V8PLUGIN_RENDERER_API_H
index d03669a..c5e676a 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_RENDERER_WRAPPER_H__
-#define __DALI_V8PLUGIN_RENDERER_WRAPPER_H__
+#ifndef DALI_V8PLUGIN_RENDERER_WRAPPER_H
+#define DALI_V8PLUGIN_RENDERER_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
 #include <object/handle-wrapper.h>
@@ -104,4 +104,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_V8PLUGIN_RENDERER_WRAPPER_H__
+#endif // DALI_V8PLUGIN_RENDERER_WRAPPER_H
index 1eac960..8cb5aa9 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_SAMPLER_API_H__
-#define __DALI_V8PLUGIN_SAMPLER_API_H__
+#ifndef DALI_V8PLUGIN_SAMPLER_API_H
+#define DALI_V8PLUGIN_SAMPLER_API_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/sampler.h>
+#include <dali/public-api/rendering/sampler.h>
 
 namespace Dali
 {
@@ -64,4 +64,4 @@ namespace SamplerApi
 
 } // namespace Dali
 
-#endif // header __DALI_V8PLUGIN_SAMPLER_API_H__
+#endif // DALI_V8PLUGIN_SAMPLER_API_H
index 5f2df3c..42c6300 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_SAMPLER_WRAPPER_H__
-#define __DALI_V8PLUGIN_SAMPLER_WRAPPER_H__
+#ifndef DALI_V8PLUGIN_SAMPLER_WRAPPER_H
+#define DALI_V8PLUGIN_SAMPLER_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/sampler.h>
+#include <dali/public-api/rendering/sampler.h>
 
 // INTERNAL INCLUDES
 #include <shared/base-wrapped-object.h>
@@ -100,4 +100,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_V8PLUGIN_SAMPLER_WRAPPER_H__
+#endif // DALI_V8PLUGIN_SAMPLER_WRAPPER_H
index 1c9e1a2..230e789 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_SHADER_API_H__
-#define __DALI_V8PLUGIN_SHADER_API_H__
+#ifndef DALI_V8PLUGIN_SHADER_API_H
+#define DALI_V8PLUGIN_SHADER_API_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/shader.h>
 
 
 namespace Dali
@@ -55,4 +55,4 @@ namespace ShaderApi
 
 } // namespace Dali
 
-#endif // header __DALI_V8PLUGIN_SHADER_API_H__
+#endif // DALI_V8PLUGIN_SHADER_API_H
index b4cb2a0..a5833f9 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_SHADER_WRAPPER_H__
-#define __DALI_V8PLUGIN_SHADER_WRAPPER_H__
+#ifndef DALI_V8PLUGIN_SHADER_WRAPPER_H
+#define DALI_V8PLUGIN_SHADER_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/shader.h>
+#include <dali/public-api/rendering/shader.h>
 
 // INTERNAL INCLUDES
 #include <object/handle-wrapper.h>
@@ -104,4 +104,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_V8PLUGIN_SHADER_WRAPPER_H__
+#endif // DALI_V8PLUGIN_SHADER_WRAPPER_H__
index 1c5ad39..d89807f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -92,41 +92,6 @@ TextureSet TextureSetApi::New( const v8::FunctionCallbackInfo< v8::Value >& args
   return TextureSet::New();
 }
 
-
-/**
- * Sets the image to be used by a given texture
- * @method setImage
- * @for TextureSet
- * @param {integer} index The index of the texture in the array of textures
- * @param {Object} image The image used by this sampler
- */
-void TextureSetApi::SetImage( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  TextureSet textureSet = GetTextureSet( isolate, args );
-
-  bool found( false );
-  int index = V8Utils::GetIntegerParameter( PARAMETER_0, found, isolate, args, 0 /* default */);
-  if( !found )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid index parameter" );
-    return;
-  }
-
-  found = false;
-  Image image = V8Utils::GetImageParameter( PARAMETER_1, found, isolate, args );
-  if( !found )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "missing image from param 1" );
-  }
-  else
-  {
-    textureSet.SetImage(index, image);
-  }
-}
-
 /**
  * Set the sampler used by a given texture
  * @method setSampler
index c5dc357..8b4159d 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_V8PLUGIN_TEXURE_SET_API_H__
-#define __DALI_V8PLUGIN_TEXURE_SET_API_H__
+#ifndef DALI_V8PLUGIN_TEXURE_SET_API_H
+#define DALI_V8PLUGIN_TEXURE_SET_API_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/texture-set.h>
 
 
 namespace Dali
@@ -66,4 +66,4 @@ namespace TextureSetApi
 
 } // namespace Dali
 
-#endif // header __DALI_V8PLUGIN_TEXURE_SET_API_H__
+#endif // DALI_V8PLUGIN_TEXURE_SET_API_H
index 9e0426a..aaf8ecc 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_V8PLUGIN_TEXTURE_SET_WRAPPER_H__
-#define __DALI_V8PLUGIN_TEXTURE_SET_WRAPPER_H__
+#ifndef DALI_V8PLUGIN_TEXTURE_SET_WRAPPER_H
+#define DALI_V8PLUGIN_TEXTURE_SET_WRAPPER_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/devel-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/texture-set.h>
 
 // INTERNAL INCLUDES
 #include <object/handle-wrapper.h>
@@ -104,4 +104,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_V8PLUGIN_TEXTURE_SET_WRAPPER_H__
+#endif // DALI_V8PLUGIN_TEXTURE_SET_WRAPPER_H
index faeaf25..b675779 100644 (file)
@@ -66,9 +66,9 @@ v8::Local<v8::Value> DaliAnyConverter::ConvertToJavaScriptObject(v8::Isolate* is
   {
     returnValue = PropertyValueWrapper::WrapDaliProperty( isolate, value.Get<Vector3>() );
   }
-  else if(  typeInfo == typeid( Dali::TouchEvent ) )
+  else if(  typeInfo == typeid( Dali::TouchData ) )
   {
-    returnValue = EventObjectGenerator::CreateTouchEvent( isolate, value.Get<TouchEvent>() );
+    returnValue = EventObjectGenerator::CreateTouchData( isolate, value.Get<TouchData>() );
   }
   else if(  typeInfo == typeid( Dali::HoverEvent ) )
   {
index b943903..d806913 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/events/pan-gesture-detector.h>
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/images/image.h>
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/events/hover-event.h>
 #include <dali/public-api/events/wheel-event.h>
 #include <dali/public-api/events/key-event.h>
@@ -54,7 +54,7 @@ namespace V8Plugin
 
 namespace // un-named namespace
 {
-const char* const SIGNAL_TOUCHED = "touched";
+const char* const SIGNAL_TOUCH = "touch";
 const char* const SIGNAL_HOVERED = "hovered";
 const char* const SIGNAL_WHEEL_EVENT = "wheelEvent";
 const char* const SIGNAL_ON_STAGE = "onStage";
@@ -64,7 +64,7 @@ const char* const SIGNAL_PAN_DETECTED = "panDetected";
 
 const char* const STAGE_SIGNAL_KEY_EVENT = "keyEvent";
 const char* const STAGE_SIGNAL_EVENT_PROCESSING_FINISHED = "eventProcessingFinished";
-const char* const STAGE_SIGNAL_TOUCHED = "touched";
+const char* const STAGE_SIGNAL_TOUCH = "touch";
 const char* const SIGNAL_IMAGE_LOADING_FINISHED = "imageLoadingFinished";
 const char* const SIGNAL_IMAGE_UPLOADED = "uploaded";
 
@@ -185,12 +185,12 @@ public:
     mActor(actor)
   {
   }
-  bool OnTouch( Actor actor, const TouchEvent& event)
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     std::vector< Dali::Any > arguments;  // Dali::Vector considers Dali::Any to be a non trivial type so won't compile
     Dali::Any returnValue(false);
     arguments.push_back( actor );
-    arguments.push_back( event );
+    arguments.push_back( touch );
     CallJavaScript( returnValue, arguments );
     bool ret;
     returnValue.Get(ret);
@@ -308,11 +308,11 @@ public:
     Dali::Any returnValue;  //no return
     CallJavaScript( returnValue, arguments );
   }
-  void TouchedSignal( const TouchEvent& touchEvent)
+  void TouchSignal( const TouchData& touch )
   {
     std::vector< Dali::Any > arguments;
     Dali::Any returnValue;   //no return
-    arguments.push_back( touchEvent );
+    arguments.push_back( touch );
     CallJavaScript( returnValue, arguments );
   }
 };
@@ -398,9 +398,9 @@ void ActorConnection( v8::Isolate* isolate,
 
   ActorCallback* callback =new ActorCallback( isolate, javaScriptCallback, signalName, actor );
 
-  if( strcmp( signalName.c_str(), SIGNAL_TOUCHED ) == 0 )
+  if( strcmp( signalName.c_str(), SIGNAL_TOUCH ) == 0 )
   {
-    actor.TouchedSignal().Connect( callback, &ActorCallback::OnTouch );
+    actor.TouchSignal().Connect( callback, &ActorCallback::OnTouch );
   }
   else if( strcmp( signalName.c_str(), SIGNAL_HOVERED ) == 0 )
   {
@@ -494,9 +494,9 @@ void StageConnection( v8::Isolate* isolate,
   {
     stage.EventProcessingFinishedSignal().Connect( callback, &StageCallback::EventProcessingFinishedSignal );
   }
-  else if (strcmp( signalName.c_str(), STAGE_SIGNAL_TOUCHED ) == 0 )
+  else if (strcmp( signalName.c_str(), STAGE_SIGNAL_TOUCH ) == 0 )
   {
-    stage.TouchedSignal().Connect( callback, &StageCallback::TouchedSignal );
+    stage.TouchSignal().Connect( callback, &StageCallback::TouchSignal );
   }
   else
   {
@@ -598,10 +598,10 @@ void SignalManager::SignalConnect( const v8::FunctionCallbackInfo< v8::Value >&
   // first paramter =  signal to connect to
   // Second parameter = function ( to run )
   // args.This() = myActor
-  // e.g. myActor.Connect("touched", myJavaScriptActorTouched );
+  // e.g. myActor.Connect("touch", myJavaScriptActorTouched );
 
   // Inside Callback on myJavaScriptActorTouched
-  // myActor.Disconnect("touched", myJavaScriptActorTouched );
+  // myActor.Disconnect("touch", myJavaScriptActorTouched );
 
   v8::Isolate* isolate = args.GetIsolate();
   v8::HandleScope handleScope( isolate );