[dali_1.2.47] Merge branch 'devel/master' 53/137753/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 7 Jul 2017 10:21:19 +0000 (11:21 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 7 Jul 2017 10:21:19 +0000 (11:21 +0100)
Change-Id: I52ca97b1d74c8e0d6c26c16260ab32b89ca86a64

51 files changed:
automated-tests/src/dali-toolkit-styling/default-theme.json
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.h
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.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-VideoView.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/builder/builder.cpp
dali-toolkit/devel-api/builder/builder.h
dali-toolkit/devel-api/controls/control-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h
dali-toolkit/devel-api/controls/text-controls/text-field-devel.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/styling/style-manager-devel.cpp [new file with mode: 0644]
dali-toolkit/devel-api/styling/style-manager-devel.h [new file with mode: 0644]
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-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/model3d-view/obj-loader.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.h
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.h
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-font-style.cpp
dali-toolkit/internal/text/text-font-style.h
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/texture-manager.cpp
dali-toolkit/public-api/controls/buttons/button.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
packaging/dali-toolkit.spec

index c9e87f8..6b3ddd1 100644 (file)
@@ -1,4 +1,8 @@
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "constants":
   {
     "CONFIG_SCRIPT_LOG_LEVEL":"NoLogging"
index 521f265..19f812e 100755 (executable)
@@ -83,6 +83,7 @@ LIST(APPEND TC_SOURCES
    dali-toolkit-test-utils/toolkit-tts-player.cpp
    dali-toolkit-test-utils/toolkit-native-image-source.cpp
    dali-toolkit-test-utils/toolkit-video-player.cpp
+   dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp
    dali-toolkit-test-utils/dali-test-suite-utils.cpp
    dali-toolkit-test-utils/dummy-control.cpp
    dali-toolkit-test-utils/mesh-builder.cpp
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp
new file mode 100644 (file)
index 0000000..e2d0855
--- /dev/null
@@ -0,0 +1,54 @@
+
+#include <dali/integration-api/adaptors/trigger-event-interface.h>
+#include <dali/integration-api/adaptors/trigger-event-factory.h>
+#include <dali/public-api/signals/callback.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Toolkit
+{
+
+class TriggerEvent: public Dali::TriggerEventInterface
+{
+public:
+
+  TriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options Options );
+  ~TriggerEvent(){}
+
+  void Trigger();
+
+private:
+  Dali::CallbackBase* mCallback;
+
+};
+
+TriggerEvent::TriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options Options )
+  : mCallback( callback )
+{
+}
+
+void TriggerEvent::Trigger()
+{
+  Dali::CallbackBase::Execute( *mCallback );
+}
+
+} // namespace Toolkit
+
+} // namespace Internal
+
+} // namespace Dali
+
+Dali::TriggerEventInterface* Dali::TriggerEventFactory::CreateTriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options options )
+{
+  return new Dali::Internal::Toolkit::TriggerEvent( callback, options );
+}
+
+void Dali::TriggerEventFactory::DestroyTriggerEvent( Dali::TriggerEventInterface* triggerEventInterface )
+{
+  Dali::Internal::Toolkit::TriggerEvent* triggerEvent( static_cast< Dali::Internal::Toolkit::TriggerEvent *>(triggerEventInterface) );
+  delete triggerEvent;
+}
index 05e66d8..eee723b 100644 (file)
@@ -200,6 +200,10 @@ int VideoPlayer::GetPlayPosition()
   return 0;
 }
 
+void VideoPlayer::SetDisplayArea( DisplayArea area )
+{
+}
+
 void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
 {
 }
@@ -214,5 +218,13 @@ Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
   return Internal::Adaptor::GetImplementation( *this ).mFinishedSignal;
 }
 
+void VideoPlayer::Forward( int millisecond )
+{
+}
+
+void VideoPlayer::Backward( int millisecond )
+{
+}
+
 } // namespace Dali;
 
index 717a243..199fa12 100644 (file)
@@ -87,12 +87,18 @@ public:
 
   int GetPlayPosition();
 
+  void SetDisplayArea( DisplayArea area );
+
   void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
 
   Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation();
 
   Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal();
 
+  void Forward( int millisecond );
+
+  void Backward( int millisecond );
+
 private:
 
   VideoPlayer( Internal::Adaptor::VideoPlayer* internal );
index 60f4a1b..f134be3 100644 (file)
@@ -1820,3 +1820,33 @@ int UtcDaliBuilderActionsWithParams(void)
 
   END_TEST;
 }
+
+int UtcDaliBuilderConfigurationP(void)
+{
+  ToolkitTestApplication application;
+
+  // JSON with a quit event when the actor is touched
+  std::string json(
+      "{\n"
+      "  \"config\":\n"
+      "  {\n"
+      "    \"alwaysShowFocus\":true\n"
+      "  }\n"
+      "}\n"
+  );
+
+  Builder builder = Builder::New();
+  builder.LoadFromString( json );
+
+  Property::Map map = builder.GetConfigurations();
+
+  Dali::Property::Value* pValue = map.Find( "alwaysShowFocus" );
+
+  DALI_TEST_CHECK( pValue );
+
+  bool value = pValue->Get<bool>();
+
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
index 29b7a40..e8198ca 100644 (file)
@@ -77,6 +77,9 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 const char* TEST_IMAGE_FILE_NAME =  "gallery_image_01.jpg";
 const char* TEST_IMAGE_FILE_NAME2 =  "gallery_image_02.jpg";
 
+const char* TEST_IMAGE_1 = TEST_RESOURCE_DIR "/TB-gloss.png";
+const char* TEST_IMAGE_2 = TEST_RESOURCE_DIR "/tb-norm.png";
+
 // resolution: 34*34, pixel format: RGBA8888
 static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png";
 // resolution: 600*600, pixel format: RGB888
@@ -1302,3 +1305,52 @@ int UtcDaliImageViewGetImageN(void)
 
   END_TEST;
 }
+
+
+int UtcDaliImageViewReplaceImage(void)
+{
+  ToolkitTestApplication application;
+
+  gResourceReadySignalFired = false;
+
+  int width = 100;
+  int height = 200;
+  Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
+
+  // Check ImageView with background and main image, to ensure both visuals are marked as loaded
+  ImageView imageView = ImageView::New( TEST_IMAGE_1 );
+
+  DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), false, TEST_LOCATION );
+
+  Toolkit::DevelControl::ResourceReadySignal( imageView ).Connect( &ResourceReadySignal);
+
+  Stage::GetCurrent().Add( imageView );
+
+  application.SendNotification();
+  application.Render(16);
+
+  // loading started, this waits for the loader thread for max 30 seconds
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+
+  gResourceReadySignalFired = false;
+
+  imageView.SetImage(TEST_IMAGE_2);
+
+  application.SendNotification();
+  application.Render(16);
+
+  // loading started, this waits for the loader thread for max 30 seconds
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+
+  END_TEST;
+}
index 16f9fef..25779d5 100644 (file)
@@ -842,6 +842,58 @@ int UtcDaliImageVisualTextureCancelRemoteLoad(void)
   END_TEST;
 }
 
+int UtcDaliImageVisualTextureCancelAsyncLoad(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "Load image asynchronosly, cancel loading, then load again" );
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  Property::Map propertyMap;
+  propertyMap.Insert( Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable( true );
+  TraceCallStack& drawTrace = gl.GetDrawTrace();
+  drawTrace.Enable( true );
+
+  DummyControl actor = DummyControl::New();
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( Control::Property::BACKGROUND, visual );
+
+  Stage::GetCurrent().Add( actor );
+
+  // Cancel loading
+  Stage::GetCurrent().Remove( actor );
+
+  Stage::GetCurrent().Add( actor );
+
+  // Create another visual with the same image
+  visual = factory.CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  dummyImpl.RegisterVisual( Control::Property::BACKGROUND, visual );
+
+  application.SendNotification();
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliImageVisualSetInvalidAsyncImage(void)
 {
   ToolkitTestApplication application;
index 66805cc..e09f7ce 100644 (file)
@@ -97,6 +97,7 @@ const char* const PROPERTY_NAME_LINE_COUNT                           = "lineCoun
 const char* const PROPERTY_NAME_PLACEHOLDER_TEXT                     = "placeholderText";
 const char* const PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR               = "placeholderTextColor";
 const char* const PROPERTY_NAME_ENABLE_SELECTION                     = "enableSelection";
+const char* const PROPERTY_NAME_PLACEHOLDER                          = "placeholder";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
@@ -467,6 +468,7 @@ int UtcDaliTextEditorGetPropertyP(void)
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == DevelTextEditor::Property::ENABLE_SELECTION );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == DevelTextEditor::Property::PLACEHOLDER );
 
   END_TEST;
 }
@@ -773,9 +775,74 @@ int UtcDaliTextEditorSetPropertyP(void)
   editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR, Color::RED );
   DALI_TEST_EQUALS( editor.GetProperty<Vector4>( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR ), Color::RED, TEST_LOCATION );
 
+  // Check the enable selection property
   editor.SetProperty( DevelTextEditor::Property::ENABLE_SELECTION, false );
   DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_SELECTION ), false, TEST_LOCATION );
 
+  // Check the placeholder property with pixel size
+  Property::Map placeholderPixelSizeMapSet;
+  Property::Map placeholderPixelSizeMapGet;
+  Property::Map placeholderFontstyleMap;
+  placeholderPixelSizeMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderPixelSizeMapSet["placeholderColor"] = Color::BLUE;
+  placeholderPixelSizeMapSet["placeholderFontFamily"] = "Arial";
+  placeholderPixelSizeMapSet["placeholderPixelSize"] = 15.0f;
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderPixelSizeMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderPixelSizeMapSet );
+
+  placeholderPixelSizeMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderPixelSizeMapGet.Count(), placeholderPixelSizeMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderPixelSizeMapGet, placeholderPixelSizeMapSet ), true, TEST_LOCATION );
+
+  // Check the placeholder property with point size
+  Property::Map placeholderMapSet;
+  Property::Map placeholderMapGet;
+  placeholderMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderMapSet["placeholderColor"] = Color::RED;
+  placeholderMapSet["placeholderFontFamily"] = "Arial";
+  placeholderMapSet["placeholderPointSize"] = 12.0f;
+
+  // Check the placeholder font style property
+  placeholderFontstyleMap.Clear();
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderFontstyleMap.Insert( "width", "condensed" );
+  placeholderFontstyleMap.Insert( "slant", "italic" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  // Reset font style.
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "weight", "normal" );
+  placeholderFontstyleMap.Insert( "slant", "oblique" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "slant", "roman" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+
+  placeholderFontstyleMap.Clear();
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
index 38bd841..10af18a 100644 (file)
@@ -99,6 +99,7 @@ const char* const PROPERTY_NAME_INPUT_OUTLINE                        = "inputOut
 const char* const PROPERTY_NAME_HIDDEN_INPUT_SETTINGS                = "hiddenInputSettings";
 const char* const PROPERTY_NAME_PIXEL_SIZE                           = "pixelSize";
 const char* const PROPERTY_NAME_ENABLE_SELECTION                     = "enableSelection";
+const char* const PROPERTY_NAME_PLACEHOLDER                          = "placeholder";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
@@ -509,6 +510,7 @@ int UtcDaliTextFieldGetPropertyP(void)
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_HIDDEN_INPUT_SETTINGS ) == DevelTextField::Property::HIDDEN_INPUT_SETTINGS );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == DevelTextField::Property::PIXEL_SIZE );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == DevelTextField::Property::ENABLE_SELECTION );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == DevelTextField::Property::PLACEHOLDER );
 
   END_TEST;
 }
@@ -847,9 +849,74 @@ int UtcDaliTextFieldSetPropertyP(void)
   field.SetProperty( DevelTextField::Property::PIXEL_SIZE, 20.f );
   DALI_TEST_EQUALS( field.GetProperty<float>( DevelTextField::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
+  // Check the enable selection property
   field.SetProperty( DevelTextField::Property::ENABLE_SELECTION, false );
   DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::ENABLE_SELECTION ), false, TEST_LOCATION );
 
+  // Check the placeholder property with pixel size
+  Property::Map placeholderPixelSizeMapSet;
+  Property::Map placeholderPixelSizeMapGet;
+  Property::Map placeholderFontstyleMap;
+  placeholderPixelSizeMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderPixelSizeMapSet["placeholderColor"] = Color::BLUE;
+  placeholderPixelSizeMapSet["placeholderFontFamily"] = "Arial";
+  placeholderPixelSizeMapSet["placeholderPixelSize"] = 15.0f;
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderPixelSizeMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderPixelSizeMapSet );
+
+  placeholderPixelSizeMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderPixelSizeMapGet.Count(), placeholderPixelSizeMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderPixelSizeMapGet, placeholderPixelSizeMapSet ), true, TEST_LOCATION );
+
+  // Check the placeholder property with point size
+  Property::Map placeholderMapSet;
+  Property::Map placeholderMapGet;
+  placeholderMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderMapSet["placeholderColor"] = Color::RED;
+  placeholderMapSet["placeholderFontFamily"] = "Arial";
+  placeholderMapSet["placeholderPointSize"] = 12.0f;
+
+  // Check the placeholder font style property
+  placeholderFontstyleMap.Clear();
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderFontstyleMap.Insert( "width", "condensed" );
+  placeholderFontstyleMap.Insert( "slant", "italic" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  // Reset font style.
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "weight", "normal" );
+  placeholderFontstyleMap.Insert( "slant", "oblique" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "slant", "roman" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+
+  placeholderFontstyleMap.Clear();
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
index 983ac77..884efc4 100644 (file)
@@ -31,6 +31,34 @@ const char* const VOLUME_LEFT( "volumeLeft" );
 const char* const VOLUME_RIGHT( "volumeRight" );
 const char* const RENDERING_TYPE( "renderingTarget" );
 
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  varying mediump vec2 vTexCoord;\n
+  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+    vertexPosition.xyz *= uSize;\n
+    vertexPosition = uMvpMatrix * vertexPosition;\n
+    \n
+    vTexCoord = aPosition + vec2(0.5);\n
+    gl_Position = vertexPosition;\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vTexCoord;\n
+  uniform sampler2D sTexture;\n
+  uniform lowp vec4 uColor;\n
+  \n
+  void main()\n
+  {\n
+    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+  }\n
+);
+
 }
 
 void video_view_startup(void)
@@ -312,3 +340,68 @@ int UtcDaliVideoViewMethodsForRenderType(void)
 
   END_TEST;
 }
+
+int UtcDaliVideoViewCustomShaderForCoverage(void)
+{
+  ToolkitTestApplication application;
+  VideoView videoView = VideoView::New();
+  DALI_TEST_CHECK( videoView );
+
+  Stage::GetCurrent().Add( videoView );
+  videoView.SetProperty( VideoView::Property::VIDEO, "testvideo" );
+
+  Property::Map customShader;
+  customShader.Insert( "vertexShader", VERTEX_SHADER );
+  customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
+
+  Property::Map map;
+  map.Insert( "shader", customShader );
+
+  videoView.SetProperty( VideoView::Property::VIDEO, map );
+
+  Property::Map map2;
+  Property::Value value = videoView.GetProperty( VideoView::Property::VIDEO );
+
+  DALI_TEST_CHECK( !value.Get( map2 ) );
+  END_TEST;
+}
+
+int UtcDaliVideoViewMethodsForCoverage2(void)
+{
+  ToolkitTestApplication application;
+  VideoView videoView = VideoView::New();
+  DALI_TEST_CHECK( videoView );
+
+  Property::Map windowSurfaceTarget;
+
+  windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" );
+
+  Stage::GetCurrent().Add( videoView );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map map;
+  Property::Value value;
+  videoView.SetProperty( VideoView::Property::VIDEO, windowSurfaceTarget );
+
+  value = videoView.GetProperty( VideoView::Property::VIDEO );
+  DALI_TEST_CHECK( value.Get( map ) );
+
+  Property::Value* type = map.Find( RENDERING_TYPE );
+  DALI_TEST_CHECK( type );
+  DALI_TEST_EQUALS( "windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION );
+
+  Vector3 vector(100.0f, 100.0f, 0.0f);
+
+  DALI_TEST_CHECK(vector != videoView.GetCurrentSize());
+  videoView.SetSize( vector );
+
+  application.SendNotification();
+  application.Render();
+
+  // Check the size in the new frame
+  DALI_TEST_CHECK(vector == videoView.GetCurrentSize());
+
+  END_TEST;
+}
index a766f83..c2f73c3 100644 (file)
@@ -118,6 +118,7 @@ develapifocusmanagerdir =       $(develapidir)/focus-manager
 develapiimageloaderdir =        $(develapidir)/image-loader
 develapiscriptingdir =          $(develapidir)/scripting
 develapishadereffectsdir =      $(develapidir)/shader-effects
+develapistylingdir =            $(develapidir)/styling
 develapitransitioneffectsdir =  $(develapidir)/transition-effects
 develapitoolbardir =            $(develapicontrolsdir)/tool-bar
 develapitooltipdir =            $(develapicontrolsdir)/tooltip
@@ -149,6 +150,7 @@ develapivisuals_HEADERS =           $(devel_api_visuals_header_files)
 develapiscripting_HEADERS =         $(devel_api_scripting_header_files)
 develapishadowview_HEADERS =        $(devel_api_shadow_view_header_files)
 develapishadereffects_HEADERS =     $(devel_api_shader_effects_header_files)
+develapistyling_HEADERS =           $(devel_api_styling_header_files)
 develapisuperblurview_HEADERS =     $(devel_api_super_blur_view_header_files)
 develapitoolbar_HEADERS =           $(devel_api_tool_bar_header_files)
 develapitooltip_HEADERS =           $(devel_api_tooltip_header_files)
index 4270b1e..64a08a0 100644 (file)
@@ -64,6 +64,11 @@ void Builder::AddConstant( const std::string& key, const Property::Value& value
   GetImpl(*this).AddConstant( key, value );
 }
 
+const Property::Map& Builder::GetConfigurations() const
+{
+  return GetImpl(*this).GetConfigurations();
+}
+
 const Property::Map& Builder::GetConstants() const
 {
   return GetImpl(*this).GetConstants();
index 530a81a..422a517 100644 (file)
@@ -187,6 +187,14 @@ class DALI_IMPORT_API Builder : public BaseHandle
   void AddConstant( const std::string& key, const Property::Value& value );
 
   /**
+   * @brief Gets all currently defined configurations.
+   *
+   * @pre The Builder has been initialized.
+   * @return A reference to the currently defined configurations.
+   */
+  const Property::Map& GetConfigurations() const;
+
+  /**
    * @brief Gets all currently defined constants.
    *
    * e.g.
index 59fd144..58b76f3 100644 (file)
@@ -46,63 +46,63 @@ ResourceReadySignalType&  ResourceReadySignal( Control& control )
 bool IsResourceReady( const Control& control )
 {
   const Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
-  const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
+  const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
 
-  return controlImpl.IsResourceReady();
+  return controlDataImpl.IsResourceReady();
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual );
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual, depthIndex );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual, depthIndex );
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual, enabled );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual, enabled );
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual, enabled, depthIndex );
 }
 
 void UnregisterVisual( Internal::Control& control, Dali::Property::Index index )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.UnregisterVisual( index );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.UnregisterVisual( index );
 }
 
 Toolkit::Visual::Base GetVisual( const Internal::Control& control, Dali::Property::Index index )
 {
-  const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  return controlImpl.GetVisual( index );
+  const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  return controlDataImpl.GetVisual( index );
 }
 
 void EnableVisual( Internal::Control& control, Dali::Property::Index index, bool enable )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.EnableVisual( index, enable );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.EnableVisual( index, enable );
 }
 
 bool IsVisualEnabled( const Internal::Control& control, Dali::Property::Index index )
 {
-  const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  return controlImpl.IsVisualEnabled( index );
+  const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  return controlDataImpl.IsVisualEnabled( index );
 }
 
 Dali::Animation CreateTransition( Internal::Control& control, const Toolkit::TransitionData& handle )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  return controlImpl.CreateTransition( handle );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  return controlDataImpl.CreateTransition( handle );
 }
 
 
index 6acc30b..e09207c 100644 (file)
@@ -137,7 +137,30 @@ namespace Property
        * @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color.
        * @details name "enableSelection", type bool
        */
-      ENABLE_SELECTION
+      ENABLE_SELECTION,
+
+      /**
+       * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+       *
+       * @code
+       *   Property::Map propertyMap;
+       *   propertyMap["placeholderText"] = "Setting Placeholder Text";
+       *   propertyMap["placeholderColor"] = Color::RED;
+       *   propertyMap["placeholderFontFamily"] = "Arial";
+       *   propertyMap["placeholderPointSize"] = 12.0f;
+       *
+       *   Property::Map fontStyleMap;
+       *   fontstyleMap.Insert( "weight", "bold" );
+       *   fontstyleMap.Insert( "width", "condensed" );
+       *   fontstyleMap.Insert( "slant", "italic" );
+       *   propertyMap["placeholderFontStyle"] = fontStyleMap;
+       *
+       *   editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, propertyMap );
+       * @endcode
+       *
+       * @details name "placeholder", type MAP
+       */
+      PLACEHOLDER
   };
 } // namespace Property
 
index f98ea63..b678508 100644 (file)
@@ -103,7 +103,30 @@ namespace Property
        * @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color.
        * @details name "enableSelection", type bool
        */
-      ENABLE_SELECTION = INPUT_OUTLINE + 3
+      ENABLE_SELECTION = INPUT_OUTLINE + 3,
+
+      /**
+       * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+       *
+       * @code
+       *   Property::Map propertyMap;
+       *   propertyMap["placeholderText"] = "Setting Placeholder Text";
+       *   propertyMap["placeholderColor"] = Color::RED;
+       *   propertyMap["placeholderFontFamily"] = "Arial";
+       *   propertyMap["placeholderPointSize"] = 12.0f;
+       *
+       *   Property::Map fontStyleMap;
+       *   fontstyleMap.Insert( "weight", "bold" );
+       *   fontstyleMap.Insert( "width", "condensed" );
+       *   fontstyleMap.Insert( "slant", "italic" );
+       *   propertyMap["placeholderFontStyle"] = fontStyleMap;
+       *
+       *   field.SetProperty( DevelTextField::Property::PLACEHOLDER, propertyMap );
+       * @endcode
+       *
+       * @details name "placeholder", type MAP
+       */
+      PLACEHOLDER = INPUT_OUTLINE + 4
   };
 } // namespace Property
 
index 64fbb88..7f4308b 100644 (file)
@@ -31,6 +31,7 @@ devel_api_src_files = \
   $(devel_api_src_dir)/image-loader/atlas-upload-observer.cpp \
   $(devel_api_src_dir)/image-loader/image-atlas.cpp \
   $(devel_api_src_dir)/scripting/script.cpp \
+  $(devel_api_src_dir)/styling/style-manager-devel.cpp \
   $(devel_api_src_dir)/transition-effects/cube-transition-cross-effect.cpp \
   $(devel_api_src_dir)/transition-effects/cube-transition-effect.cpp \
   $(devel_api_src_dir)/transition-effects/cube-transition-fold-effect.cpp \
@@ -133,6 +134,9 @@ devel_api_shader_effects_header_files = \
   $(devel_api_src_dir)/shader-effects/motion-blur-effect.h \
   $(devel_api_src_dir)/shader-effects/motion-stretch-effect.h
 
+devel_api_styling_header_files= \
+  $(devel_api_src_dir)/styling/style-manager-devel.h
+
 devel_api_super_blur_view_header_files = \
   $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.h
 
diff --git a/dali-toolkit/devel-api/styling/style-manager-devel.cpp b/dali-toolkit/devel-api/styling/style-manager-devel.cpp
new file mode 100644 (file)
index 0000000..7ac5a64
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
+#include <dali-toolkit/internal/styling/style-manager-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelStyleManager
+{
+
+const Property::Map GetConfigurations( StyleManager styleManager )
+{
+  return GetImpl(styleManager).GetConfigurations();
+}
+
+} // namespace DevelStyleManager
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/devel-api/styling/style-manager-devel.h b/dali-toolkit/devel-api/styling/style-manager-devel.h
new file mode 100644 (file)
index 0000000..faf3c57
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
+#define DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/styling/style-manager.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelStyleManager
+{
+
+
+/**
+ * @brief Gets all currently defined configurations.
+ *
+ * @pre The Builder has been initialized.
+ * @param[in] styleManager The instance of StyleManager
+ * @return A property map to the currently defined configurations
+**/
+DALI_IMPORT_API const Property::Map GetConfigurations( StyleManager styleManager );
+
+} // namespace DevelStyleManager
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
index e4ef639..4a23ed1 100644 (file)
@@ -179,9 +179,10 @@ void Builder::LoadFromString( std::string const& data, Dali::Toolkit::Builder::U
   }
   else
   {
+    // load configuration map
+    LoadConfiguration( *parser.GetRoot(), mConfigurationMap );
     // load constant map (allows the user to override the constants in the json after loading)
     LoadConstants( *parser.GetRoot(), mReplacementMap );
-
     // merge includes
     if( OptionalChild includes = IsChild(*parser.GetRoot(), KEYNAME_INCLUDES) )
     {
@@ -228,6 +229,11 @@ void Builder::AddConstant( const std::string& key, const Property::Value& value
   mReplacementMap[key] = value;
 }
 
+const Property::Map& Builder::GetConfigurations() const
+{
+  return mConfigurationMap;
+}
+
 const Property::Map& Builder::GetConstants() const
 {
   return mReplacementMap;
@@ -773,6 +779,25 @@ Builder::~Builder()
 {
 }
 
+void Builder::LoadConfiguration( const TreeNode& root, Property::Map& intoMap )
+{
+  Replacement replacer(intoMap);
+
+  if( OptionalChild constants = IsChild(root, "config") )
+  {
+    for(TreeNode::ConstIterator iter = (*constants).CBegin();
+        iter != (*constants).CEnd(); ++iter)
+    {
+      Dali::Property::Value property;
+      if( (*iter).second.GetName() )
+      {
+        DeterminePropertyFromNode( (*iter).second, property, replacer );
+        intoMap[ (*iter).second.GetName() ] = property;
+      }
+    }
+  }
+}
+
 void Builder::LoadConstants( const TreeNode& root, Property::Map& intoMap )
 {
   Replacement replacer(intoMap);
index ea0b635..8a90b03 100644 (file)
@@ -95,6 +95,11 @@ public:
   void AddConstant( const std::string& key, const Property::Value& value );
 
   /**
+   * @copydoc Toolkit::Builder::GetConfigurations
+   */
+  const Property::Map& GetConfigurations() const;
+
+  /**
    * @copydoc Toolkit::Builder::GetConstants
    */
   const Property::Map& GetConstants() const;
@@ -257,6 +262,8 @@ private:
 
   void LoadConstants( const TreeNode& root, Property::Map& intoMap );
 
+  void LoadConfiguration( const TreeNode& root, Property::Map& intoMap );
+
   Animation CreateAnimation( const std::string& animationName,
                              const Replacement& replacement,
                              Dali::Actor        sourceActor );
@@ -384,6 +391,7 @@ private:
   LinearConstrainerLut                mLinearConstrainerLut;
   SlotDelegate<Builder>               mSlotDelegate;
   Property::Map                       mReplacementMap;
+  Property::Map                       mConfigurationMap;
   MappingsLut                         mCompleteMappings;
   Dictionary<StylePtr>                mStyles; // State based styles
   Toolkit::Builder::BuilderSignalType mQuitSignal;
index 81fa035..e1d82e3 100644 (file)
@@ -151,6 +151,19 @@ Toolkit::Visual::Base GetVisualByName(
 }
 
 /**
+ * Move visual from source to destination container
+ */
+void MoveVisual( RegisteredVisualContainer::Iterator sourceIter, RegisteredVisualContainer& source, RegisteredVisualContainer& destination )
+{
+   Toolkit::Visual::Base visual = (*sourceIter)->visual;
+   if( visual )
+   {
+     RegisteredVisual* rv = source.Release( sourceIter );
+     destination.PushBack( rv );
+   }
+}
+
+/**
  * Performs actions as requested using the action name.
  * @param[in] object The object on which to perform the action.
  * @param[in] actionName The action to perform.
@@ -344,9 +357,51 @@ void Control::Impl::LongPressDetected(Actor actor, const LongPressGesture& longP
 // Called by a Visual when it's resource is ready
 void Control::Impl::ResourceReady( Visual::Base& object)
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceReady \n");
+
+  // A resource is ready, check if is in the replacement visual container
+  // Iterate through all visuals in replacement container and store indexes of ready visuals
+  Dali::Vector <Property::Index> readyVisuals;
+  Actor self = mControlImpl.Self();
+
+  for( auto replacementVisualIter = mReplacementVisuals.Begin();
+        replacementVisualIter < mReplacementVisuals.End(); ++replacementVisualIter )
+  {
+    const Toolkit::Visual::Base replacementVisual = (*replacementVisualIter)->visual;
+    const Internal::Visual::Base& replacementVisualImpl = Toolkit::GetImplementation( replacementVisual );
+
+    if( replacementVisualImpl.IsResourceReady() )
+    {
+      // Check if new replacement visual (index) is already queued for replacement and swap old for new.
+      RegisteredVisualContainer::Iterator registeredVisualsIter;
+      if( FindVisual( (*replacementVisualIter)->index, mVisuals, registeredVisualsIter ) )
+      {
+        Property::Index readyVisualIndex = (*replacementVisualIter)->index;
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceReady: %d Ready to replace\n", readyVisualIndex );
+        readyVisuals.PushBack( readyVisualIndex );
+        // Remove current shown visual from stage and from registered visuals container
+        Toolkit::GetImplementation((*registeredVisualsIter)->visual).SetOffStage( self );
+        mVisuals.Erase( registeredVisualsIter );
+      }
+    }
+  }
+
+  for( auto readyVisualsIter = readyVisuals.Begin(); readyVisualsIter != readyVisuals.End(); readyVisualsIter++ )
+  {
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceReady: %d Matched\n", (*readyVisualsIter) );
+    // Move new visual to be shown from replacement container into the control's registered visuals container
+    // Replacement visual has already been set on stage when it was added to replacement container
+    RegisteredVisualContainer::Iterator readyReplacementVisual;
+    if( FindVisual( (*readyVisualsIter) , mReplacementVisuals, readyReplacementVisual ) )
+    {
+      MoveVisual( readyReplacementVisual, mReplacementVisuals, mVisuals ); // Erases visual from replacement queue
+    }
+    // A visual has been replaced so control will most likely need relayouting
+    mControlImpl.RelayoutRequest();
+  }
 
   // go through and check if all the visuals are ready, if they are emit a signal
-  for ( RegisteredVisualContainer::ConstIterator visualIter = mVisuals.Begin();
+  for( auto visualIter = mVisuals.Begin();
         visualIter != mVisuals.End(); ++visualIter )
   {
     const Toolkit::Visual::Base visual = (*visualIter)->visual;
@@ -362,7 +417,6 @@ void Control::Impl::ResourceReady( Visual::Base& object)
   // all the visuals are ready
   Dali::Toolkit::Control handle( mControlImpl.GetOwner() );
   mResourceReadySignal.Emit( handle );
-
 }
 
 bool Control::Impl::IsResourceReady() const
@@ -405,33 +459,56 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
 
 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "RegisterVisual:%d \n", index );
+
   bool visualReplaced ( false );
   Actor self = mControlImpl.Self();
 
   if( !mVisuals.Empty() )
   {
-    RegisteredVisualContainer::Iterator iter;
+    RegisteredVisualContainer::Iterator registeredVisualsiter;
     // Check if visual (index) is already registered.  Replace if so.
-    if ( FindVisual( index, mVisuals, iter ) )
+    if( FindVisual( index, mVisuals, registeredVisualsiter ) )
     {
-      if( (*iter)->visual && self.OnStage() )
+      if( (*registeredVisualsiter)->visual )
       {
-        Toolkit::GetImplementation((*iter)->visual).SetOffStage( self );
-      }
+        // Store current visual depth index as may need to set the replacement visual to same depth
+        const int currentDepthIndex = (*registeredVisualsiter)->visual.GetDepthIndex();
 
-      // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
-      if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
-          ( visual.GetDepthIndex() == 0 ) )
-      {
-        const int currentDepthIndex = (*iter)->visual.GetDepthIndex();
-        visual.SetDepthIndex( currentDepthIndex );
-      }
+        // Monitor when the visuals resources are ready
+        StopObservingVisual( (*registeredVisualsiter)->visual );
+        StartObservingVisual( visual );
+
+        if(  self.OnStage() )
+        {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "RegisterVisual Adding visual to replacement Queue: %d \n", index );
+          // Check if visual is currently in the process of being replaced
+          RegisteredVisualContainer::Iterator queuedReplacementVisual;
+          if ( FindVisual( index, mReplacementVisuals, queuedReplacementVisual ) )
+          {
+            // If visual on replacement queue is going to be replaced before it's ready then will be removed from queue (and stage)
+            // Only the the last requested visual will be queued and then displayed.
+            Toolkit::GetImplementation( (*queuedReplacementVisual)->visual ).SetOffStage( self );
+            mReplacementVisuals.Erase(queuedReplacementVisual);
+          }
+          // Add to replacement list
+          mReplacementVisuals.PushBack( new RegisteredVisual( index, visual, ( enabled == VisualState::ENABLED ? true : false ) ) );
+        }
+        else
+        {
+          // Not staged so can just replace registered visual
+          (*registeredVisualsiter)->visual = visual;
+          (*registeredVisualsiter)->enabled = ( enabled == VisualState::ENABLED ) ? true : false;
+        }
 
-      StopObservingVisual( (*iter)->visual );
-      StartObservingVisual( visual );
+        // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
+        if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
+            ( visual.GetDepthIndex() == 0 ) )
+        {
+          visual.SetDepthIndex( currentDepthIndex );
+        }
+      }
 
-      (*iter)->visual = visual;
-      (*iter)->enabled = ( enabled == VisualState::ENABLED ) ? true : false;
       visualReplaced = true;
     }
   }
@@ -458,6 +535,7 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
 
   if( !visualReplaced ) // New registration entry
   {
+    DALI_LOG_INFO( gLogFilter, Debug::Concise, "New Visual registration %d\n", index);
     mVisuals.PushBack( new RegisteredVisual( index, visual, ( enabled == VisualState::ENABLED ? true : false ) ) );
 
     // monitor when the visuals resources are ready
@@ -497,6 +575,7 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
     // Put on stage if enabled and the control is already on the stage
     if( ( enabled == VisualState::ENABLED ) && self.OnStage() )
     {
+      // Visual must be set on stage for the renderer to be created and the ResourceReady triggered.
       Toolkit::GetImplementation(visual).SetOnStage( self );
     }
   }
@@ -532,6 +611,8 @@ Toolkit::Visual::Base Control::Impl::GetVisual( Property::Index index ) const
 
 void Control::Impl::EnableVisual( Property::Index index, bool enable )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Visual (%d)\n", index);
+
   RegisteredVisualContainer::Iterator iter;
   if ( FindVisual( index, mVisuals, iter ) )
   {
index eceaa31..91b8314 100644 (file)
@@ -288,10 +288,13 @@ private:
   /**
    * @brief Adds the visual to the list of registered visuals.
    * @param[in] index The Property index of the visual, used to reference visual
-   * @param[in] visual The visual to register
+   * @param[in,out] visual The visual to register, which can be altered in this function
    * @param[in] enabled false if derived class wants to control when visual is set on stage
    * @param[in] depthIndexValueSet Set to true if the depthIndex has actually been set manually
    * @param[in] depthIndex The visual's depth-index is set to this
+   *
+   * @note Registering a visual with an index that already has a registered visual will replace it. The replacement will
+   *       occur once the replacement visual is ready (loaded).
    */
   void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex = 0 );
 
@@ -329,6 +332,8 @@ public:
   bool mIsKeyboardNavigationSupported :1;  ///< Stores whether keyboard navigation is supported by the control.
   bool mIsKeyboardFocusGroup :1;           ///< Stores whether the control is a focus group.
 
+  RegisteredVisualContainer mReplacementVisuals;         ///< List of visuals that will be used for replacing current visuals.
+
   // Properties - these need to be members of Internal::Control::Impl as they access private methods/data of Internal::Control and Internal::Control::Impl.
   static const PropertyRegistration PROPERTY_1;
   static const PropertyRegistration PROPERTY_2;
index 65e043e..8ced30e 100644 (file)
@@ -87,6 +87,13 @@ Toolkit::ImageView ImageView::New()
 
 /////////////////////////////////////////////////////////////
 
+void ImageView::OnInitialize()
+{
+  // ImageView can relayout in the OnImageReady, alternative to a signal would be to have a upcall from the Control to ImageView
+  Dali::Toolkit::Control handle( GetOwner() );
+  Toolkit::DevelControl::ResourceReadySignal( handle ).Connect( this, &ImageView::OnResourceReady );
+}
+
 void ImageView::SetImage( Image image )
 {
   // Don't bother comparing if we had a visual previously, just drop old visual and create new one
@@ -94,10 +101,13 @@ void ImageView::SetImage( Image image )
   mUrl.clear();
   mPropertyMap.Clear();
 
-  mVisual =  Toolkit::VisualFactory::Get().CreateVisual( image );
-  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual  );
+  Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( image );
+  if (!mVisual)
+  {
+    mVisual = visual;
+  }
 
-  RelayoutRequest();
+  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual  );
 }
 
 void ImageView::SetImage( const Property::Map& map )
@@ -106,11 +116,14 @@ void ImageView::SetImage( const Property::Map& map )
   mPropertyMap = map;
   mUrl.clear();
   mImage.Reset();
+  Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
+  // Don't set mVisual until it is ready and shown. Getters will still use current visual.
+  if (!mVisual)
+  {
+    mVisual = visual;
+  }
 
-  mVisual =  Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
-  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual  );
-
-  RelayoutRequest();
+  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual  );
 }
 
 void ImageView::SetImage( const std::string& url, ImageDimensions size )
@@ -120,10 +133,14 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
   mImage.Reset();
   mPropertyMap.Clear();
 
-  mVisual =  Toolkit::VisualFactory::Get().CreateVisual( url, size );
-  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual );
+  // Don't set mVisual until it is ready and shown. Getters will still use current visual.
+  Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( url, size );
+  if (!mVisual)
+  {
+    mVisual = visual;
+  }
 
-  RelayoutRequest();
+  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual );
 }
 
 Image ImageView::GetImage() const
@@ -205,6 +222,11 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
   }
 }
 
+void ImageView::OnResourceReady( Toolkit::Control control )
+{
+  mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+}
+
 ///////////////////////////////////////////////////////////
 //
 // Properties
index ac76e78..f335ce7 100644 (file)
@@ -123,6 +123,11 @@ public:
 private: // From Control
 
   /**
+   * @copydoc Toolkit::Control::OnInitialize
+   */
+  void OnInitialize();
+
+  /**
    * @copydoc Toolkit::Control::GetNaturalSize
    */
   virtual Vector3 GetNaturalSize();
@@ -143,6 +148,14 @@ private: // From Control
   virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
 private:
+
+  /**
+   * @brief Callback for ResourceReadySignal
+   * param[in] control signal prototype
+   */
+  void OnResourceReady( Toolkit::Control control );
+
+private:
   // Undefined
   ImageView( const ImageView& );
   ImageView& operator=( const ImageView& );
index 6717bab..fca57b4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -364,7 +364,7 @@ bool ObjLoader::LoadObject( char* objBuffer, std::streampos fileSize )
 
   std::string strMatActual;
 
-  std::string input = objBuffer;
+  std::string input( objBuffer, fileSize );
   std::istringstream ss(input);
   ss.imbue( std::locale( "C" ) );
 
@@ -442,7 +442,7 @@ bool ObjLoader::LoadObject( char* objBuffer, std::streampos fileSize )
       }
 
       int numIndices = 0;
-      while( isline >> vet[numIndices] && numIndices < MAX_POINT_INDICES )
+      while( ( numIndices < MAX_POINT_INDICES ) && ( isline >> vet[numIndices] ) )
       {
         numIndices++;
       }
@@ -566,7 +566,7 @@ void ObjLoader::LoadMaterial( char* objBuffer, std::streampos fileSize, std::str
 
   std::string info;
 
-  std::string input = objBuffer;
+  std::string input( objBuffer, fileSize );
   std::istringstream ss(input);
   ss.imbue(std::locale("C"));
 
index 7374138..c7dd2e4 100644 (file)
@@ -919,7 +919,6 @@ Toolkit::Control Popup::CreateBacking()
 
   // Must always be positioned top-left of stage, regardless of parent.
   backing.SetInheritPosition(false);
-  backing.SetAnchorPoint( AnchorPoint::TOP_LEFT );
 
   // Always the full size of the stage.
   backing.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
index 0f4f0e2..53b0683 100644 (file)
@@ -140,6 +140,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "lineCount",
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText",                STRING,    PLACEHOLDER_TEXT                     )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderTextColor",           VECTOR4,   PLACEHOLDER_TEXT_COLOR               )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableSelection",                BOOLEAN,   ENABLE_SELECTION                     )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholder",                    MAP,       PLACEHOLDER                          )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED )
@@ -702,6 +703,15 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+      {
+        const Property::Map* map = value.GetMap();
+        if( map )
+        {
+          impl.mController->SetPlaceholderProperty( *map );
+        }
+        break;
+      }
     } // switch
   } // texteditor
 }
@@ -1071,6 +1081,13 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+      {
+        Property::Map map;
+        impl.mController->GetPlaceholderProperty( map );
+        value = map;
+        break;
+      }
     } //switch
   }
 
index 134d144..1faa17f 100644 (file)
@@ -141,6 +141,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputOutline",
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "hiddenInputSettings",            MAP,       HIDDEN_INPUT_SETTINGS                )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "pixelSize",                      FLOAT,     PIXEL_SIZE                           )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableSelection",                BOOLEAN,   ENABLE_SELECTION                     )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder",                    MAP,       PLACEHOLDER                          )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached",   SIGNAL_MAX_LENGTH_REACHED )
@@ -762,6 +763,15 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::DevelTextField::Property::PLACEHOLDER:
+      {
+        const Property::Map* map = value.GetMap();
+        if( map )
+        {
+          impl.mController->SetPlaceholderProperty( *map );
+        }
+        break;
+      }
     } // switch
   } // textfield
 }
@@ -1148,6 +1158,13 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
+      case Toolkit::DevelTextField::Property::PLACEHOLDER:
+      {
+        Property::Map map;
+        impl.mController->GetPlaceholderProperty( map );
+        value = map;
+        break;
+      }
     } //switch
   }
 
index 1fd4be5..b09de6b 100644 (file)
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/animation/constraint.h>
+#include <dali/devel-api/actors/actor-devel.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 
 namespace Dali
 {
@@ -71,20 +79,72 @@ const char* const RENDERING_TARGET( "renderingTarget" );
 const char* const WINDOW_SURFACE_TARGET( "windowSurfaceTarget" );
 const char* const NATIVE_IMAGE_TARGET( "nativeImageTarget" );
 
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+    vertexPosition.xyz *= uSize;\n
+    gl_Position = uMvpMatrix * vertexPosition;\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  uniform lowp vec4 uColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
+  \n
+  void main()\n
+  {\n
+    gl_FragColor = vec4(mixColor, opacity)*uColor;\n
+  }\n
+);
+
+struct TriggerFunctor
+{
+  TriggerFunctor( TriggerEventInterface* notification )
+  : mNotification( notification )
+  {
+  }
+
+  void operator()( bool& current, const PropertyInputContainer& inputs )
+  {
+    if( mNotification != NULL )
+    {
+      mNotification->Trigger();
+    }
+  }
+
+  TriggerEventInterface* mNotification;
+};
+
 } // anonymous namepsace
 
 VideoView::VideoView()
 : Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
+  mUpdateTriggerPropertyIndex( Property::INVALID_INDEX),
+  mNotification( NULL ),
   mCurrentVideoPlayPosition( 0 ),
   mIsNativeImageTarget( true ),
   mIsPlay( false ),
   mIsPause( false )
 {
   mVideoPlayer = Dali::VideoPlayer::New();
+
+  TriggerEventFactory triggerEventFactory;
+  mNotification = triggerEventFactory.CreateTriggerEvent( MakeCallback(this, &VideoView::UpdateDisplayArea ),
+                                                               TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
 }
 
 VideoView::~VideoView()
 {
+  if( mNotification != NULL )
+  {
+    delete mNotification;
+  }
 }
 
 Toolkit::VideoView VideoView::New()
@@ -105,6 +165,8 @@ void VideoView::OnInitialize()
 
   mVideoPlayer.SetRenderingTarget( nativeImageSourcePtr );
   mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
+
+  mUpdateTriggerPropertyIndex = Self().RegisterProperty( "updateTrigger", true );
 }
 
 void VideoView::SetUrl( const std::string& url )
@@ -151,6 +213,18 @@ void VideoView::SetPropertyMap( Property::Map map )
     }
   }
 
+  Property::Value* target = map.Find( RENDERING_TARGET );
+  std::string targetType;
+
+  if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET )
+  {
+    this->SetWindowSurfaceTarget();
+  }
+  else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET )
+  {
+    this->SetNativeImageTarget();
+  }
+
   RelayoutRequest();
 }
 
@@ -327,25 +401,33 @@ void VideoView::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::VideoView::Property::VIDEO:
       {
         std::string videoUrl;
+        Property::Map map;
+
         if( value.Get( videoUrl ) )
         {
           impl.SetUrl( videoUrl );
         }
-
-        Property::Map map;
-        if( value.Get( map ) )
+        else if( value.Get( map ) )
         {
-          impl.SetPropertyMap( map );
+          Property::Value* shaderValue = map.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
 
-          Property::Value* target = map.Find( RENDERING_TARGET );
-          std::string targetType;
-          if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET )
+          if( map.Count() > 1u || !shaderValue )
           {
-            impl.SetWindowSurfaceTarget();
+            impl.SetPropertyMap( map );
           }
-          else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET )
+          else if( impl.mVisual && map.Count() == 1u && shaderValue )
           {
-            impl.SetNativeImageTarget();
+            Property::Map shaderMap;
+            if( shaderValue->Get( shaderMap ) )
+            {
+              Internal::Visual::Base& visual = Toolkit::GetImplementation( impl.mVisual );
+              visual.SetCustomShader( shaderMap );
+              if( videoView.OnStage() )
+              {
+                visual.SetOffStage( videoView );
+                visual.SetOnStage( videoView );
+              }
+            }
           }
         }
         break;
@@ -519,6 +601,11 @@ void VideoView::SetWindowSurfaceTarget()
     mVisual.Reset();
   }
 
+  Constraint constraint = Constraint::New<bool>( self, mUpdateTriggerPropertyIndex, TriggerFunctor( mNotification ) );
+  constraint.AddSource( Source( self, Actor::Property::POSITION ) );
+  constraint.AddSource( Source( self, Actor::Property::SIZE ) );
+  constraint.Apply();
+
   mVideoPlayer.SetRenderingTarget( Dali::Adaptor::Get().GetNativeWindowHandle() );
   mVideoPlayer.SetUrl( mUrl );
 
@@ -534,6 +621,18 @@ void VideoView::SetWindowSurfaceTarget()
     mVideoPlayer.Pause();
   }
   mVideoPlayer.SetPlayPosition( curPos );
+
+  // For underlay rendering mode, video display area have to be transparent.
+  Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
+  Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+  Renderer renderer = Renderer::New( geometry, shader );
+
+  renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::ZERO );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA, BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ZERO );
+  self.AddRenderer( renderer );
 }
 
 void VideoView::SetNativeImageTarget()
@@ -564,8 +663,26 @@ void VideoView::SetNativeImageTarget()
   mVideoPlayer.SetPlayPosition( curPos );
 }
 
+void VideoView::UpdateDisplayArea()
+{
+  Actor self( Self() );
+
+  bool positionUsesAnchorPoint = self.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >();
+  Vector3 actorSize = self.GetCurrentSize() * self.GetCurrentScale();
+  Vector3 anchorPointOffSet = actorSize * ( positionUsesAnchorPoint ? self.GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
+
+  Vector2 screenPosition = self.GetProperty( DevelActor::Property::SCREEN_POSITION ).Get< Vector2 >();
+
+  mDisplayArea.x = screenPosition.x - anchorPointOffSet.x;
+  mDisplayArea.y = screenPosition.y - anchorPointOffSet.y;
+  mDisplayArea.width = actorSize.x;
+  mDisplayArea.height = actorSize.y;
+
+  mVideoPlayer.SetDisplayArea( mDisplayArea );
+}
+
 } // namespace Internal
 
-} // namespace Toolkit
+} // namespace toolkit
 
 } // namespace Dali
index a662802..130d2c2 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/images/native-image.h>
 #include <dali/devel-api/adaptor-framework/video-player.h>
+#include <dali/integration-api/adaptors/trigger-event-factory.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/image/image-visual.h>
@@ -195,8 +196,22 @@ public:
    */
   static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes );
 
+  /**
+   * Connects a callback function with the object's signals.
+   * @param[in] object The object providing the signal.
+   * @param[in] tracker Used to disconnect the signal.
+   * @param[in] signalName The signal to connect to.
+   * @param[in] functor A newly allocated FunctorDelegate.
+   * @return True if the signal was connected.
+   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the c
+   */
   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
 
+  /*
+   * @brief Updates video display area for window rendering target
+   */
+  void UpdateDisplayArea();
+
 private: // From Control
 
   /**
@@ -249,6 +264,11 @@ private:
   Dali::NativeImage mNativeImage; ///< Native image handle for video rendering by texture streaming
   Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal;
   std::string mUrl;
+  Dali::DisplayArea mDisplayArea;
+
+  Property::Index mUpdateTriggerPropertyIndex;
+  TriggerEventInterface* mNotification;
+
   int mCurrentVideoPlayPosition;
   bool mIsNativeImageTarget;
   bool mIsPlay;
index 15e5366..5225c46 100644 (file)
@@ -29,6 +29,7 @@
 #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/object/property-map.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/integration-api/debug.h>
 
@@ -38,6 +39,8 @@
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
 
 namespace Dali
 {
@@ -116,8 +119,8 @@ KeyboardFocusManager::KeyboardFocusManager()
   mFocusedActorEnterKeySignal(),
   mCurrentFocusActor(),
   mFocusIndicatorActor(),
+  mIsFocusIndicatorEnabled( -1 ),
   mFocusGroupLoopEnabled( false ),
-  mIsFocusIndicatorEnabled( false ),
   mIsWaitingKeyboardFocusChangeCommit( false ),
   mFocusHistory(),
   mSlotDelegate( this ),
@@ -132,10 +135,25 @@ KeyboardFocusManager::~KeyboardFocusManager()
 {
 }
 
+void KeyboardFocusManager::GetConfigurationFromStyleManger()
+{
+    Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+    if( styleManager )
+    {
+      Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
+      mIsFocusIndicatorEnabled = static_cast<int>(config["alwaysShowFocus"].Get<bool>());
+    }
+}
+
 bool KeyboardFocusManager::SetCurrentFocusActor( Actor actor )
 {
   DALI_ASSERT_DEBUG( !mIsWaitingKeyboardFocusChangeCommit && "Calling this function in the PreFocusChangeSignal callback?" );
 
+  if( mIsFocusIndicatorEnabled == -1 )
+  {
+    GetConfigurationFromStyleManger();
+  }
+
   return DoSetCurrentFocusActor( actor );
 }
 
@@ -523,7 +541,7 @@ void KeyboardFocusManager::ClearFocus()
   }
 
   mCurrentFocusActor.Reset();
-  mIsFocusIndicatorEnabled = false;
+  mIsFocusIndicatorEnabled = 0;
 }
 
 void KeyboardFocusManager::SetFocusGroupLoop(bool enabled)
@@ -623,6 +641,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
 
   std::string keyName = event.keyPressedName;
 
+  if( mIsFocusIndicatorEnabled == -1 )
+  {
+    GetConfigurationFromStyleManger();
+  }
+
   bool isFocusStartableKey = false;
 
   if(event.state == KeyEvent::Down)
@@ -634,7 +657,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         if(!mIsFocusIndicatorEnabled)
         {
           // Show focus indicator
-          mIsFocusIndicatorEnabled = true;
+          mIsFocusIndicatorEnabled = 1;
         }
         else
         {
@@ -657,7 +680,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         if(!mIsFocusIndicatorEnabled)
         {
           // Show focus indicator
-          mIsFocusIndicatorEnabled = true;
+          mIsFocusIndicatorEnabled = 1;
         }
         else
         {
@@ -678,7 +701,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -693,7 +716,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -708,7 +731,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -723,7 +746,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -738,7 +761,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -754,7 +777,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
 
       isFocusStartableKey = true;
@@ -765,7 +788,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
 
       isFocusStartableKey = true;
@@ -785,7 +808,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled && !isAccessibilityEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
index 298b3a7..7283b1e 100644 (file)
@@ -165,6 +165,11 @@ private:
   typedef FocusStack::Iterator FocusStackIterator; ///< Define FocusStack::Iterator as FocusStackIterator to navigate FocusStack
 
   /**
+   * Get configuration from StyleManager.
+   */
+  void GetConfigurationFromStyleManger();
+
+  /**
    * Get the focus group of current focused actor.
    * @pre The FocusManager has been initialized.
    * @return A handle to the parent of the current focused actor which is a focus group,
@@ -253,9 +258,9 @@ private:
 
   Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the keyboard focusable actors for highlight
 
-  bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group
+  int mIsFocusIndicatorEnabled; ///< Whether indicator should be shown / hidden when getting focus. It could be enabled when keyboard focus feature is enabled and navigation keys or 'Tab' key are pressed.
 
-  bool mIsFocusIndicatorEnabled:1; ///< Whether indicator should be shown / hidden. It could be enabled when keyboard focus feature enabled and navigation keys or 'Tab' key pressed.
+  bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group
 
   bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet.
 
index ba89d88..df885d9 100644 (file)
@@ -228,15 +228,22 @@ void StyleManager::SetTheme( const std::string& themeFile )
 {
   bool themeLoaded = false;
 
-  mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
-
-  // Always load the default theme first, then merge in the custom theme if present
-  themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
-  mThemeFile = themeFile;
+  if( mThemeFile.compare(DEFAULT_THEME) == 0 && mThemeBuilder )
+  {
+    // We have already loaded the default theme into mThemeBuilder
+  }
+  else
+  {
+    // Reload the default theme
+    mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+    themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+  }
 
   if( themeFile.compare(DEFAULT_THEME) != 0 )
   {
-    themeLoaded = LoadJSON( mThemeBuilder, mThemeFile );
+    // The theme is different to the default: Merge it
+    themeLoaded = LoadJSON( mThemeBuilder, themeFile );
+    mThemeFile = themeFile;
   }
 
   if( themeLoaded )
@@ -254,6 +261,32 @@ void StyleManager::SetTheme( const std::string& themeFile )
   }
 }
 
+const Property::Map StyleManager::GetConfigurations()
+{
+  Property::Map result;
+  if( mThemeBuilder )
+  {
+    result = mThemeBuilder.GetConfigurations();
+  }
+  else
+  {
+    bool themeLoaded = false;
+
+    mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+
+    // Load default theme because this is first try to load stylesheet.
+    themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+    mThemeFile = DEFAULT_THEME;
+
+    if( themeLoaded )
+    {
+      result = mThemeBuilder.GetConfigurations();
+    }
+  }
+
+  return result;
+}
+
 bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut )
 {
   DALI_ASSERT_DEBUG( 0 != filename.length());
index aa514ea..d6bc4a1 100644 (file)
@@ -94,6 +94,11 @@ public: // Public API
   bool GetStyleConstant( const std::string& key, Property::Value& valueOut );
 
   /**
+   * @copydoc Toolkit::StyleManager::GetConfigurations
+   */
+  const Property::Map GetConfigurations();
+
+  /**
    * @brief Apply the theme style to a control.
    *
    * @param[in] control The control to apply style.
index 58893d4..6a90595 100644 (file)
@@ -70,6 +70,7 @@ namespace Text
 EventData::EventData( DecoratorPtr decorator )
 : mDecorator( decorator ),
   mImfManager(),
+  mPlaceholderFont( NULL ),
   mPlaceholderText(),
   mPlaceholderTextActive(),
   mPlaceholderTextInactive(),
@@ -105,7 +106,8 @@ EventData::EventData( DecoratorPtr decorator )
   mScrollAfterDelete( false ),
   mAllTextSelected( false ),
   mUpdateInputStyle( false ),
-  mPasswordInput( false )
+  mPasswordInput( false ),
+  mIsPlaceholderPixelSize( false )
 {
   mImfManager = ImfManager::Get();
 }
@@ -884,8 +886,19 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
       // Get the default font's description.
       TextAbstraction::FontDescription defaultFontDescription;
       TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE;
-      if( NULL != mFontDefaults )
+
+      if( IsShowingPlaceholderText() && ( NULL != mEventData->mPlaceholderFont ) )
+      {
+        // If the placeholder font is set specifically, only placeholder font is changed.
+        defaultFontDescription = mEventData->mPlaceholderFont->mFontDescription;
+        if( mEventData->mPlaceholderFont->sizeDefined )
+        {
+          defaultPointSize = mEventData->mPlaceholderFont->mDefaultPointSize * 64u;
+        }
+      }
+      else if( NULL != mFontDefaults )
       {
+        // Set the normal font and the placeholder font.
         defaultFontDescription = mFontDefaults->mFontDescription;
         defaultPointSize = mFontDefaults->mDefaultPointSize * 64u;
       }
index e9d99f1..f48ce13 100644 (file)
@@ -39,6 +39,7 @@ namespace Text
 
 //Forward declarations
 struct CursorInfo;
+struct FontDefaults;
 
 struct Event
 {
@@ -104,6 +105,7 @@ struct EventData
 
   DecoratorPtr       mDecorator;               ///< Pointer to the decorator.
   ImfManager         mImfManager;              ///< The Input Method Framework Manager.
+  FontDefaults*      mPlaceholderFont;         ///< The placeholder default font.
   std::string        mPlaceholderText;         ///< The text to display when the TextField is empty.
   std::string        mPlaceholderTextActive;   ///< The text to display when the TextField is empty with key-input focus.
   std::string        mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
@@ -155,6 +157,7 @@ struct EventData
   bool mUpdateInputStyle                : 1;   ///< Whether to update the input style after moving the cursor.
   bool mPasswordInput                   : 1;   ///< True if password input is enabled.
   bool mCheckScrollAmount               : 1;   ///< Whether to check scrolled amount after updating the position
+  bool mIsPlaceholderPixelSize          : 1;   ///< True if the placeholder font size is set as pixel size.
 };
 
 struct ModifyEvent
index c472fe6..b94ff3a 100644 (file)
 #include <dali-toolkit/internal/text/character-set-conversion.h>
 #include <dali-toolkit/internal/text/layouts/layout-parameters.h>
 #include <dali-toolkit/internal/text/markup-processor.h>
+#include <dali-toolkit/internal/text/multi-language-support.h>
 #include <dali-toolkit/internal/text/text-controller-impl.h>
 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
+#include <dali-toolkit/internal/text/text-font-style.h>
 
 namespace
 {
@@ -45,6 +47,13 @@ const float MAX_FLOAT = std::numeric_limits<float>::max();
 
 const std::string EMPTY_STRING("");
 
+const char * const PLACEHOLDER_TEXT = "placeholderText";
+const char * const PLACEHOLDER_COLOR = "placeholderColor";
+const char * const PLACEHOLDER_FONT_FAMILY = "placeholderFontFamily";
+const char * const PLACEHOLDER_FONT_STYLE = "placeholderFontStyle";
+const char * const PLACEHOLDER_POINT_SIZE = "placeholderPointSize";
+const char * const PLACEHOLDER_PIXEL_SIZE = "placeholderPixelSize";
+
 float ConvertToEven( float value )
 {
   int intValue(static_cast<int>( value ));
@@ -628,6 +637,33 @@ const std::string& Controller::GetDefaultFontFamily() const
   return EMPTY_STRING;
 }
 
+void Controller::SetPlaceholderFontFamily( const std::string& placeholderTextFontFamily )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.family = placeholderTextFontFamily;
+    DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetPlaceholderFontFamily %s\n", placeholderTextFontFamily.c_str());
+    mImpl->mEventData->mPlaceholderFont->familyDefined = !placeholderTextFontFamily.empty();
+
+    mImpl->RequestRelayout();
+  }
+}
+
+const std::string& Controller::GetPlaceholderFontFamily() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.family;
+  }
+
+  return EMPTY_STRING;
+}
+
 void Controller::SetDefaultFontWeight( FontWeight weight )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -659,6 +695,41 @@ FontWeight Controller::GetDefaultFontWeight() const
   return TextAbstraction::FontWeight::NORMAL;
 }
 
+void Controller::SetPlaceholderTextFontWeight( FontWeight weight )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.weight = weight;
+    mImpl->mEventData->mPlaceholderFont->weightDefined = true;
+
+    mImpl->RequestRelayout();
+  }
+}
+
+bool Controller::IsPlaceholderTextFontWeightDefined() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->weightDefined;
+  }
+  return false;
+}
+
+FontWeight Controller::GetPlaceholderTextFontWeight() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.weight;
+  }
+
+  return TextAbstraction::FontWeight::NORMAL;
+}
+
 void Controller::SetDefaultFontWidth( FontWidth width )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -690,6 +761,41 @@ FontWidth Controller::GetDefaultFontWidth() const
   return TextAbstraction::FontWidth::NORMAL;
 }
 
+void Controller::SetPlaceholderTextFontWidth( FontWidth width )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.width = width;
+    mImpl->mEventData->mPlaceholderFont->widthDefined = true;
+
+    mImpl->RequestRelayout();
+  }
+}
+
+bool Controller::IsPlaceholderTextFontWidthDefined() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->widthDefined;
+  }
+  return false;
+}
+
+FontWidth Controller::GetPlaceholderTextFontWidth() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.width;
+  }
+
+  return TextAbstraction::FontWidth::NORMAL;
+}
+
 void Controller::SetDefaultFontSlant( FontSlant slant )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -721,6 +827,41 @@ FontSlant Controller::GetDefaultFontSlant() const
   return TextAbstraction::FontSlant::NORMAL;
 }
 
+void Controller::SetPlaceholderTextFontSlant( FontSlant slant )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.slant = slant;
+    mImpl->mEventData->mPlaceholderFont->slantDefined = true;
+
+    mImpl->RequestRelayout();
+  }
+}
+
+bool Controller::IsPlaceholderTextFontSlantDefined() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->slantDefined;
+  }
+  return false;
+}
+
+FontSlant Controller::GetPlaceholderTextFontSlant() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.slant;
+  }
+
+  return TextAbstraction::FontSlant::NORMAL;
+}
+
 void Controller::SetDefaultFontSize( float fontSize, FontSizeType type )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -738,20 +879,16 @@ void Controller::SetDefaultFontSize( float fontSize, FontSizeType type )
     }
     case PIXEL_SIZE:
     {
-      // Point size = Pixel size * 72 / DPI
+      // Point size = Pixel size * 72.f / DPI
       unsigned int horizontalDpi = 0u;
       unsigned int verticalDpi = 0u;
       TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
       fontClient.GetDpi( horizontalDpi, verticalDpi );
 
-      mImpl->mFontDefaults->mDefaultPointSize = ( fontSize * 72 ) / horizontalDpi;
+      mImpl->mFontDefaults->mDefaultPointSize = ( fontSize * 72.f ) / static_cast< float >( horizontalDpi );
       mImpl->mFontDefaults->sizeDefined = true;
       break;
     }
-    default:
-    {
-      DALI_ASSERT_ALWAYS( false );
-    }
   }
 
   // Clear the font-specific data
@@ -774,18 +911,97 @@ float Controller::GetDefaultFontSize( FontSizeType type ) const
       }
       case PIXEL_SIZE:
       {
-        // Pixel size = Point size * DPI / 72
+        // Pixel size = Point size * DPI / 72.f
+        unsigned int horizontalDpi = 0u;
+        unsigned int verticalDpi = 0u;
+        TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+        fontClient.GetDpi( horizontalDpi, verticalDpi );
+
+        value = mImpl->mFontDefaults->mDefaultPointSize * static_cast< float >( horizontalDpi ) / 72.f;
+        break;
+      }
+    }
+    return value;
+  }
+
+  return value;
+}
+
+void Controller::SetPlaceholderTextFontSize( float fontSize, FontSizeType type )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    switch( type )
+    {
+      case POINT_SIZE:
+      {
+        mImpl->mEventData->mPlaceholderFont->mDefaultPointSize = fontSize;
+        mImpl->mEventData->mPlaceholderFont->sizeDefined = true;
+        mImpl->mEventData->mIsPlaceholderPixelSize = false; // Font size flag
+        break;
+      }
+      case PIXEL_SIZE:
+      {
+        // Point size = Pixel size * 72.f / DPI
         unsigned int horizontalDpi = 0u;
         unsigned int verticalDpi = 0u;
         TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
         fontClient.GetDpi( horizontalDpi, verticalDpi );
 
-        value = mImpl->mFontDefaults->mDefaultPointSize * horizontalDpi / 72;
+        mImpl->mEventData->mPlaceholderFont->mDefaultPointSize = ( fontSize * 72.f ) / static_cast< float >( horizontalDpi );
+        mImpl->mEventData->mPlaceholderFont->sizeDefined = true;
+        mImpl->mEventData->mIsPlaceholderPixelSize = true; // Font size flag
+        break;
+      }
+    }
+
+    mImpl->RequestRelayout();
+  }
+}
+
+float Controller::GetPlaceholderTextFontSize( FontSizeType type ) const
+{
+  float value = 0.0f;
+  if( NULL != mImpl->mEventData )
+  {
+    switch( type )
+    {
+      case POINT_SIZE:
+      {
+        if( NULL != mImpl->mEventData->mPlaceholderFont )
+        {
+          value = mImpl->mEventData->mPlaceholderFont->mDefaultPointSize;
+        }
+        else
+        {
+          // If the placeholder text font size is not set, then return the default font size.
+          value = GetDefaultFontSize( POINT_SIZE );
+        }
         break;
       }
-      default:
+      case PIXEL_SIZE:
       {
-        DALI_ASSERT_ALWAYS( false );
+        if( NULL != mImpl->mEventData->mPlaceholderFont )
+        {
+          // Pixel size = Point size * DPI / 72.f
+          unsigned int horizontalDpi = 0u;
+          unsigned int verticalDpi = 0u;
+          TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+          fontClient.GetDpi( horizontalDpi, verticalDpi );
+
+          value = mImpl->mEventData->mPlaceholderFont->mDefaultPointSize * static_cast< float >( horizontalDpi ) / 72.f;
+        }
+        else
+        {
+          // If the placeholder text font size is not set, then return the default font size.
+          value = GetDefaultFontSize( PIXEL_SIZE );
+        }
+        break;
       }
     }
     return value;
@@ -1687,6 +1903,86 @@ void Controller::GetHiddenInputOption(Property::Map& options )
   }
 }
 
+void Controller::SetPlaceholderProperty( const Property::Map& map )
+{
+  const Property::Map::SizeType count = map.Count();
+
+  for( Property::Map::SizeType position = 0; position < count; ++position )
+  {
+    KeyValuePair keyValue = map.GetKeyValue( position );
+    Property::Key& key = keyValue.first;
+    Property::Value& value = keyValue.second;
+
+    if( key == PLACEHOLDER_TEXT )
+    {
+      std::string text = "";
+      value.Get( text );
+      SetPlaceholderText( text );
+    }
+    else if( key == PLACEHOLDER_COLOR )
+    {
+      Vector4 textColor;
+      value.Get( textColor );
+      if( GetPlaceholderTextColor() != textColor )
+      {
+        SetPlaceholderTextColor( textColor );
+      }
+    }
+    else if( key == PLACEHOLDER_FONT_FAMILY )
+    {
+      std::string fontFamily = "";
+      value.Get( fontFamily );
+      SetPlaceholderFontFamily( fontFamily );
+    }
+    else if( key == PLACEHOLDER_FONT_STYLE )
+    {
+      SetFontStyleProperty( this, value, Text::FontStyle::PLACEHOLDER );
+    }
+    else if( key == PLACEHOLDER_POINT_SIZE )
+    {
+      float pointSize;
+      value.Get( pointSize );
+      if( !Equals( GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE ), pointSize ) )
+      {
+        SetPlaceholderTextFontSize( pointSize, Text::Controller::POINT_SIZE );
+      }
+    }
+    else if( key == PLACEHOLDER_PIXEL_SIZE )
+    {
+      float pixelSize;
+      value.Get( pixelSize );
+      if( !Equals( GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE ), pixelSize ) )
+      {
+        SetPlaceholderTextFontSize( pixelSize, Text::Controller::PIXEL_SIZE );
+      }
+    }
+  }
+}
+
+void Controller::GetPlaceholderProperty( Property::Map& map )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    map[ PLACEHOLDER_TEXT ] = mImpl->mEventData->mPlaceholderText;
+    map[ PLACEHOLDER_COLOR ] = mImpl->mEventData->mPlaceholderTextColor;
+    map[ PLACEHOLDER_FONT_FAMILY ] = GetPlaceholderFontFamily();
+
+    Property::Value fontStyleMapGet;
+    GetFontStyleProperty( this, fontStyleMapGet, Text::FontStyle::PLACEHOLDER );
+    map[ PLACEHOLDER_FONT_STYLE ] = fontStyleMapGet;
+
+    // Choose font size : POINT_SIZE or PIXEL_SIZE
+    if( !mImpl->mEventData->mIsPlaceholderPixelSize )
+    {
+      map[ PLACEHOLDER_POINT_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE );
+    }
+    else
+    {
+      map[ PLACEHOLDER_PIXEL_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE );
+    }
+  }
+}
+
 // public : Relayout.
 
 Controller::UpdateTextType Controller::Relayout( const Size& size )
index efd6d1a..9c80fc7 100644 (file)
@@ -516,6 +516,19 @@ public: // Default style & Input style
   const std::string& GetDefaultFontFamily() const;
 
   /**
+   * @brief Sets the placeholder text font family.
+   * @param[in] placeholderTextFontFamily The placeholder text font family.
+   */
+  void SetPlaceholderFontFamily( const std::string& placeholderTextFontFamily );
+
+  /**
+   * @brief Retrieves the placeholder text font family.
+   *
+   * @return The placeholder text font family
+   */
+  const std::string& GetPlaceholderFontFamily() const;
+
+  /**
    * @brief Sets the default font weight.
    *
    * @param[in] weight The font weight.
@@ -535,6 +548,27 @@ public: // Default style & Input style
   FontWeight GetDefaultFontWeight() const;
 
   /**
+   * @brief Sets the placeholder text font weight.
+   *
+   * @param[in] weight The font weight
+   */
+  void SetPlaceholderTextFontWeight( FontWeight weight );
+
+  /**
+   * @brief Whether the font's weight has been defined.
+   *
+   * @return True if the placeholder text font weight is defined
+   */
+  bool IsPlaceholderTextFontWeightDefined() const;
+
+  /**
+   * @brief Retrieves the placeholder text font weight.
+   *
+   * @return The placeholder text font weight
+   */
+  FontWeight GetPlaceholderTextFontWeight() const;
+
+  /**
    * @brief Sets the default font width.
    *
    * @param[in] width The font width.
@@ -554,6 +588,27 @@ public: // Default style & Input style
   FontWidth GetDefaultFontWidth() const;
 
   /**
+   * @brief Sets the placeholder text font width.
+   *
+   * @param[in] width The font width
+   */
+  void SetPlaceholderTextFontWidth( FontWidth width );
+
+  /**
+   * @brief Whether the font's width has been defined.
+   *
+   * @return True if the placeholder text font width is defined
+   */
+  bool IsPlaceholderTextFontWidthDefined() const;
+
+  /**
+   * @brief Retrieves the placeholder text font width.
+   *
+   * @return The placeholder text font width
+   */
+  FontWidth GetPlaceholderTextFontWidth() const;
+
+  /**
    * @brief Sets the default font slant.
    *
    * @param[in] slant The font slant.
@@ -573,9 +628,30 @@ public: // Default style & Input style
   FontSlant GetDefaultFontSlant() const;
 
   /**
+   * @brief Sets the placeholder text font slant.
+   *
+   * @param[in] slant The font slant
+   */
+  void SetPlaceholderTextFontSlant( FontSlant slant );
+
+  /**
+   * @brief Whether the font's slant has been defined.
+   *
+   * @return True if the placeholder text font slant is defined
+   */
+  bool IsPlaceholderTextFontSlantDefined() const;
+
+  /**
+   * @brief Retrieves the placeholder text font slant.
+   *
+   * @return The placeholder text font slant
+   */
+  FontSlant GetPlaceholderTextFontSlant() const;
+
+  /**
    * @brief Set the default font size.
    *
-   * @param[in] size The default font size.
+   * @param[in] fontSize The default font size
    * @param[in] type The font size type is point size or pixel size
    */
   void SetDefaultFontSize( float fontSize, FontSizeType type );
@@ -589,6 +665,20 @@ public: // Default style & Input style
   float GetDefaultFontSize( FontSizeType type ) const;
 
   /**
+   * @brief Sets the Placeholder text font size.
+   * @param[in] fontSize The placeholder text font size
+   * @param[in] type The font size type is point size or pixel size
+   */
+  void SetPlaceholderTextFontSize( float fontSize, FontSizeType type );
+
+  /**
+   * @brief Retrieves the Placeholder text font size.
+   * @param[in] type The font size type
+   * @return The placeholder font size
+   */
+  float GetPlaceholderTextFontSize( FontSizeType type ) const;
+
+  /**
    * @brief Sets the text's default color.
    *
    * @param color The default color.
@@ -978,6 +1068,20 @@ public: // Queries & retrieves.
    */
   void GetHiddenInputOption( Property::Map& options );
 
+  /**
+   * @brief Sets the Placeholder Properties.
+   *
+   * @param[in] map The placeholder property map
+   */
+  void SetPlaceholderProperty( const Property::Map& map );
+
+  /**
+   * @brief Retrieves the Placeholder Property map.
+   *
+   * @param[out] map The property map
+   */
+  void GetPlaceholderProperty( Property::Map& map );
+
 public: // Relayout.
 
   /**
index 249157e..8978beb 100644 (file)
@@ -216,6 +216,28 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu
           }
           break;
         }
+        case FontStyle::PLACEHOLDER:
+        {
+          // Sets the placeholder text font's style values.
+          if( !weightDefined ||
+              ( weightDefined && ( controller->GetPlaceholderTextFontWeight() != weight ) ) )
+          {
+            controller->SetPlaceholderTextFontWeight( weight );
+          }
+
+          if( !widthDefined ||
+              ( widthDefined && ( controller->GetPlaceholderTextFontWidth() != width ) ) )
+          {
+            controller->SetPlaceholderTextFontWidth( width );
+          }
+
+          if( !slantDefined ||
+              ( slantDefined && ( controller->GetPlaceholderTextFontSlant() != slant ) ) )
+          {
+            controller->SetPlaceholderTextFontSlant( slant );
+          }
+          break;
+        }
       } // switch
     } // map not empty
     else
@@ -236,6 +258,13 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu
           controller->SetInputFontSlant( TextAbstraction::FontSlant::NONE );
           break;
         }
+        case FontStyle::PLACEHOLDER:
+        {
+          controller->SetPlaceholderTextFontWeight( TextAbstraction::FontWeight::NONE );
+          controller->SetPlaceholderTextFontWidth( TextAbstraction::FontWidth::NONE );
+          controller->SetPlaceholderTextFontSlant( TextAbstraction::FontSlant::NONE );
+          break;
+        }
       } // switch
     } // map.Empty()
   } // controller
@@ -245,7 +274,6 @@ void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, Fon
 {
   if( controller )
   {
-    const bool isDefaultStyle = FontStyle::DEFAULT == type;
     const bool isSetbyString = controller->IsFontStyleSetByString();
 
     bool weightDefined = false;
@@ -255,46 +283,74 @@ void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, Fon
     FontWidth width = TextAbstraction::FontWidth::NONE;
     FontSlant slant = TextAbstraction::FontSlant::NONE;
 
-    if( isDefaultStyle )
+    switch( type )
     {
-      weightDefined = controller->IsDefaultFontWeightDefined();
-      widthDefined = controller->IsDefaultFontWidthDefined();
-      slantDefined = controller->IsDefaultFontSlantDefined();
-
-      if( weightDefined )
+      case FontStyle::DEFAULT:
       {
-        weight = controller->GetDefaultFontWeight();
-      }
+        weightDefined = controller->IsDefaultFontWeightDefined();
+        widthDefined = controller->IsDefaultFontWidthDefined();
+        slantDefined = controller->IsDefaultFontSlantDefined();
 
-      if( widthDefined )
-      {
-        width = controller->GetDefaultFontWidth();
-      }
+        if( weightDefined )
+        {
+          weight = controller->GetDefaultFontWeight();
+        }
 
-      if( slantDefined )
-      {
-        slant = controller->GetDefaultFontSlant();
-      }
-    }
-    else
-    {
-      weightDefined = controller->IsInputFontWeightDefined();
-      widthDefined = controller->IsInputFontWidthDefined();
-      slantDefined = controller->IsInputFontSlantDefined();
+        if( widthDefined )
+        {
+          width = controller->GetDefaultFontWidth();
+        }
 
-      if( weightDefined )
-      {
-        weight = controller->GetInputFontWeight();
+        if( slantDefined )
+        {
+          slant = controller->GetDefaultFontSlant();
+        }
+        break;
       }
-
-      if( widthDefined )
+      case FontStyle::INPUT:
       {
-        width = controller->GetInputFontWidth();
-      }
+        weightDefined = controller->IsInputFontWeightDefined();
+        widthDefined = controller->IsInputFontWidthDefined();
+        slantDefined = controller->IsInputFontSlantDefined();
 
-      if( slantDefined )
+        if( weightDefined )
+        {
+          weight = controller->GetInputFontWeight();
+        }
+
+        if( widthDefined )
+        {
+          width = controller->GetInputFontWidth();
+        }
+
+        if( slantDefined )
+        {
+          slant = controller->GetInputFontSlant();
+        }
+        break;
+      }
+      case FontStyle::PLACEHOLDER:
       {
-        slant = controller->GetInputFontSlant();
+        // The type is FontStyle::PLACEHOLDER
+        weightDefined = controller->IsPlaceholderTextFontWeightDefined();
+        widthDefined = controller->IsPlaceholderTextFontWidthDefined();
+        slantDefined = controller->IsPlaceholderTextFontSlantDefined();
+
+        if( weightDefined )
+        {
+          weight = controller->GetPlaceholderTextFontWeight();
+        }
+
+        if( widthDefined )
+        {
+          width = controller->GetPlaceholderTextFontWidth();
+        }
+
+        if( slantDefined )
+        {
+          slant = controller->GetPlaceholderTextFontSlant();
+        }
+        break;
       }
     }
 
index e74bcfb..4a01d32 100644 (file)
@@ -83,8 +83,9 @@ namespace FontStyle
 {
   enum Type
   {
-    DEFAULT, ///< The default font's style.
-    INPUT    ///< The input font's style.
+    DEFAULT,      ///< The default font's style.
+    INPUT,        ///< The input font's style.
+    PLACEHOLDER   ///< The placeholder text font's style.
   };
 };
 
@@ -101,7 +102,7 @@ void SetFontFamilyProperty( ControllerPtr controller, const Property::Value& val
  *
  * @param[in] controller The text's controller.
  * @param[in] value The value of the font's style.
- * @param[in] type Whether the property is for the default font's style or the input font's style.
+ * @param[in] type Whether the property is for the default font's style, the input font's style or the placeholder font's style.
  *
  */
 void SetFontStyleProperty( ControllerPtr controller, const Property::Value& value, FontStyle::Type type );
@@ -111,7 +112,7 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu
  *
  * @param[in] controller The text's controller.
  * @param[out] value The value of the font's style.
- * @param[in] type Whether the property is for the default font's style or the input font's style.
+ * @param[in] type Whether the property is for the default font's style, the input font's style or the placeholder font's style.
  */
 void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, FontStyle::Type type );
 
index a1da87f..1e95223 100644 (file)
@@ -110,6 +110,9 @@ void SvgVisual::DoSetOnStage( Actor& actor )
 
   // Hold the weak handle of the placement actor and delay the adding of renderer until the svg rasterization is finished.
   mPlacementActor = actor;
+
+  // SVG visual needs it's size set before it can be rasterized hence set ResourceReady once on stage
+  ResourceReady();
 }
 
 void SvgVisual::DoSetOffStage( Actor& actor )
index 3ff4ce8..2b5215a 100644 (file)
@@ -457,6 +457,7 @@ void TextVisual::UpdateRenderer( bool initializeRendererAndTexture )
     }
 
     // Nothing else to do if the relayout size is zero.
+    ResourceReady();
     return;
   }
 
index 0c839ad..7334b48 100644 (file)
@@ -654,12 +654,15 @@ void TextureManager::ObserverDestroyed( TextureUploadObserver* observer )
   for( unsigned int i = 0; i < count; ++i )
   {
     TextureInfo& textureInfo( mTextureInfoContainer[i] );
-    for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin(); j != textureInfo.observerList.End(); ++j )
+    for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin(); j != textureInfo.observerList.End(); )
     {
       if( *j == observer )
       {
-        textureInfo.observerList.Erase( j );
-        break;
+        j = textureInfo.observerList.Erase( j );
+      }
+      else
+      {
+        ++j;
       }
     }
   }
index 2dd17c3..52ebd8f 100644 (file)
@@ -97,7 +97,7 @@ void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
 
 float Button::GetInitialAutoRepeatingDelay() const
 {
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetPositionInheritanceMode() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetInitialAutoRepeatingDelay() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
 
   return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
 }
index 7064c51..3bb9f35 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 46;
+const unsigned int TOOLKIT_MICRO_VERSION = 47;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 7e86b0d..dd06d35 100644 (file)
 //******************************************************************************
 
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "styles":
   {
     "Tooltip":
index 6e1db0b..8612b3c 100644 (file)
 //******************************************************************************
 
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "styles":
   {
     "Tooltip":
index e84bc65..0c48655 100644 (file)
 //******************************************************************************
 
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "styles":
   {
     "TextLabel":
index 8ef63e7..e512fe7 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.46
+Version:    1.2.47
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT