[dali_1.1.42] Merge branch 'devel/master' 05/79205/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 8 Jul 2016 16:44:08 +0000 (17:44 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 8 Jul 2016 16:44:08 +0000 (17:44 +0100)
Change-Id: I7f23a8bf3eb1db0acdd16c4cb1f688a19fe88719

75 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp
automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.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-RendererFactory.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-ToolBar.cpp
dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.cpp
dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp
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/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.h
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/model3d-view/obj-loader.cpp
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/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/renderers/control-renderer-data-impl.cpp
dali-toolkit/internal/controls/renderers/control-renderer-impl.cpp
dali-toolkit/internal/controls/renderers/control-renderer-impl.h
dali-toolkit/internal/controls/renderers/mesh/mesh-renderer.cpp
dali-toolkit/internal/controls/renderers/mesh/mesh-renderer.h
dali-toolkit/internal/controls/renderers/renderer-factory-impl.cpp
dali-toolkit/internal/controls/renderers/renderer-factory-impl.h
dali-toolkit/internal/controls/renderers/renderer-string-constants.cpp
dali-toolkit/internal/controls/renderers/renderer-string-constants.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
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.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.cpp
dali-toolkit/internal/filters/emboss-filter.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/metrics.h
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
doc/dali-toolkit-doc.h
docs/content/example-code/properties.cpp
docs/content/programming-guide/event-system.h
docs/content/programming-guide/hello-world.h
docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md
docs/content/shared-javascript-and-cpp-documentation/multi-touch-guide.md
docs/content/shared-javascript-and-cpp-documentation/performance-profiling.md
docs/content/shared-javascript-and-cpp-documentation/programming-languages.md
packaging/dali-toolkit.spec

index 69698fa..edaf7fd 100644 (file)
@@ -329,7 +329,7 @@ public:
   Test mTest;
 };
 
-static bool TestCallback(Actor actor, const TouchEvent& event)
+static bool TestCallback(Actor actor, const TouchData& event)
 {
   return true;
 }
@@ -384,7 +384,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void)
 
   // * Actor's touch event is connected to a callback function
   //   and this callback function consumes the event.
-  actor.TouchedSignal().Connect( &TestCallback );
+  actor.TouchSignal().Connect( &TestCallback );
 
   // * Button's pressed signal is connected to a callback function
   //   which also consumes the event.
@@ -527,7 +527,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void)
 
   // * Actor's touch event is connected to a callback function
   //   and this callback function consumes the event.
-  actor.TouchedSignal().Connect( &TestCallback );
+  actor.TouchSignal().Connect( &TestCallback );
 
   // * Button's pressed signal is connected to a callback function
   //   which also consumes the event.
index e445084..da94586 100644 (file)
@@ -662,6 +662,11 @@ public:
         *type = GL_SAMPLER_2D;
         *size = 1;
         break;
+      case 2:
+        *length = snprintf(name, bufsize, "sGloss");
+        *type = GL_SAMPLER_2D;
+        *size = 1;
+        break;
       default:
         break;
     }
@@ -878,9 +883,10 @@ public:
     namedParams["program"] = ToString(program);
     mShaderTrace.PushCall("LinkProgram", out.str(), namedParams);
 
-    mNumberOfActiveUniforms=2;
+    mNumberOfActiveUniforms=3;
     GetUniformLocation(program, "sTexture");
     GetUniformLocation(program, "sEffect");
+    GetUniformLocation(program, "sGloss");
   }
 
   inline void PixelStorei(GLenum pname, GLint param)
index cd0c19d..63c89d3 100644 (file)
@@ -149,9 +149,9 @@ public:
   bool IsScalable( const FontDescription& fontDescription ){return true;}
   void GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes ){}
   void GetFixedSizes( const FontDescription& fontDescription, Dali::Vector< PointSize26Dot6 >& sizes ){}
-  void GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize ){}
+  void GetFontMetrics( FontId fontId, FontMetrics& metrics ){}
   GlyphIndex GetGlyphIndex( FontId fontId, Character charcode ){return 0;}
-  bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal, int desiredFixedSize ){return true;}
+  bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal ){return true;}
   BufferImage CreateBitmap( FontId fontId, GlyphIndex glyphIndex ){return BufferImage();}
   void CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob,
                          unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
@@ -447,9 +447,9 @@ void FontClient::GetFixedSizes( const FontDescription& fontDescription,
   GetImplementation(*this).GetFixedSizes( fontDescription, sizes );
 }
 
-void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize )
+void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
 {
-  GetImplementation(*this).GetFontMetrics( fontId, metrics, desiredFixedSize );
+  GetImplementation(*this).GetFontMetrics( fontId, metrics );
 }
 
 GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
@@ -457,9 +457,9 @@ GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
   return GetImplementation(*this).GetGlyphIndex( fontId, charcode );
 }
 
-bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal, int desiredFixedSize )
+bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
 {
-  return GetImplementation(*this).GetGlyphMetrics( array, size, horizontal, desiredFixedSize );
+  return GetImplementation(*this).GetGlyphMetrics( array, size, horizontal );
 }
 
 BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
index 0ae0611..fc015f1 100644 (file)
@@ -954,7 +954,7 @@ int UtcDaliAlignmentSizeSetP(void)
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-static bool TouchEventCallback(Actor actor, const TouchEvent& event)
+static bool TouchCallback(Actor actor, const TouchData& event)
 {
   return false;
 }
@@ -970,7 +970,7 @@ int UtcDaliAlignmentOnTouchEvent(void)
   alignment.SetAnchorPoint(AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(alignment);
 
-  alignment.TouchedSignal().Connect(&TouchEventCallback);
+  alignment.TouchSignal().Connect(&TouchCallback);
 
   application.Render();
   application.SendNotification();
index a8aca48..07b810f 100644 (file)
@@ -147,3 +147,59 @@ int UtcDaliCheckBoxButtonSetGetSelected(void)
   DALI_TEST_CHECK( gCheckBoxButtonState );
   END_TEST;
 }
+
+int UtcDaliCheckBoxSetLabelP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  Property::Map propertyMap;
+  propertyMap.Insert("text",  "activate");
+  checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+
+  DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GerProperty once that code is implemented
+
+  END_TEST;
+}
+
+int UtcDaliCheckBoxSetLabelDisabledP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+  Stage::GetCurrent().Add( checkBox );
+
+  checkBox.SetSize( Vector2( 20.0f, 20.0f ) );
+  checkBox.SetDisabledBackgroundImage( "Image.jpg" );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map propertyMap;
+  propertyMap.Insert("text",  "activate");
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
+
+  checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+
+  DALI_TEST_CHECK(  checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+  DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GerProperty once that code is implemented
+
+  END_TEST;
+}
+
+int UtcDaliCheckBoxSettingDisabled(void)
+{
+  ToolkitTestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
+  DALI_TEST_CHECK(  checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), false);
+
+  DALI_TEST_CHECK(  !checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+
+  END_TEST;
+}
index 0983366..43caadd 100644 (file)
@@ -54,7 +54,7 @@ int UtcDaliControlRendererCopyAndAssignment(void)
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
   propertyMap.Insert("mixColor",  Color::BLUE);
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
 
   ControlRenderer controlRendererCopy( controlRenderer );
   DALI_TEST_CHECK(controlRenderer == controlRendererCopy);
@@ -87,7 +87,7 @@ int UtcDaliControlRendererSetGetDepthIndex(void)
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
   propertyMap.Insert("mixColor",  Color::BLUE);
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
 
   controlRenderer.SetDepthIndex( 1.f );
 
@@ -118,7 +118,10 @@ int UtcDaliControlRendererSize(void)
   Vector2 naturalSize;
 
   // color renderer
-  ControlRenderer colorRenderer = factory.GetControlRenderer( Color::MAGENTA );
+  Dali::Property::Map map;
+  map[ "rendererType" ] = "color";
+  map[ "mixColor" ] = Color::MAGENTA;
+  ControlRenderer colorRenderer = factory.CreateControlRenderer( map );
   colorRenderer.SetSize( rendererSize );
   DALI_TEST_EQUALS( colorRenderer.GetSize(), rendererSize, TEST_LOCATION );
   colorRenderer.GetNaturalSize(naturalSize);
@@ -126,7 +129,7 @@ int UtcDaliControlRendererSize(void)
 
   // image renderer
   Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
-  ControlRenderer imageRenderer = factory.GetControlRenderer( image );
+  ControlRenderer imageRenderer = factory.CreateControlRenderer( image );
   imageRenderer.SetSize( rendererSize );
   DALI_TEST_EQUALS( imageRenderer.GetSize(), rendererSize, TEST_LOCATION );
   imageRenderer.GetNaturalSize(naturalSize);
@@ -137,7 +140,7 @@ int UtcDaliControlRendererSize(void)
   Vector2 testSize(80.f, 160.f);
   platform.SetClosestImageSize(testSize);
   image = ResourceImage::New(TEST_NPATCH_FILE_NAME);
-  ControlRenderer nPatchRenderer = factory.GetControlRenderer( image );
+  ControlRenderer nPatchRenderer = factory.CreateControlRenderer( image );
   nPatchRenderer.SetSize( rendererSize );
   DALI_TEST_EQUALS( nPatchRenderer.GetSize(), rendererSize, TEST_LOCATION );
   nPatchRenderer.GetNaturalSize(naturalSize);
@@ -145,7 +148,11 @@ int UtcDaliControlRendererSize(void)
 
   // border renderer
   float borderSize = 5.f;
-  ControlRenderer borderRenderer = factory.GetControlRenderer( borderSize, Color::RED );
+  map.Clear();
+  map[ "rendererType" ] = "border";
+  map[ "borderColor"  ] = Color::RED;
+  map[ "borderSize"   ] = borderSize;
+  ControlRenderer borderRenderer = factory.CreateControlRenderer( map );
   borderRenderer.SetSize( rendererSize );
   DALI_TEST_EQUALS( borderRenderer.GetSize(), rendererSize, TEST_LOCATION );
   borderRenderer.GetNaturalSize(naturalSize);
@@ -163,14 +170,14 @@ int UtcDaliControlRendererSize(void)
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::GREEN );
   propertyMap.Insert("stopColor",   stopColors);
-  ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap);
   gradientRenderer.SetSize( rendererSize );
   DALI_TEST_EQUALS( gradientRenderer.GetSize(), rendererSize, TEST_LOCATION );
   gradientRenderer.GetNaturalSize(naturalSize);
   DALI_TEST_EQUALS( naturalSize, Vector2::ZERO,TEST_LOCATION );
 
   //svg renderer
-  ControlRenderer svgRenderer = factory.GetControlRenderer( TEST_SVG_FILE_NAME );
+  ControlRenderer svgRenderer = factory.CreateControlRenderer( TEST_SVG_FILE_NAME, ImageDimensions() );
   svgRenderer.SetSize( rendererSize );
   DALI_TEST_EQUALS( svgRenderer.GetSize(), rendererSize, TEST_LOCATION );
   svgRenderer.GetNaturalSize(naturalSize);
@@ -191,7 +198,7 @@ int UtcDaliControlRendererSetOnOffStage(void)
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
   propertyMap.Insert("mixColor",  Color::BLUE);
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
 
   Actor actor = Actor::New();
   actor.SetSize(200.f, 200.f);
@@ -238,7 +245,7 @@ int UtcDaliControlRendererRemoveAndReset(void)
   }
 
   Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
-  imageRenderer = factory.GetControlRenderer(image);
+  imageRenderer = factory.CreateControlRenderer(image);
   DALI_TEST_CHECK( imageRenderer );
 
   imageRenderer.SetOnStage( actor );
@@ -264,7 +271,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
   propertyMap.Insert("mixColor",  Color::BLUE);
-  ControlRenderer colorRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer colorRenderer = factory.CreateControlRenderer( propertyMap );
 
   Property::Map resultMap;
   colorRenderer.CreatePropertyMap( resultMap );
@@ -279,7 +286,9 @@ int UtcDaliControlRendererGetPropertyMap1(void)
 
   // change the blend color
   Actor actor;
-  factory.ResetRenderer( colorRenderer, actor, Color::CYAN );
+  colorRenderer.RemoveAndReset( actor );
+  propertyMap["mixColor"] = Color::CYAN;
+  colorRenderer = factory.CreateControlRenderer( propertyMap  );
   colorRenderer.CreatePropertyMap( resultMap );
 
   colorValue = resultMap.Find( "mixColor",  Property::VECTOR4 );
@@ -299,7 +308,7 @@ int UtcDaliControlRendererGetPropertyMap2(void)
   propertyMap.Insert("rendererType",  "border");
   propertyMap.Insert("borderColor",  Color::BLUE);
   propertyMap.Insert("borderSize",  5.f);
-  ControlRenderer borderRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer borderRenderer = factory.CreateControlRenderer( propertyMap );
 
   Property::Map resultMap;
   borderRenderer.CreatePropertyMap( resultMap );
@@ -317,7 +326,11 @@ int UtcDaliControlRendererGetPropertyMap2(void)
   DALI_TEST_CHECK( sizeValue );
   DALI_TEST_CHECK( sizeValue->Get<float>() == 5.f );
 
-  borderRenderer = factory.GetControlRenderer( 10.f, Color::CYAN );
+  Property::Map propertyMap1;
+  propertyMap1[ "rendererType" ] = "border";
+  propertyMap1[ "borderColor"  ] = Color::CYAN;
+  propertyMap1[ "borderSize"   ] = 10.0f;
+  borderRenderer = factory.CreateControlRenderer( propertyMap1 );
   borderRenderer.CreatePropertyMap( resultMap );
 
   typeValue = resultMap.Find( "rendererType",  Property::STRING );
@@ -359,7 +372,7 @@ int UtcDaliControlRendererGetPropertyMap3(void)
   stopColors.PushBack( Color::GREEN );
   propertyMap.Insert("stopColor",   stopColors);
 
-  ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap);
 
   Property::Map resultMap;
   gradientRenderer.CreatePropertyMap( resultMap );
@@ -426,7 +439,7 @@ int UtcDaliControlRendererGetPropertyMap4(void)
   stopColors.PushBack( Color::GREEN );
   propertyMap.Insert("stopColor",   stopColors);
 
-  ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap);
   DALI_TEST_CHECK( gradientRenderer );
 
   Property::Map resultMap;
@@ -488,7 +501,7 @@ int UtcDaliControlRendererGetPropertyMap5(void)
   propertyMap.Insert( "samplingMode",   "BOX_THEN_NEAREST" );
   propertyMap.Insert( "synchronousLoading",   true );
 
-  ControlRenderer imageRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer imageRenderer = factory.CreateControlRenderer(propertyMap);
   DALI_TEST_CHECK( imageRenderer );
 
   Property::Map resultMap;
@@ -525,7 +538,7 @@ int UtcDaliControlRendererGetPropertyMap5(void)
 
   // Get an image renderer with an image handle, and test the default property values
   Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
-  imageRenderer = factory.GetControlRenderer(image);
+  imageRenderer = factory.CreateControlRenderer(image);
   imageRenderer.CreatePropertyMap( resultMap );
 
   value = resultMap.Find( "rendererType",  Property::STRING );
@@ -569,7 +582,7 @@ int UtcDaliControlRendererGetPropertyMap6(void)
   propertyMap.Insert( "rendererType",  "image" );
   propertyMap.Insert( "url",  TEST_NPATCH_FILE_NAME );
   propertyMap.Insert( "borderOnly",  true );
-  ControlRenderer nPatchRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer nPatchRenderer = factory.CreateControlRenderer( propertyMap );
 
   Property::Map resultMap;
   nPatchRenderer.CreatePropertyMap( resultMap );
@@ -600,7 +613,7 @@ int UtcDaliControlRendererGetPropertyMap7(void)
   Property::Map propertyMap;
   propertyMap.Insert( "rendererType",  "image" );
   propertyMap.Insert( "url",  TEST_SVG_FILE_NAME );
-  ControlRenderer svgRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer svgRenderer = factory.CreateControlRenderer( propertyMap );
 
   Property::Map resultMap;
   svgRenderer.CreatePropertyMap( resultMap );
@@ -614,7 +627,7 @@ int UtcDaliControlRendererGetPropertyMap7(void)
   DALI_TEST_CHECK( value->Get<std::string>() == TEST_SVG_FILE_NAME );
 
   // request SvgRenderer with an URL
-  ControlRenderer svgRenderer2 = factory.GetControlRenderer( TEST_SVG_FILE_NAME );
+  ControlRenderer svgRenderer2 = factory.CreateControlRenderer( TEST_SVG_FILE_NAME, ImageDimensions() );
   resultMap.Clear();
   svgRenderer2.CreatePropertyMap( resultMap );
   // check the property values from the returned map from control renderer
@@ -643,7 +656,7 @@ int UtcDaliControlRendererGetPropertyMap8(void)
   propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
   propertyMap.Insert( "texturesPath", TEST_RESOURCE_LOCATION );
   propertyMap.Insert( "shaderType", "textureless" );
-  ControlRenderer meshRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer meshRenderer = factory.CreateControlRenderer( propertyMap );
 
   Property::Map resultMap;
   meshRenderer.CreatePropertyMap( resultMap );
index 702f726..52f16ed 100644 (file)
@@ -74,7 +74,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
   Property::Map propertyMap1;
   propertyMap1.Insert("rendererType",  "color");
   propertyMap1.Insert("mixColor",  Color::BLUE);
-  ControlRenderer colorRenderer = factory.GetControlRenderer(propertyMap1);
+  ControlRenderer colorRenderer = factory.CreateControlRenderer(propertyMap1);
   DALI_TEST_CHECK( colorRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( colorRenderer ) );
 
@@ -83,7 +83,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
   propertyMap2.Insert("rendererType",  "border");
   propertyMap2.Insert("borderColor",  Color::BLUE);
   propertyMap2.Insert("borderSize",  2.f);
-  ControlRenderer borderRenderer = factory.GetControlRenderer(propertyMap2);
+  ControlRenderer borderRenderer = factory.CreateControlRenderer(propertyMap2);
   DALI_TEST_CHECK( borderRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( borderRenderer ) );
 
@@ -103,7 +103,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::GREEN );
   propertyMap3.Insert("gradientStopColor",   stopColors);
-  ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap3);
+  ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap3);
   DALI_TEST_CHECK( gradientRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( gradientRenderer ) );
 
@@ -111,7 +111,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
   Property::Map propertyMap4;
   propertyMap4.Insert( "rendererType",  "image" );
   propertyMap4.Insert( "url",  TEST_IMAGE_FILE_NAME );
-  ControlRenderer imageRenderer = factory.GetControlRenderer( propertyMap4 );
+  ControlRenderer imageRenderer = factory.CreateControlRenderer( propertyMap4 );
   DALI_TEST_CHECK( imageRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( imageRenderer ) );
 
@@ -119,7 +119,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
   Property::Map propertyMap5;
   propertyMap5.Insert( "rendererType",  "image" );
   propertyMap5.Insert( "url",  TEST_NPATCH_FILE_NAME );
-  ControlRenderer nPatchRenderer = factory.GetControlRenderer( propertyMap4 );
+  ControlRenderer nPatchRenderer = factory.CreateControlRenderer( propertyMap4 );
   DALI_TEST_CHECK( nPatchRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( nPatchRenderer ) );
 
@@ -137,65 +137,34 @@ int UtcDaliDebugRendererGetRenderer2(void)
   DALI_TEST_CHECK( factory );
 
   // Test that color renderer is replaced with debug renderer
-  ControlRenderer colorRenderer = factory.GetControlRenderer(Color::CYAN);
+  Dali::Property::Map map;
+  map[ "rendererType" ] = "color";
+  map[ "mixColor" ] = Color::CYAN;
+
+  ControlRenderer colorRenderer = factory.CreateControlRenderer( map);
   DALI_TEST_CHECK( colorRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( colorRenderer ) );
 
   // Test that border renderer is replaced with debug renderer
-  ControlRenderer borderRenderer = factory.GetControlRenderer(2.f, Color::GREEN);
+  map.Clear();
+  map[ "rendererType" ] = "border";
+  map[ "borderColor"  ] = Color::GREEN;
+  map[ "borderSize"   ] = 2.f;
+  ControlRenderer borderRenderer = factory.CreateControlRenderer( map );
   DALI_TEST_CHECK( borderRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( borderRenderer ) );
 
   // Test that image renderer is replaced with debug renderer
   Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
-  ControlRenderer imageRenderer = factory.GetControlRenderer( image );
+  ControlRenderer imageRenderer = factory.CreateControlRenderer( image );
   DALI_TEST_CHECK( imageRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( imageRenderer ) );
 
   // Test that n patch renderer is replaced with debug renderer
-  ControlRenderer nPatchRenderer = factory.GetControlRenderer( TEST_NPATCH_FILE_NAME );
+  ControlRenderer nPatchRenderer = factory.CreateControlRenderer( TEST_NPATCH_FILE_NAME, ImageDimensions() );
   DALI_TEST_CHECK( nPatchRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( nPatchRenderer ) );
 
   EnvironmentVariable::SetTestingEnvironmentVariable(false);
   END_TEST;
 }
-
-int UtcDaliDebugRendererResetRenderer(void)
-{
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliDebugRendererResetRenderer: Reset renderer with various parameters" );
-
-  RendererFactory factory = RendererFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  // Test that color renderer is replaced with debug renderer
-  ControlRenderer controlRenderer = factory.GetControlRenderer(Color::CYAN);
-  DALI_TEST_CHECK( controlRenderer );
-  DALI_TEST_CHECK( IsDebugRenderer( controlRenderer ) );
-
-  Actor actor;
-  // Reset to render another color
-  // Test that color renderer is replaced with debug renderer
-  factory.ResetRenderer( controlRenderer, actor, Color::BLUE );
-  DALI_TEST_CHECK( IsDebugRenderer( controlRenderer ) );
-
-  // Reset to render an image
-  // Test that image renderer is replaced with debug renderer
-  Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
-  factory.ResetRenderer( controlRenderer, actor, image );
-  DALI_TEST_CHECK( IsDebugRenderer( controlRenderer ) );
-
-  // Reset with a property map of border renderer
-  // Test that border renderer is replaced with debug renderer
-  Property::Map propertyMap;
-  propertyMap.Insert("rendererType",  "border");
-  propertyMap.Insert("borderColor",  Color::BLUE);
-  propertyMap.Insert("borderSize",  2.f);
-  factory.ResetRenderer( controlRenderer, actor, propertyMap );
-  DALI_TEST_CHECK( IsDebugRenderer( controlRenderer ) );
-
-  EnvironmentVariable::SetTestingEnvironmentVariable(false);
-  END_TEST;
-}
index bd04f56..709282a 100644 (file)
@@ -442,9 +442,10 @@ int UtcDaliImageViewSyncLoading(void)
 
   // Sync loading, no atlasing for big size image
   {
-    ImageView imageView = ImageView::New( gImage_600_RGB );
+    ImageView imageView = ImageView::New();
 
     // Sync loading is used
+    syncLoadingMap[ "url" ] = gImage_600_RGB;
     imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
 
     // BitmapLoader is used, and the loading is started immediately even the actor is not on stage.
@@ -993,7 +994,6 @@ int UtcDaliImageViewSetImageNativeImageWithCustomShader(void)
   customShader.Insert( "hints", shaderHints );
 
   Property::Map map;
-  map.Insert( "rendererType", "image" );
   map.Insert( "shader", customShader );
 
   TestNativeImagePointer nativeImageInterface = TestNativeImage::New( width, height );
@@ -1003,8 +1003,6 @@ int UtcDaliImageViewSetImageNativeImageWithCustomShader(void)
   imageView.SetProperty( ImageView::Property::IMAGE, map );
   Stage::GetCurrent().Add( imageView );
 
-  imageView.SetProperty( ImageView::Property::IMAGE, map );
-
   TestGlAbstraction& gl = application.GetGlAbstraction();
   gl.EnableTextureCallTrace( true );
 
@@ -1045,7 +1043,6 @@ int UtcDaliImageViewSetImageBufferImageWithCustomShaderToNativeImage(void)
   customShader.Insert( "hints", shaderHints );
 
   Property::Map map;
-  map.Insert( "rendererType", "image" );
   map.Insert( "shader", customShader );
 
   BufferImage image = CreateBufferImage( width, height, Color::WHITE );
@@ -1054,8 +1051,6 @@ int UtcDaliImageViewSetImageBufferImageWithCustomShaderToNativeImage(void)
   imageView.SetProperty( ImageView::Property::IMAGE, map );
   Stage::GetCurrent().Add( imageView );
 
-  imageView.SetProperty( ImageView::Property::IMAGE, map );
-
   TestGlAbstraction& gl = application.GetGlAbstraction();
   gl.EnableTextureCallTrace( true );
 
index 94a369f..0e33b72 100644 (file)
@@ -296,7 +296,7 @@ int UtcDaliRendererFactoryGetColorRenderer1(void)
   propertyMap.Insert("rendererType",  "color");
   propertyMap.Insert("mixColor",  testColor);
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -319,7 +319,10 @@ int UtcDaliRendererFactoryGetColorRenderer2(void)
   DALI_TEST_CHECK( factory );
 
   Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
-  ControlRenderer controlRenderer = factory.GetControlRenderer(testColor);
+  Dali::Property::Map map;
+  map[ "rendererType" ] = "color";
+  map[ "mixColor" ] = testColor;
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( map );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -351,7 +354,7 @@ int UtcDaliRendererFactoryGetBorderRenderer1(void)
   propertyMap.Insert("borderColor",  testColor);
   propertyMap.Insert("borderSize",  testSize);
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -394,7 +397,11 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
   Vector4 testColor( 1.f, 0.5f, 0.3f, 1.f );
   float testSize = 5.f;
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer(testSize, testColor );
+  Dali::Property::Map propertyMap;
+  propertyMap[ "rendererType" ] = "border";
+  propertyMap[ "borderColor"  ] = testColor;
+  propertyMap[ "borderSize"   ] = testSize;
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -424,7 +431,12 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
   controlRenderer.SetOffStage( actor );
 
   // enable the anti-aliasing
-  controlRenderer = factory.GetControlRenderer(testSize, testColor, true );
+  Dali::Property::Map map;
+  map[ "rendererType" ] = "border";
+  map[ "borderColor"  ] = testColor;
+  map[ "borderSize"   ] = testSize;
+  map[ "antiAliasing"   ] = true;
+  controlRenderer = factory.CreateControlRenderer( map );
   controlRenderer.SetOnStage( actor );
 
   application.SendNotification();
@@ -462,7 +474,7 @@ int UtcDaliRendererFactoryGetLinearGradientRenderer(void)
   stopColors.PushBack( Color::GREEN );
   propertyMap.Insert("stopColor",   stopColors);
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
 
   // A lookup texture is generated and pass to shader as sampler
@@ -502,7 +514,7 @@ int UtcDaliRendererFactoryGetRadialGradientRenderer(void)
   stopColors.PushBack( Color::GREEN );
   propertyMap.Insert("stopColor",   stopColors);
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
 
   // A lookup texture is generated and pass to shader as sampler
@@ -542,7 +554,7 @@ int UtcDaliRendererFactoryDefaultOffsetsGradientRenderer(void)
   stopColors.PushBack( Color::GREEN );
   propertyMap.Insert("stopColor",   stopColors);
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
+  ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
 
   // A lookup texture is generated and pass to shader as sampler
@@ -567,7 +579,7 @@ int UtcDaliRendererFactoryGetImageRenderer1(void)
   propertyMap.Insert( "rendererType",  "image" );
   propertyMap.Insert( "url",  TEST_IMAGE_FILE_NAME );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -604,7 +616,7 @@ int UtcDaliRendererFactoryGetImageRenderer2(void)
   DALI_TEST_CHECK( factory );
 
   Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
-  ControlRenderer controlRenderer = factory.GetControlRenderer( image );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( image );
 
   Actor actor = Actor::New();
   // For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied.
@@ -650,7 +662,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer1(void)
   propertyMap.Insert( "url",  TEST_NPATCH_FILE_NAME );
   {
     tet_infoline( "whole grid" );
-    ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+    ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
     DALI_TEST_CHECK( controlRenderer );
 
     Actor actor = Actor::New();
@@ -669,7 +681,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer1(void)
   propertyMap.Insert( "borderOnly",  true );
   {
     tet_infoline( "border only" );
-    ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+    ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
     DALI_TEST_CHECK( controlRenderer );
 
     Actor actor = Actor::New();
@@ -713,7 +725,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer2(void)
   propertyMap.Insert( "rendererType",  "image" );
   propertyMap.Insert( "url",  TEST_NPATCH_FILE_NAME );
   {
-    ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+    ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
     DALI_TEST_CHECK( controlRenderer );
 
     Actor actor = Actor::New();
@@ -735,7 +747,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer2(void)
   propertyMap.Insert( "borderOnly",  true );
   {
     tet_infoline( "border only" );
-    ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+    ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
     DALI_TEST_CHECK( controlRenderer );
 
     TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -772,7 +784,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer3(void)
   stretchRangesY.PushBack( Uint16Pair( 4, 5 ) );
   Integration::ResourcePointer ninePatchResource = CustomizeNinePatch( application, ninePatchImageWidth, ninePatchImageHeight, stretchRangesX, stretchRangesY );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( TEST_NPATCH_FILE_NAME );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( TEST_NPATCH_FILE_NAME, ImageDimensions() );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -811,7 +823,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer4(void)
   stretchRangesY.PushBack( Uint16Pair( 25, 27 ) );
   Integration::ResourcePointer ninePatchResource = CustomizeNinePatch( application, ninePatchImageWidth, ninePatchImageHeight, stretchRangesX, stretchRangesY );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( TEST_NPATCH_FILE_NAME );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( TEST_NPATCH_FILE_NAME, ImageDimensions() );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -839,7 +851,7 @@ int UtcDaliRendererFactoryGetNPatchRendererN1(void)
   RendererFactory factory = RendererFactory::Get();
   DALI_TEST_CHECK( factory );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( "ERROR.9.jpg" );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( "ERROR.9.jpg", ImageDimensions() );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -875,7 +887,7 @@ int UtcDaliRendererFactoryGetNPatchRendererN2(void)
   propertyMap.Insert( "rendererType",  111 );
   propertyMap.Insert( "url",  "ERROR.9.jpg" );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -903,7 +915,7 @@ int UtcDaliRendererFactoryGetSvgRenderer(void)
   tet_infoline( "UtcDaliRendererFactoryGetSvgRenderer: Request svg renderer with a svg url" );
 
   RendererFactory factory = RendererFactory::Get();
-  ControlRenderer controlRenderer = factory.GetControlRenderer( TEST_SVG_FILE_NAME );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( TEST_SVG_FILE_NAME, ImageDimensions() );
   DALI_TEST_CHECK( controlRenderer );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -951,7 +963,7 @@ int UtcDaliRendererFactoryGetMeshRenderer1(void)
   propertyMap.Insert( "rendererType",  "mesh" );
   propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
@@ -1005,7 +1017,7 @@ int UtcDaliRendererFactoryGetMeshRenderer2(void)
   propertyMap.Insert( "materialUrl", "" );
   propertyMap.Insert( "texturesPath", "" );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   //Add renderer to an actor on stage.
@@ -1061,7 +1073,7 @@ int UtcDaliRendererFactoryGetMeshRenderer3(void)
   propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
   propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   //Add renderer to an actor on stage.
@@ -1117,7 +1129,7 @@ int UtcDaliRendererFactoryGetMeshRenderer4(void)
   propertyMap.Insert( "materialUrl", TEST_SIMPLE_MTL_FILE_NAME );
   propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   //Add renderer to an actor on stage.
@@ -1172,7 +1184,7 @@ int UtcDaliRendererFactoryGetMeshRendererN1(void)
   propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
   propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   //Add renderer to an actor on stage.
@@ -1224,7 +1236,7 @@ int UtcDaliRendererFactoryGetMeshRendererN2(void)
   propertyMap.Insert( "materialUrl", "invalid" );
   propertyMap.Insert( "texturesPath", "also invalid" );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   //Add renderer to an actor on stage.
@@ -1276,7 +1288,7 @@ int UtcDaliRendererFactoryGetMeshRendererN3(void)
   propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
   propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
 
-  ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
+  ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
   DALI_TEST_CHECK( controlRenderer );
 
   //Add renderer to an actor on stage.
@@ -1311,204 +1323,3 @@ int UtcDaliRendererFactoryGetMeshRendererN3(void)
 
   END_TEST;
 }
-
-int UtcDaliRendererFactoryResetRenderer1(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliRendererFactoryResetRenderer1" );
-
-  RendererFactory factory = RendererFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  ControlRenderer controlRenderer = factory.GetControlRenderer( Color::RED );
-  DALI_TEST_CHECK( controlRenderer );
-
-  Actor actor = Actor::New();
-  TestControlRendererRender( application, actor, controlRenderer );
-
-  Vector4 actualValue(Vector4::ZERO);
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION );
-
-  factory.ResetRenderer( controlRenderer, actor, Color::GREEN );
-  application.SendNotification();
-  application.Render(0);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION );
-
-  Image bufferImage = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) );
-  factory.ResetRenderer( controlRenderer, actor, bufferImage );
-
-  Actor actor2 = Actor::New();
-  actor2.SetSize(200.f, 200.f);
-  Stage::GetCurrent().Add( actor2 );
-  controlRenderer.SetSize(Vector2(200.f, 200.f));
-  controlRenderer.SetOnStage( actor2 );
-  application.SendNotification();
-  application.Render(0);
-
-  END_TEST;
-}
-
-int UtcDaliRendererFactoryResetRenderer2(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliRendererFactoryResetRenderer2" );
-
-  Actor actor = Actor::New();
-  actor.SetSize(200.f, 200.f);
-  Stage::GetCurrent().Add( actor );
-  RendererFactory factory = RendererFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  Image resourceImage = ResourceImage::New(TEST_IMAGE_FILE_NAME);
-  ControlRenderer controlRenderer = factory.GetControlRenderer( resourceImage );
-  DALI_TEST_CHECK( controlRenderer );
-  controlRenderer.SetSize(Vector2(200.f, 200.f));
-  controlRenderer.SetOnStage( actor );
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  application.SendNotification();
-  application.Render(0);
-
-  Image bufferImage = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) );
-  factory.ResetRenderer( controlRenderer, actor, bufferImage );
-  application.SendNotification();
-  application.Render(0);
-
-  factory.ResetRenderer( controlRenderer, actor, Color::RED );
-
-  Actor actor2 = Actor::New();
-  actor2.SetSize(200.f, 200.f);
-  Stage::GetCurrent().Add( actor2 );
-  controlRenderer.SetSize(Vector2(200.f, 200.f));
-  controlRenderer.SetOnStage( actor2 );
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  application.SendNotification();
-  application.Render(0);
-  Vector4 actualValue(Vector4::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliRendererFactoryResetRenderer3(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliRendererFactoryResetRenderer3" );
-
-  Actor actor = Actor::New();
-  actor.SetSize(200.f, 200.f);
-  Stage::GetCurrent().Add( actor );
-  RendererFactory factory = RendererFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  // Get renderer for rendering a resource image
-  Image resourceImage = ResourceImage::New(TEST_IMAGE_FILE_NAME);
-  ControlRenderer controlRenderer = factory.GetControlRenderer( resourceImage );
-  DALI_TEST_CHECK( controlRenderer );
-  controlRenderer.SetSize(Vector2(200.f, 200.f));
-  controlRenderer.SetOnStage( actor );
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  // reset the renderer to renderer a svg image
-  factory.ResetRenderer( controlRenderer, actor, TEST_SVG_FILE_NAME, ImageDimensions( 100, 100 ) );
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  EventThreadCallback* eventTrigger = EventThreadCallback::Get();
-  CallbackBase* callback = eventTrigger->GetCallback();
-
-  eventTrigger->WaitingForTrigger( 1 );// waiting until the svg image is rasterized.
-  CallbackBase::Execute( *callback );
-
-  END_TEST;
-}
-
-//Test resetting mesh and primitive shape renderers
-int UtcDaliRendererFactoryResetRenderer4(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliRendererFactoryResetRenderer4:  Mesh and primitive renderers" );
-
-  Actor actor = Actor::New();
-  actor.SetSize( 200.f, 200.f );
-  Stage::GetCurrent().Add( actor );
-  RendererFactory factory = RendererFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  Property::Map map;
-
-  //******
-
-  //Start with basic color renderer
-  ControlRenderer controlRenderer = factory.GetControlRenderer( Color::RED );
-  DALI_TEST_CHECK( controlRenderer );
-
-  TestControlRendererRender( application, actor, controlRenderer );
-
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  //Ensure set correctly.
-  Vector4 actualValue( Vector4::ZERO );
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION );
-
-  //******
-
-  //Reset to mesh renderer
-  map.Insert( "rendererType", "mesh" );
-  map.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
-  map.Insert( "materialUrl", TEST_MTL_FILE_NAME );
-  map.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
-  factory.ResetRenderer( controlRenderer, actor, map );
-  application.SendNotification();
-  application.Render( 0 );
-
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  //Tell the platform abstraction that the required resources have been loaded.
-  TestPlatformAbstraction& platform = application.GetPlatform();
-  platform.SetAllResourceRequestsAsLoaded();
-
-  //Render again to upload the now-loaded textures.
-  application.SendNotification();
-  application.Render( 0 );
-
-  //Ensure set correctly.
-  controlRenderer.CreatePropertyMap( map );
-  DALI_TEST_EQUALS( map.Find( "objectUrl", Property::STRING )->Get<std::string>(), TEST_OBJ_FILE_NAME, TEST_LOCATION );
-
-  Matrix testScaleMatrix;
-  testScaleMatrix.SetIdentityAndScale( Vector3( 1.0, -1.0, 1.0 ) );
-  Matrix actualScaleMatrix;
-
-  //Test to see if the object has been successfully loaded.
-  DALI_TEST_CHECK( gl.GetUniformValue<Matrix>( "uObjectMatrix", actualScaleMatrix ) );
-  DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION );
-
-  //******
-
-  //Reset back to color renderer
-  factory.ResetRenderer( controlRenderer, actor, Color::GREEN );
-  application.SendNotification();
-  application.Render( 0 );
-
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  //Ensure set correctly.
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION );
-
-  //******
-
-  END_TEST;
-}
index a361701..52f4f87 100644 (file)
@@ -597,17 +597,14 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  // Check there are the expected number of children ( active layer, offscreen root actor, and the offscreen image view
-  DALI_TEST_EQUALS( editor.GetChildCount(), 3u, TEST_LOCATION );
+  // Check there are the expected number of children ( offscreen root actor, and the offscreen image view
+  DALI_TEST_EQUALS( editor.GetChildCount(), 2u, TEST_LOCATION );
 
-  Actor layer = editor.GetChildAt( 0u );
-  DALI_TEST_CHECK( layer.IsLayer() );
-
-  Actor offscreenRoot = editor.GetChildAt( 1u );
+  Actor offscreenRoot = editor.GetChildAt( 0u );
   DALI_TEST_CHECK( offscreenRoot.IsLayer() );
   DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
 
-  Actor offscreenImage = editor.GetChildAt( 2u );
+  Actor offscreenImage = editor.GetChildAt( 1u );
   DALI_TEST_CHECK( offscreenImage );
 
   // Create a tap event to touch the text editor.
@@ -618,6 +615,9 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
+  Actor layer = editor.GetChildAt( 2u );
+  DALI_TEST_CHECK( layer.IsLayer() );
+
   DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
   DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
 
@@ -756,7 +756,7 @@ int utcDaliTextEditorEvent03(void)
   application.Render();
 
   // The offscreen root actor should have three actors: the camera, a renderer and the highlight actor.
-  Actor offscreenRoot = editor.GetChildAt( 1u );
+  Actor offscreenRoot = editor.GetChildAt( 0u );
   DALI_TEST_CHECK( offscreenRoot.IsLayer() );
 
   CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
index 1bcbe2b..65fa82e 100644 (file)
@@ -707,17 +707,14 @@ int utcDaliTextFieldEvent02(void)
   application.SendNotification();
   application.Render();
 
-  // Check there are the expected number of children ( active layer, offscreen root actor, and the offscreen image view
-  DALI_TEST_EQUALS( field.GetChildCount(), 3u, TEST_LOCATION );
+  // Check there are the expected number of children ( offscreen root actor, and the offscreen image view
+  DALI_TEST_EQUALS( field.GetChildCount(), 2u, TEST_LOCATION );
 
-  Actor layer = field.GetChildAt( 0u );
-  DALI_TEST_CHECK( layer.IsLayer() );
-
-  Actor offscreenRoot = field.GetChildAt( 1u );
+  Actor offscreenRoot = field.GetChildAt( 0u );
   DALI_TEST_CHECK( offscreenRoot.IsLayer() );
   DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
 
-  Actor offscreenImage = field.GetChildAt( 2u );
+  Actor offscreenImage = field.GetChildAt( 1u );
   DALI_TEST_CHECK( offscreenImage );
 
   // Create a tap event to touch the text field.
@@ -728,6 +725,9 @@ int utcDaliTextFieldEvent02(void)
   application.SendNotification();
   application.Render();
 
+  Actor layer = field.GetChildAt( 2u );
+  DALI_TEST_CHECK( layer.IsLayer() );
+
   DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
   DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
 
index fec7948..9adf9cd 100644 (file)
@@ -40,7 +40,10 @@ Actor CreateColorActor( const Vector4& color )
   Actor solidColorActor = Actor::New();
 
   RendererFactory factory = RendererFactory::Get();
-  ControlRenderer colorRenderer = factory.GetControlRenderer( color );
+  Dali::Property::Map map;
+  map[ "rendererType" ] = "color";
+  map[ "mixColor" ] = color;
+  ControlRenderer colorRenderer = factory.CreateControlRenderer( map );
   colorRenderer.SetOnStage( solidColorActor );
 
   return solidColorActor;
index b1de7f0..cbcadc7 100644 (file)
@@ -94,55 +94,19 @@ RendererFactory::RendererFactory(Internal::RendererFactory *impl)
 {
 }
 
-ControlRenderer RendererFactory::GetControlRenderer( const Property::Map& propertyMap )
+ControlRenderer RendererFactory::CreateControlRenderer( const Property::Map& propertyMap )
 {
-  return GetImplementation( *this ).GetControlRenderer( propertyMap );
+  return GetImplementation( *this ).CreateControlRenderer( propertyMap );
 }
 
-ControlRenderer RendererFactory::GetControlRenderer( const Vector4& color )
+ControlRenderer RendererFactory::CreateControlRenderer( const Image& image )
 {
-  return GetImplementation( *this ).GetControlRenderer( color );
+  return GetImplementation( *this ).CreateControlRenderer( image );
 }
 
-void RendererFactory::ResetRenderer( ControlRenderer& renderer, Actor& actor, const Vector4& color )
+ControlRenderer RendererFactory::CreateControlRenderer( const std::string& url, ImageDimensions size )
 {
-  GetImplementation( *this ).ResetRenderer( renderer, actor, color );
-}
-
-ControlRenderer RendererFactory::GetControlRenderer( float borderSize, const Vector4& borderColor )
-{
-  return GetImplementation( *this ).GetControlRenderer( borderSize, borderColor, false );
-}
-
-
-ControlRenderer RendererFactory::GetControlRenderer( float borderSize, const Vector4& borderColor, bool antiAliasing )
-{
-  return GetImplementation( *this ).GetControlRenderer( borderSize, borderColor, antiAliasing );
-}
-
-ControlRenderer RendererFactory::GetControlRenderer( const Image& image )
-{
-  return GetImplementation( *this ).GetControlRenderer( image );
-}
-
-void RendererFactory::ResetRenderer( ControlRenderer& renderer, Actor& actor, const Image& image )
-{
-  GetImplementation( *this ).ResetRenderer( renderer, actor, image );
-}
-
-ControlRenderer RendererFactory::GetControlRenderer( const std::string& url, ImageDimensions size )
-{
-  return GetImplementation( *this ).GetControlRenderer( url, size );
-}
-
-void RendererFactory::ResetRenderer( ControlRenderer& renderer, Actor& actor, const std::string& url, ImageDimensions size )
-{
-  GetImplementation( *this ).ResetRenderer( renderer, actor, url, size );
-}
-
-void RendererFactory::ResetRenderer( ControlRenderer& renderer, Actor& actor, const Property::Map& propertyMap )
-{
-  GetImplementation( *this ).ResetRenderer( renderer, actor, propertyMap );
+  return GetImplementation( *this ).CreateControlRenderer( url, size );
 }
 
 } // namespace Toolkit
index fb52bf3..52e0d5c 100644 (file)
@@ -20,6 +20,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/images/image-operations.h>
+#include <dali/public-api/object/property-map.h>
 
 // INTERNAK INCLUDES
 #include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
@@ -95,46 +96,7 @@ public:
    *            Depends on the content of the map, different kind of renderer would be returned.
    * @return The pointer pointing to control renderer
    */
-  ControlRenderer GetControlRenderer( const Property::Map& propertyMap  );
-
-  /**
-   * @brief Request the control renderer to render the given color
-   *
-   * @param[in] color The color to be rendered
-   * @return The pointer pointing to the control renderer
-   */
-  ControlRenderer GetControlRenderer( const Vector4& color );
-
-  /**
-   * @brief Request the current control renderer to render the given color
-   *
-   * if the current renderer is a handle to an internal color renderer, set this color to it,
-   * else the renderer would be a handle to a newly created internal color renderer.
-   *
-   * @param[in] renderer The ControlRenderer to reset
-   * @param[in] actor The Actor the renderer is applied to, empty if the renderer has not been applied to any Actor
-   * @param[in] color The color to be rendered.
-   */
-  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const Vector4& color );
-
-  /**
-   * @brief Request the control renderer to renderer the border with the given size and color.
-   *
-   * @param[in] borderSize The size of the border. Border size is the same along all edges.
-   * @param[in] borderColor The color of the border.
-   * @return The pointer pointing to the control renderer
-   */
-  ControlRenderer GetControlRenderer( float borderSize, const Vector4& borderColor );
-
-  /**
-   * @brief Request the control renderer to renderer the border with the given size and color, and specify whether anti-aliasing is needed.
-   *
-   * @param[in] borderSize The size of the border. Border size is the same along all edges.
-   * @param[in] borderColor The color of the border.
-   * @param[in] antiAliasing Whether anti-aliasing is required for border rendering.
-   * @return The pointer pointing to the control renderer
-   */
-  ControlRenderer GetControlRenderer( float borderSize, const Vector4& borderColor, bool antiAliasing );
+  ControlRenderer CreateControlRenderer( const Property::Map& propertyMap  );
 
   /**
    * @brief Request the control renderer to render the image.
@@ -142,19 +104,7 @@ public:
    * @param[in] image The image to be rendered.
    * @return The pointer pointing to the control renderer
    */
-  ControlRenderer GetControlRenderer( const Image& image );
-
-  /**
-   * @brief Request the current control renderer to render the given image
-   *
-   * if the current renderer is a handle to an internal image renderer, set this image to it,
-   * else the renderer would be a handle to a newly created internal image renderer.
-   *
-   * @param[in] renderer The ControlRenderer to reset
-   * @param[in] actor The Actor the renderer is applied to, empty if the renderer has not been applied to any Actor
-   * @param[in] image The Image to be rendered.
-   */
-  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const Image& image );
+  ControlRenderer CreateControlRenderer( const Image& image );
 
   /**
    * @brief Request the control renderer to render the given resource at the url.
@@ -163,35 +113,7 @@ public:
    * @param[in] size The width and height to fit the loaded image to.
    * @return The pointer pointing to the control renderer
    */
-  ControlRenderer GetControlRenderer( const std::string& url,
-                                      ImageDimensions size = ImageDimensions() );
-
-  /**
-   * @brief Request the current control renderer to render the given resource at the url
-   *
-   * if the current renderer is a handle to an internal image renderer, set this image to it,
-   * else the renderer would be a handle to a newly created internal image renderer.
-   *
-   * @param[in] renderer The ControlRenderer to reset
-   * @param[in] actor The Actor the renderer is applied to, empty if the renderer has not been applied to any Actor
-   * @param[in] url The URL to the resource to be rendered.
-   * @param[in] size The width and height to fit the loaded image to.
-   */
-  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const std::string& url,
-                      ImageDimensions size = ImageDimensions() );
-
-  /**
-   * @brief Request the current control renderer from the property map, merging the property map with the renderer
-   *
-   * if the current renderer is capable of merging with the property map the reset the renderer with the merged properties
-   * else the renderer would be a handle to a newly created internal renderer.
-   *
-   * @param[in] renderer The ControlRenderer to reset
-   * @param[in] actor The Actor the renderer is applied to, empty if the renderer has not been applied to any Actor
-   * @param[in] propertyMap The map contains the properties required by the control renderer
-   *            Depends on the content of the map, different kind of renderer would be returned.
-   */
-  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const Property::Map& propertyMap );
+  ControlRenderer CreateControlRenderer( const std::string& url, ImageDimensions size );
 
 private:
 
@@ -199,8 +121,52 @@ private:
 
 };
 
+
+/**
+ * @brief Template to allow discard old renderer, get new one and set it on stage if possible
+ *
+ * @tparam ParameterType0 The type of first argument passed to the CreateControlRenderer()
+ * @tparam ParameterType1 The type of second argument passed to the CreateControlRenderer()
+ * @SINCE_1_0.39
+ * @param[in] actor Actor for which the renderer will be replaced
+ * @param[in,out] renderer The renderer object to be replaced
+ * @param[in] param0 First template based argument passed to the renderer factory
+ * @param[in] param1 Second template based argument passed to the renderer factory
+ */
+template< class ParameterType0, class ParameterType1 >
+void InitializeControlRenderer( Actor& actor, ControlRenderer& renderer, ParameterType0& param0, ParameterType1& param1 )
+{
+  renderer.RemoveAndReset( actor );
+  renderer = Toolkit::RendererFactory::Get().CreateControlRenderer( param0, param1 );
+  if( renderer && actor && actor.OnStage() )
+  {
+    renderer.SetOnStage( actor );
+  }
+}
+
+/**
+ * @brief Template to allow discard old renderer, get new one and set it on stage if possible
+ *
+ * @tparam ParameterType The type of argument passed to the CreateControlRenderer()
+ * @SINCE_1_0.39
+ * @param[in] actor Actor for which the renderer will be replaced
+ * @param[in,out] renderer The renderer object to be replaced
+ * @param[in] param Template based argument passed to the renderer factory
+ */
+template< class ParameterType >
+void InitializeControlRenderer( Actor& actor, ControlRenderer& renderer, ParameterType& param )
+{
+  renderer.RemoveAndReset( actor );
+  renderer =  Toolkit::RendererFactory::Get().CreateControlRenderer( param );
+  if( renderer && actor && actor.OnStage() )
+  {
+    renderer.SetOnStage( actor );
+  }
+}
+
 } // namespace Toolkit
 
 } // namespace Dali
 
+
 #endif /* __DALI_TOOLKIT_RENDERER_FACTORY_H__ */
index 353a7c2..a2c607f 100644 (file)
@@ -231,23 +231,10 @@ void BloomView::OnInitialize()
   mBloomExtractImageView = Toolkit::ImageView::New();
   mBloomExtractImageView.SetParentOrigin( ParentOrigin::CENTER );
 
-  // Create shader used for extracting the bright parts of an image
-  Property::Map customShader;
-  customShader[ "fragmentShader" ] = BLOOM_EXTRACT_FRAGMENT_SOURCE;
-  Property::Map rendererMap;
-  rendererMap.Insert( "rendererType", "image" );
-  rendererMap.Insert( "shader", customShader );
-  mBloomExtractImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
-
   // Create an image view for compositing the result (scene and bloom textures) to output
   mCompositeImageView = Toolkit::ImageView::New();
   mCompositeImageView.SetParentOrigin( ParentOrigin::CENTER );
 
-  // Create shader used to composite bloom and original image to output render target
-  customShader[ "fragmentShader" ] = COMPOSITE_FRAGMENT_SOURCE;
-  rendererMap[ "shader" ] = customShader;
-  mCompositeImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
-
   // Create an image view for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
   mTargetImageView = Toolkit::ImageView::New();
   mTargetImageView.SetParentOrigin( ParentOrigin::CENTER );
@@ -385,12 +372,22 @@ void BloomView::AllocateResources()
 
     mBloomExtractImageView.SetImage( mRenderTargetForRenderingChildren );
     mBloomExtractImageView.SetSize(mDownsampledWidth, mDownsampledHeight); // size needs to match render target
+    // Create shader used for extracting the bright parts of an image
+    Property::Map customShader;
+    customShader[ "fragmentShader" ] = BLOOM_EXTRACT_FRAGMENT_SOURCE;
+    Property::Map rendererMap;
+    rendererMap.Insert( "shader", customShader );
+    mBloomExtractImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
 
     // set GaussianBlurView to blur our extracted bloom
     mGaussianBlurView.SetUserImageAndOutputRenderTarget(mBloomExtractTarget, mBlurExtractTarget);
 
     // use the completed blur in the first buffer and composite with the original child actors render
     mCompositeImageView.SetImage( mRenderTargetForRenderingChildren );
+    // Create shader used to composite bloom and original image to output render target
+    customShader[ "fragmentShader" ] = COMPOSITE_FRAGMENT_SOURCE;
+    rendererMap[ "shader" ] = customShader;
+    mCompositeImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
     TextureSet textureSet = mCompositeImageView.GetRendererAt(0).GetTextures();
     textureSet.SetImage( 1u, mBlurExtractTarget );
 
index 5126408..b13765b 100644 (file)
@@ -75,7 +75,7 @@ BubbleEmitter::BubbleEmitter( const Vector2& movementArea,
                               Image shapeImage,
                               unsigned int maximumNumberOfBubble,
                               const Vector2& bubbleSizeRange )
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mShapeImage( shapeImage ),
   mMovementArea( movementArea ),
   mBubbleSizeRange( bubbleSizeRange ),
@@ -176,7 +176,7 @@ void BubbleEmitter::SetBackground( Image bgImage, const Vector3& hsvDelta )
   mBackgroundImage = bgImage;
   mHSVDelta = hsvDelta;
 
-  Toolkit::ImageView sourceActor = Toolkit::ImageView::New( bgImage );
+  Toolkit::ImageView sourceActor = Toolkit::ImageView::New(bgImage);
   sourceActor.SetSize( mMovementArea );
   sourceActor.SetParentOrigin(ParentOrigin::CENTER);
 
index 3af81bb..30e84a9 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
 #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>
@@ -108,7 +108,7 @@ const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
 } // unnamed namespace
 
 Button::Button()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mAutoRepeatingTimer(),
   mUnselectedColor( Color::WHITE ), // The natural colors of the specified images will be used by default.
   mSelectedColor( Color::WHITE ),
@@ -942,15 +942,62 @@ bool Button::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tr
   return connected;
 }
 
-bool Button::OnTouchEvent(const TouchEvent& event)
+void Button::OnInitialize()
+{
+  Actor self = Self();
+
+  mTapDetector = TapGestureDetector::New();
+  mTapDetector.Attach( self );
+  mTapDetector.DetectedSignal().Connect(this, &Button::OnTap);
+
+  self.SetKeyboardFocusable( true );
+
+  self.TouchSignal().Connect( this, &Button::OnTouch );
+}
+
+bool Button::OnAccessibilityActivated()
+{
+  return OnKeyboardEnter();
+}
+
+bool Button::OnKeyboardEnter()
+{
+  // When the enter key is pressed, or button is activated, the click action is performed.
+  Property::Map attributes;
+  bool ret = DoClickAction( attributes );
+
+  return ret;
+}
+
+void Button::OnStageDisconnection()
+{
+  if( ButtonDown == mState )
+  {
+    if( !mTogglableButton )
+    {
+      Released();
+
+      if( mAutoRepeating )
+      {
+        mAutoRepeatingTimer.Reset();
+      }
+    }
+  }
+
+  mState = ButtonUp;
+
+  Control::OnStageDisconnection();
+}
+
+bool Button::OnTouch( Actor actor, const TouchData& touch )
 {
   // Only events are processed when the button is not disabled and the touch event has only
   // one touch point.
-  if( ( !mDisabled ) && ( 1 == event.GetPointCount() ) )
+  if( ( !mDisabled ) && ( 1 == touch.GetPointCount() ) )
   {
-    switch( event.GetPoint(0).state )
+    switch( touch.GetState( 0 ) )
     {
-      case TouchPoint::Down:
+      case PointState::DOWN:
       {
         OnButtonDown(); // Notification for derived classes.
 
@@ -958,7 +1005,7 @@ bool Button::OnTouchEvent(const TouchEvent& event)
         mState = ButtonDown;
         break;
       }
-      case TouchPoint::Up:
+      case PointState::UP:
       {
         OnButtonUp(); // Notification for derived classes.
 
@@ -966,7 +1013,7 @@ bool Button::OnTouchEvent(const TouchEvent& event)
         mState = ButtonUp;
         break;
       }
-      case TouchPoint::Interrupted:
+      case PointState::INTERRUPTED:
       {
         OnTouchPointInterrupted(); // Notification for derived classes.
 
@@ -974,7 +1021,7 @@ bool Button::OnTouchEvent(const TouchEvent& event)
         mState = ButtonUp;
         break;
       }
-      case TouchPoint::Leave:
+      case PointState::LEAVE:
       {
         OnTouchPointLeave(); // Notification for derived classes.
 
@@ -982,20 +1029,15 @@ bool Button::OnTouchEvent(const TouchEvent& event)
         mState = ButtonUp;
         break;
       }
-      case TouchPoint::Motion:
-      case TouchPoint::Stationary: // FALLTHROUGH
+      case PointState::MOTION:
+      case PointState::STATIONARY: // FALLTHROUGH
       {
         // Nothing to do
         break;
       }
-      default:
-      {
-        DALI_ASSERT_ALWAYS( !"Point status unhandled." );
-        break;
-      }
     }
   }
-  else if( 1 < event.GetPointCount() )
+  else if( 1 < touch.GetPointCount() )
   {
     OnTouchPointLeave(); // Notification for derived classes.
 
@@ -1006,51 +1048,6 @@ bool Button::OnTouchEvent(const TouchEvent& event)
   return false;
 }
 
-void Button::OnInitialize()
-{
-  Actor self = Self();
-
-  mTapDetector = TapGestureDetector::New();
-  mTapDetector.Attach( self );
-  mTapDetector.DetectedSignal().Connect(this, &Button::OnTap);
-
-  self.SetKeyboardFocusable( true );
-}
-
-bool Button::OnAccessibilityActivated()
-{
-  return OnKeyboardEnter();
-}
-
-bool Button::OnKeyboardEnter()
-{
-  // When the enter key is pressed, or button is activated, the click action is performed.
-  Property::Map attributes;
-  bool ret = DoClickAction( attributes );
-
-  return ret;
-}
-
-void Button::OnStageDisconnection()
-{
-  if( ButtonDown == mState )
-  {
-    if( !mTogglableButton )
-    {
-      Released();
-
-      if( mAutoRepeating )
-      {
-        mAutoRepeatingTimer.Reset();
-      }
-    }
-  }
-
-  mState = ButtonUp;
-
-  Control::OnStageDisconnection();
-}
-
 void Button::OnTap(Actor actor, const TapGesture& tap)
 {
   // Do nothing.
index 6f1e313..71a42fe 100644 (file)
@@ -376,26 +376,25 @@ private:
   virtual void OnDisabledBackgroundImageSet() {}
 
   /**
-   * This method is called from the OnTouchEvent method when the button is down.
+   * This method is called the button is down.
    * Could be reimplemented in subclasses to provide specific behaviour.
    */
   virtual void OnButtonDown();
 
   /**
-   * This method is called from the OnTouchEvent method when the button is up.
+   * This method is called when the button is up.
    * Could be reimplemented in subclasses to provide specific behaviour.
    */
   virtual void OnButtonUp();
 
   /**
-   * This method is called from the OnTouchEvent method when the touch point leaves the boundary of the button or
-   * more than one touch points are received.
+   * This method is called when touch leaves the boundary of the button or several touch points are received.
    * Could be reimplemented in subclasses to provide specific behaviour.
    */
   virtual void OnTouchPointLeave();
 
   /**
-   * This method is called from the OnTouchEvent method when the touch point is interrupted.
+   * This method is called when the touch is interrupted.
    * Could be reimplemented in subclasses to provide specific behaviour.
    */
   virtual void OnTouchPointInterrupted();
@@ -474,11 +473,6 @@ public:
 protected: // From Control
 
   /**
-   * @copydoc Dali::Control::OnTouchEvent( const TouchEvent& event )
-   */
-  virtual bool OnTouchEvent( const TouchEvent& event );
-
-  /**
    * @copydoc Toolkit::Control::OnInitialize()
    * @note If overridden by deriving button classes, then an up-call to Button::OnInitialize MUST be made at the start.
    */
@@ -503,6 +497,14 @@ protected: // From Control
 private:
 
   /**
+   * @brief Handler for touch data
+   * @param[in]  actor  The touched actor.
+   * @param[in]  touch  The touch info.
+   * @return true, if consumed, false otherwise.
+   */
+  bool OnTouch( Actor actor, const TouchData& touch );
+
+  /**
    * Handler for tap events.
    * We do not actually do anything when we receive a tap as the button handles tap event through
    * the touch event system itself as it requires more than just tap handling (e.g. leave events).
index a11dfed..ae4ac45 100644 (file)
 #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>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 #include <dali-toolkit/internal/filters/blur-two-pass-filter.h>
 #include <dali-toolkit/internal/filters/emboss-filter.h>
 #include <dali-toolkit/internal/filters/spread-filter.h>
@@ -185,7 +187,7 @@ void EffectsView::SetType( Toolkit::EffectsView::EffectType type )
     customShader[ "vertexShader" ] = EFFECTS_VIEW_VERTEX_SOURCE;
     customShader[ "fragmentShader" ] = EFFECTS_VIEW_FRAGMENT_SOURCE;
     rendererMap[ "shader" ] = customShader;
-    Toolkit::RendererFactory::Get().ResetRenderer( mRendererPostFilter, self, rendererMap );
+    InitializeControlRenderer( self, mRendererPostFilter, rendererMap );
 
     mEffectType = type;
   }
@@ -429,15 +431,16 @@ void EffectsView::AllocateResources()
     mLastSize = mTargetSize;
     SetupCameras();
 
-    Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
-    Actor self = Self();
+    Actor self( Self() );
 
     mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
-    rendererFactory.ResetRenderer(mRendererForChildren, self, mImageForChildren);
+    InitializeControlRenderer( self, mRendererForChildren, mImageForChildren );
     mRendererForChildren.SetDepthIndex( DepthIndex::CONTENT+1 );
 
     mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
-    rendererFactory.ResetRenderer(mRendererPostFilter, self, mImagePostFilter);
+    TextureSet textureSet = TextureSet::New();
+    textureSet.SetImage( 0u,  mImagePostFilter);
+    self.GetRendererAt( 0 ).SetTextures( textureSet );
     mRendererPostFilter.SetDepthIndex( DepthIndex::CONTENT );
 
     SetupFilters();
index e7e14eb..7b5b1f6 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.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/public-api/render-tasks/render-task-list.h>
@@ -218,6 +217,7 @@ void GaussianBlurView::SetUserImageAndOutputRenderTarget(Image inputImage, Frame
 
   mUserInputImage = inputImage;
   mImageViewHorizBlur.SetImage( mUserInputImage );
+  mImageViewHorizBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, mCustomShader );
 
   mUserOutputRenderTarget = outputRenderTarget;
 }
@@ -259,11 +259,9 @@ void GaussianBlurView::OnInitialize()
   std::ostringstream horizFragmentShaderStringStream;
   horizFragmentShaderStringStream << "#define NUM_SAMPLES " << mNumSamples << "\n";
   horizFragmentShaderStringStream << GAUSSIAN_BLUR_FRAGMENT_SOURCE;
-  Property::Map customShader;
-  customShader[ "fragmentShader" ] = horizFragmentShaderStringStream.str();
-  Property::Map rendererMap;
-  rendererMap.Insert( "rendererType", "image" );
-  rendererMap.Insert( "shader", customShader );
+  Property::Map source;
+  source[ "fragmentShader" ] = horizFragmentShaderStringStream.str();
+  mCustomShader["shader"] = source;
 
   //////////////////////////////////////////////////////
   // Create actors
@@ -271,12 +269,10 @@ void GaussianBlurView::OnInitialize()
   // Create an image view for performing a horizontal blur on the texture
   mImageViewHorizBlur = Toolkit::ImageView::New();
   mImageViewHorizBlur.SetParentOrigin(ParentOrigin::CENTER);
-  mImageViewHorizBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
 
   // Create an image view for performing a vertical blur on the texture
   mImageViewVertBlur = Toolkit::ImageView::New();
   mImageViewVertBlur.SetParentOrigin(ParentOrigin::CENTER);
-  mImageViewVertBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
 
   // Register a property that the user can control to fade the blur in / out via the GaussianBlurView object
   Actor self = Self();
@@ -414,6 +410,7 @@ void GaussianBlurView::AllocateResources()
 
       // Set image view for performing a horizontal blur on the texture
       mImageViewHorizBlur.SetImage( mRenderTargetForRenderingChildren );
+      mImageViewHorizBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, mCustomShader );
 
       // Create offscreen buffer for vert blur pass
       mRenderTarget1 = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat );
@@ -433,6 +430,7 @@ void GaussianBlurView::AllocateResources()
 
     // size needs to match render target
     mImageViewVertBlur.SetImage( mRenderTarget2 );
+    mImageViewVertBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, mCustomShader );
     mImageViewVertBlur.SetSize(mDownsampledWidth, mDownsampledHeight);
 
     // set gaussian blur up for new sized render targets
index f3f46d9..b4b9baf 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <sstream>
 #include <cmath>
+#include <dali/public-api/object/property-map.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -169,6 +170,8 @@ private:
   Toolkit::ImageView mImageViewHorizBlur;
   Toolkit::ImageView mImageViewVertBlur;
 
+  Property::Map mCustomShader;
+
   RenderTask mHorizBlurTask;
   RenderTask mVertBlurTask;
 
index 03229f9..4571113 100644 (file)
@@ -12,6 +12,8 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
+#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
 
 namespace Dali
 {
@@ -78,8 +80,8 @@ void ImageView::SetImage( Image image )
 
     mImage = image;
 
-    Actor self = Self();
-    Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, image );
+    Actor self( Self() );
+    InitializeControlRenderer( self, mRenderer, image );
     mImageSize = image ? ImageDimensions( image.GetWidth(), image.GetHeight() ) : ImageDimensions( 0, 0 );
 
     RelayoutRequest();
@@ -92,8 +94,8 @@ void ImageView::SetImage( Property::Map map )
   mImage.Reset();
   mPropertyMap = map;
 
-  Actor self = Self();
-  Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, mPropertyMap );
+  Actor self( Self() );
+  InitializeControlRenderer( self, mRenderer, mPropertyMap );
 
   Property::Value* widthValue = mPropertyMap.Find( "width" );
   if( widthValue )
@@ -121,7 +123,7 @@ void ImageView::SetImage( Property::Map map )
 void ImageView::SetImage( const std::string& url, ImageDimensions size )
 {
   if( ( mUrl != url ) ||
-      mImage          ||       // If we're changing from an Image type to a URL type
+        mImage        ||       // If we're changing from an Image type to a URL type
       ! mPropertyMap.Empty() ) // If we're changing from a property map type to a URL type
   {
     mImage.Reset();
@@ -134,8 +136,10 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
       mImageSize = size;
     }
 
-    Actor self = Self();
-    Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, mUrl, size );
+    Actor self( Self() );
+    InitializeControlRenderer( self, mRenderer, url, size );
+
+    mRenderer.SetSize( mSizeSet );
 
     RelayoutRequest();
   }
@@ -251,6 +255,7 @@ void ImageView::OnStageDisconnection()
 void ImageView::OnSizeSet( const Vector3& targetSize )
 {
   Control::OnSizeSet( targetSize );
+  mSizeSet = targetSize;
 
   if( mRenderer )
   {
@@ -270,6 +275,7 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr
 
   if ( imageView )
   {
+    ImageView& impl = GetImpl( imageView );
     switch ( index )
     {
       case Toolkit::ImageView::Property::RESOURCE_URL:
@@ -277,7 +283,7 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr
         std::string imageUrl;
         if( value.Get( imageUrl ) )
         {
-          GetImpl( imageView ).SetImage( imageUrl, ImageDimensions() );
+          impl.SetImage( imageUrl, ImageDimensions() );
         }
         break;
       }
@@ -285,20 +291,37 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::ImageView::Property::IMAGE:
       {
         std::string imageUrl;
+        Property::Map map;
         if( value.Get( imageUrl ) )
         {
-          ImageView& impl = GetImpl( imageView );
           impl.SetImage( imageUrl, ImageDimensions() );
         }
-
         // if its not a string then get a Property::Map from the property if possible.
-        Property::Map map;
-        if( value.Get( map ) )
+        else if( value.Get( map ) )
         {
-          ImageView& impl = GetImpl( imageView );
-          impl.SetImage( map );
+          Property::Value* shaderValue = map.Find( "shader" );
+          // set image only if property map contains image information other than custom shader
+          if( map.Count() > 1u ||  !shaderValue )
+          {
+            impl.SetImage( map );
+          }
+          // the property map contains only the custom shader
+          else if(  impl.mRenderer && map.Count() == 1u &&  shaderValue )
+          {
+            Property::Map shaderMap;
+            if( shaderValue->Get( shaderMap ) )
+            {
+              Internal::ControlRenderer& renderer = GetImplementation( impl.mRenderer );
+              renderer.SetCustomShader( shaderMap );
+              if( imageView.OnStage() )
+              {
+                // force to create new core renderer to use the newly set shader
+                renderer.SetOffStage( imageView );
+                renderer.SetOnStage( imageView );
+              }
+            }
+          }
         }
-
         break;
       }
 
@@ -307,7 +330,7 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr
         bool isPre;
         if( value.Get( isPre ) )
         {
-          GetImpl(imageView).EnablePreMultipliedAlpha( isPre );
+          impl.EnablePreMultipliedAlpha( isPre );
         }
         break;
       }
index fcc0c63..150fbd5 100644 (file)
@@ -160,6 +160,7 @@ private:
 private:
   Toolkit::ControlRenderer  mRenderer;
   ImageDimensions  mImageSize;
+  Vector2 mSizeSet;
 
   std::string      mUrl;          ///< the url for the image if the image came from a URL, empty otherwise
   Image            mImage;        ///< the Image if the image came from a Image, null otherwise
index af2fe10..cc60dd6 100644 (file)
 #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/public-api/object/property-map.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
 
 namespace Dali
 {
@@ -139,7 +141,7 @@ Dali::Toolkit::Magnifier Magnifier::New()
 }
 
 Magnifier::Magnifier()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mDefaultCameraDistance(1000.f),
   mActorSize(Vector3::ZERO),
   mMagnificationFactor(1.0f)
@@ -261,9 +263,13 @@ void Magnifier::SetFrameVisibility(bool visible)
     Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f);
     mFrame.SetSizeModeFactor( sizeOffset );
 
-    //TODO Set the renderer onto the control self when Actor::RemoveRenderer is supported
     Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
-    Toolkit::ControlRenderer borderRenderer = rendererFactory.GetControlRenderer(IMAGE_BORDER_INDENT, Color::WHITE);
+
+    Property::Map map;
+    map[ RENDERER_TYPE ] = BORDER_RENDERER;
+    map[ "borderColor"  ] = Color::WHITE;
+    map[ "borderSize"   ] = IMAGE_BORDER_INDENT;
+    Toolkit::ControlRenderer borderRenderer = rendererFactory.CreateControlRenderer( map );
     borderRenderer.SetOnStage( mFrame );
 
     Constraint constraint = Constraint::New<Vector3>( mFrame, Actor::Property::POSITION, EqualToConstraint() );
index eac2d89..fc75b7a 100644 (file)
@@ -639,7 +639,7 @@ int Model3dView::GetShaderProperties( Toolkit::Model3dView::IlluminationType ill
 
   if( illuminationType == Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP )
   {
-    objectProperties |= ObjLoader::TANGENTS | ObjLoader::BINOMIALS;
+    objectProperties |= ObjLoader::TANGENTS | ObjLoader::BINORMALS;
   }
 
   return objectProperties;
index aaf7c60..2a34f59 100644 (file)
@@ -592,7 +592,7 @@ Geometry ObjLoader::CreateGeometry( int objectProperties )
   }
 
   //Some need tangent and bitangent
-  if( ( objectProperties & TANGENTS ) && ( objectProperties & BINOMIALS ) && mHasTexturePoints )
+  if( ( objectProperties & TANGENTS ) && ( objectProperties & BINORMALS ) && mHasTexturePoints )
   {
     Property::Map vertexExtFormat;
     vertexExtFormat["aTangent"] = Property::VECTOR3;
index 0336323..a877bb9 100644 (file)
@@ -97,7 +97,7 @@ public:
   {
     TEXTURE_COORDINATES = 1 << 0,
     TANGENTS = 1 << 1,
-    BINOMIALS = 1 << 2
+    BINORMALS = 1 << 2
   };
 
   ObjLoader();
index f066e4d..20c57c0 100644 (file)
@@ -349,7 +349,7 @@ void PageTurnView::Page::SetCurrentCenter( const Vector2& value )
 }
 
 PageTurnView::PageTurnView( PageFactory& pageFactory, const Vector2& pageSize )
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mPageFactory( &pageFactory ),
   mPageSize( pageSize ),
   mSpineShadowParameter( DEFAULT_SPINE_SHADOW_PARAMETER ),
index 935ac86..08fbe4e 100755 (executable)
@@ -27,7 +27,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/key-event.h>
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/scripting/scripting.h>
@@ -220,7 +220,7 @@ Dali::Toolkit::Popup Popup::New()
 }
 
 Popup::Popup()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mTouchedOutsideSignal(),
   mShowingSignal(),
   mShownSignal(),
@@ -318,7 +318,7 @@ void Popup::OnInitialize()
   mPopupLayout.SetFitHeight( 0 ); // Set row to fit.
   mPopupLayout.SetFitHeight( 1 ); // Set row to fit.
 
-  mPopupLayout.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
+  mPopupLayout.TouchSignal().Connect( this, &Popup::OnDialogTouched );
 
   mPopupContainer.Add( mPopupLayout );
 
@@ -578,7 +578,7 @@ void Popup::SetPopupBackgroundImage( Actor image )
   mPopupBackgroundImage.SetParentOrigin( ParentOrigin::CENTER );
 
   // OnDialogTouched only consumes the event. It prevents the touch event to be caught by the backing.
-  mPopupBackgroundImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
+  mPopupBackgroundImage.TouchSignal().Connect( this, &Popup::OnDialogTouched );
 
   // Set the popup border to be slightly larger than the layout contents.
   mPopupBackgroundImage.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
@@ -902,7 +902,7 @@ Toolkit::Control Popup::CreateBacking()
 
   // Default to being transparent.
   backing.SetProperty( Actor::Property::COLOR_ALPHA, 0.0f );
-  backing.TouchedSignal().Connect( this, &Popup::OnBackingTouched );
+  backing.TouchSignal().Connect( this, &Popup::OnBackingTouched );
   backing.WheelEventSignal().Connect( this, &Popup::OnBackingWheelEvent );
   return backing;
 }
@@ -1454,7 +1454,7 @@ bool Popup::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   return connected;
 }
 
-bool Popup::OnBackingTouched( Actor actor, const TouchEvent& event )
+bool Popup::OnBackingTouched( Actor actor, const TouchData& touch )
 {
   // Allow events to pass through if touch transparency is enabled.
   if( mTouchTransparent )
@@ -1462,11 +1462,9 @@ bool Popup::OnBackingTouched( Actor actor, const TouchEvent& event )
     return false;
   }
 
-  if( event.GetPointCount() > 0 )
+  if( touch.GetPointCount() > 0 )
   {
-    const TouchPoint& point = event.GetPoint( 0 );
-
-    if( point.state == TouchPoint::Down )
+    if( touch.GetState( 0 ) == PointState::DOWN )
     {
       // Guard against destruction during signal emission.
       Toolkit::Popup handle( GetOwner() );
@@ -1493,7 +1491,7 @@ bool Popup::OnBackingWheelEvent( Actor actor, const WheelEvent& event )
   return true;
 }
 
-bool Popup::OnDialogTouched(Actor actor, const TouchEvent& event)
+bool Popup::OnDialogTouched( Actor actor, const TouchData& touch )
 {
   // Allow events to pass through if touch transparency is enabled.
   if( mTouchTransparent )
index 91d68b7..cc5a2f6 100755 (executable)
@@ -396,10 +396,10 @@ private:
   /**
    * Signal occurs when the dimmed backing for the Popup is touched.
    * @param[in] actor The Actor Touched
-   * @param[in] event The Touch Event.
+   * @param[in] touch The Touch Data.
    * @return Whether to consume event or not.
    */
-  bool OnBackingTouched(Actor actor, const TouchEvent& event);
+  bool OnBackingTouched(Actor actor, const TouchData& touch);
 
   /**
    * Signal occurs when a mouse wheel event occurs on the dimmed backing.
@@ -412,10 +412,10 @@ private:
   /**
    * Signal occurs when the dialog has been touched.
    * @param[in] actor The Actor Touched
-   * @param[in] event The Touch Event.
+   * @param[in] touch The Touch Data.
    * @return Whether to consume event or not.
    */
-  bool OnDialogTouched(Actor actor, const TouchEvent& event);
+  bool OnDialogTouched( Actor actor, const TouchData& touch );
 
   /**
    * @copydoc Toolkit::Control::OnInitialize()
index df5a006..168f579 100644 (file)
@@ -94,106 +94,90 @@ Internal::ControlRenderer::Impl::CustomShader::CustomShader( const Property::Map
   SetPropertyMap( map );
 }
 
-void Internal::ControlRenderer::Impl::CustomShader::SetPropertyMap( const Property::Map& propertyMap )
+void Internal::ControlRenderer::Impl::CustomShader::SetPropertyMap( const Property::Map& shaderMap )
 {
-  Property::Value* shaderValue = propertyMap.Find( CUSTOM_SHADER );
-  if( shaderValue )
+  mVertexShader.clear();
+  mFragmentShader.clear();
+  mGridSize = ImageDimensions( 1, 1 );
+  mHints = Shader::HINT_NONE;
+
+  Property::Value* vertexShaderValue = shaderMap.Find( CUSTOM_VERTEX_SHADER );
+  if( vertexShaderValue )
   {
-    mVertexShader.clear();
-    mFragmentShader.clear();
-    mGridSize = ImageDimensions( 1, 1 );
-    mHints = Shader::HINT_NONE;
+    if( !vertexShaderValue->Get( mVertexShader ) )
+    {
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string", CUSTOM_VERTEX_SHADER );
+    }
+  }
 
-    Property::Map shaderMap;
-    if( shaderValue->Get( shaderMap ) )
+  Property::Value* fragmentShaderValue = shaderMap.Find( CUSTOM_FRAGMENT_SHADER );
+  if( fragmentShaderValue )
+  {
+    if( !fragmentShaderValue->Get( mFragmentShader ) )
     {
-      Property::Value* vertexShaderValue = shaderMap.Find( CUSTOM_VERTEX_SHADER );
-      if( vertexShaderValue )
-      {
-        if( !vertexShaderValue->Get( mVertexShader ) )
-        {
-          DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string", CUSTOM_VERTEX_SHADER );
-        }
-      }
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string", CUSTOM_FRAGMENT_SHADER );
+    }
+  }
 
-      Property::Value* fragmentShaderValue = shaderMap.Find( CUSTOM_FRAGMENT_SHADER );
-      if( fragmentShaderValue )
-      {
-        if( !fragmentShaderValue->Get( mFragmentShader ) )
-        {
-          DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string", CUSTOM_FRAGMENT_SHADER );
-        }
-      }
+  Property::Value* subdivideXValue = shaderMap.Find( CUSTOM_SUBDIVIDE_GRID_X );
+  if( subdivideXValue )
+  {
+    int subdivideX;
+    if( !subdivideXValue->Get( subdivideX ) || subdivideX < 1 )
+    {
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1", CUSTOM_SUBDIVIDE_GRID_X );
+    }
+    else
+    {
+      mGridSize = ImageDimensions( subdivideX, mGridSize.GetY() );
+    }
+  }
 
-      Property::Value* subdivideXValue = shaderMap.Find( CUSTOM_SUBDIVIDE_GRID_X );
-      if( subdivideXValue )
-      {
-        int subdivideX;
-        if( !subdivideXValue->Get( subdivideX ) || subdivideX < 1 )
-        {
-          DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1", CUSTOM_SUBDIVIDE_GRID_X );
-        }
-        else
-        {
-          mGridSize = ImageDimensions( subdivideX, mGridSize.GetY() );
-        }
-      }
+  Property::Value* subdivideYValue = shaderMap.Find( CUSTOM_SUBDIVIDE_GRID_Y );
+  if( subdivideYValue )
+  {
+    int subdivideY;
+    if( !subdivideYValue->Get( subdivideY ) || subdivideY < 1 )
+    {
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1", CUSTOM_SUBDIVIDE_GRID_Y );
+    }
+    else
+    {
+      mGridSize = ImageDimensions( mGridSize.GetX(), subdivideY );
+    }
+  }
 
-      Property::Value* subdivideYValue = shaderMap.Find( CUSTOM_SUBDIVIDE_GRID_Y );
-      if( subdivideYValue )
-      {
-        int subdivideY;
-        if( !subdivideYValue->Get( subdivideY ) || subdivideY < 1 )
-        {
-          DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1", CUSTOM_SUBDIVIDE_GRID_Y );
-        }
-        else
-        {
-          mGridSize = ImageDimensions( mGridSize.GetX(), subdivideY );
-        }
-      }
+  Property::Value* hintsValue = shaderMap.Find( CUSTOM_SHADER_HINTS );
+  if( hintsValue )
+  {
+    std::string hintString;
+    Property::Array hintsArray;
 
-      Property::Value* hintsValue = shaderMap.Find( CUSTOM_SHADER_HINTS );
-      if( hintsValue )
+    if( hintsValue->Get( hintString ) )
+    {
+      mHints = HintFromString( hintString );
+    }
+    else if( hintsValue->Get( hintsArray ) )
+    {
+      int hints = Shader::HINT_NONE;
+      for( Property::Array::SizeType i = 0; i < hintsArray.Count(); ++i)
       {
-        std::string hintString;
-        Property::Array hintsArray;
-
-        if( hintsValue->Get( hintString ) )
-        {
-          mHints = HintFromString( hintString );
-        }
-        else if( hintsValue->Get( hintsArray ) )
+        Property::Value hintValue = hintsArray[ i ];
+        if( hintValue.Get( hintString ) )
         {
-          int hints = Shader::HINT_NONE;
-          for( Property::Array::SizeType i = 0; i < hintsArray.Count(); ++i)
-          {
-            Property::Value hintValue = hintsArray[ i ];
-            if( hintValue.Get( hintString ) )
-            {
-              hints |= static_cast< int >( HintFromString( hintString ) );
-            }
-            else
-            {
-              DALI_LOG_ERROR( "'%s' parameter does not correctly specify an hint string at index %d", CUSTOM_SHADER_HINTS, i );
-            }
-
-            mHints = static_cast< Shader::ShaderHints >( hints );
-          }
+          hints |= static_cast< int >( HintFromString( hintString ) );
         }
         else
         {
-          DALI_LOG_ERROR( "'%s' parameter does not correctly specify a hint string or an array of hint strings", CUSTOM_SHADER_HINTS );
+          DALI_LOG_ERROR( "'%s' parameter does not correctly specify an hint string at index %d", CUSTOM_SHADER_HINTS, i );
         }
+
+        mHints = static_cast< Shader::ShaderHints >( hints );
       }
     }
     else
     {
-      //use value with no type to mean reseting the shader back to default
-      if( shaderValue->GetType() != Dali::Property::NONE )
-      {
-        DALI_LOG_ERROR( "'%s' parameter does not correctly specify a property map", CUSTOM_SHADER );
-      }
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a hint string or an array of hint strings", CUSTOM_SHADER_HINTS );
     }
   }
 }
index 2009f8a..4155a9c 100644 (file)
@@ -56,24 +56,30 @@ ControlRenderer::~ControlRenderer()
   delete mImpl;
 }
 
-void ControlRenderer::Initialize( Actor& actor, const Property::Map& propertyMap )
+void ControlRenderer::SetCustomShader( const Property::Map& shaderMap )
 {
   if( mImpl->mCustomShader )
   {
-    mImpl->mCustomShader->SetPropertyMap( propertyMap );
+    mImpl->mCustomShader->SetPropertyMap( shaderMap );
   }
   else
   {
-    Property::Value* customShaderValue = propertyMap.Find( CUSTOM_SHADER );
-    if( customShaderValue )
+   mImpl->mCustomShader = new Impl::CustomShader( shaderMap );
+  }
+}
+
+void ControlRenderer::Initialize( Actor& actor, const Property::Map& propertyMap )
+{
+  Property::Value* customShaderValue = propertyMap.Find( CUSTOM_SHADER );
+  if( customShaderValue )
+  {
+    Property::Map shaderMap;
+    if( customShaderValue->Get( shaderMap ) )
     {
-      Property::Map customShader;
-      if( customShaderValue->Get( customShader ) )
-      {
-        mImpl->mCustomShader = new Impl::CustomShader( propertyMap );
-      }
+      SetCustomShader( shaderMap );
     }
   }
+
   DoInitialize( actor, propertyMap );
 }
 
index 70ffb35..3880b0b 100644 (file)
@@ -146,6 +146,12 @@ public:
    */
   bool IsPreMultipliedAlphaEnabled() const;
 
+  /**
+   * @brief Sets properties of custom shader
+   * @param[in] propertyMap Property map containing the custom shader data
+   */
+  void SetCustomShader( const Property::Map& propertyMap );
+
 protected:
 
   /**
index 8b3256d..dd52948 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/common/stage.h>
+#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <dali/devel-api/adaptor-framework/file-loader.h>
 #include <fstream>
 
 namespace Dali
 {
 
+namespace
+{
+  /**
+   * @brief Loads a texture from a file
+   * @param[in] imageUrl The url of the file
+   * @param[in] generateMipmaps Indicates whether to generate mipmaps for the texture
+   * @return A texture if loading succeeds, an empty handle otherwise
+   */
+  Texture LoadTexture( const char* imageUrl, bool generateMipmaps )
+  {
+    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 );
+
+      if( generateMipmaps )
+      {
+        texture.GenerateMipmaps();
+      }
+    }
+
+    return texture;
+  }
+}// unnamed namespace
+
 namespace Toolkit
 {
 
@@ -244,7 +274,8 @@ const char* NORMAL_MAP_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 MeshRenderer::MeshRenderer( RendererFactoryCache& factoryCache )
 : ControlRenderer( factoryCache ),
   mShaderType( ALL_TEXTURES ),
-  mUseTexture( true )
+  mUseTexture( true ),
+  mUseMipmapping( true )
 {
 }
 
@@ -275,6 +306,12 @@ void MeshRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap
     mTexturesPath.clear();
   }
 
+  Property::Value* useMipmapping = propertyMap.Find( USE_MIPMAPPING );
+  if( useMipmapping )
+  {
+    useMipmapping->Get( mUseMipmapping );
+  }
+
   Property::Value* shaderType = propertyMap.Find( SHADER_TYPE );
   if( shaderType && shaderType->Get( mShaderTypeString ) )
   {
@@ -413,16 +450,13 @@ void MeshRenderer::CreateShader()
 bool MeshRenderer::CreateGeometry()
 {
   //Determine if we need to use a simpler shader to handle the provided data
-  if( mShaderType == ALL_TEXTURES )
+  if( !mUseTexture || !mObjLoader.IsDiffuseMapPresent() )
   {
-    if( !mObjLoader.IsNormalMapPresent() || !mObjLoader.IsSpecularMapPresent() )
-    {
-      mShaderType = DIFFUSE_TEXTURE;
-    }
+    mShaderType = TEXTURELESS;
   }
-  if( !mObjLoader.IsTexturePresent() || !mObjLoader.IsDiffuseMapPresent() || !mUseTexture )
+  else if( mShaderType == ALL_TEXTURES && (!mObjLoader.IsNormalMapPresent() || !mObjLoader.IsSpecularMapPresent()) )
   {
-    mShaderType = TEXTURELESS;
+    mShaderType = DIFFUSE_TEXTURE;
   }
 
   int objectProperties = 0;
@@ -435,7 +469,7 @@ bool MeshRenderer::CreateGeometry()
 
   if( mShaderType == ALL_TEXTURES )
   {
-    objectProperties |= ObjLoader::TANGENTS | ObjLoader::BINOMIALS;
+    objectProperties |= ObjLoader::TANGENTS | ObjLoader::BINORMALS;
   }
 
   //Create geometry with attributes required by shader.
@@ -492,57 +526,68 @@ bool MeshRenderer::LoadTextures()
 {
   mTextureSet = TextureSet::New();
 
-  if( !mDiffuseTextureUrl.empty() )
+  if( mShaderType != TEXTURELESS )
   {
-    std::string imageUrl = mTexturesPath + mDiffuseTextureUrl;
-
-    //Load textures
-    Image diffuseTexture = ResourceImage::New( imageUrl );
-    if( diffuseTexture )
-    {
-      mTextureSet.SetImage( DIFFUSE_INDEX, diffuseTexture );
-    }
-    else
+    Sampler sampler = Sampler::New();
+    if( mUseMipmapping )
     {
-      DALI_LOG_ERROR( "Failed to load diffuse map texture in mesh renderer.\n");
-      return false;
+      sampler.SetFilterMode( FilterMode::LINEAR_MIPMAP_LINEAR, FilterMode::LINEAR_MIPMAP_LINEAR );
     }
-  }
-
-  if( !mNormalTextureUrl.empty() && ( mShaderType == ALL_TEXTURES ) )
-  {
-    std::string imageUrl = mTexturesPath + mNormalTextureUrl;
 
-    //Load textures
-    Image normalTexture = ResourceImage::New( imageUrl );
-    if( normalTexture )
+    if( !mDiffuseTextureUrl.empty() )
     {
-      mTextureSet.SetImage( NORMAL_INDEX, normalTexture );
+      std::string imageUrl = mTexturesPath + mDiffuseTextureUrl;
+
+      //Load textures
+      Texture diffuseTexture = LoadTexture( imageUrl.c_str(), mUseMipmapping );
+      if( diffuseTexture )
+      {
+        mTextureSet.SetTexture( DIFFUSE_INDEX, diffuseTexture );
+        mTextureSet.SetSampler( DIFFUSE_INDEX, sampler );
+      }
+      else
+      {
+        DALI_LOG_ERROR( "Failed to load diffuse map texture in mesh renderer.\n");
+        return false;
+      }
     }
-    else
-    {
-      DALI_LOG_ERROR( "Failed to load normal map texture in mesh renderer.\n");
-      return false;
-    }
-  }
-
-  if( !mGlossTextureUrl.empty() && ( mShaderType == ALL_TEXTURES ) )
-  {
-    std::string imageUrl = mTexturesPath + mGlossTextureUrl;
 
-    //Load textures
-    Image glossTexture = ResourceImage::New( imageUrl );
-    if( glossTexture )
+    if( !mNormalTextureUrl.empty() && ( mShaderType == ALL_TEXTURES ) )
     {
-      mTextureSet.SetImage( GLOSS_INDEX, glossTexture );
+      std::string imageUrl = mTexturesPath + mNormalTextureUrl;
+
+      //Load textures
+      Texture normalTexture = LoadTexture( imageUrl.c_str(), mUseMipmapping );
+      if( normalTexture )
+      {
+        mTextureSet.SetTexture( NORMAL_INDEX, normalTexture );
+        mTextureSet.SetSampler( NORMAL_INDEX, sampler );
+      }
+      else
+      {
+        DALI_LOG_ERROR( "Failed to load normal map texture in mesh renderer.\n");
+        return false;
+      }
     }
-    else
+
+    if( !mGlossTextureUrl.empty() && ( mShaderType == ALL_TEXTURES ) )
     {
-      DALI_LOG_ERROR( "Failed to load gloss map texture in mesh renderer.\n");
-      return false;
+      std::string imageUrl = mTexturesPath + mGlossTextureUrl;
+
+      //Load textures
+      Texture glossTexture = LoadTexture( imageUrl.c_str(), mUseMipmapping );
+      if( glossTexture )
+      {
+        mTextureSet.SetTexture( GLOSS_INDEX, glossTexture );
+        mTextureSet.SetSampler( GLOSS_INDEX, sampler );
+      }
+      else
+      {
+        DALI_LOG_ERROR( "Failed to load gloss map texture in mesh renderer.\n");
+        return false;
+      }
     }
   }
-
   return true;
 }
 
index ede12fb..e5aaee5 100644 (file)
@@ -196,6 +196,7 @@ private:
   ShaderType mShaderType;
 
   bool mUseTexture;
+  bool mUseMipmapping;
 };
 
 } // namespace Internal
index fe00209..6cb0aa0 100644 (file)
@@ -130,7 +130,7 @@ RendererFactory::RendererType RendererFactory::GetRendererType( const Property::
   return rendererType;
 }
 
-Toolkit::ControlRenderer RendererFactory::GetControlRenderer( const Property::Map& propertyMap )
+Toolkit::ControlRenderer RendererFactory::CreateControlRenderer( const Property::Map& propertyMap )
 {
   ControlRenderer* rendererPtr = NULL;
 
@@ -207,72 +207,7 @@ Toolkit::ControlRenderer RendererFactory::GetControlRenderer( const Property::Ma
   return Toolkit::ControlRenderer( rendererPtr );
 }
 
-Toolkit::ControlRenderer RendererFactory::GetControlRenderer( const Vector4& color )
-{
-  if( !mFactoryCache )
-  {
-    mFactoryCache = new RendererFactoryCache();
-  }
-
-  if( mDebugEnabled )
-  {
-    return Toolkit::ControlRenderer( new DebugRenderer( *( mFactoryCache.Get() ) ) );
-  }
-
-  ColorRenderer* rendererPtr = new ColorRenderer( *( mFactoryCache.Get() ) );
-  rendererPtr->SetColor( color );
-
-  return Toolkit::ControlRenderer( rendererPtr );
-}
-
-void RendererFactory::ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const Vector4& color )
-{
-  if( mDebugEnabled && renderer )
-  {
-    return;
-  }
-
-  if( renderer )
-  {
-    ColorRenderer* rendererPtr = dynamic_cast< ColorRenderer* >( &GetImplementation( renderer ) );
-    if( rendererPtr )
-    {
-      rendererPtr->SetColor( color );
-      return;
-    }
-
-    renderer.RemoveAndReset( actor );
-  }
-
-  renderer = GetControlRenderer( color );
-  if( actor && actor.OnStage() )
-  {
-    renderer.SetOnStage( actor );
-  }
-}
-
-Toolkit::ControlRenderer RendererFactory::GetControlRenderer( float borderSize, const Vector4& borderColor, bool antiAliasing )
-{
-  if( !mFactoryCache )
-  {
-    mFactoryCache = new RendererFactoryCache();
-  }
-
-  if( mDebugEnabled )
-  {
-    return Toolkit::ControlRenderer( new DebugRenderer( *( mFactoryCache.Get() ) ) );
-  }
-
-  BorderRenderer* rendererPtr = new BorderRenderer( *mFactoryCache.Get() );
-
-  rendererPtr->SetBorderSize( borderSize );
-  rendererPtr->SetBorderColor( borderColor );
-  rendererPtr->RequireAntiAliasing( antiAliasing );
-
-  return Toolkit::ControlRenderer( rendererPtr );
-}
-
-Toolkit::ControlRenderer RendererFactory::GetControlRenderer( const Image& image )
+Toolkit::ControlRenderer RendererFactory::CreateControlRenderer( const Image& image )
 {
   if( !mFactoryCache )
   {
@@ -303,53 +238,7 @@ Toolkit::ControlRenderer RendererFactory::GetControlRenderer( const Image& image
   }
 }
 
-void RendererFactory::ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const Image& image )
-{
-  if( mDebugEnabled && renderer )
-  {
-    return;
-  }
-
-  if( renderer )
-  {
-    if( ! image )
-    {
-      // If the image is empty, then reset the renderer and return
-      renderer.RemoveAndReset( actor );
-      return;
-    }
-
-    NinePatchImage npatchImage = NinePatchImage::DownCast( image );
-    if( npatchImage )
-    {
-      NPatchRenderer* rendererPtr = dynamic_cast< NPatchRenderer* >( &GetImplementation( renderer ) );
-      if( rendererPtr )
-      {
-        rendererPtr->SetImage( npatchImage );
-        return;
-      }
-    }
-    else
-    {
-      ImageRenderer* rendererPtr = dynamic_cast< ImageRenderer* >( &GetImplementation( renderer ) );
-      if( rendererPtr )
-      {
-        rendererPtr->SetImage( actor, image );
-        return;
-      }
-    }
-
-    renderer.RemoveAndReset( actor );
-  }
-
-  renderer = GetControlRenderer( image );
-  if( actor && actor.OnStage() )
-  {
-    renderer.SetOnStage( actor );
-  }
-}
-
-Toolkit::ControlRenderer RendererFactory::GetControlRenderer( const std::string& url, ImageDimensions size )
+Toolkit::ControlRenderer RendererFactory::CreateControlRenderer( const std::string& url, ImageDimensions size )
 {
   if( !mFactoryCache )
   {
@@ -386,96 +275,6 @@ Toolkit::ControlRenderer RendererFactory::GetControlRenderer( const std::string&
   }
 }
 
-void RendererFactory::ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const std::string& url, ImageDimensions size )
-{
-  if( mDebugEnabled && renderer )
-  {
-    return;
-  }
-
-  if( renderer )
-  {
-    if( url.empty() )
-    {
-      // If the URL is empty, then reset the renderer and return
-      renderer.RemoveAndReset( actor );
-      return;
-    }
-    else if( NinePatchImage::IsNinePatchUrl( url ) )
-    {
-      NPatchRenderer* rendererPtr = dynamic_cast< NPatchRenderer* >( &GetImplementation( renderer ) );
-      if( rendererPtr )
-      {
-        rendererPtr->SetImage( url );
-        return;
-      }
-    }
-    else if( SvgRenderer::IsSvgUrl( url ) )
-    {
-      SvgRenderer* rendererPtr = dynamic_cast< SvgRenderer* >( &GetImplementation( renderer ) );
-      if( rendererPtr )
-      {
-        rendererPtr->SetImage( url, size );
-        return;
-      }
-    }
-    else
-    {
-      ImageRenderer* rendererPtr = dynamic_cast< ImageRenderer* >( &GetImplementation( renderer ) );
-      if( rendererPtr )
-      {
-        rendererPtr->SetImage( actor, url, size );
-        return;
-      }
-    }
-
-    renderer.RemoveAndReset( actor );
-  }
-
-  renderer = GetControlRenderer( url, size );
-  if( actor && actor.OnStage() )
-  {
-    renderer.SetOnStage( actor );
-  }
-}
-
-void RendererFactory::ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const Property::Map& propertyMap )
-{
-  if( mDebugEnabled && renderer )
-  {
-    return;
-  }
-
-  if( renderer )
-  {
-    ControlRenderer& controlRenderer = GetImplementation( renderer );
-
-    RendererType type = GetRendererType( propertyMap );
-
-    //If there's no renderer type specified or if there hasn't been a renderer type change then we can reuse the renderer
-    if( type == UNDEFINED ||
-        ( type == IMAGE     && typeid( controlRenderer ) == typeid( ImageRenderer ) ) ||
-        ( type == N_PATCH   && typeid( controlRenderer ) == typeid( NPatchRenderer ) ) ||
-        ( type == COLOR     && typeid( controlRenderer ) == typeid( ColorRenderer ) ) ||
-        ( type == GRADIENT  && typeid( controlRenderer ) == typeid( GradientRenderer ) ) ||
-        ( type == BORDER    && typeid( controlRenderer ) == typeid( BorderRenderer ) ) ||
-        ( type == SVG       && typeid( controlRenderer ) == typeid( SvgRenderer ) ) ||
-        ( type == MESH      && typeid( controlRenderer ) == typeid( MeshRenderer ) ) )
-    {
-      controlRenderer.Initialize( actor, propertyMap );
-      return;
-    }
-
-    renderer.RemoveAndReset( actor );
-  }
-
-  renderer = GetControlRenderer( propertyMap );
-  if( renderer && actor && actor.OnStage() )
-  {
-    renderer.SetOnStage( actor );
-  }
-}
-
 Image RendererFactory::GetBrokenRendererImage()
 {
   return ResourceImage::New( BROKEN_RENDERER_IMAGE_URL );
index 87e321f..671c752 100644 (file)
@@ -66,49 +66,19 @@ public:
   RendererFactory( bool debugEnabled );
 
   /**
-   * @copydoc Toolkit::RenderFactory::GetControlRenderer( const Property::Map& )
+   * @copydoc Toolkit::RenderFactory::CreateControlRenderer( const Property::Map& )
    */
-  Toolkit::ControlRenderer GetControlRenderer( const Property::Map& propertyMap );
+  Toolkit::ControlRenderer CreateControlRenderer( const Property::Map& propertyMap );
 
   /**
-   * @copydoc Toolkit::RenderFactory::ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const Property::Map& propertyMap )
+   * @copydoc Toolkit::RenderFactory::CreateControlRenderer( const Image& )
    */
-  void ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const Property::Map& propertyMap );
+  Toolkit::ControlRenderer CreateControlRenderer( const Image& image );
 
   /**
-   * @copydoc Toolkit::RenderFactory::GetControlRenderer( const Vector4& )
+   * @copydoc Toolkit::RenderFactory::CreateControlRenderer( const std::string&, ImageDimensions )
    */
-  Toolkit::ControlRenderer GetControlRenderer( const Vector4& color );
-
-  /**
-   * @copydoc Toolkit::RendererFactory::ResetRenderer( Toolkit::ControlRenderer&, Actor& actor, const Vector4& )
-   */
-  void ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const Vector4& color );
-
-  /**
-   * @copydoc Toolkit::RenderFactory::GetControlRenderer( float, const Vector4&, bool )
-   */
-  Toolkit::ControlRenderer GetControlRenderer( float borderSize, const Vector4& borderColor, bool antiAliasing );
-
-  /**
-   * @copydoc Toolkit::RenderFactory::GetControlRenderer( const Image& )
-   */
-  Toolkit::ControlRenderer GetControlRenderer( const Image& image );
-
-  /**
-   * @copydoc Toolkit::RendererFactory::ResetRenderer( Toolkit::ControlRenderer&, Actor& actor, const Image& )
-   */
-  void ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const Image& image );
-
-  /**
-   * @copydoc Toolkit::RenderFactory::GetControlRenderer( const std::string&, ImageDimensions )
-   */
-  Toolkit::ControlRenderer GetControlRenderer( const std::string& image, ImageDimensions size );
-
-  /**
-   * @copydoc Toolkit::RendererFactory::ResetRenderer( Toolkit::ControlRenderer&, Actor& actor, const std::string&, ImageDimensions )
-   */
-  void ResetRenderer( Toolkit::ControlRenderer& renderer, Actor& actor, const std::string& image, ImageDimensions size );
+  Toolkit::ControlRenderer CreateControlRenderer( const std::string& image, ImageDimensions size );
 
 public:
   /**
index a5eb87a..41fd6a7 100644 (file)
@@ -43,6 +43,7 @@ const char * const OBJECT_URL( "objectUrl" );
 const char * const MATERIAL_URL( "materialUrl" );
 const char * const TEXTURES_PATH( "texturesPath" );
 const char * const SHADER_TYPE( "shaderType" );
+const char * const USE_MIPMAPPING( "useMipmapping" );
 
 } // namespace Internal
 
index 51e13f0..0bb7d45 100644 (file)
@@ -43,6 +43,7 @@ extern const char * const OBJECT_URL;
 extern const char * const MATERIAL_URL;
 extern const char * const TEXTURES_PATH;
 extern const char * const SHADER_TYPE;
+extern const char * const USE_MIPMAPPING;
 
 } // namespace Internal
 
index f10dfb5..97e2680 100755 (executable)
@@ -175,7 +175,7 @@ const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"};
 }
 
 ScrollBar::ScrollBar(Toolkit::ScrollBar::Direction direction)
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mIndicatorShowAlpha(1.0f),
   mDirection(direction),
   mScrollableObject(WeakHandleBase()),
index 2f13c17..741b057 100644 (file)
@@ -26,7 +26,7 @@
 #include <dali/devel-api/common/set-wrapper.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/wheel-event.h>
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 
@@ -328,6 +328,7 @@ void ItemView::OnInitialize()
   Vector2 stageSize = Stage::GetCurrent().GetSize();
   mWheelScrollDistanceStep = stageSize.y * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
 
+  self.TouchSignal().Connect( this, &ItemView::OnTouch );
   EnableGestureDetection(Gesture::Type(Gesture::Pan));
 
   mWheelEventFinishedTimer = Timer::New( WHEEL_EVENT_FINISHED_TIME_OUT );
@@ -980,37 +981,6 @@ void ItemView::OnChildAdd(Actor& child)
   }
 }
 
-bool ItemView::OnTouchEvent(const TouchEvent& event)
-{
-  // Ignore events with multiple-touch points
-  if (event.GetPointCount() != 1)
-  {
-    return false;
-  }
-
-  if (event.GetPoint(0).state == TouchPoint::Down)
-  {
-    // Cancel ongoing scrolling etc.
-    mGestureState = Gesture::Clear;
-
-    mScrollDistance = 0.0f;
-    mScrollSpeed = 0.0f;
-    Self().SetProperty(Toolkit::ItemView::Property::SCROLL_SPEED, mScrollSpeed);
-
-    mScrollOvershoot = 0.0f;
-    AnimateScrollOvershoot(0.0f);
-
-    if(mScrollAnimation)
-    {
-      mScrollCompletedSignal.Emit(GetCurrentScrollPosition());
-    }
-
-    RemoveAnimation(mScrollAnimation);
-  }
-
-  return true; // consume since we're potentially scrolling
-}
-
 bool ItemView::OnWheelEvent(const WheelEvent& event)
 {
   // Respond the wheel event to scroll
@@ -1103,6 +1073,37 @@ float ItemView::ClampFirstItemPosition( float targetPosition, const Vector3& tar
   return clamppedPosition;
 }
 
+bool ItemView::OnTouch( Actor actor, const TouchData& touch )
+{
+  // Ignore events with multiple-touch points
+  if (touch.GetPointCount() != 1)
+  {
+    return false;
+  }
+
+  if ( touch.GetState( 0 ) == PointState::DOWN )
+  {
+    // Cancel ongoing scrolling etc.
+    mGestureState = Gesture::Clear;
+
+    mScrollDistance = 0.0f;
+    mScrollSpeed = 0.0f;
+    Self().SetProperty(Toolkit::ItemView::Property::SCROLL_SPEED, mScrollSpeed);
+
+    mScrollOvershoot = 0.0f;
+    AnimateScrollOvershoot(0.0f);
+
+    if(mScrollAnimation)
+    {
+      mScrollCompletedSignal.Emit(GetCurrentScrollPosition());
+    }
+
+    RemoveAnimation(mScrollAnimation);
+  }
+
+  return true; // consume since we're potentially scrolling
+}
+
 void ItemView::OnPan( const PanGesture& gesture )
 {
   Actor self = Self();
index 3d31e1c..d8bbcac 100644 (file)
@@ -392,13 +392,6 @@ private: // From CustomActorImpl
   virtual void OnChildAdd(Actor& child);
 
   /**
-   * From CustomActorImpl; called after a touch-signal is received by the owning actor.
-   * @param[in] event The touch event.
-   * @return True if the event should be consumed.
-   */
-  virtual bool OnTouchEvent(const TouchEvent& event);
-
-  /**
    * From CustomActorImpl; called after a wheel-event is received by the owning actor.
    * @param[in] event The wheel event.
    * @return True if the event should be consumed.
@@ -484,14 +477,6 @@ private:
   // Input Handling
 
   /**
-   * Helper to handle pressed (Down) events.
-   * @param[in] x The X coordinate of the touch event.
-   * @param[in] y The Y coordinate of the touch event.
-   * @param[in] timeMs The time-stamp of the touch event.
-   */
-  void OnPressed(float x, float y, unsigned long timeMs);
-
-  /**
    * Helper to clamp the first-item position when dragging/swiping.
    * @param[in] targetPosition The target position of the drag etc.
    * @param[in] targetSize The target ItemView & layout size.
@@ -502,6 +487,14 @@ private:
   float ClampFirstItemPosition(float targetPosition, const Vector3& targetSize, ItemLayout& layout, bool updateOvershoot = true);
 
   /**
+   * Called after a touch-signal is received by the owning actor.
+   * @param[in] actor The touched actor.
+   * @param[in] touch The touch information.
+   * @return True if the event should be consumed.
+   */
+  bool OnTouch( Actor actor, const TouchData& touch );
+
+  /**
    * Called upon pan gesture event.
    *
    * @param[in] gesture The gesture event.
index 4cc2393..690704d 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/wheel-event.h>
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
@@ -683,6 +683,7 @@ void ScrollView::OnInitialize()
 
   mGestureStackDepth = 0;
 
+  self.TouchSignal().Connect( this, &ScrollView::OnTouch );
   EnableGestureDetection( Gesture::Type( Gesture::Pan ) );
 
   // By default we'll allow the user to freely drag the scroll view,
@@ -2043,7 +2044,7 @@ bool ScrollView::OnTouchDownTimeout()
   return false;
 }
 
-bool ScrollView::OnTouchEvent(const TouchEvent& event)
+bool ScrollView::OnTouch( Actor actor, const TouchData& touch )
 {
   if(!mSensitive)
   {
@@ -2054,21 +2055,21 @@ bool ScrollView::OnTouchEvent(const TouchEvent& event)
   }
 
   // Ignore events with multiple-touch points
-  if (event.GetPointCount() != 1)
+  if (touch.GetPointCount() != 1)
   {
     DALI_LOG_SCROLL_STATE("[0x%X], multiple touch, ignoring", this);
 
     return false;
   }
 
-  const TouchPoint::State pointState = event.GetPoint(0).state;
-  if( pointState == TouchPoint::Down )
+  const PointState::Type pointState = touch.GetState( 0 );
+  if( pointState == PointState::DOWN )
   {
     DALI_LOG_SCROLL_STATE("[0x%X] Down", this);
 
     if(mGestureStackDepth==0)
     {
-      mTouchDownTime = event.time;
+      mTouchDownTime = touch.GetTime();
 
       // This allows time for a pan-gesture to start, to avoid breaking snap-animation behavior with fast flicks.
       // If touch-down does not become a pan (after timeout interval), then snap-animation can be interrupted.
@@ -2077,8 +2078,8 @@ bool ScrollView::OnTouchEvent(const TouchEvent& event)
       StartTouchDownTimer();
     }
   }
-  else if( ( pointState == TouchPoint::Up ) ||
-           ( ( pointState == TouchPoint::Interrupted ) && ( event.GetPoint(0).hitActor == Self() ) ) )
+  else if( ( pointState == PointState::UP ) ||
+           ( ( pointState == PointState::INTERRUPTED ) && ( touch.GetHitActor( 0 )== Self() ) ) )
   {
     DALI_LOG_SCROLL_STATE("[0x%X] %s", this, ( ( pointState == TouchPoint::Up ) ? "Up" : "Interrupted" ) );
 
@@ -2089,8 +2090,8 @@ bool ScrollView::OnTouchEvent(const TouchEvent& event)
     // otherwise our scroll could be stopped (interrupted) half way through an animation.
     if(mGestureStackDepth==0 && mTouchDownTimeoutReached)
     {
-      if( ( event.GetPoint(0).state == TouchPoint::Interrupted ) ||
-          ( ( event.time - mTouchDownTime ) >= MINIMUM_TIME_BETWEEN_DOWN_AND_UP_FOR_RESET ) )
+      if( ( pointState == PointState::INTERRUPTED ) ||
+          ( ( touch.GetTime() - mTouchDownTime ) >= MINIMUM_TIME_BETWEEN_DOWN_AND_UP_FOR_RESET ) )
       {
         // Reset the velocity only if down was received a while ago
         mLastVelocity = Vector2( 0.0f, 0.0f );
index b9db77d..63df8dc 100644 (file)
@@ -539,7 +539,7 @@ public: //Signals
    */
   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
 
-private: // private overriden functions from CustomActorImpl and Controls
+private: // private overridden functions from CustomActorImpl and Controls
 
   /**
    * @copydoc Dali::CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
@@ -564,16 +564,6 @@ private: // private overriden functions from CustomActorImpl and Controls
   virtual void OnChildRemove(Actor& child);
 
   /**
-   * From CustomActorImpl; called after a touchSignal is received by the owning actor.
-   *
-   * We don't listen to these events as content within the contain may consume events.
-   *
-   * @param[in] event The touch event.
-   * @return True if the event should be consumed.
-   */
-  virtual bool OnTouchEvent(const TouchEvent& event);
-
-  /**
    * From CustomActorImpl; called after a wheelEvent is received by the owning actor.
    * @param[in] event The wheel event.
    * @return True if the event should be consumed.
@@ -608,6 +598,17 @@ private: // private overriden functions from CustomActorImpl and Controls
 private:
 
   /**
+   * Called after a touchSignal is received by the owning actor.
+   *
+   * We don't consume these events as content within the container may consume events.
+   *
+   * @param[in] actor The touched actor.
+   * @param[in] touch The touch information.
+   * @return True if the event should be consumed.
+   */
+  bool OnTouch( Actor actor, const TouchData& touch );
+
+  /**
    * Start a timer which calls OnTouchDownTimeout()
    */
   void StartTouchDownTimer();
@@ -894,7 +895,7 @@ private:
   Vector2 mLastVelocity;                ///< Record the last velocity from PanGesture (Finish event doesn't have correct velocity)
   LockAxis mLockAxis;
 
-  Timer mTouchDownTimer;                ///< Used to interrupt snap-animation. This cannot be done in OnTouchEvent without breaking fast flick behavior.
+  Timer mTouchDownTimer;                ///< Used to interrupt snap-animation. This cannot be done in OnTouch without breaking fast flick behavior.
 
   float mScrollUpdateDistance;          ///< Distance for scrolling to travel for the scroll update notifications
   Dali::PropertyNotification mScrollXUpdateNotification; ///< scroll x position update notification
index e33c920..2bec6b6 100644 (file)
@@ -81,7 +81,7 @@ const Vector2 OVERSHOOT_DEFAULT_SIZE( 720.0f, 42.0f );
 // Scrollable controls are not layout containers so they dont need size negotiation..
 // we dont want size negotiation while scrolling if we can avoid it
 Scrollable::Scrollable()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | DISABLE_SIZE_NEGOTIATION ) ),
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS | DISABLE_SIZE_NEGOTIATION ) ),
   mOvershootEffectColor(  DEFAULT_OVERSHOOT_COLOUR ),
   mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
   mOvershootSize( OVERSHOOT_DEFAULT_SIZE ),
@@ -91,7 +91,7 @@ Scrollable::Scrollable()
 }
 
 Scrollable::Scrollable( ControlBehaviour behaviourFlags )
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | behaviourFlags ) ),
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS | behaviourFlags ) ),
   mOvershootEffectColor(  DEFAULT_OVERSHOOT_COLOUR ),
   mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
   mOvershootSize( OVERSHOOT_DEFAULT_SIZE ),
index 1191778..1d107a2 100644 (file)
@@ -151,12 +151,11 @@ void ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground)
 {
   mShadowPlaneBg = shadowPlaneBackground;
 
-  mShadowPlane = Toolkit::ImageView::New();
+  mShadowPlane = Toolkit::ImageView::New( mOutputImage );
   mShadowPlane.SetName( "SHADOW_PLANE" );
   mShadowPlane.SetParentOrigin(ParentOrigin::CENTER);
   mShadowPlane.SetAnchorPoint(AnchorPoint::CENTER);
 
-  mShadowPlane.SetImage(mOutputImage);
   mShadowPlane.SetProperty( Toolkit::ImageView::Property::IMAGE, mShadowRenderShader );
   SetShaderConstants();
 
index 9c9965c..915db02 100755 (executable)
@@ -22,7 +22,7 @@
 #include <cstring> // for strcmp
 #include <sstream>
 #include <limits>
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
@@ -135,7 +135,7 @@ Dali::Toolkit::Slider Slider::New()
 }
 
 Slider::Slider()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mState( NORMAL ),
   mPopupVisual(""),
   mPopupArrowVisual(""),
@@ -201,6 +201,9 @@ void Slider::OnInitialize()
 
   // Size the Slider actor to a default
   self.SetSize( DEFAULT_HIT_REGION.x, DEFAULT_HIT_REGION.y );
+
+  // Connect to the touch signal
+  self.TouchSignal().Connect( this, &Slider::OnTouch );
 }
 
 void Slider::OnSizeSet( const Vector3& size )
@@ -210,22 +213,22 @@ void Slider::OnSizeSet( const Vector3& size )
   SetTrackRegion( Vector2( size.x - GetHandleSize().x, GetTrackRegion().y ) );
 }
 
-bool Slider::OnTouchEvent(Actor actor, const TouchEvent& event)
+bool Slider::OnTouch(Actor actor, const TouchData& touch)
 {
   if( mState != DISABLED )
   {
-    TouchPoint::State touchState = event.GetPoint(0).state;
+    const PointState::Type touchState = touch.GetState(0);
 
-    if( touchState == TouchPoint::Down )
+    if( touchState == PointState::DOWN )
     {
       mState = PRESSED;
 
-      float percentage = MapPercentage( event.GetPoint(0).local );
+      float percentage = MapPercentage( touch.GetLocalPosition( 0 ) );
       float value = MapBounds( ( GetSnapToMarks() ) ? SnapToMark( percentage ) : MarkFilter( percentage ), GetLowerBound(), GetUpperBound() );
       SetValue( value );
       DisplayPopup( value );
     }
-    else if( touchState == TouchPoint::Up)
+    else if( touchState == PointState::UP )
     {
       if( mState == PRESSED )
       {
@@ -372,7 +375,7 @@ Actor Slider::CreateHitRegion()
   Actor hitRegion = Actor::New();
   hitRegion.SetParentOrigin( ParentOrigin::CENTER );
   hitRegion.SetAnchorPoint( AnchorPoint::CENTER );
-  hitRegion.TouchedSignal().Connect( this, &Slider::OnTouchEvent );
+  hitRegion.TouchSignal().Connect( this, &Slider::OnTouch );
 
   return hitRegion;
 }
index acc7494..f2c81b2 100755 (executable)
@@ -324,13 +324,13 @@ private:
   virtual void OnInitialize();
 
   /**
-   * Hit region touch event
+   * Hit region touch
    *
    * @param[in] actor The actor the event is raised for
-   * @param[in] event The touch event info
-   * @return If the event is handled or not
+   * @param[in] touch The touch info
+   * @return If touch is handled or not
    */
-  bool OnTouchEvent( Actor actor, const TouchEvent& event );
+  bool OnTouch( Actor actor, const TouchData& touch );
 
   /**
    * Pan gesture event
index 2a4979b..47a0790 100644 (file)
@@ -29,6 +29,9 @@
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
+// INTERNAL_INCLUDES
+#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+
 namespace //Unnamed namespace
 {
 
@@ -154,21 +157,6 @@ Toolkit::SuperBlurView SuperBlurView::New( unsigned int blurLevels )
 void SuperBlurView::OnInitialize()
 {
   mBlurStrengthPropertyIndex = Self().RegisterProperty( "blurStrength", 0.f );
-
-  Property::Map rendererMap;
-  rendererMap.Insert( "rendererType", "image");
-
-  Property::Map shaderMap;
-  std::stringstream verterShaderString;
-  shaderMap[ "fragmentShader" ] = FRAGMENT_SHADER;
-  rendererMap.Insert( "shader", shaderMap );
-
-  Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
-  for(unsigned int i=0; i<=mBlurLevels; i++)
-  {
-    mRenderers[i] = rendererFactory.GetControlRenderer( rendererMap );
-    mRenderers[i].SetDepthIndex(i);
-  }
 }
 
 void SuperBlurView::SetImage(Image inputImage)
@@ -181,8 +169,14 @@ void SuperBlurView::SetImage(Image inputImage)
   ClearBlurResource();
 
   mInputImage = inputImage;
-  Actor self = Self();
-  Toolkit::RendererFactory::Get().ResetRenderer( mRenderers[0], self, mInputImage );
+  Actor self( Self() );
+  InitializeControlRenderer( self, mRenderers[0], mInputImage );
+  mRenderers[0].SetDepthIndex(0);
+  SetShaderEffect( mRenderers[0] );
+  if( self.OnStage() )
+  {
+    mRenderers[0].SetOnStage( self );
+  }
 
   BlurImage( 0,  inputImage);
   for(unsigned int i=1; i<mBlurLevels;i++)
@@ -265,6 +259,15 @@ void SuperBlurView::ClearBlurResource()
     mResourcesCleared = true;
   }
 }
+void SuperBlurView::SetShaderEffect( Toolkit::ControlRenderer& renderer )
+{
+  Property::Map shaderMap;
+  std::stringstream verterShaderString;
+  shaderMap[ "fragmentShader" ] = FRAGMENT_SHADER;
+
+  Internal::ControlRenderer& rendererImpl = GetImplementation( renderer );
+  rendererImpl.SetCustomShader( shaderMap );
+}
 
 void SuperBlurView::OnSizeSet( const Vector3& targetSize )
 {
@@ -274,12 +277,14 @@ void SuperBlurView::OnSizeSet( const Vector3& targetSize )
 
     Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
     Actor self = Self();
-    for(unsigned int i=1; i<=mBlurLevels;i++)
+    for( unsigned int i = 1; i <= mBlurLevels; i++ )
     {
       float exponent = static_cast<float>(i);
       mBlurredImage[i-1] = FrameBufferImage::New( mTargetSize.width/std::pow(2.f,exponent) , mTargetSize.height/std::pow(2.f,exponent),
                                                 GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT, Dali::Image::NEVER );
-      rendererFactory.ResetRenderer( mRenderers[i], self, mBlurredImage[i-1] );
+      InitializeControlRenderer( self, mRenderers[i], mBlurredImage[i - 1] );
+      mRenderers[ i ].SetDepthIndex( i );
+      SetShaderEffect( mRenderers[ i ] );
     }
 
     if( mInputImage )
@@ -289,7 +294,7 @@ void SuperBlurView::OnSizeSet( const Vector3& targetSize )
 
     if( self.OnStage() )
     {
-      for(unsigned int i=0; i<=mBlurLevels;i++)
+      for( unsigned int i = 1; i <= mBlurLevels; i++ )
       {
         mRenderers[i].SetOnStage( self );
       }
@@ -307,10 +312,16 @@ void SuperBlurView::OnStageConnection( int depth )
   }
 
   Actor self = Self();
-  mRenderers[0].SetOnStage( self );
+  if( mRenderers[0] )
+  {
+    mRenderers[0].SetOnStage( self );
+  }
   for(unsigned int i=1; i<=mBlurLevels;i++)
   {
-    mRenderers[i].SetOnStage( self );
+    if( mRenderers[i] )
+    {
+      mRenderers[i].SetOnStage( self );
+    }
 
     Renderer renderer = self.GetRendererAt( i );
     Property::Index index = renderer.RegisterProperty( ALPHA_UNIFORM_NAME, 0.f );
index 594693c..fa5be8e 100644 (file)
@@ -161,6 +161,12 @@ private:
    */
   void ClearBlurResource();
 
+  /**
+   * Sets shader effect on the control renderer
+   * @param[in,out] Sets custom shader effect on the given renderer
+   */
+  void SetShaderEffect( Toolkit::ControlRenderer& renderer );
+
 private:
   std::vector<Toolkit::GaussianBlurView> mGaussianBlurView;
   std::vector<FrameBufferImage>          mBlurredImage;
index 2fbd6d0..4763884 100644 (file)
@@ -936,7 +936,7 @@ void TextEditor::OnInitialize()
   EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
   GetTapGestureDetector().SetMaximumTapsRequired( 2 );
 
-  self.TouchedSignal().Connect( this, &TextEditor::OnTouched );
+  self.TouchSignal().Connect( this, &TextEditor::OnTouched );
 
   // Set BoundingBox to stage size if not already set.
   Rect<int> boundingBox;
@@ -1005,12 +1005,15 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor OnRelayout\n");
 
-  if( mController->Relayout( size ) ||
+  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
+
+  if( ( Text::Controller::NONE_UPDATED != updateTextType ) ||
       !mRenderer )
   {
     DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnRelayout %p Displaying new contents\n", mController.Get() );
 
-    if( mDecorator )
+    if( mDecorator &&
+        ( Text::Controller::NONE_UPDATED != ( Text::Controller::DECORATOR_UPDATED & updateTextType ) ) )
     {
       mDecorator->Relayout( size );
     }
@@ -1021,23 +1024,27 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
     }
 
     EnableClipping( true, size );
-    RenderText();
+    RenderText( updateTextType );
   }
 }
 
-void TextEditor::RenderText()
+void TextEditor::RenderText( Text::Controller::UpdateTextType updateTextType )
 {
   Actor self = Self();
   Actor renderableActor;
-  if( mRenderer )
-  {
-    renderableActor = mRenderer->Render( mController->GetView(), DepthIndex::TEXT );
-  }
 
-  if( renderableActor != mRenderableActor )
+  if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
   {
-    UnparentAndReset( mRenderableActor );
-    mRenderableActor = renderableActor;
+    if( mRenderer )
+    {
+      renderableActor = mRenderer->Render( mController->GetView(), DepthIndex::TEXT );
+    }
+
+    if( renderableActor != mRenderableActor )
+    {
+      UnparentAndReset( mRenderableActor );
+      mRenderableActor = renderableActor;
+    }
   }
 
   if( mRenderableActor )
@@ -1225,7 +1232,7 @@ void TextEditor::OnStageConnect( Dali::Actor actor )
 {
   if ( mHasBeenStaged )
   {
-    RenderText();
+    RenderText( static_cast<Text::Controller::UpdateTextType>( Text::Controller::MODEL_UPDATED | Text::Controller::DECORATOR_UPDATED ) );
   }
   else
   {
@@ -1313,7 +1320,7 @@ void TextEditor::OnStageConnection( int depth )
   // The depth of the text renderer is set in the RenderText() called from OnRelayout().
 }
 
-bool TextEditor::OnTouched( Actor actor, const TouchEvent& event )
+bool TextEditor::OnTouched( Actor actor, const TouchData& touch )
 {
   return true;
 }
index f00d66d..1c7376d 100644 (file)
@@ -211,9 +211,9 @@ private: // Implementation
    * @brief Callback when TextEditor is touched
    *
    * @param[in] actor TextEditor touched
-   * @param[in] event TouchEvent information
+   * @param[in] touch Touch information
    */
-  bool OnTouched( Actor actor, const TouchEvent& event );
+  bool OnTouched( Actor actor, const TouchData& touch );
 
   /**
    * Construct a new TextEditor.
@@ -232,7 +232,7 @@ private: // Implementation
   /**
    * @brief Render view, create and attach actor(s) to this text editor.
    */
-  void RenderText();
+  void RenderText( Text::Controller::UpdateTextType updateTextType );
 
   // Connection needed to re-render text, when a text editor returns to the stage.
   void OnStageConnect( Dali::Actor actor );
index b5f4858..69776fa 100644 (file)
@@ -1120,7 +1120,7 @@ void TextField::OnInitialize()
   EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
   GetTapGestureDetector().SetMaximumTapsRequired( 2 );
 
-  self.TouchedSignal().Connect( this, &TextField::OnTouched );
+  self.TouchSignal().Connect( this, &TextField::OnTouched );
 
   // Set BoundingBox to stage size if not already set.
   Rect<int> boundingBox;
@@ -1189,12 +1189,15 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField OnRelayout\n");
 
-  if( mController->Relayout( size ) ||
+  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
+
+  if( ( Text::Controller::NONE_UPDATED != updateTextType ) ||
       !mRenderer )
   {
     DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnRelayout %p Displaying new contents\n", mController.Get() );
 
-    if( mDecorator )
+    if( mDecorator &&
+        ( Text::Controller::NONE_UPDATED != ( Text::Controller::DECORATOR_UPDATED & updateTextType ) ) )
     {
       mDecorator->Relayout( size );
     }
@@ -1204,24 +1207,28 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
       mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
     }
 
-    EnableClipping( (Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy), size );
-    RenderText();
+    EnableClipping( ( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy ), size );
+    RenderText( updateTextType );
   }
 }
 
-void TextField::RenderText()
+void TextField::RenderText( Text::Controller::UpdateTextType updateTextType )
 {
   Actor self = Self();
   Actor renderableActor;
-  if( mRenderer )
-  {
-    renderableActor = mRenderer->Render( mController->GetView(), DepthIndex::TEXT );
-  }
 
-  if( renderableActor != mRenderableActor )
+  if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
   {
-    UnparentAndReset( mRenderableActor );
-    mRenderableActor = renderableActor;
+    if( mRenderer )
+    {
+      renderableActor = mRenderer->Render( mController->GetView(), DepthIndex::TEXT );
+    }
+
+    if( renderableActor != mRenderableActor )
+    {
+      UnparentAndReset( mRenderableActor );
+      mRenderableActor = renderableActor;
+    }
   }
 
   if( mRenderableActor )
@@ -1405,7 +1412,7 @@ void TextField::OnStageConnect( Dali::Actor actor )
 {
   if ( mHasBeenStaged )
   {
-    RenderText();
+    RenderText( static_cast<Text::Controller::UpdateTextType>( Text::Controller::MODEL_UPDATED | Text::Controller::DECORATOR_UPDATED ) );
   }
   else
   {
@@ -1499,7 +1506,7 @@ void TextField::OnStageConnection( int depth )
   // The depth of the text renderer is set in the RenderText() called from OnRelayout().
 }
 
-bool TextField::OnTouched( Actor actor, const TouchEvent& event )
+bool TextField::OnTouched( Actor actor, const TouchData& touch )
 {
   return true;
 }
index 91d757b..c574bb8 100644 (file)
@@ -216,9 +216,9 @@ private: // Implementation
    * @brief Callback when TextField is touched
    *
    * @param[in] actor TextField touched
-   * @param[in] event TouchEvent information
+   * @param[in] touch Touch information
    */
-  bool OnTouched( Actor actor, const TouchEvent& event );
+  bool OnTouched( Actor actor, const TouchData& touch );
 
   /**
    * Construct a new TextField.
@@ -237,7 +237,7 @@ private: // Implementation
   /**
    * @brief Render view, create and attach actor(s) to this Text Field.
    */
-  void RenderText();
+  void RenderText( Text::Controller::UpdateTextType updateTextType );
 
   // Connection needed to re-render text, when a Text Field returns to the stage.
   void OnStageConnect( Dali::Actor actor );
index c2b154e..308f947 100644 (file)
@@ -711,7 +711,9 @@ void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnRelayout\n" );
 
-  if( mController->Relayout( size ) ||
+  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
+
+  if( ( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) ) ||
       !mRenderer )
   {
     if( !mRenderer )
index 28cb38a..0b431fc 100644 (file)
@@ -119,8 +119,8 @@ void VideoView::SetPropertyMap( Property::Map map )
 {
   mPropertyMap = map;
 
-  Actor self = Self();
-  Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, mPropertyMap );
+  Actor self( Self() );
+  InitializeControlRenderer( self, mRenderer, mPropertyMap );
 
   Property::Value* widthValue = mPropertyMap.Find( "width" );
   if( widthValue )
@@ -525,7 +525,7 @@ void VideoView::SetWindowSurfaceTarget()
 
 void VideoView::SetNativeImageTarget()
 {
-  Actor self = Self();
+  Actor self( Self() );
   int curPos = mVideoPlayer.GetPlayPosition();
 
   mSetRenderingTarget = true;
@@ -538,7 +538,7 @@ void VideoView::SetNativeImageTarget()
   mVideoPlayer.SetUrl( mUrl );
   mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
 
-  Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, mNativeImage );
+  InitializeControlRenderer( self, mRenderer, mNativeImage );
 
   if( mIsPlay )
   {
index e44877e..c96d1bc 100644 (file)
@@ -27,8 +27,6 @@
 #include <dali/devel-api/rendering/renderer.h>
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 
-// INTERNAL INCLUDES
-
 namespace Dali
 {
 
@@ -96,7 +94,7 @@ void EmbossFilter::Enable()
   rendererMap.Insert( "shader", customShader );
 
   // create actor to render input with applied emboss effect
-  mActorForInput1 = Toolkit::ImageView::New( mInputImage );
+  mActorForInput1 = Toolkit::ImageView::New(mInputImage);
   mActorForInput1.SetParentOrigin( ParentOrigin::CENTER );
   mActorForInput1.SetSize(mTargetSize);
   Vector2 textureScale( 1.5f/mTargetSize.width, 1.5f/mTargetSize.height);
@@ -106,7 +104,7 @@ void EmbossFilter::Enable()
   mActorForInput1.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
   mRootActor.Add( mActorForInput1 );
 
-  mActorForInput2 = Toolkit::ImageView::New( mInputImage );
+  mActorForInput2 = Toolkit::ImageView::New(mInputImage);
   mActorForInput2.SetParentOrigin( ParentOrigin::CENTER );
   mActorForInput2.SetSize(mTargetSize);
   mActorForInput2.RegisterProperty( TEX_SCALE_UNIFORM_NAME, textureScale );
@@ -122,18 +120,22 @@ void EmbossFilter::Enable()
 
   customShader[ "fragmentShader" ] = COMPOSITE_FRAGMENT_SOURCE;
   rendererMap[ "shader"] = customShader;
-  Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
-  mRendererForEmboss1 = rendererFactory.GetControlRenderer( mImageForEmboss1 );
-  mRendererForEmboss2 = rendererFactory.GetControlRenderer( mImageForEmboss2 );
-  // set COMPOSITE custom shader to both renderers
-  rendererFactory.ResetRenderer( mRendererForEmboss1, mActorForComposite, rendererMap);
-  rendererFactory.ResetRenderer( mRendererForEmboss2, mActorForComposite, rendererMap);
-  // apply renderers to the actor
-  mRendererForEmboss1.SetOnStage( mActorForComposite );
-  mRendererForEmboss2.SetOnStage( mActorForComposite );
+  rendererMap[ "rendererType"] = "image";
+
+  mRootActor.Add( mActorForComposite );
+
+  InitializeControlRenderer( mActorForComposite, mRendererForEmboss1, rendererMap );
+  InitializeControlRenderer( mActorForComposite, mRendererForEmboss2, rendererMap );
+
+  TextureSet textureSet1 = TextureSet::New();
+  textureSet1.SetImage( 0, mImageForEmboss1 );
+  mActorForComposite.GetRendererAt(0).SetTextures( textureSet1 );
   mActorForComposite.GetRendererAt(0).RegisterProperty( COLOR_UNIFORM_NAME, Color::BLACK );
+
+  TextureSet textureSet2 = TextureSet::New();
+  textureSet2.SetImage( 0, mImageForEmboss2 );
+  mActorForComposite.GetRendererAt(1).SetTextures( textureSet2 );
   mActorForComposite.GetRendererAt(1).RegisterProperty( COLOR_UNIFORM_NAME, Color::WHITE );
-  mRootActor.Add( mActorForComposite );
 
   SetupCamera();
   CreateRenderTasks();
index 2a52cff..d503638 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/key-event.h>
+#include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
@@ -120,7 +121,7 @@ KeyboardFocusManager::KeyboardFocusManager()
   OnPhysicalKeyboardStatusChanged(PhysicalKeyboard::Get());
 
   Toolkit::KeyInputFocusManager::Get().UnhandledKeyEventSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnKeyEvent);
-  Stage::GetCurrent().TouchedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnTouched);
+  Stage::GetCurrent().TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
   PhysicalKeyboard::Get().StatusChangedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnPhysicalKeyboardStatusChanged);
 }
 
@@ -681,11 +682,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
   }
 }
 
-void KeyboardFocusManager::OnTouched(const TouchEvent& touchEvent)
+void KeyboardFocusManager::OnTouch(const TouchData& touch)
 {
   // Clear the focus when user touch the screen.
   // We only do this on a Down event, otherwise the clear action may override a manually focused actor.
-  if( ( touchEvent.GetPointCount() < 1 ) || ( touchEvent.GetPoint( 0 ).state == TouchPoint::Down ) )
+  if( ( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN ) )
   {
     ClearFocus();
   }
index de3770f..f615731 100644 (file)
@@ -221,9 +221,9 @@ private:
   /**
    * Callback for the touch event when the screen is touched and when the touch ends
    * (i.e. the down & up touch events only).
-   * @param[in] touchEvent The touch event
+   * @param[in] touch The touch information
    */
-  void OnTouched(const TouchEvent& touchEvent);
+  void OnTouch( const TouchData& touch );
 
   /**
    * Change the keyboard focus status when keyboard focus feature turned on or off.
index ff03ac9..74fc924 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/common/stage.h>
-#include <dali/public-api/events/touch-event.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>
@@ -284,7 +284,7 @@ struct Decorator::Impl : public ConnectionTracker
   {
     mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
     mHighlightShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
-    SetupTouchEvents();
+    SetupGestures();
   }
 
   /**
@@ -621,7 +621,7 @@ struct Decorator::Impl : public ConnectionTracker
     return true;
   }
 
-  void SetupTouchEvents()
+  void SetupGestures()
   {
     mTapDetector = TapGestureDetector::New();
     mTapDetector.DetectedSignal().Connect( this, &Decorator::Impl::OnTap );
@@ -694,7 +694,7 @@ struct Decorator::Impl : public ConnectionTracker
         grabHandle.actor.Add( grabHandle.grabArea );
         grabHandle.actor.SetColor( mHandleColor );
 
-        grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
+        grabHandle.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
         mTapDetector.Attach( grabHandle.grabArea );
         mPanGestureDetector.Attach( grabHandle.grabArea );
 
@@ -757,7 +757,7 @@ struct Decorator::Impl : public ConnectionTracker
 
         mTapDetector.Attach( primary.grabArea );
         mPanGestureDetector.Attach( primary.grabArea );
-        primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
+        primary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
 
         primary.actor.Add( primary.grabArea );
 
@@ -794,7 +794,7 @@ struct Decorator::Impl : public ConnectionTracker
 
         mTapDetector.Attach( secondary.grabArea );
         mPanGestureDetector.Attach( secondary.grabArea );
-        secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
+        secondary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
 
         secondary.actor.Add( secondary.grabArea );
 
@@ -1179,20 +1179,20 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
-  bool OnGrabHandleTouched( Actor actor, const TouchEvent& event )
+  bool OnGrabHandleTouched( Actor actor, const TouchData& touch )
   {
     // Switch between pressed/release grab-handle images
-    if( event.GetPointCount() > 0 &&
+    if( touch.GetPointCount() > 0 &&
         mHandle[GRAB_HANDLE].actor )
     {
-      const TouchPoint& point = event.GetPoint(0);
+      const PointState::Type state = touch.GetState( 0 );
 
-      if( TouchPoint::Down == point.state )
+      if( PointState::DOWN == state )
       {
         mHandle[GRAB_HANDLE].pressed = true;
       }
-      else if( ( TouchPoint::Up == point.state ) ||
-               ( TouchPoint::Interrupted == point.state ) )
+      else if( ( PointState::UP == state ) ||
+               ( PointState::INTERRUPTED == state ) )
       {
         mHandle[GRAB_HANDLE].pressed = false;
       }
@@ -1204,20 +1204,20 @@ struct Decorator::Impl : public ConnectionTracker
     return true;
   }
 
-  bool OnHandleOneTouched( Actor actor, const TouchEvent& event )
+  bool OnHandleOneTouched( Actor actor, const TouchData& touch )
   {
     // Switch between pressed/release selection handle images
-    if( event.GetPointCount() > 0 &&
+    if( touch.GetPointCount() > 0 &&
         mHandle[LEFT_SELECTION_HANDLE].actor )
     {
-      const TouchPoint& point = event.GetPoint(0);
+      const PointState::Type state = touch.GetState( 0 );
 
-      if( TouchPoint::Down == point.state )
+      if( PointState::DOWN == state )
       {
         mHandle[LEFT_SELECTION_HANDLE].pressed = true;
       }
-      else if( ( TouchPoint::Up == point.state ) ||
-               ( TouchPoint::Interrupted == point.state ) )
+      else if( ( PointState::UP == state ) ||
+               ( PointState::INTERRUPTED == state ) )
       {
         mHandle[LEFT_SELECTION_HANDLE].pressed = false;
         mHandlePreviousCrossed = mHandleCurrentCrossed;
@@ -1231,20 +1231,20 @@ struct Decorator::Impl : public ConnectionTracker
     return true;
   }
 
-  bool OnHandleTwoTouched( Actor actor, const TouchEvent& event )
+  bool OnHandleTwoTouched( Actor actor, const TouchData& touch )
   {
     // Switch between pressed/release selection handle images
-    if( event.GetPointCount() > 0 &&
+    if( touch.GetPointCount() > 0 &&
         mHandle[RIGHT_SELECTION_HANDLE].actor )
     {
-      const TouchPoint& point = event.GetPoint(0);
+      const PointState::Type state = touch.GetState( 0 );
 
-      if( TouchPoint::Down == point.state )
+      if( PointState::DOWN == state )
       {
         mHandle[RIGHT_SELECTION_HANDLE].pressed = true;
       }
-      else if( ( TouchPoint::Up == point.state ) ||
-               ( TouchPoint::Interrupted == point.state ) )
+      else if( ( PointState::UP == state ) ||
+               ( PointState::INTERRUPTED == state ) )
       {
         mHandle[RIGHT_SELECTION_HANDLE].pressed = false;
         mHandlePreviousCrossed = mHandleCurrentCrossed;
index 232360e..ad4ed41 100644 (file)
@@ -38,7 +38,7 @@ class Metrics;
 typedef IntrusivePtr<Metrics> MetricsPtr;
 
 /**
- * @brief A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics.
+ * @brief A wrapper around FontClient used to get metrics.
  */
 class Metrics : public RefObject
 {
@@ -63,26 +63,6 @@ public:
   }
 
   /**
-   * @brief Set the maximum Emoji size.
-   *
-   * @param[in] emojiSize Emoticons will be scaled to fit this size in pixels.
-   */
-  void SetMaxEmojiSize( int emojiSize )
-  {
-    mEmojiSize = emojiSize;
-  }
-
-  /**
-   * @brief Get the maximum Emoji size.
-   *
-   * @return The maximum Emoji size.
-   */
-  int GetMaxEmojiSize() const
-  {
-    return mEmojiSize;
-  }
-
-  /**
    * @brief Query the metrics for a font.
    *
    * @param[in] fontId The ID of the font for the required glyph.
@@ -90,7 +70,7 @@ public:
    */
   void GetFontMetrics( FontId fontId, FontMetrics& metrics )
   {
-    mFontClient.GetFontMetrics( fontId, metrics, mEmojiSize ); // inline for performance
+    mFontClient.GetFontMetrics( fontId, metrics ); // inline for performance
   }
 
   /**
@@ -104,7 +84,7 @@ public:
    */
   bool GetGlyphMetrics( GlyphInfo* array, uint32_t size )
   {
-    return mFontClient.GetGlyphMetrics( array, size, mGlyphType, true, mEmojiSize ); // inline for performance
+    return mFontClient.GetGlyphMetrics( array, size, mGlyphType, true ); // inline for performance
   }
 
 protected:
@@ -121,10 +101,8 @@ private:
    */
   Metrics( TextAbstraction::FontClient& fontClient )
   : mFontClient( fontClient ),
-    mGlyphType( TextAbstraction::BITMAP_GLYPH ),
-    mEmojiSize( 0 )
-  {
-  }
+    mGlyphType( TextAbstraction::BITMAP_GLYPH )
+  {}
 
   // Undefined
   Metrics(const Metrics&);
@@ -136,7 +114,6 @@ private:
 
   TextAbstraction::FontClient mFontClient;
   TextAbstraction::GlyphType mGlyphType;
-  int mEmojiSize;
 };
 
 } // namespace Text
index 1e8abf2..1a72243 100644 (file)
@@ -211,6 +211,19 @@ void MultilanguageSupport::SetScripts( const Vector<Character>& text,
     while( !endOfText &&
            ( TextAbstraction::COMMON == script ) )
     {
+      if( TextAbstraction::EMOJI == currentScriptRun.script )
+      {
+        // Emojis doesn't mix well with characters common to all scripts. Insert the emoji run.
+        scripts.Insert( scripts.Begin() + scriptIndex, currentScriptRun );
+        ++scriptIndex;
+
+        // Initialize the new one.
+        currentScriptRun.characterRun.characterIndex = currentScriptRun.characterRun.characterIndex + currentScriptRun.characterRun.numberOfCharacters;
+        currentScriptRun.characterRun.numberOfCharacters = 0u;
+        currentScriptRun.script = TextAbstraction::UNKNOWN;
+        numberOfAllScriptCharacters = 0u;
+      }
+
       // Count all these characters to be added into a script.
       ++numberOfAllScriptCharacters;
 
@@ -248,7 +261,7 @@ void MultilanguageSupport::SetScripts( const Vector<Character>& text,
         character = *( textBuffer + index );
         script = TextAbstraction::GetCharacterScript( character );
       }
-    }
+    } // end while( !endOfText && ( TextAbstraction::COMMON == script ) )
 
     if( endOfText )
     {
@@ -260,7 +273,8 @@ void MultilanguageSupport::SetScripts( const Vector<Character>& text,
     // Check if it is the first character of a paragraph.
     if( isFirstScriptToBeSet &&
         ( TextAbstraction::UNKNOWN != script ) &&
-        ( TextAbstraction::COMMON != script ) )
+        ( TextAbstraction::COMMON != script ) &&
+        ( TextAbstraction::EMOJI != script ) )
     {
       // Sets the direction of the first valid script.
       isParagraphRTL = TextAbstraction::IsRightToLeftScript( script );
@@ -288,6 +302,13 @@ void MultilanguageSupport::SetScripts( const Vector<Character>& text,
         currentScriptRun.characterRun.numberOfCharacters += numberOfAllScriptCharacters;
         numberOfAllScriptCharacters = 0u;
       }
+      else if( ( TextAbstraction::UNKNOWN == currentScriptRun.script ) &&
+               ( TextAbstraction::EMOJI == script ) )
+      {
+        currentScriptRun.script = TextAbstraction::LATIN;
+        currentScriptRun.characterRun.numberOfCharacters += numberOfAllScriptCharacters;
+        numberOfAllScriptCharacters = 0u;
+      }
 
       if( 0u != currentScriptRun.characterRun.numberOfCharacters )
       {
@@ -435,6 +456,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
   PointSize26Dot6 currentPointSize = defaultPointSize;
   FontId currentFontId = 0u;
   FontId previousFontId = 0u;
+  bool isPreviousEmojiScript = false;
 
   // Whether it's the first set of characters to be validated.
   // Used in case the paragraph starts with characters common to all scripts.
@@ -497,6 +519,23 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
     isValidFont = isValidCachedDefaultFont && ( fontId == cachedDefaultFontId );
 
     bool isCommonScript = false;
+    bool isEmojiScript = TextAbstraction::EMOJI == script;
+
+    if( isEmojiScript && !isPreviousEmojiScript )
+    {
+      if( 0u != currentFontRun.characterRun.numberOfCharacters )
+      {
+        // Store the font run.
+        fonts.Insert( fonts.Begin() + fontIndex, currentFontRun );
+        ++fontIndex;
+      }
+
+      // Initialize the new one.
+      currentFontRun.characterRun.characterIndex = currentFontRun.characterRun.characterIndex + currentFontRun.characterRun.numberOfCharacters;
+      currentFontRun.characterRun.numberOfCharacters = 0u;
+      currentFontRun.fontId = fontId;
+    }
+
 
     // If the given font is not valid, it means either:
     // - there is no cached font for the current script yet or,
@@ -523,7 +562,8 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
       if( isCommonScript )
       {
         if( isValidCachedDefaultFont &&
-            ( isDefault || ( currentFontId == previousFontId ) )  )
+            ( isDefault || ( currentFontId == previousFontId ) ) &&
+            !isEmojiScript )
         {
           // At this point the character common for all scripts has no font assigned.
           // If there is a valid previously cached default font for it, use that one.
@@ -551,7 +591,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
 
           // Emojis are present in many monochrome fonts; prefer color by default.
           if( isValidFont &&
-              ( TextAbstraction::EMOJI == script ) )
+              isEmojiScript )
           {
             const BufferImage bitmap = fontClient.CreateBitmap( fontId, glyphIndex );
 
@@ -611,8 +651,13 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
               // Cache the font.
               if( NULL == defaultFontsPerScript )
               {
-                defaultFontsPerScript = new DefaultFonts();
-                *( defaultFontPerScriptCacheBuffer + script ) = defaultFontsPerScript;
+                defaultFontsPerScript = *( defaultFontPerScriptCacheBuffer + script );
+
+                if( NULL == defaultFontsPerScript )
+                {
+                  defaultFontsPerScript = new DefaultFonts();
+                  *( defaultFontPerScriptCacheBuffer + script ) = defaultFontsPerScript;
+                }
               }
               defaultFontsPerScript->mFonts.PushBack( fontId );
             }
@@ -670,6 +715,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
     // Whether the current character is a new paragraph character.
     isNewParagraphCharacter = TextAbstraction::IsNewParagraph( character );
     previousFontId = currentFontId;
+    isPreviousEmojiScript = isEmojiScript;
   } // end traverse characters.
 
   if( 0u != currentFontRun.characterRun.numberOfCharacters )
index 96a2dc3..3abcccd 100644 (file)
@@ -40,7 +40,6 @@ namespace
 #endif
 
 const float MAX_FLOAT = std::numeric_limits<float>::max();
-const unsigned int POINTS_PER_INCH = 72;
 
 const std::string EMPTY_STRING("");
 
@@ -491,15 +490,6 @@ void Controller::SetDefaultPointSize( float pointSize )
   mImpl->mFontDefaults->mDefaultPointSize = pointSize;
   mImpl->mFontDefaults->sizeDefined = true;
 
-  unsigned int horizontalDpi( 0u );
-  unsigned int verticalDpi( 0u );
-  mImpl->mFontClient.GetDpi( horizontalDpi, verticalDpi );
-
-  // Adjust the metrics if the fixed-size font should be down-scaled
-  int maxEmojiSize( pointSize/POINTS_PER_INCH * verticalDpi );
-  DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultPointSize %p setting MaxEmojiSize %d\n", this, maxEmojiSize );
-  mImpl->mMetrics->SetMaxEmojiSize( maxEmojiSize );
-
   // Clear the font-specific data
   ClearFontData();
 
@@ -1389,17 +1379,18 @@ float Controller::GetHeightForWidth( float width )
   return layoutSize.height;
 }
 
-bool Controller::Relayout( const Size& size )
+Controller::UpdateTextType Controller::Relayout( const Size& size )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f, autoScroll[%s]\n", this, size.width, size.height, (mImpl->mAutoScrollEnabled)?"true":"false"  );
 
+  UpdateTextType updateTextType = NONE_UPDATED;
+
   if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) )
   {
-    bool glyphsRemoved( false );
     if( 0u != mImpl->mVisualModel->mGlyphPositions.Count() )
     {
       mImpl->mVisualModel->mGlyphPositions.Clear();
-      glyphsRemoved = true;
+      updateTextType = MODEL_UPDATED;
     }
 
     // Clear the update info. This info will be set the next time the text is updated.
@@ -1408,7 +1399,7 @@ bool Controller::Relayout( const Size& size )
     // Not worth to relayout if width or height is equal to zero.
     DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout (skipped)\n" );
 
-    return glyphsRemoved;
+    return updateTextType;
   }
 
   // Whether a new size has been set.
@@ -1447,6 +1438,11 @@ bool Controller::Relayout( const Size& size )
                         mImpl->mOperationsPending,
                         layoutSize ) || updated;
 
+  if( updated )
+  {
+    updateTextType = MODEL_UPDATED;
+  }
+
   // Do not re-do any operation until something changes.
   mImpl->mOperationsPending = NO_OPERATION;
 
@@ -1478,14 +1474,17 @@ bool Controller::Relayout( const Size& size )
     }
 
     // Move the cursor, grab handle etc.
-    updated = mImpl->ProcessInputEvents() || updated;
+    if( mImpl->ProcessInputEvents() )
+    {
+      updateTextType = static_cast<UpdateTextType>( updateTextType | DECORATOR_UPDATED );
+    }
   }
 
   // Clear the update info. This info will be set the next time the text is updated.
   mImpl->mTextUpdateInfo.Clear();
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout\n" );
 
-  return updated;
+  return updateTextType;
 }
 
 void Controller::ProcessModifyEvents()
@@ -2657,7 +2656,6 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons
         mImpl->mEventData->mScrollAfterDelete = true;
 
         requestRelayout = true;
-        retrieveCursor = true;
       }
       break;
     }
index e559fad..8517ca5 100644 (file)
@@ -108,6 +108,13 @@ public:
     DONT_UPDATE_INPUT_STYLE
   };
 
+  enum UpdateTextType
+  {
+    NONE_UPDATED      = 0x0,
+    MODEL_UPDATED     = 0x1,
+    DECORATOR_UPDATED = 0x2
+  };
+
   /**
    * @brief Create a new instance of a Controller.
    *
@@ -722,9 +729,10 @@ public:
    *
    * @note UI Controls are expected to minimize calls to this method e.g. call once after size negotiation.
    * @param[in] size A the size of a bounding box to layout text within.
-   * @return True if the text model or decorations were updated.
+   *
+   * @return Whether the text model or decorations were updated.
    */
-  bool Relayout( const Size& size );
+  UpdateTextType Relayout( const Size& size );
 
   /**
    * @brief Process queued events which modify the model.
index ef276bb..0a2c3c8 100644 (file)
@@ -40,6 +40,7 @@
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 #include <dali-toolkit/internal/controls/renderers/color/color-renderer.h>
+#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
 
 namespace Dali
 {
@@ -441,12 +442,16 @@ const std::string& Control::GetStyleName() const
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
-  mImpl->mBackgroundColor = color;
-
   Actor self( Self() );
-  Toolkit::RendererFactory factory = Toolkit::RendererFactory::Get();
-  factory.ResetRenderer( mImpl->mBackgroundRenderer, self, color );
-  mImpl->mBackgroundRenderer.SetDepthIndex( DepthIndex::BACKGROUND );
+  mImpl->mBackgroundColor = color;
+  Property::Map map;
+  map[ RENDERER_TYPE ] = COLOR_RENDERER;
+  map[ "mixColor" ] = color;
+  InitializeControlRenderer( self, mImpl->mBackgroundRenderer, map );
+  if( mImpl->mBackgroundRenderer )
+  {
+    mImpl->mBackgroundRenderer.SetDepthIndex( DepthIndex::BACKGROUND );
+  }
 }
 
 Vector4 Control::GetBackgroundColor() const
@@ -454,25 +459,24 @@ Vector4 Control::GetBackgroundColor() const
   return mImpl->mBackgroundColor;
 }
 
-void Control::SetBackground(const Property::Map& map)
+void Control::SetBackground( const Property::Map& map )
 {
   Actor self( Self() );
-  mImpl->mBackgroundRenderer.RemoveAndReset( self );
-  Toolkit::RendererFactory factory = Toolkit::RendererFactory::Get();
-  mImpl->mBackgroundRenderer = factory.GetControlRenderer( map );
-  if( mImpl->mBackgroundRenderer  && self.OnStage() ) // Request control renderer with a property map might return an empty handle
+  InitializeControlRenderer( self, mImpl->mBackgroundRenderer, map );
+  if( mImpl->mBackgroundRenderer )
   {
     mImpl->mBackgroundRenderer.SetDepthIndex( DepthIndex::BACKGROUND );
-    mImpl->mBackgroundRenderer.SetOnStage( self );
   }
 }
 
 void Control::SetBackgroundImage( Image image )
 {
   Actor self( Self() );
-  Toolkit::RendererFactory factory = Toolkit::RendererFactory::Get();
-  factory.ResetRenderer( mImpl->mBackgroundRenderer, self, image );
-  mImpl->mBackgroundRenderer.SetDepthIndex( DepthIndex::BACKGROUND );
+  InitializeControlRenderer( self, mImpl->mBackgroundRenderer, image );
+  if( mImpl->mBackgroundRenderer )
+  {
+    mImpl->mBackgroundRenderer.SetDepthIndex( DepthIndex::BACKGROUND );
+  }
 }
 
 void Control::ClearBackground()
index 7d98390..d087913 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 = 41;
+const unsigned int TOOLKIT_MICRO_VERSION = 42;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index eef34ab..87b49b5 100644 (file)
  *    <td>Controls for displaying text or text input.</td>
  * </tr>
  * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_flex_container</td>
+ *    <td>FlexContainer is a container for Flexbox layout.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_video_view</td>
+ *    <td>VideoView is a control for video playback and display.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_slider</td>
+ *    <td>Slider is a control to enable sliding an indicator between two values.</td>
+ * </tr>
+ * <tr>
  *    <td>@ref dali_toolkit_managers</td>
  *    <td>Singleton classes for managing application-wide functionalities.</td>
  * </tr>
  *     @defgroup dali_toolkit_controls_video_view Video View
  *     @brief VideoView is a control for video playback and display.
 
+ *     @defgroup dali_toolkit_controls_slider Slider
+ *     @brief Slider is a control to enable sliding an indicator between two values.
+
  *   @}
 
  *   @defgroup dali_toolkit_managers Managers
index d0f8923..300d276 100644 (file)
@@ -79,7 +79,7 @@ public:
     mTagPropertyIndex = mImageView.RegisterProperty( TAG_PROPERTY_NAME, 0, Property::READ_WRITE /* Event-side only, i.e. not animatable */ );
 
     // Connect to the touch-event
-    mImageView.TouchedSignal().Connect( this, &PropertyController::OnTouched );
+    mImageView.TouchSignal().Connect( this, &PropertyController::OnTouched );
 
     // Create text label
     mTagText = Toolkit::TextLabel::New( "0" );
@@ -95,7 +95,7 @@ public:
    * param[in] touch The touch-event
    * return Set to true if the signal was consumed correctly
    */
-  bool OnTouched( Actor actor, const TouchEvent& touch )
+  bool OnTouched( Actor actor, const TouchData& touch )
   {
     int touchedCount = 0;
 
index f360947..98c650d 100644 (file)
@@ -2,25 +2,27 @@
 
 DALi emits several signals to an application to inform it of user actions.
 
-<h2 class="pg">Touch Events</h2>
+<h2 class="pg">Touch</h2>
 
-An application can be notified when a user interacts with the touch screen on the device by connecting to the touch signal provided by Dali::Actor.  This signal will be emitted by DALi whenever the touch occurs within the connected actor's bounds.
+An application can be notified when a user interacts with the touch screen on the device by connecting to the touch signal provided by Dali::Actor.
+This signal will be emitted by DALi whenever the touch occurs within the connected actor's bounds.
 
-Each point on the screen that is currently being touched or where touch has stopped is represented by a Dali::TouchPoint.  This object stores information about the state of the touch point (down, up, motion etc.) and the co-ordinates of the touch.
+Each point on the screen that is currently being touched or where touch has stopped is represented by a point.
+Dali::TouchData stores information about the state of each point (down, up, motion etc.) and the co-ordinates of the touch.
 
-A collection of touch points at a specific moment in time is collated into a Dali::TouchEvent.  When a multi-touch event occurs, each touch point represents the points that are currently being touched or the points where touch has stopped.
+When a multi-touch event occurs, each point represents the points that are currently being touched or the points where touch has stopped.
 
 The following example shows how a connection to a touch event signal can be established:
 
 @code
-bool OnTouch(Actor actor, const TouchEvent& touch)
+bool OnTouch( Dali::Actor actor, const Dali::TouchData& touch )
 {
   bool handled = false;
 
-  switch(touch.GetPointCount())
+  switch( touch.GetPointCount() )
   {
     case 1: // Single touch
-      if (touch.GetPoint(0).GetState == TouchPoint::Down)
+      if ( touch.GetState( 0 ) == Dali::PointState::DOWN )
       {
         // Do action when first touches the touch screen.
         ...
@@ -39,41 +41,45 @@ bool OnTouch(Actor actor, const TouchEvent& touch)
 }
 
 // Elsewhere
-Actor actor = Actor::New();
-actor.SignalTouch().Connect(&OnTouch);
+Dali::Actor actor = Actor::New();
+actor.TouchSignal().Connect( &OnTouch );
 @endcode
 
 The primary touch point is the first point that the user touches.
 
-The touch event is first emitted to the actor which is hit by the primary touch point.  If this hit actor does not handle the event, then the event is offered to the hit actor's parent.  Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.
+The touch signal is first emitted to the actor which is hit by the primary touch point.
+If this hit actor does not handle (consume) the event, then the event is offered to the hit actor's parent.
+Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.
 
-If a parent and child both connect to the Touch signal, then the touch event is first offered to the child.  If it is consumed by the child, then the parent will not be informed.
+If the TouchSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
+If it is consumed by the child's listener, then the parent will not be informed.
 
 <h2 class="pg">Gestures</h2>
 
-A Dali::GestureDetector analyses a stream of touch events and attempts to determine the intention of the user.  An actor is attached to a gesture detector and if the detector recognises a pattern, it will emit a detected signal to the application.
+A Dali::GestureDetector analyses a stream of touch input and attempts to determine the intention of the user.
+An actor is attached to a gesture detector and if the detector recognises a pattern, it will emit a detected signal to the application.
 
-The following gesture detectors are currently supported in Dali:
+The following gesture detectors are currently supported in DALi:
 
+- Dali::LongPressGestureDetector - When the user presses and holds a particular point on the screen for a specified length of time.
 - Dali::PinchGestureDetector - When the user moves two fingers towards or away from each other.
 - Dali::PanGestureDetector - When the user moves one or more fingers in the same direction.
+- Dali::TapGestureDetector - When the user taps the screen.
 
 The example below shows how an application can be notified of a pinch gesture:
 
 @code
-void OnPinch(Actor actor, PinchGesture pinch)
+void OnPinch( Dali::Actor actor, const Dali::PinchGesture& pinch )
 {
   // Scale your actor according to the pinch scale
-  Vector3 newSize = actor.GetCurrentSize() * pinch.GetScale();
+  Vector3 newSize = actor.GetCurrentSize() * pinch.scale;
   actor.SetSize(newSize);
 }
 
 // Elsewhere
-PinchDetector detector = PinchDetector::New();
-detector.Attach(myActor);
-detector.SignalDetected().Connect(&OnPinch);
+Dali::PinchGestureDetector detector = Dali::PinchDetector::New();
+detector.Attach( myActor );
+detector.DetectedSignal().Connect( &OnPinch );
 @endcode
 
- */
-
-// @TODO: Add "Key Events" section
+*/
index 9c4383f..c7b5ddd 100644 (file)
@@ -48,10 +48,10 @@ public:
     stage.Add( mTextLabel );
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch );
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     // quit the application
     mApplication.Quit();
index 7410978..946b4f0 100644 (file)
@@ -137,7 +137,6 @@ Dali::Toolkit::Internal::Control provides several behaviours which are specified
 | Behaviour                            | Description                                                             |
 |--------------------------------------|-------------------------------------------------------------------------|
 | ACTOR_BEHAVIOUR_NONE                 | No behaviour required.                                                  |
-| REQUIRES_TOUCH_EVENTS                | If our control requires [touch events](@ref creating-controls-events).  |
 | REQUIRES_HOVER_EVENTS                | If our control requires [hover events](@ref creating-controls-events).  |
 | REQUIRES_WHEEL_EVENTS                | If our control requires [wheel events](@ref creating-controls-events).  |
 | REQUIRES_STYLE_CHANGE_SIGNALS        | True if need to monitor style change signals such as Theme/Font change. |
@@ -146,25 +145,11 @@ ________________________________________________________________________________
 
 ### Touch, Hover & Wheel Events {#creating-controls-events}
 
-+ A **touch event** is when any touch occurs within the bounds of the custom actor.
++ A **touch** is when any touch occurs within the bounds of the custom actor. Connect to Dali::Actor::TouchSignal().
 + A **hover event** is when a pointer moves within the bounds of a custom actor (e.g. mouse pointer or hover pointer).
 + A **wheel event** is when the mouse wheel (or similar) is moved while hovering over an actor (via a mouse pointer or hover pointer).
  
-If the control should needs to utilise these events, then the correct behaviour flag should be used when constructing the control.
-Then the appropriate method should be overridden.
-~~~{.cpp}
-// C++
-bool MyUIControlImpl::OnTouchEvent( const TouchEvent& event )
-{
-  bool consumed = false;
-
-  // Handle touch event
-
-  // Return true if handled/consumed, false otherwise
-  return consumed;
-}
-~~~
+If the control needs to utilise hover and wheel events, then the correct behaviour flag should be used when constructing the control and then the appropriate method should be overridden.
 ~~~{.cpp}
 // C++
 bool MyUIControlImpl::OnHoverEvent( const HoverEvent& event )
index f3a1df2..d58019f 100644 (file)
@@ -6,9 +6,9 @@ Multi-Touch Events
 
 Touch events are received via signals.
 
-For C++ API see Dali::Actor::TouchedSignal() and Dali::Actor::HoveredSignal() for more details.
+For C++ API see Dali::Actor::TouchSignal() and Dali::Actor::HoveredSignal() for more details.
 
-For JavaScript use actor.connect( "touched", myCallback ) and actor.connect("hovered", myCallback );
+For JavaScript use actor.connect( "touch", myCallback ) and actor.connect("hovered", myCallback );
 
 ### Hit Testing Rules Summary:
 
@@ -115,7 +115,7 @@ Hit Priority of above Actor tree (all overlays): 1 - Lowest. 6 - Highest.
     IF ( TOUCH-SIGNAL-NOT-EMPTY )
     {
       // Only do the emission if touch signal of actor has connections.
-        CONSUMED = TOUCHED-SIGNAL( TOUCH-EVENT )
+        CONSUMED = TOUCH-SIGNAL( TOUCH-DATA )
     }
 
     IF ( NOT-CONSUMED )
index 60a4435..c53bee7 100644 (file)
@@ -174,7 +174,7 @@ $ INFO: DALI:  Event, min 0.04 ms, max 5.27 ms, total (0.1 secs), avg 0.28 ms, s
 ~~~
 
 Inside the event processing, the application may be listening for certain events.
-For example when an actor is touched, some application code may be run in an OnTouchEvent callback.
+For example when an actor is touched, some application code may be run in an OnTouch callback.
 By checking the max times you can check for any spikes that occur when interacting with the application.
 
 Example:
index e2c4de2..5938e53 100644 (file)
@@ -13,15 +13,15 @@ actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
 actor.SetAnchorPoint( Dali::AnchorPoint::CENTER );
 Dali::Stage::GetCurrent().Add( actor );
 ...
-bool OnPressed( Dali::Actor, const TouchEvent& event )
+bool OnPressed( Dali::Actor, const TouchData& touch )
 {
   Dali::Animation anim = Dali::Animation::New( 1.5f );
-  anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 200,-100,0), AlphaFunctions::Bounce );
+  anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 200, -100, 0 ), AlphaFunctions::Bounce );
   anim.play();
   return true; // consume the touch event
 }
 ...
-actor.TouchedSignal().Connect( &OnPressed );
+actor.TouchSignal().Connect( &OnPressed );
 ~~~
 
 */
@@ -34,16 +34,16 @@ actor.parentOrigin = dali.CENTER;
 actor.anchorPoint = dali.CENTER;
 dali.stage.add( actor );
 ...
-function onPressed( actor, touchEvent )
+function onPressed( actor, touch )
 {
   var animOptions = { alpha: "bounce", delay: 0, duration: 15 };
   var anim = new dali.Animation();
-  anim.animateTo( actor, "position", [ 200,-100,0], animOptions );
+  anim.animateTo( actor, "position", [ 200, -100, 0 ], animOptions );
   anim.play();
   return true; // consume the touch event
 }
 ...
-actor.connect( "touched", onPressed );
+actor.connect( "touch", onPressed );
 
 ~~~
 
@@ -76,7 +76,7 @@ actor.connect( "touched", onPressed );
       "parentOrigin": "CENTER",
       "signals" :
       [
-        { "name" : "touched", "action": "play", "animation": "move" }
+        { "name" : "touch", "action": "play", "animation": "move" }
       ]
     }
   ]
index 24da6cf..682ae40 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.41
+Version:    1.1.42
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT