Merge "[3.0] Remove dali csharp codes" into tizen_3.0 accepted/tizen/3.0/common/20161216.124122 accepted/tizen/3.0/ivi/20161216.085508 accepted/tizen/3.0/mobile/20161216.085047 accepted/tizen/3.0/tv/20161216.085248 accepted/tizen/3.0/wearable/20161216.085407 submit/tizen_3.0/20161216.023434 submit/tizen_3.0/20161216.041228 submit/tizen_3.0/20161216.053358
authordongsug.song <dongsug.song@samsung.com>
Tue, 13 Dec 2016 04:29:18 +0000 (20:29 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 13 Dec 2016 04:29:19 +0000 (20:29 -0800)
39 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.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-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/devel-api/visuals/visual-properties-devel.h [new file with mode: 0644]
dali-toolkit/internal/builder/builder-animations.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/text/clipping/text-clipper.cpp [deleted file]
dali-toolkit/internal/text/clipping/text-clipper.h [deleted file]
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/text-control-interface.cpp [deleted file]
dali-toolkit/internal/text/text-control-interface.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-editable-control-interface.h [new file with mode: 0644]
dali-toolkit/internal/text/text-view.cpp
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/public-api/controls/buttons/button.cpp
dali-toolkit/public-api/controls/buttons/button.h
dali-toolkit/public-api/controls/buttons/push-button.cpp
dali-toolkit/public-api/controls/buttons/push-button.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/control.cpp
dali-toolkit/public-api/controls/control.h
dali-toolkit/public-api/controls/image-view/image-view.cpp
dali-toolkit/public-api/controls/image-view/image-view.h

index 7480435..c67f622 100644 (file)
@@ -23,6 +23,8 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/text-control-interface.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -40,7 +42,7 @@ const char* const OPTION_CLIPBOARD("optionClipboard");      // "Clipboard" popup
 
 const Size CONTROL_SIZE( 300.f, 60.f );
 
-class ControlImpl : public ControlInterface
+class ControlImpl : public ControlInterface, public Text::EditableControlInterface
 {
 public:
   ControlImpl()
@@ -80,8 +82,7 @@ int UtcDaliTextController(void)
   ToolkitTestApplication application;
 
   // Creates a text controller.
-  ControlImpl controlImpl;
-  ControllerPtr controller = Controller::New( controlImpl );
+  ControllerPtr controller = Controller::New();
 
   DALI_TEST_CHECK( controller );
 
@@ -95,8 +96,7 @@ int UtcDaliTextControllerEnableCursorBlinking(void)
   ToolkitTestApplication application;
 
   // Creates a text controller.
-  ControlImpl controlImpl;
-  ControllerPtr controller = Controller::New( controlImpl );
+  ControllerPtr controller = Controller::New();
 
   DALI_TEST_CHECK( controller );
 
@@ -131,8 +131,7 @@ int UtcDaliTextControllerImfEvent(void)
   ToolkitTestApplication application;
 
   // Creates a text controller.
-  ControlImpl controlImpl;
-  ControllerPtr controller = Controller::New( controlImpl );
+  ControllerPtr controller = Controller::New();
 
   std::string text;
   ImfManager::ImfEventData imfEvent;
@@ -214,8 +213,7 @@ int UtcDaliTextControllerTextPopupButtonTouched(void)
   ToolkitTestApplication application;
 
   // Creates a text controller.
-  ControlImpl controlImpl;
-  ControllerPtr controller = Controller::New( controlImpl );
+  ControllerPtr controller = Controller::New();
 
   DALI_TEST_CHECK( controller );
 
index 36ab916..4d42843 100644 (file)
@@ -3247,7 +3247,7 @@ int UtcDaliTextLayoutEllipsis02(void)
   };
 
   Size textArea( 100.f, 50.f );
-  Size layoutSize( 100.f, 60.f );
+  Size layoutSize( 100.f, 40.f );
 
   LayoutTextData data =
   {
@@ -3545,7 +3545,7 @@ int UtcDaliTextLayoutEllipsis04(void)
   };
 
   Size textArea( 100.f, 50.f );
-  Size layoutSize( 100.f, 60.f );
+  Size layoutSize( 100.f, 40.f );
 
   LayoutTextData data =
   {
@@ -3575,6 +3575,80 @@ int UtcDaliTextLayoutEllipsis04(void)
   END_TEST;
 }
 
+int UtcDaliTextLayoutEllipsis05(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliTextLayoutEllipsis05");
+
+  const std::string fontLatin( "TizenSans" );
+
+  // Set a known font description
+  FontDescriptionRun fontDescriptionRun01;
+  fontDescriptionRun01.characterRun.characterIndex = 0u;
+  fontDescriptionRun01.characterRun.numberOfCharacters = 51u;
+  fontDescriptionRun01.familyLength = fontLatin.size();
+  fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength];
+  memcpy( fontDescriptionRun01.familyName, fontLatin.c_str(), fontDescriptionRun01.familyLength );
+  fontDescriptionRun01.familyDefined = true;
+  fontDescriptionRun01.weightDefined = false;
+  fontDescriptionRun01.widthDefined = false;
+  fontDescriptionRun01.slantDefined = false;
+  fontDescriptionRun01.sizeDefined = false;
+
+  Vector<FontDescriptionRun> fontDescriptionRuns;
+  fontDescriptionRuns.PushBack( fontDescriptionRun01 );
+
+  struct LineRun line01 =
+  {
+    { 0u, 11u },
+    { 0u, 11u },
+    80.f,
+    15.f,
+    -5.f,
+    0.f,
+    0.f,
+    false,
+    true
+  };
+  Vector<LineRun> lines;
+  lines.PushBack( line01 );
+
+  float positions[] =
+  {
+    1.f, -12.f
+  };
+
+  Size textArea( 100.f, 19.f );
+  Size layoutSize( 100.f, 20.f );
+
+  LayoutTextData data =
+  {
+    "Not enough height.",
+    "Hello world",
+    textArea,
+    1u,
+    fontDescriptionRuns.Begin(),
+    layoutSize,
+    1u,
+    positions,
+    1u,
+    lines.Begin(),
+    LayoutEngine::MULTI_LINE_BOX,
+    0u,
+    11u,
+    true,
+    true
+  };
+
+  if( !LayoutTextTest( data ) )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  tet_result(TET_PASS);
+  END_TEST;
+}
+
 int UtcDaliTextReorderLayout01(void)
 {
   ToolkitTestApplication application;
index 83744f3..f4c43e0 100644 (file)
@@ -1106,15 +1106,10 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  // Check there are the expected number of children ( offscreen root actor, and the offscreen image view
-  DALI_TEST_EQUALS( editor.GetChildCount(), 2u, TEST_LOCATION );
+  // Check there are the expected number of children (the stencil).
+  DALI_TEST_EQUALS( editor.GetChildCount(), 1u, TEST_LOCATION );
 
-  Actor offscreenRoot = editor.GetChildAt( 0u );
-  DALI_TEST_CHECK( offscreenRoot.IsLayer() );
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
-
-  Actor offscreenImage = editor.GetChildAt( 1u );
-  DALI_TEST_CHECK( offscreenImage );
+  Actor stencil = editor.GetChildAt( 0u );
 
   // Create a tap event to touch the text editor.
   application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
@@ -1124,11 +1119,11 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  Actor layer = editor.GetChildAt( 2u );
+  Actor layer = editor.GetChildAt( 1u );
   DALI_TEST_CHECK( layer.IsLayer() );
 
   DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
+  DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
   // Now the text editor has the focus, so it can handle the key events.
   application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
@@ -1140,16 +1135,13 @@ int utcDaliTextEditorEvent02(void)
 
   // Checks the cursor and the renderer have been created.
   DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 2u, TEST_LOCATION ); // The camera actor and the renderer
+  DALI_TEST_EQUALS( stencil.GetChildCount(), 1u, TEST_LOCATION ); // The renderer
 
   Control cursor = Control::DownCast( layer.GetChildAt( 0u ) );
   DALI_TEST_CHECK( cursor );
 
-  CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
-  DALI_TEST_CHECK( camera );
-
-  // The offscreen root actor has a container with all the actors which contain the text renderers.
-  Actor container = offscreenRoot.GetChildAt( 1u );
+  // The stencil actor has a container with all the actors which contain the text renderers.
+  Actor container = stencil.GetChildAt( 0u );
   for( unsigned int index = 0; index < container.GetChildCount(); ++index )
   {
     Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
@@ -1223,7 +1215,7 @@ int utcDaliTextEditorEvent02(void)
   DALI_TEST_EQUALS( position2, position6, TEST_LOCATION );// Should be in the same position2.
 
   // Should not be a renderer.
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor only.
+  DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1280,22 +1272,18 @@ int utcDaliTextEditorEvent03(void)
   application.SendNotification();
   application.Render();
 
-  // The offscreen root actor should have three actors: the camera, a renderer and the highlight actor.
-  Actor offscreenRoot = editor.GetChildAt( 0u );
-  DALI_TEST_CHECK( offscreenRoot.IsLayer() );
-
-  CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
-  DALI_TEST_CHECK( camera );
+  // The stencil actor should have two actors: the renderer and the highlight actor.
+  Actor stencil = editor.GetChildAt( 0u );
 
-  // The offscreen root actor has a container with all the actors which contain the text renderers.
-  Actor container = offscreenRoot.GetChildAt( 1u );
+  // The stencil actor has a container with all the actors which contain the text renderers.
+  Actor container = stencil.GetChildAt( 0u );
   for( unsigned int index = 0; index < container.GetChildCount(); ++index )
   {
     Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
     DALI_TEST_CHECK( renderer );
   }
 
-  Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
+  Renderer highlight = stencil.GetChildAt( 1u ).GetRendererAt( 0u );
   DALI_TEST_CHECK( highlight );
 
   END_TEST;
index 0335e4e..40d49a7 100644 (file)
@@ -520,7 +520,10 @@ int UtcDaliTextFieldSetPropertyP(void)
   DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::MAX_LENGTH ), maxNumberOfCharacters, TEST_LOCATION );
 
   // Check exceed policy
-  // Set a different exceed policy is not implemented.
+  field.SetProperty( TextField::Property::EXCEED_POLICY, Dali::Toolkit::TextField::EXCEED_POLICY_CLIP );
+  DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::EXCEED_POLICY ), static_cast<int>( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP ), TEST_LOCATION );
+  field.SetProperty( TextField::Property::EXCEED_POLICY, Dali::Toolkit::TextField::EXCEED_POLICY_ORIGINAL );
+  DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::EXCEED_POLICY ), static_cast<int>( Dali::Toolkit::TextField::EXCEED_POLICY_ORIGINAL ), TEST_LOCATION );
 
   // Check that the Alignment properties can be correctly set
   field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "END" );
@@ -1330,15 +1333,11 @@ int utcDaliTextFieldEvent02(void)
   application.SendNotification();
   application.Render();
 
-  // Check there are the expected number of children ( offscreen root actor, and the offscreen image view
-  DALI_TEST_EQUALS( field.GetChildCount(), 2u, TEST_LOCATION );
+  // Check there are the expected number of children ( stencil ).
+  DALI_TEST_EQUALS( field.GetChildCount(), 1u, TEST_LOCATION );
 
-  Actor offscreenRoot = field.GetChildAt( 0u );
-  DALI_TEST_CHECK( offscreenRoot.IsLayer() );
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
-
-  Actor offscreenImage = field.GetChildAt( 1u );
-  DALI_TEST_CHECK( offscreenImage );
+  Actor stencil = field.GetChildAt( 0u );
+  DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
   // Create a tap event to touch the text field.
   application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
@@ -1348,11 +1347,11 @@ int utcDaliTextFieldEvent02(void)
   application.SendNotification();
   application.Render();
 
-  Actor layer = field.GetChildAt( 2u );
+  Actor layer = field.GetChildAt( 1u );
   DALI_TEST_CHECK( layer.IsLayer() );
 
   DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
+  DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
   // Now the text field has the focus, so it can handle the key events.
   application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
@@ -1364,16 +1363,13 @@ int utcDaliTextFieldEvent02(void)
 
   // Checks the cursor and the renderer have been created.
   DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 2u, TEST_LOCATION ); // The camera actor and the renderer
+  DALI_TEST_EQUALS( stencil.GetChildCount(), 1u, TEST_LOCATION ); // The renderer
 
   Control cursor = Control::DownCast( layer.GetChildAt( 0u ) );
   DALI_TEST_CHECK( cursor );
 
-  CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
-  DALI_TEST_CHECK( camera );
-
   // The offscreen root actor has a container with all the actors which contain the text renderers.
-  Actor container = offscreenRoot.GetChildAt( 1u );
+  Actor container = stencil.GetChildAt( 0u );
   for( unsigned int index = 0; index < container.GetChildCount(); ++index )
   {
     Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
@@ -1447,7 +1443,7 @@ int utcDaliTextFieldEvent02(void)
   DALI_TEST_EQUALS( position2, position6, TEST_LOCATION );// Should be in the same position2.
 
   // Should not be a renderer.
-  DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor only.
+  DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1494,22 +1490,18 @@ int utcDaliTextFieldEvent03(void)
   application.SendNotification();
   application.Render();
 
-  // The offscreen root actor should have three actors: the camera, a renderer and the highlight actor.
-  Actor offscreenRoot = field.GetChildAt( 1u );
-  DALI_TEST_CHECK( offscreenRoot.IsLayer() );
-
-  CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
-  DALI_TEST_CHECK( camera );
+  // The offscreen root actor should have two actors: the renderer and the highlight actor.
+  Actor stencil = field.GetChildAt( 0u );
 
   // The offscreen root actor has a container with all the actors which contain the text renderers.
-  Actor container = offscreenRoot.GetChildAt( 1u );
+  Actor container = stencil.GetChildAt( 0u );
   for( unsigned int index = 0; index < container.GetChildCount(); ++index )
   {
     Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
     DALI_TEST_CHECK( renderer );
   }
 
-  Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
+  Renderer highlight = stencil.GetChildAt( 1u ).GetRendererAt( 0u );
   DALI_TEST_CHECK( highlight );
 
   END_TEST;
@@ -1640,7 +1632,7 @@ int utcDaliTextFieldEvent05(void)
   SendPan(application, Gesture::Finished, pos);
   Wait(application, RENDER_FRAME_INTERVAL);
 
-  Actor offscreenRoot = field.GetChildAt( 1u );
+  Actor stencil = field.GetChildAt( 1u );
   END_TEST;
 }
 
index 39778f7..5f9a710 100644 (file)
@@ -413,3 +413,35 @@ int UtcDaliToolkitTextlabelScrollingP(void)
 
   END_TEST;
 }
+
+int UtcDaliToolkitTextlabelEllipsis(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextlabelEllipsis");
+
+  TextLabel label = TextLabel::New("Hello world");
+  DALI_TEST_CHECK( label );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+  Stage::GetCurrent().Add( label );
+
+  // Turn on all the effects
+  label.SetAnchorPoint( AnchorPoint::CENTER );
+  label.SetParentOrigin( ParentOrigin::CENTER );
+  label.SetSize( 360.0f, 10.f );
+
+  try
+  {
+    // Render the text.
+    application.SendNotification();
+    application.Render();
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
index d82277d..ed906ae 100644 (file)
@@ -1012,3 +1012,61 @@ int UtcDaliVisualWireframeVisual(void)
   END_TEST;
 }
 
+int UtcDaliVisualPremultipliedAlpha(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualPremultipliedAlpha" );
+
+  VisualFactory factory = VisualFactory::Get();
+
+  // image visual, test default value ( false )
+  {
+    Visual::Base imageVisual = factory.CreateVisual(
+          Property::Map()
+          .Add( Visual::Property::TYPE, Visual::IMAGE )
+          .Add( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ) );
+
+    Dali::Property::Map visualMap;
+    imageVisual.CreatePropertyMap( visualMap );
+    Property::Value* value = visualMap.Find( DevelVisual::Property::PREMULTIPLIED_ALPHA );
+
+    // test values
+    DALI_TEST_CHECK( value );
+    DALI_TEST_EQUALS( value->Get<bool>(), false, TEST_LOCATION );
+  }
+
+  // image visual, override premultiplied
+  {
+    Visual::Base imageVisual = factory.CreateVisual(
+          Property::Map()
+          .Add( Visual::Property::TYPE, Visual::IMAGE )
+          .Add( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME )
+          .Add( DevelVisual::Property::PREMULTIPLIED_ALPHA, true ) );
+
+    Dali::Property::Map visualMap;
+    imageVisual.CreatePropertyMap( visualMap );
+    Property::Value* value = visualMap.Find( DevelVisual::Property::PREMULTIPLIED_ALPHA );
+
+    // test values
+    DALI_TEST_CHECK( value );
+    DALI_TEST_EQUALS( value->Get<bool>(), true, TEST_LOCATION);
+  }
+
+  // svg visual ( premultiplied alpha by default is true )
+  {
+    Visual::Base imageVisual = factory.CreateVisual(
+          Property::Map()
+          .Add( Visual::Property::TYPE, Visual::IMAGE )
+          .Add( ImageVisual::Property::URL, TEST_SVG_FILE_NAME ) );
+
+    Dali::Property::Map visualMap;
+    imageVisual.CreatePropertyMap( visualMap );
+    Property::Value* value = visualMap.Find( DevelVisual::Property::PREMULTIPLIED_ALPHA );
+
+    // test values
+    DALI_TEST_CHECK( value );
+    DALI_TEST_EQUALS( value->Get<bool>(), true, TEST_LOCATION );
+  }
+
+  END_TEST;
+}
diff --git a/dali-toolkit/devel-api/visuals/visual-properties-devel.h b/dali-toolkit/devel-api/visuals/visual-properties-devel.h
new file mode 100644 (file)
index 0000000..8f7248f
--- /dev/null
@@ -0,0 +1,135 @@
+#ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelVisual
+{
+
+/**
+ * @brief All the visual types.
+ */
+enum Type
+{
+  BORDER    = Dali::Toolkit::Visual::BORDER,
+  COLOR     = Dali::Toolkit::Visual::COLOR,
+  GRADIENT  = Dali::Toolkit::Visual::GRADIENT,
+  IMAGE     = Dali::Toolkit::Visual::IMAGE,
+  MESH      = Dali::Toolkit::Visual::MESH,
+  PRIMITIVE = Dali::Toolkit::Visual::PRIMITIVE,
+  WIREFRAME = Dali::Toolkit::Visual::WIREFRAME,
+
+  TEXT      = WIREFRAME + 1, ///< Renders text.
+};
+
+namespace Property
+{
+
+enum Type
+{
+  TYPE   = Dali::Toolkit::Visual::Property::TYPE,
+  SHADER = Dali::Toolkit::Visual::Property::SHADER,
+
+  /**
+   * @brief The transform used by the visual.
+   * @details Name "transform", type Property::Map.
+
+   * @note Optional.
+   * @see DevelVisual::Transform::Property
+   */
+  TRANSFORM = SHADER + 1, // Dali::Toolkit::Visual::Property::SHADER + 1
+
+  /**
+   * @brief Enables/disables premultiplied alpha.
+   * The premultiplied alpha is false by default unless this behaviour is modified
+   * by the derived Visual type.
+
+   * @details Name "premultipliedAlpha", type Property::Boolean.
+
+   * @note Optional.
+   */
+  PREMULTIPLIED_ALPHA = SHADER + 2, // Dali::Toolkit::Visual::Property::SHADER + 2
+};
+
+} //namespace Property
+
+namespace Transform
+{
+
+namespace Property
+{
+
+enum Type
+{
+  /**
+   * @brief Offset of the visual. It can be either relative (percentage of the parent)
+   * or absolute (in world units).
+   * @details Name "offset", type Property::VECTOR2
+   */
+  OFFSET,
+
+  /**
+   * @brief Size of the visual. It can be either relative (percentage of the parent)
+   * or absolute (in world units).
+   * @details Name "size", type Property::VECTOR2
+   */
+  SIZE,
+
+  /**
+   * @brief The origin of the visual within its control area.
+   * @details Name "origin", type Align::Type (Property::INTEGER) or Property::STRING.
+   * @see Toolkit::Align
+   */
+  ORIGIN,
+
+  /**
+   * @brief The anchor-point of the visual
+   * @details Name "anchorPoint", type Align::Type (Property::INTEGER) or Property::STRING.
+   * @see Toolkit::Align
+   */
+  ANCHOR_POINT,
+
+  /**
+   * @brief Indicates which components of the offset and size are relative
+   * (percentage of the parent) or absolute (in world units).
+   * 0 indicates the component is relative, and 1 absolute.
+   * @details Name "offsetSizeMode", type Property::VECTOR4
+   */
+  OFFSET_SIZE_MODE
+};
+
+} //namespace Property
+
+} // namespace Transform
+
+} // namespace DevelVisual
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
index b16235f..dce9b61 100644 (file)
@@ -231,12 +231,6 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D
             DALI_SCRIPT_WARNING( "Cannot find property on object\n" );
             continue;
         }
-
-        if( propIndex == Property::INVALID_INDEX)
-        {
-          DALI_ASSERT_ALWAYS( propIndex != Property::INVALID_INDEX && "Animation must specify a valid property" );
-          continue;
-        }
       }
 
       // these are the defaults
index ddcb8d5..d0d0836 100644 (file)
@@ -31,7 +31,9 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/text/rendering-backend.h>
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
 #include <dali-toolkit/internal/text/text-effects-style.h>
 #include <dali-toolkit/internal/text/text-font-style.h>
@@ -933,7 +935,7 @@ void TextEditor::OnInitialize()
 {
   Actor self = Self();
 
-  mController = Text::Controller::New( *this );
+  mController = Text::Controller::New( this, this );
 
   mDecorator = Text::Decorator::New( *mController,
                                      *mController );
@@ -980,6 +982,24 @@ void TextEditor::OnInitialize()
   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
   self.OnStageSignal().Connect( this, &TextEditor::OnStageConnect );
+
+  // Creates an extra control to be used as stencil buffer.
+  mStencil = Control::New();
+  mStencil.SetAnchorPoint( AnchorPoint::CENTER );
+  mStencil.SetParentOrigin( ParentOrigin::CENTER );
+
+  // Creates a background visual. Even if the color is transparent it updates the stencil.
+  Property::Map backGroundMap;
+  backGroundMap[Toolkit::Visual::Property::TYPE] = Visual::COLOR;
+  backGroundMap[ColorVisual::Property::MIX_COLOR] = Color::TRANSPARENT;
+
+  mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND, backGroundMap );
+
+  // Enable the clipping property.
+  mStencil.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+  mStencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+  self.Add( mStencil );
 }
 
 void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
@@ -1042,7 +1062,6 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
       mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
     }
 
-    EnableClipping( true, size );
     RenderText( updateTextType );
   }
 
@@ -1068,7 +1087,6 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
 void TextEditor::RenderText( Text::Controller::UpdateTextType updateTextType )
 {
-  Actor self = Self();
   Actor renderableActor;
 
   if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
@@ -1091,39 +1109,19 @@ void TextEditor::RenderText( Text::Controller::UpdateTextType updateTextType )
 
     mRenderableActor.SetPosition( scrollOffset.x, scrollOffset.y );
 
-    Actor clipRootActor;
-    if( mClipper )
-    {
-      clipRootActor = mClipper->GetRootActor();
-    }
+    // Make sure the actors are parented correctly with/without clipping
+    Actor self = mStencil ? mStencil : Self();
 
     for( std::vector<Actor>::const_iterator it = mClippingDecorationActors.begin(),
            endIt = mClippingDecorationActors.end();
          it != endIt;
          ++it )
     {
-      Actor actor = *it;
-
-      if( clipRootActor )
-      {
-        clipRootActor.Add( actor );
-      }
-      else
-      {
-        self.Add( actor );
-      }
+      self.Add( *it );
     }
     mClippingDecorationActors.clear();
 
-    // Make sure the actor is parented correctly with/without clipping
-    if( clipRootActor )
-    {
-      clipRootActor.Add( mRenderableActor );
-    }
-    else
-    {
-      self.Add( mRenderableActor );
-    }
+    self.Add( mRenderableActor );
   }
 }
 
@@ -1235,21 +1233,6 @@ bool TextEditor::OnKeyEvent( const KeyEvent& event )
   return mController->KeyEvent( event );
 }
 
-void TextEditor::AddDecoration( Actor& actor, bool needsClipping )
-{
-  if( actor )
-  {
-    if( needsClipping )
-    {
-      mClippingDecorationActors.push_back( actor );
-    }
-    else
-    {
-      Self().Add( actor );
-    }
-  }
-}
-
 void TextEditor::RequestTextRelayout()
 {
   RelayoutRequest();
@@ -1261,6 +1244,11 @@ void TextEditor::TextChanged()
   mTextChangedSignal.Emit( handle );
 }
 
+void TextEditor::MaxLengthReached()
+{
+  // Nothing to do as TextEditor doesn't emit a max length reached signal.
+}
+
 void TextEditor::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
 {
   Dali::Toolkit::TextEditor handle( GetOwner() );
@@ -1315,9 +1303,19 @@ void TextEditor::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
   mInputStyleChangedSignal.Emit( handle, editorInputStyleMask );
 }
 
-void TextEditor::MaxLengthReached()
+void TextEditor::AddDecoration( Actor& actor, bool needsClipping )
 {
-  // Nothing to do as TextEditor doesn't emit a max length reached signal.
+  if( actor )
+  {
+    if( needsClipping )
+    {
+      mClippingDecorationActors.push_back( actor );
+    }
+    else
+    {
+      Self().Add( actor );
+    }
+  }
 }
 
 void TextEditor::OnStageConnect( Dali::Actor actor )
@@ -1353,34 +1351,6 @@ void TextEditor::GetHandleImagePropertyValue(  Property::Value& value, Text::Han
   }
 }
 
-void TextEditor::EnableClipping( bool clipping, const Vector2& size )
-{
-  if( clipping )
-  {
-    // Not worth to created clip actor if width or height is equal to zero.
-    if( size.width > Math::MACHINE_EPSILON_1000 && size.height > Math::MACHINE_EPSILON_1000 )
-    {
-      if( !mClipper )
-      {
-        Actor self = Self();
-
-        mClipper = Clipper::New( size );
-        self.Add( mClipper->GetRootActor() );
-        self.Add( mClipper->GetImageView() );
-      }
-      else if ( mClipper )
-      {
-        mClipper->Refresh( size );
-      }
-    }
-  }
-  else
-  {
-    // Note - this will automatically remove the root actor & the image view
-    mClipper.Reset();
-  }
-}
-
 void TextEditor::OnClipboardTextSelected( ClipboardEventNotifier& clipboard )
 {
   mController->PasteClipboardItemEvent();
@@ -1436,7 +1406,7 @@ TextEditor::TextEditor()
 
 TextEditor::~TextEditor()
 {
-  mClipper.Reset();
+  UnparentAndReset( mStencil );
 
   if( ( NULL != mIdleCallback ) && Adaptor::IsAvailable() )
   {
index cb40406..0145262 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -21,9 +21,9 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
-#include <dali-toolkit/internal/text/clipping/text-clipper.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/text-control-interface.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
 
@@ -42,7 +42,7 @@ namespace Internal
 /**
  * @brief A control which renders a long text string with styles.
  */
-class TextEditor : public Control, public Text::ControlInterface
+class TextEditor : public Control, public Text::ControlInterface, public Text::EditableControlInterface
 {
 public:
 
@@ -157,15 +157,12 @@ private: // From Control
 // From ControlInterface
 
   /**
-   * @copydoc Text::ControlInterface::AddDecoration()
-   */
-  virtual void AddDecoration( Actor& actor, bool needsClipping );
-
-  /**
    * @copydoc Text::ControlInterface::RequestTextRelayout()
    */
   virtual void RequestTextRelayout();
 
+// From EditableControlInterface
+
   /**
    * @copydoc Text::ControlInterface::TextChanged()
    */
@@ -181,6 +178,11 @@ private: // From Control
    */
   virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
 
+  /**
+   * @copydoc Text::ControlInterface::AddDecoration()
+   */
+  virtual void AddDecoration( Actor& actor, bool needsClipping );
+
 private: // Implementation
 
   /**
@@ -203,14 +205,6 @@ private: // Implementation
   void GetHandleImagePropertyValue(  Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType );
 
   /**
-   * @brief Enable or disable clipping.
-   *
-   * @param[in] clipping True if clipping should be enabled.
-   * @param[in] size The area to clip within.
-   */
-  void EnableClipping( bool clipping, const Vector2& size );
-
-  /**
    * @brief Callback when keyboard is shown/hidden.
    *
    * @param[in] keyboardShown True if keyboard is shown.
@@ -263,7 +257,7 @@ private: // Data
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
   Text::DecoratorPtr mDecorator;
-  Text::ClipperPtr mClipper;
+  Toolkit::Control mStencil;
   std::vector<Actor> mClippingDecorationActors;   ///< Decoration actors which need clipping.
 
   Actor mRenderableActor;
@@ -299,4 +293,4 @@ inline const Toolkit::Internal::TextEditor& GetImpl( const Toolkit::TextEditor&
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
index e0d75ce..e8e24cf 100644 (file)
@@ -30,7 +30,9 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/text/rendering-backend.h>
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
 #include <dali-toolkit/internal/text/text-effects-style.h>
 #include <dali-toolkit/internal/text/text-font-style.h>
@@ -270,7 +272,17 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::EXCEED_POLICY:
       {
-        // TODO
+        impl.mExceedPolicy = value.Get<int>();
+
+        if( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == impl.mExceedPolicy )
+        {
+          impl.EnableClipping();
+        }
+        else
+        {
+          UnparentAndReset( impl.mStencil );
+        }
+        impl.RequestTextRelayout();
         break;
       }
       case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
@@ -1114,7 +1126,7 @@ void TextField::OnInitialize()
 {
   Actor self = Self();
 
-  mController = Text::Controller::New( *this );
+  mController = Text::Controller::New( this, this );
 
   // When using the vector-based rendering, the size of the GLyphs are different
   TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
@@ -1160,6 +1172,11 @@ void TextField::OnInitialize()
   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
   self.OnStageSignal().Connect( this, &TextField::OnStageConnect );
+
+  if( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy )
+  {
+    EnableClipping();
+  }
 }
 
 void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
@@ -1222,7 +1239,6 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
       mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
     }
 
-    EnableClipping( ( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy ), size );
     RenderText( updateTextType );
   }
 
@@ -1248,7 +1264,6 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
   void TextField::RenderText( Text::Controller::UpdateTextType updateTextType )
 {
-  Actor self = Self();
   Actor renderableActor;
 
   if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
@@ -1271,39 +1286,19 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
     mRenderableActor.SetPosition( scrollOffset.x, scrollOffset.y );
 
-    Actor clipRootActor;
-    if( mClipper )
-    {
-      clipRootActor = mClipper->GetRootActor();
-    }
+    // Make sure the actors are parented correctly with/without clipping
+    Actor self = mStencil ? mStencil : Self();
 
     for( std::vector<Actor>::const_iterator it = mClippingDecorationActors.begin(),
            endIt = mClippingDecorationActors.end();
          it != endIt;
          ++it )
     {
-      Actor actor = *it;
-
-      if( clipRootActor )
-      {
-        clipRootActor.Add( actor );
-      }
-      else
-      {
-        self.Add( actor );
-      }
+      self.Add( *it );
     }
     mClippingDecorationActors.clear();
 
-    // Make sure the actor is parented correctly with/without clipping
-    if( clipRootActor )
-    {
-      clipRootActor.Add( mRenderableActor );
-    }
-    else
-    {
-      self.Add( mRenderableActor );
-    }
+    self.Add( mRenderableActor );
   }
 }
 
@@ -1416,21 +1411,6 @@ bool TextField::OnKeyEvent( const KeyEvent& event )
   return mController->KeyEvent( event );
 }
 
-void TextField::AddDecoration( Actor& actor, bool needsClipping )
-{
-  if( actor )
-  {
-    if( needsClipping )
-    {
-      mClippingDecorationActors.push_back( actor );
-    }
-    else
-    {
-      Self().Add( actor );
-    }
-  }
-}
-
 void TextField::RequestTextRelayout()
 {
   RelayoutRequest();
@@ -1442,6 +1422,12 @@ void TextField::TextChanged()
   mTextChangedSignal.Emit( handle );
 }
 
+void TextField::MaxLengthReached()
+{
+  Dali::Toolkit::TextField handle( GetOwner() );
+  mMaxLengthReachedSignal.Emit( handle );
+}
+
 void TextField::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
 {
   Dali::Toolkit::TextField handle( GetOwner() );
@@ -1492,6 +1478,21 @@ void TextField::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
   mInputStyleChangedSignal.Emit( handle, fieldInputStyleMask );
 }
 
+void TextField::AddDecoration( Actor& actor, bool needsClipping )
+{
+  if( actor )
+  {
+    if( needsClipping )
+    {
+      mClippingDecorationActors.push_back( actor );
+    }
+    else
+    {
+      Self().Add( actor );
+    }
+  }
+}
+
 void TextField::OnStageConnect( Dali::Actor actor )
 {
   if ( mHasBeenStaged )
@@ -1504,12 +1505,6 @@ void TextField::OnStageConnect( Dali::Actor actor )
   }
 }
 
-void TextField::MaxLengthReached()
-{
-  Dali::Toolkit::TextField handle( GetOwner() );
-  mMaxLengthReachedSignal.Emit( handle );
-}
-
 ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName );
@@ -1531,31 +1526,27 @@ void TextField::GetHandleImagePropertyValue(  Property::Value& value, Text::Hand
   }
 }
 
-void TextField::EnableClipping( bool clipping, const Vector2& size )
+void TextField::EnableClipping()
 {
-  if( clipping )
+  if( !mStencil )
   {
-    // Not worth to created clip actor if width or height is equal to zero.
-    if( size.width > Math::MACHINE_EPSILON_1000 && size.height > Math::MACHINE_EPSILON_1000 )
-    {
-      if( !mClipper )
-      {
-        Actor self = Self();
+    // Creates an extra control to be used as stencil buffer.
+    mStencil = Control::New();
+    mStencil.SetAnchorPoint( AnchorPoint::CENTER );
+    mStencil.SetParentOrigin( ParentOrigin::CENTER );
 
-        mClipper = Clipper::New( size );
-        self.Add( mClipper->GetRootActor() );
-        self.Add( mClipper->GetImageView() );
-      }
-      else if ( mClipper )
-      {
-        mClipper->Refresh( size );
-      }
-    }
-  }
-  else
-  {
-    // Note - this will automatically remove the root actor & the image view
-    mClipper.Reset();
+    // Creates a background visual. Even if the color is transparent it updates the stencil.
+    Property::Map backGroundMap;
+    backGroundMap[Toolkit::Visual::Property::TYPE] = Visual::COLOR;
+    backGroundMap[ColorVisual::Property::MIX_COLOR] = Color::TRANSPARENT;
+
+    mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND, backGroundMap );
+
+    // Enable the clipping property.
+    mStencil.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+    mStencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+    Self().Add( mStencil );
   }
 }
 
@@ -1615,7 +1606,7 @@ TextField::TextField()
 
 TextField::~TextField()
 {
-  mClipper.Reset();
+  UnparentAndReset( mStencil );
 
   if( ( NULL != mIdleCallback ) && Adaptor::IsAvailable() )
   {
index 558cced..9eed382 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -21,9 +21,9 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-field.h>
-#include <dali-toolkit/internal/text/clipping/text-clipper.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/text-control-interface.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
 
@@ -42,7 +42,7 @@ namespace Internal
 /**
  * @brief A control which renders a short text string.
  */
-class TextField : public Control, public Text::ControlInterface
+class TextField : public Control, public Text::ControlInterface, public Text::EditableControlInterface
 {
 public:
 
@@ -162,15 +162,12 @@ private: // From Control
 // From ControlInterface
 
   /**
-   * @copydoc Text::ControlInterface::AddDecoration()
-   */
-  virtual void AddDecoration( Actor& actor, bool needsClipping );
-
-  /**
    * @copydoc Text::ControlInterface::RequestTextRelayout()
    */
   virtual void RequestTextRelayout();
 
+// From EditableControlInterface
+
   /**
    * @copydoc Text::ControlInterface::TextChanged()
    */
@@ -186,6 +183,11 @@ private: // From Control
    */
   virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
 
+  /**
+   * @copydoc Text::ControlInterface::AddDecoration()
+   */
+  virtual void AddDecoration( Actor& actor, bool needsClipping );
+
 private: // Implementation
 
   /**
@@ -209,11 +211,8 @@ private: // Implementation
 
   /**
    * @brief Enable or disable clipping.
-   *
-   * @param[in] clipping True if clipping should be enabled.
-   * @param[in] size The area to clip within.
    */
-  void EnableClipping( bool clipping, const Vector2& size );
+  void EnableClipping();
 
   /**
    * @brief Callback when keyboard is shown/hidden.
@@ -269,7 +268,7 @@ private: // Data
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
   Text::DecoratorPtr mDecorator;
-  Text::ClipperPtr mClipper; ///< For EXCEED_POLICY_CLIP
+  Toolkit::Control mStencil; ///< For EXCEED_POLICY_CLIP
   std::vector<Actor> mClippingDecorationActors;   ///< Decoration actors which need clipping.
 
   Actor mRenderableActor;
@@ -306,4 +305,4 @@ inline const Toolkit::Internal::TextField& GetImpl( const Toolkit::TextField& te
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
index bf8c866..6fbe3b6 100644 (file)
@@ -644,7 +644,7 @@ void TextLabel::OnInitialize()
 {
   Actor self = Self();
 
-  mController = Text::Controller::New( *this );
+  mController = Text::Controller::New( this );
 
   // When using the vector-based rendering, the size of the GLyphs are different
   TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
@@ -791,11 +791,6 @@ void TextLabel::OnStageConnect( Dali::Actor actor )
   }
 }
 
-void TextLabel::AddDecoration( Actor& actor, bool needsClipping )
-{
-  // TextLabel does not show decorations
-}
-
 void TextLabel::OnStageConnection( int depth )
 {
   // Call the Control::OnStageConnection() to set the depth of the background.
@@ -804,21 +799,6 @@ void TextLabel::OnStageConnection( int depth )
   // The depth of the text renderer is set in the RenderText() called from OnRelayout().
 }
 
-void TextLabel::TextChanged()
-{
-  // TextLabel does not provide a signal for this.
-}
-
-void TextLabel::MaxLengthReached()
-{
-  // Pure Virtual from TextController Interface, only needed when inputting text
-}
-
-void TextLabel::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
-{
-  // TextLabel does not provide a signal for this.
-}
-
 void TextLabel::ScrollingFinished()
 {
   // Pure Virtual from TextScroller Interface
index 298ba1a..c928763 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -21,6 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
+#include <dali-toolkit/internal/text/text-control-interface.h>
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/text-scroller-interface.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
@@ -95,35 +96,17 @@ private: // From Control
   virtual float GetHeightForWidth( float width );
 
   /**
-   * @copydoc Text::ControlInterface::AddDecoration()
-   */
-  virtual void AddDecoration( Actor& actor, bool needsClipping );
-
-  /**
    * @copydoc Control::OnStageConnection()
    */
   virtual void OnStageConnection( int depth );
 
+// From ControlInterface
+
   /**
    * @copydoc Text::ControlInterface::RequestTextRelayout()
    */
   virtual void RequestTextRelayout();
 
-  /**
-   * @copydoc Text::ControlInterface::TextChanged()
-   */
-  virtual void TextChanged();
-
-  /**
-   * @copydoc Text::ControlInterface::MaxLengthReached()
-   */
-  virtual void MaxLengthReached();
-
-  /**
-   * @copydoc Text::ControlInterface::InputStyleChanged()
-   */
-  virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
-
 private: // from TextScroller
 
   /**
@@ -198,4 +181,4 @@ inline const Toolkit::Internal::TextLabel& GetImpl( const Toolkit::TextLabel& te
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
index 9bb071a..847d9b1 100644 (file)
@@ -90,7 +90,6 @@ toolkit_src_files = \
    $(toolkit_src_dir)/styling/style-manager-impl.cpp \
    $(toolkit_src_dir)/text/bidirectional-support.cpp \
    $(toolkit_src_dir)/text/character-set-conversion.cpp \
-   $(toolkit_src_dir)/text/clipping/text-clipper.cpp \
    $(toolkit_src_dir)/text/color-segmentation.cpp \
    $(toolkit_src_dir)/text/cursor-helper-functions.cpp \
    $(toolkit_src_dir)/text/glyph-metrics-helper.cpp \
@@ -103,7 +102,6 @@ toolkit_src_files = \
    $(toolkit_src_dir)/text/property-string-parser.cpp \
    $(toolkit_src_dir)/text/segmentation.cpp \
    $(toolkit_src_dir)/text/shaper.cpp \
-   $(toolkit_src_dir)/text/text-control-interface.cpp \
    $(toolkit_src_dir)/text/text-controller.cpp \
    $(toolkit_src_dir)/text/text-controller-impl.cpp \
    $(toolkit_src_dir)/text/text-effects-style.cpp \
diff --git a/dali-toolkit/internal/text/clipping/text-clipper.cpp b/dali-toolkit/internal/text/clipping/text-clipper.cpp
deleted file mode 100644 (file)
index 11a8fc9..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/internal/text/clipping/text-clipper.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/stage.h>
-#include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/public-api/rendering/renderer.h>
-
-namespace
-{
-
-// Currently on desktop machines 2k x 2k is the maximum frame buffer size, on target is 4k x 4k.
-const float MAX_OFFSCREEN_RENDERING_SIZE = 2048.f;
-
-} // namespace
-
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Text
-{
-
-ClipperPtr Clipper::New( const Vector2& size )
-{
-  ClipperPtr clipper( new Clipper() );
-
-  // Second-phase init
-  clipper->Initialize( size );
-
-  return clipper;
-}
-
-Actor Clipper::GetRootActor() const
-{
-  return mOffscreenRootActor;
-}
-
-Actor Clipper::GetImageView() const
-{
-  return mImageView;
-}
-
-void Clipper::Refresh( const Vector2& size )
-{
-  const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
-                            std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );
-
-  const bool sizeChanged = offscreenSize != mCurrentOffscreenSize;
-
-  if( sizeChanged )
-  {
-    // Reconfigure camera for current size.
-    mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );
-
-    // Recreate frame buffer for offscreen rendering when the size changes.
-    FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
-                                                               offscreenSize.height,
-                                                               Pixel::RGBA8888 );
-
-    mOffscreenRootActor.SetSize( size );
-
-    mImageView.SetSize( offscreenSize );
-    mImageView.SetImage( frameBufferImage );
-    mRenderTask.SetTargetFrameBuffer( frameBufferImage );
-
-    // Stores current sizPe to avoid create new Dali resources if text changes.
-    mCurrentOffscreenSize = offscreenSize;
-  }
-
-  mRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
-}
-
-void Clipper::Initialize( const Vector2& size )
-{
-  const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
-                            std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );
-
-  // Create a root actor and an image view for offscreen rendering.
-  mOffscreenRootActor = Layer::New();
-  mOffscreenRootActor.SetColorMode( USE_OWN_COLOR );
-  mOffscreenRootActor.SetInheritPosition( false );
-  mOffscreenRootActor.SetInheritScale( false );
-  mOffscreenRootActor.SetDepthTestDisabled( true );
-  mOffscreenRootActor.SetSize( offscreenSize );
-
-  mImageView = ImageView::New();
-  mImageView.SetParentOrigin( ParentOrigin::CENTER );
-  mImageView.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
-  mImageView.SetSize( offscreenSize );
-
-  // Creates a new camera actor.
-  mOffscreenCameraActor = CameraActor::New();
-  mOffscreenCameraActor.SetParentOrigin( ParentOrigin::CENTER );
-  mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );
-  mOffscreenRootActor.Add( mOffscreenCameraActor ); // camera to shoot the offscreen text
-
-  // Creates a new render task.
-  mRenderTask = Stage::GetCurrent().GetRenderTaskList().CreateTask();
-  mRenderTask.SetSourceActor( mOffscreenRootActor );
-  mRenderTask.SetClearColor( Color::TRANSPARENT );
-  mRenderTask.SetClearEnabled( true );
-  mRenderTask.SetExclusive( true );
-  mRenderTask.SetCameraActor( mOffscreenCameraActor );
-
-  // Creates a frame buffer for offscreen rendering
-  FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
-                                                             offscreenSize.height,
-                                                             Pixel::RGBA8888 );
-  mImageView.SetImage( frameBufferImage );
-  mRenderTask.SetTargetFrameBuffer( frameBufferImage );
-  mImageView.OnStageSignal().Connect(this, &Clipper::OnStageConnect);
-
-  // Stores current size to avoid create new Dali resources if text changes.
-  mCurrentOffscreenSize = offscreenSize;
-}
-
-void Clipper::OnStageConnect( Dali::Actor actor )
-{
-  Renderer renderer = mImageView.GetRendererAt(0);
-  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB,    BlendFactor::ONE );
-  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB,   BlendFactor::ONE_MINUS_SRC_ALPHA );
-  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA,  BlendFactor::ONE );
-  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ONE );
-}
-
-Clipper::Clipper()
-{
-}
-
-Clipper::~Clipper()
-{
-  if( Stage::IsInstalled() )
-  {
-    UnparentAndReset( mOffscreenRootActor );
-    UnparentAndReset( mImageView );
-
-    Stage::GetCurrent().GetRenderTaskList().RemoveTask( mRenderTask );
-  }
-}
-
-} // namespace Text
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/text/clipping/text-clipper.h b/dali-toolkit/internal/text/clipping/text-clipper.h
deleted file mode 100644 (file)
index 5f5be4b..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_CLIPPER_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_CLIPPER_H__
-
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/render-tasks/render-task.h>
-#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali/public-api/signals/connection-tracker.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Text
-{
-
-class Clipper;
-typedef IntrusivePtr<Clipper> ClipperPtr;
-
-/**
- * @brief A helper class for clipping actors using a FrameBufferImage.
- */
-class Clipper : public RefObject, public ConnectionTracker
-{
-public:
-
-  /**
-   * @brief Create a clipper.
-   *
-   * @param[in] size The size of the clipping region.
-   */
-  static ClipperPtr New( const Vector2& size );
-
-  /**
-   * @brief Children added to this actor will be clipped with the specified region.
-   *
-   * @note This is done by rendering to a FrameBufferImage which must then be displayed; see also GetImageView().
-   * @return The root actor.
-   */
-  Actor GetRootActor() const;
-
-  /**
-   * @brief This actor will display the resulting FrameBufferImage.
-   *
-   * @return The image view.
-   */
-  Actor GetImageView() const;
-
-  /**
-   * @brief Refresh the contents of the FrameBufferImage.
-   *
-   * @param[in] size The size of the clipping region.
-   */
-  void Refresh( const Vector2& size );
-
-private: // Implementation
-
-  /**
-   * @brief Second-phase init
-   *
-   * @param[in] size The size of the clipping region.
-   */
-  void Initialize( const Vector2& size );
-
-  /**
-   * The renderer is not created until the clipper actor is set on stage, only by then the blend function could be set.
-   *
-   * @param[in] actor The actor connected to stage.
-   */
-  void OnStageConnect( Dali::Actor actor );
-
-  /**
-   * Construct a new Clipper.
-   */
-  Clipper();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~Clipper();
-
-private:
-
-  // Undefined copy constructor and assignment operators
-  Clipper(const Clipper&);
-  Clipper& operator=(const Clipper& rhs);
-
-private: // Data
-
-  Layer mOffscreenRootActor;
-  CameraActor mOffscreenCameraActor;
-  ImageView mImageView;
-  RenderTask mRenderTask;
-  Vector2 mCurrentOffscreenSize;
-};
-
-} // namespace Text
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_CLIPPER_H__
index cd51c8d..717c752 100644 (file)
@@ -596,7 +596,10 @@ struct LayoutEngine::Impl
       lineRun->ellipsis = true;
 
       layoutSize.width = layoutParameters.boundingBox.width;
-      layoutSize.height += ( lineRun->ascender + -lineRun->descender );
+      if( layoutSize.height < Math::MACHINE_EPSILON_1000 )
+      {
+        layoutSize.height += ( lineRun->ascender + -lineRun->descender );
+      }
 
       SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
                          ellipsisLayout.numberOfGlyphs,
diff --git a/dali-toolkit/internal/text/text-control-interface.cpp b/dali-toolkit/internal/text/text-control-interface.cpp
deleted file mode 100644 (file)
index 8ac77d1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/internal/text/text-control-interface.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Text
-{
-
-ControlInterface::ControlInterface()
-{
-}
-
-ControlInterface::~ControlInterface()
-{
-}
-
-} // namespace Text
-
-} // namespace Toolkit
-
-} // namespace Dali
index f5346e0..ce5af88 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H__
-#define __DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H__
+#ifndef DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H
+#define DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  */
 
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/input-style.h>
-
 namespace Dali
 {
 
-class Actor;
-
 namespace Toolkit
 {
 
@@ -40,44 +35,15 @@ class ControlInterface
 public:
 
   /**
-   * @brief Constructor.
-   */
-  ControlInterface();
-
-  /**
    * @brief Virtual destructor.
    */
-  virtual ~ControlInterface();
-
-  /**
-   * @brief Add a decoration.
-   *
-   * @param[in] decoration The actor displaying a decoration.
-   * @param[in] needsClipping Whether the actor needs clipping.
-   */
-  virtual void AddDecoration( Actor& actor, bool needsClipping ) = 0;
+  virtual ~ControlInterface()
+  {}
 
   /**
    * @brief Called to request a text relayout.
    */
   virtual void RequestTextRelayout() = 0;
-
-  /**
-   * @brief Called to signal that text has been inserted or deleted.
-   */
-  virtual void TextChanged() = 0;
-
-  /**
-   * @brief Called when the number of characters to be inserted exceeds the maximum limit
-   */
-  virtual void MaxLengthReached() = 0;
-
-  /**
-   * @brief Called to signal that input style has been changed.
-   *
-   * @param[in] inputStyleMask Mask with the bits of the input style that has changed.
-   */
-  virtual void InputStyleChanged( InputStyle::Mask inputStyleMask ) = 0;
 };
 
 } // namespace Text
@@ -86,4 +52,4 @@ public:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H__
+#endif // DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H
index 5769fac..98868a8 100644 (file)
@@ -31,6 +31,7 @@
 #include <dali-toolkit/internal/text/multi-language-support.h>
 #include <dali-toolkit/internal/text/segmentation.h>
 #include <dali-toolkit/internal/text/shaper.h>
+#include <dali-toolkit/internal/text/text-control-interface.h>
 #include <dali-toolkit/internal/text/text-run-container.h>
 
 namespace
@@ -88,6 +89,7 @@ EventData::EventData( DecoratorPtr decorator )
   mGrabHandleEnabled( true ),
   mGrabHandlePopupEnabled( true ),
   mSelectionEnabled( true ),
+  mUpdateCursorHookPosition( false ),
   mUpdateCursorPosition( false ),
   mUpdateGrabHandlePosition( false ),
   mUpdateLeftSelectionPosition( false ),
@@ -1308,6 +1310,7 @@ void Controller::Impl::OnLongPressEvent( const Event& event )
   {
     ChangeState ( EventData::EDITING_WITH_POPUP );
     mEventData->mDecoratorUpdated = true;
+    mEventData->mUpdateInputStyle = true;
   }
 }
 
@@ -2682,6 +2685,12 @@ void Controller::Impl::ClampHorizontalScroll( const Vector2& layoutSize )
 
 void Controller::Impl::ClampVerticalScroll( const Vector2& layoutSize )
 {
+  if( LayoutEngine::SINGLE_LINE_BOX == mLayoutEngine.GetLayout() )
+  {
+    // Nothing to do if the text is single line.
+    return;
+  }
+
   // Clamp between -space & 0.
   if( layoutSize.height > mVisualModel->mControlSize.height )
   {
@@ -2749,7 +2758,10 @@ void Controller::Impl::ScrollTextToMatchCursor( const CursorInfo& cursorInfo )
 
 void Controller::Impl::RequestRelayout()
 {
-  mControlInterface.RequestTextRelayout();
+  if( NULL != mControlInterface )
+  {
+    mControlInterface->RequestTextRelayout();
+  }
 }
 
 } // namespace Text
index 9b17fa7..399de3f 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
-#define __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
+#ifndef DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H
+#define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -285,8 +285,10 @@ struct OutlineDefaults
 
 struct Controller::Impl
 {
-  Impl( ControlInterface& controlInterface )
+  Impl( ControlInterface* controlInterface,
+        EditableControlInterface* editableControlInterface )
   : mControlInterface( controlInterface ),
+    mEditableControlInterface( editableControlInterface ),
     mLogicalModel(),
     mVisualModel(),
     mFontDefaults( NULL ),
@@ -686,7 +688,8 @@ private:
 
 public:
 
-  ControlInterface& mControlInterface;     ///< Reference to the text controller.
+  ControlInterface* mControlInterface;     ///< Reference to the text controller.
+  EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller.
   LogicalModelPtr mLogicalModel;           ///< Pointer to the logical model.
   VisualModelPtr  mVisualModel;            ///< Pointer to the visual model.
   FontDefaults* mFontDefaults;             ///< Avoid allocating this when the user does not specify a font.
@@ -725,4 +728,4 @@ public:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#endif // DALI_TOOLKIT_TEXT_CONTROLLER_H
index ca90f55..bc70bed 100644 (file)
@@ -31,6 +31,7 @@
 #include <dali-toolkit/internal/text/layouts/layout-parameters.h>
 #include <dali-toolkit/internal/text/markup-processor.h>
 #include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
 
 namespace
 {
@@ -100,11 +101,23 @@ FontDescriptionRun& UpdateSelectionFontStyleRun( EventData* eventData,
 
 // public : Constructor.
 
-ControllerPtr Controller::New( ControlInterface& controlInterface )
+ControllerPtr Controller::New()
+{
+  return ControllerPtr( new Controller() );
+}
+
+ControllerPtr Controller::New( ControlInterface* controlInterface )
 {
   return ControllerPtr( new Controller( controlInterface ) );
 }
 
+ControllerPtr Controller::New( ControlInterface* controlInterface,
+                               EditableControlInterface* editableControlInterface )
+{
+  return ControllerPtr( new Controller( controlInterface,
+                                        editableControlInterface ) );
+}
+
 // public : Configure the text controller.
 
 void Controller::EnableTextInput( DecoratorPtr decorator )
@@ -460,8 +473,11 @@ void Controller::SetText( const std::string& text )
     mImpl->mEventData->mEventQueue.clear();
   }
 
-  // Do this last since it provides callbacks into application code
-  mImpl->mControlInterface.TextChanged();
+  // Do this last since it provides callbacks into application code.
+  if( NULL != mImpl->mEditableControlInterface )
+  {
+    mImpl->mEditableControlInterface->TextChanged();
+  }
 }
 
 void Controller::GetText( std::string& text ) const
@@ -1514,6 +1530,9 @@ Controller::UpdateTextType Controller::Relayout( const Size& size )
     // Set the update info to relayout the whole text.
     mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
     mImpl->mTextUpdateInfo.mCharacterIndex = 0u;
+
+    // Store the size used to layout the text.
+    mImpl->mVisualModel->mControlSize = size;
   }
 
   // Whether there are modify events.
@@ -1605,8 +1624,11 @@ void Controller::ProcessInputStyleChangedSignals()
   {
     const InputStyle::Mask mask = *it;
 
-    // Emit the input style changed signal.
-    mImpl->mControlInterface.InputStyleChanged( mask );
+    if( NULL != mImpl->mEditableControlInterface )
+    {
+      // Emit the input style changed signal.
+      mImpl->mEditableControlInterface->InputStyleChanged( mask );
+    }
   }
 
   mImpl->mEventData->mInputStyleChangedQueue.Clear();
@@ -1732,10 +1754,11 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
     mImpl->RequestRelayout();
   }
 
-  if( textChanged )
+  if( textChanged &&
+      ( NULL != mImpl->mEditableControlInterface ) )
   {
     // Do this last since it provides callbacks into application code
-    mImpl->mControlInterface.TextChanged();
+    mImpl->mEditableControlInterface->TextChanged();
   }
 
   return true;
@@ -1966,10 +1989,11 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons
 
   ImfManager::ImfCallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false );
 
-  if( requestRelayout )
+  if( requestRelayout &&
+      ( NULL != mImpl->mEditableControlInterface ) )
   {
     // Do this last since it provides callbacks into application code
-    mImpl->mControlInterface.TextChanged();
+    mImpl->mEditableControlInterface->TextChanged();
   }
 
   return callbackData;
@@ -2002,7 +2026,10 @@ void Controller::GetTargetSize( Vector2& targetSize )
 
 void Controller::AddDecoration( Actor& actor, bool needsClipping )
 {
-  mImpl->mControlInterface.AddDecoration( actor, needsClipping );
+  if( NULL != mImpl->mEditableControlInterface )
+  {
+    mImpl->mEditableControlInterface->AddDecoration( actor, needsClipping );
+  }
 }
 
 void Controller::DecorationEvent( HandleType handleType, HandleState state, float x, float y )
@@ -2089,7 +2116,11 @@ void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Butt
       mImpl->mEventData->mScrollAfterDelete = true;
 
       mImpl->RequestRelayout();
-      mImpl->mControlInterface.TextChanged();
+
+      if( NULL != mImpl->mEditableControlInterface )
+      {
+        mImpl->mEditableControlInterface->TextChanged();
+      }
       break;
     }
     case Toolkit::TextSelectionPopup::COPY:
@@ -2376,8 +2407,11 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
 
     mImpl->ResetImfManager();
 
-    // Do this last since it provides callbacks into application code
-    mImpl->mControlInterface.MaxLengthReached();
+    if( NULL != mImpl->mEditableControlInterface )
+    {
+      // Do this last since it provides callbacks into application code
+      mImpl->mEditableControlInterface->MaxLengthReached();
+    }
   }
 }
 
@@ -2387,8 +2421,11 @@ void Controller::PasteText( const std::string& stringToPaste )
   mImpl->ChangeState( EventData::EDITING );
   mImpl->RequestRelayout();
 
-  // Do this last since it provides callbacks into application code
-  mImpl->mControlInterface.TextChanged();
+  if( NULL != mImpl->mEditableControlInterface )
+  {
+    // Do this last since it provides callbacks into application code
+    mImpl->mEditableControlInterface->TextChanged();
+  }
 }
 
 bool Controller::RemoveText( int cursorOffset,
@@ -2645,9 +2682,6 @@ bool Controller::DoRelayout( const Size& size,
         mImpl->mVisualModel->SetLayoutSize( layoutSize );
       }
     } // view updated
-
-    // Store the size used to layout the text.
-    mImpl->mVisualModel->mControlSize = size;
   }
 
   if( NO_OPERATION != ( ALIGN & operations ) )
@@ -3012,10 +3046,22 @@ void Controller::ResetScrollPosition()
 
 // private : Private contructors & copy operator.
 
-Controller::Controller( ControlInterface& controlInterface )
+Controller::Controller()
 : mImpl( NULL )
 {
-  mImpl = new Controller::Impl( controlInterface );
+  mImpl = new Controller::Impl( NULL, NULL );
+}
+
+Controller::Controller( ControlInterface* controlInterface )
+{
+  mImpl = new Controller::Impl( controlInterface, NULL );
+}
+
+Controller::Controller( ControlInterface* controlInterface,
+                        EditableControlInterface* editableControlInterface )
+{
+  mImpl = new Controller::Impl( controlInterface,
+                                editableControlInterface );
 }
 
 // The copy constructor and operator are left unimplemented.
index 07e1665..f99d5a9 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_H__
-#define __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#ifndef DALI_TOOLKIT_TEXT_CONTROLLER_H
+#define DALI_TOOLKIT_TEXT_CONTROLLER_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -26,7 +26,6 @@
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
-#include <dali-toolkit/internal/text/text-control-interface.h>
 
 namespace Dali
 {
@@ -38,10 +37,11 @@ namespace Text
 {
 
 class Controller;
+class ControlInterface;
+class EditableControlInterface;
 class View;
 
 typedef IntrusivePtr<Controller> ControllerPtr;
-typedef Dali::Toolkit::Text::ControlInterface ControlInterface;
 
 /**
  * @brief A Text Controller is used by UI Controls which display text.
@@ -123,10 +123,29 @@ public: // Constructor.
   /**
    * @brief Create a new instance of a Controller.
    *
-   * @param[in] controlInterface An interface used to request a text relayout.
    * @return A pointer to a new Controller.
    */
-  static ControllerPtr New( ControlInterface& controlInterface );
+  static ControllerPtr New();
+
+  /**
+   * @brief Create a new instance of a Controller.
+   *
+   * @param[in] controlInterface The control's interface.
+   *
+   * @return A pointer to a new Controller.
+   */
+  static ControllerPtr New( ControlInterface* controlInterface );
+
+  /**
+   * @brief Create a new instance of a Controller.
+   *
+   * @param[in] controlInterface The control's interface.
+   * @param[in] editableControlInterface The editable control's interface.
+   *
+   * @return A pointer to a new Controller.
+   */
+  static ControllerPtr New( ControlInterface* controlInterface,
+                            EditableControlInterface* editableControlInterface );
 
 public: // Configure the text controller.
 
@@ -1058,7 +1077,18 @@ private: // Private contructors & copy operator.
   /**
    * @brief Private constructor.
    */
-  Controller( ControlInterface& controlInterface );
+  Controller();
+
+  /**
+   * @brief Private constructor.
+   */
+  Controller( ControlInterface* controlInterface );
+
+  /**
+   * @brief Private constructor.
+   */
+  Controller( ControlInterface* controlInterface,
+              EditableControlInterface* editableControlInterface );
 
   // Undefined
   Controller( const Controller& handle );
@@ -1085,4 +1115,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#endif // DALI_TOOLKIT_TEXT_CONTROLLER_H
diff --git a/dali-toolkit/internal/text/text-editable-control-interface.h b/dali-toolkit/internal/text/text-editable-control-interface.h
new file mode 100644 (file)
index 0000000..e54704c
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef DALI_TOOLKIT_TEXT_EDITABLE_CONTROL_INTERFACE_H
+#define DALI_TOOLKIT_TEXT_EDITABLE_CONTROL_INTERFACE_H
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/input-style.h>
+
+namespace Dali
+{
+
+class Actor;
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * @brief An interface that the Text::Controller uses to notify about text changes and add decoration to the text control.
+ */
+class EditableControlInterface
+{
+public:
+
+  /**
+   * @brief Virtual destructor.
+   */
+  virtual ~EditableControlInterface()
+  {}
+
+  /**
+   * @brief Called to signal that text has been inserted or deleted.
+   */
+  virtual void TextChanged() = 0;
+
+  /**
+   * @brief Called when the number of characters to be inserted exceeds the maximum limit
+   */
+  virtual void MaxLengthReached() = 0;
+
+  /**
+   * @brief Called to signal that input style has been changed.
+   *
+   * @param[in] inputStyleMask Mask with the bits of the input style that has changed.
+   */
+  virtual void InputStyleChanged( InputStyle::Mask inputStyleMask ) = 0;
+
+  /**
+   * @brief Add a decoration.
+   *
+   * @param[in] decoration The actor displaying a decoration.
+   * @param[in] needsClipping Whether the actor needs clipping.
+   */
+  virtual void AddDecoration( Actor& actor, bool needsClipping ) = 0;
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_EDITABLE_CONTROL_INTERFACE_H
index be6ac8f..7333428 100644 (file)
@@ -190,6 +190,24 @@ Length View::GetGlyphs( GlyphInfo* glyphs,
 
         if( lastLine.ellipsis )
         {
+          if( ( 1u == numberOfLines ) &&
+              ( lastLine.ascender - lastLine.descender > mImpl->mVisualModel->mControlSize.height ) )
+          {
+            // Get the first glyph which is going to be replaced and the ellipsis glyph.
+            GlyphInfo& glyphInfo = *glyphs;
+            const GlyphInfo& ellipsisGlyph = mImpl->mFontClient.GetEllipsisGlyph( mImpl->mFontClient.GetPointSize( glyphInfo.fontId ) );
+
+            // Change the 'x' and 'y' position of the ellipsis glyph.
+            Vector2& position = *glyphPositions;
+            position.x = ellipsisGlyph.xBearing;
+            position.y = mImpl->mVisualModel->mControlSize.height - ellipsisGlyph.yBearing;
+
+            // Replace the glyph by the ellipsis glyph.
+            glyphInfo = ellipsisGlyph;
+
+             return 1u;
+          }
+
           // firstPenX, penY and firstPenSet are used to position the ellipsis glyph if needed.
           float firstPenX = 0.f; // Used if rtl text is elided.
           float penY = 0.f;
index 5681016..8010118 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/integration-api/debug.h>
 
 //INTERNAL HEARDER
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
@@ -64,6 +65,7 @@ void Base::SetCustomShader( const Property::Map& shaderMap )
 
 void Base::Initialize( Actor& actor, const Property::Map& propertyMap )
 {
+
   Property::Value* customShaderValue = propertyMap.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
   if( customShaderValue )
   {
@@ -74,6 +76,16 @@ void Base::Initialize( Actor& actor, const Property::Map& propertyMap )
     }
   }
 
+  Property::Value* premultipliedAlphaValue = propertyMap.Find( Toolkit::DevelVisual::Property::PREMULTIPLIED_ALPHA, PREMULTIPLIED_ALPHA );
+  if( premultipliedAlphaValue )
+  {
+    bool premultipliedAlpha( false );
+    if( premultipliedAlphaValue->Get( premultipliedAlpha ) )
+    {
+      EnablePreMultipliedAlpha( premultipliedAlpha );
+    }
+  }
+
   DoInitialize( actor, propertyMap );
 }
 
@@ -138,7 +150,7 @@ void Base::SetOffStage( Actor& actor )
 
 void Base::EnablePreMultipliedAlpha( bool preMultipled )
 {
-  if(preMultipled)
+  if( preMultipled )
   {
     mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
   }
@@ -172,6 +184,9 @@ void Base::CreatePropertyMap( Property::Map& map ) const
   {
     mImpl->mCustomShader->CreatePropertyMap( map );
   }
+
+  bool premultipliedAlpha( IsPreMultipliedAlphaEnabled() );
+  map.Insert( DevelVisual::Property::PREMULTIPLIED_ALPHA, premultipliedAlpha );
 }
 
 bool Base::GetIsOnStage() const
index a224124..07831a0 100644 (file)
@@ -35,6 +35,9 @@ const char * const CUSTOM_SUBDIVIDE_GRID_X( "subdivideGridX" );
 const char * const CUSTOM_SUBDIVIDE_GRID_Y( "subdivideGridY" );
 const char * const CUSTOM_SHADER_HINTS( "hints" );
 
+// Premultipled alpha
+extern const char * const PREMULTIPLIED_ALPHA( "premultipliedAlpha" );
+
 // Image visual
 const char * const IMAGE_URL_NAME("url");
 const char * const ATLAS_RECT_UNIFORM_NAME ( "uAtlasRect" );
index efb0354..aacfa87 100644 (file)
@@ -35,6 +35,9 @@ extern const char * const CUSTOM_SUBDIVIDE_GRID_X;
 extern const char * const CUSTOM_SUBDIVIDE_GRID_Y;
 extern const char * const CUSTOM_SHADER_HINTS;
 
+// Premultiplied alpha
+extern const char * const PREMULTIPLIED_ALPHA;
+
 // Image visual
 extern const char * const IMAGE_URL_NAME;
 extern const char * const ATLAS_RECT_UNIFORM_NAME;
index 450d432..783e1e6 100644 (file)
  */
 
 // CLASS HEADER
-
 #include <dali-toolkit/public-api/controls/buttons/button.h>
 
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/buttons/button-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
@@ -58,116 +59,162 @@ Button Button::DownCast( BaseHandle handle )
 
 void Button::SetDisabled( bool disabled )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabled() is deprecated and will be removed from next release. Use SetProperty DISABLED or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetDisabled( disabled );
 }
 
 bool Button::IsDisabled() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsDisabled() is deprecated and will be removed from next release. Use GetProperty DISABLED instead.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).IsDisabled();
 }
 
 void Button::SetAutoRepeating( bool autoRepeating )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetAutoRepeating() is deprecated and will be removed from next release. Use SetProperty AUTO_REPEATING or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
 }
 
 bool Button::IsAutoRepeating() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsAutoRepeating() is deprecated and will be removed from next release. Use GetProperty AUTO_REPEATING instead.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
 }
 
 void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetInitialAutoRepeatingDelay() is deprecated and will be removed from next release. Use SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( 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" );
+
   return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
 }
 
 void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetNextAutoRepeatingDelay() is deprecated and will be removed from next release. Use SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
 }
 
 float Button::GetNextAutoRepeatingDelay() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetNextAutoRepeatingDelay() is deprecated and will be removed from next release. Use GetProperty NEXT_AUTO_REPEATING_DELAY instead.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
 }
 
 void Button::SetTogglableButton( bool togglable )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetTogglableButton() is deprecated and will be removed from next release. Use SetProperty TOGGLABLE or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetTogglableButton( togglable );
 }
 
 bool Button::IsTogglableButton() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsTogglableButton() is deprecated and will be removed from next release. Use GetProperty TOGGLABLE instead.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).IsTogglableButton();
 }
 
 void Button::SetSelected( bool selected )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelected() is deprecated and will be removed from next release. Use SetProperty SELECTED instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetSelected( selected );
 }
 
 bool Button::IsSelected() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsSelected() is deprecated and will be removed from next release. Use GetProperty SELECTED instead.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).IsSelected();
 }
 
 void Button::SetAnimationTime( float animationTime )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetAnimationTime() is deprecated and will be removed from next release. Use Styling file to set animation instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetAnimationTime( animationTime );
 }
 
 float Button::GetAnimationTime() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetAnimationTime() is deprecated and will be removed from next release.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).GetAnimationTime();
 }
 
 void Button::SetLabelText( const std::string& label )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetLabelText() is deprecated and will be removed from next release. Use SetProperty LABEL or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetLabelText( label );
 }
 
 std::string Button::GetLabelText() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetLabelText() is deprecated and will be removed from next release. Use GetProperty LABEL instead.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).GetLabelText();
 }
 
 void Button::SetUnselectedImage( const std::string& filename )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetUnselectedImage() is deprecated and will be removed from next release. Use SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetUnselectedImage( filename );
 }
 
 void Button::SetBackgroundImage( const std::string& filename )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( filename );
 }
 
 void Button::SetSelectedImage( const std::string& filename )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( filename );
 }
 
 void Button::SetSelectedBackgroundImage( const std::string& filename )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( filename );
 }
 
 void Button::SetDisabledBackgroundImage( const std::string& filename )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release. Use SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( filename );
 }
 
 void Button::SetDisabledImage( const std::string& filename )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( filename );
 }
 
 void Button::SetDisabledSelectedImage( const std::string& filename )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( filename );
 }
 
@@ -195,11 +242,15 @@ Button::ButtonSignalType& Button::StateChangedSignal()
 
 void Button::SetLabel( Actor label )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetLabel() is deprecated and will be removed from next release. Use SetProperty LABEL instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
 }
 
 void Button::SetButtonImage( Image image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
   Actor imageView = Toolkit::ImageView::New( image );
   imageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageView );
@@ -207,6 +258,8 @@ void Button::SetButtonImage( Image image )
 
 void Button::SetSelectedImage( Image image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
   Actor imageView = Toolkit::ImageView::New( image );
   imageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageView );
@@ -214,11 +267,15 @@ void Button::SetSelectedImage( Image image )
 
 Actor Button::GetButtonImage() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetButtonImage() is deprecated and will be removed from next release.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
 }
 
 Actor Button::GetSelectedImage() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetSelectedImage() is deprecated and will be removed from next release.\n" );
+
   return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
 }
 
index 7d95738..b805660 100644 (file)
@@ -184,7 +184,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] disabled property.
    */
-  void SetDisabled( bool disabled );
+  void SetDisabled( bool disabled ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use GetProperty DISABLED
@@ -193,7 +193,7 @@ public:
    * @SINCE_1_0.0
    * @return \e true if the button is \e disabled.
    */
-  bool IsDisabled() const;
+  bool IsDisabled() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 SetProperty AUTO_REPEATING or Styling file
@@ -206,7 +206,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] autoRepeating \e autorepeating property.
    */
-  void SetAutoRepeating( bool autoRepeating );
+  void SetAutoRepeating( bool autoRepeating ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 GetProperty AUTO_REPEATING
@@ -215,7 +215,7 @@ public:
    * @SINCE_1_0.0
    * @return \e true if the \e autorepeating property is set.
    */
-  bool IsAutoRepeating() const;
+  bool IsAutoRepeating() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file
@@ -228,7 +228,7 @@ public:
    * @param[in] initialAutoRepeatingDelay in seconds.
    * @pre initialAutoRepeatingDelay must be greater than zero.
    */
-  void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay );
+  void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 GetProperty INITIAL_AUTO_REPEATING_DELAY
@@ -237,7 +237,7 @@ public:
    * @SINCE_1_0.0
    * @return the initial autorepeating delay in seconds.
    */
-  float GetInitialAutoRepeatingDelay() const;
+  float GetInitialAutoRepeatingDelay() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file
@@ -250,7 +250,7 @@ public:
    * @param[in] nextAutoRepeatingDelay in seconds.
    * @pre nextAutoRepeatingDelay must be greater than zero.
    */
-  void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay );
+  void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 GetProperty NEXT_AUTO_REPEATING_DELAY
@@ -259,7 +259,7 @@ public:
    * @SINCE_1_0.0
    * @return the next autorepeating delay in seconds.
    */
-  float GetNextAutoRepeatingDelay() const;
+  float GetNextAutoRepeatingDelay() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 SetProperty TOGGLABLE or Styling file
@@ -271,7 +271,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] togglable property.
    */
-  void SetTogglableButton( bool togglable );
+  void SetTogglableButton( bool togglable ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 GetProperty TOGGLABLE
@@ -280,7 +280,7 @@ public:
    * @SINCE_1_0.0
    * @return \e true if the \e togglable property is set.
    */
-  bool IsTogglableButton() const;
+  bool IsTogglableButton() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 SetProperty SELECTED
@@ -294,16 +294,16 @@ public:
    * @SINCE_1_0.0
    * @param[in] selected property.
    */
-  void SetSelected( bool selected );
+  void SetSelected( bool selected ) DALI_DEPRECATED_API;
 
   /**
-   * DEPRECATED_1_1.32  SetProperty SELECTED
+   * DEPRECATED_1_1.32  GetProperty SELECTED
    *
    * @brief Returns if the selected property is set and the button is togglable.
    * @SINCE_1_0.0
    * @return \e true if the button is \e selected.
    */
-  bool IsSelected() const;
+  bool IsSelected() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use Styling file to set animation
@@ -313,7 +313,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] animationTime The animation time in seconds.
    */
-  void SetAnimationTime( float animationTime );
+  void SetAnimationTime( float animationTime ) DALI_DEPRECATED_API;
 
   /**
    * DEPRECATED_1_1.32 Use Styling file to set animation
@@ -323,7 +323,7 @@ public:
    * @SINCE_1_0.0
    * @return The animation time in seconds.
    */
-  float GetAnimationTime() const;
+  float GetAnimationTime() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 SetProperty LABEL or Styling file
@@ -333,7 +333,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] label The label text.
    */
-  void SetLabelText( const std::string& label );
+  void SetLabelText( const std::string& label ) DALI_DEPRECATED_API;
 
   /**
    * DEPRECATED_1_1.32 GetProperty LABEL
@@ -343,7 +343,7 @@ public:
    * @SINCE_1_0.0
    * @return The label text.
    */
-  std::string GetLabelText() const;
+  std::string GetLabelText() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use Styling file
@@ -353,7 +353,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] filename The button image.
    */
-  void SetUnselectedImage( const std::string& filename );
+  void SetUnselectedImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use styling
@@ -363,7 +363,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] filename The background image.
    */
-  void SetBackgroundImage( const std::string& filename );
+  void SetBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use styling file
@@ -373,7 +373,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] filename The selected image.
    */
-  void SetSelectedImage( const std::string& filename );
+  void SetSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use styling file
@@ -383,7 +383,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] filename The selected background image.
    */
-  void SetSelectedBackgroundImage( const std::string& filename );
+  void SetSelectedBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use styling file
@@ -393,7 +393,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] filename The disabled background image.
    */
-  void SetDisabledBackgroundImage( const std::string& filename );
+  void SetDisabledBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use styling file
@@ -403,7 +403,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] filename The disabled button image.
    */
-  void SetDisabledImage( const std::string& filename );
+  void SetDisabledImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.32 Use styling file
@@ -413,7 +413,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] filename The disabled selected button image.
    */
-  void SetDisabledSelectedImage( const std::string& filename );
+  void SetDisabledSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_0.50. Instead, use SetLabelText.
@@ -423,7 +423,7 @@ public:
    * @SINCE_1_0.0
    * @param[in]  label The actor to use as a label
    */
-  void SetLabel( Actor label );
+  void SetLabel( Actor label ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_0.50. Instead, use SetUnselectedImage.
@@ -433,7 +433,7 @@ public:
    * @SINCE_1_0.0
    * @param[in]  image The button image.
    */
-  void SetButtonImage( Image image );
+  void SetButtonImage( Image image ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_0.50. Instead, use SetSelectedImage( const std::string& filename ).
@@ -443,7 +443,7 @@ public:
    * @SINCE_1_0.0
    * @param[in]  image The selected image.
    */
-  void SetSelectedImage( Image image );
+  void SetSelectedImage( Image image ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_0.50
@@ -454,7 +454,7 @@ public:
    * @remarks Avoid using this method as it's a legacy code.
    * @return     An actor with the button image.
    */
-  Actor GetButtonImage() const;
+  Actor GetButtonImage() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_0.50
@@ -465,7 +465,7 @@ public:
    * @remarks Avoid using this method as it's a legacy code.
    * @return     An actor with the selected image.
    */
-  Actor GetSelectedImage() const;
+  Actor GetSelectedImage() const DALI_DEPRECATED_API;
 
 public: //Signals
 
index 90fcefd..5e40b55 100644 (file)
  */
 
 // CLASS HEADER
-
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
 
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
 
 namespace Dali
@@ -77,36 +78,50 @@ PushButton PushButton::DownCast( BaseHandle handle )
 
 void PushButton::SetButtonImage( Actor image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Button.SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
 }
 
 void PushButton::SetBackgroundImage( Actor image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
 }
 
 void PushButton::SetSelectedImage( Actor image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Button.SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
 }
 
 void PushButton::SetSelectedBackgroundImage( Actor image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image );
 }
 
 void PushButton::SetDisabledBackgroundImage( Actor image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
 }
 
 void PushButton::SetDisabledImage( Actor image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Button.SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
 }
 
 void PushButton::SetDisabledSelectedImage( Actor image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" );
+
   Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( image );
 }
 
index c49e55d..0a3a2ee 100644 (file)
@@ -185,7 +185,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
-  void SetButtonImage( Actor image );
+  void SetButtonImage( Actor image ) DALI_DEPRECATED_API;
 
   using Button::SetBackgroundImage;
 
@@ -197,7 +197,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
-  void SetBackgroundImage( Actor image );
+  void SetBackgroundImage( Actor image ) DALI_DEPRECATED_API;
 
   using Button::SetSelectedImage;
 
@@ -209,7 +209,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
-  void SetSelectedImage( Actor image );
+  void SetSelectedImage( Actor image ) DALI_DEPRECATED_API;
 
   using Button::SetSelectedBackgroundImage;
 
@@ -221,7 +221,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
-  void SetSelectedBackgroundImage( Actor image );
+  void SetSelectedBackgroundImage( Actor image ) DALI_DEPRECATED_API;
 
   using Button::SetDisabledBackgroundImage;
 
@@ -233,7 +233,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
-  void SetDisabledBackgroundImage( Actor image );
+  void SetDisabledBackgroundImage( Actor image ) DALI_DEPRECATED_API;
 
   using Button::SetDisabledImage;
 
@@ -245,7 +245,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
-  void SetDisabledImage( Actor image );
+  void SetDisabledImage( Actor image ) DALI_DEPRECATED_API;
 
   using Button::SetDisabledSelectedImage;
 
@@ -257,7 +257,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
-  void SetDisabledSelectedImage( Actor image );
+  void SetDisabledSelectedImage( Actor image ) DALI_DEPRECATED_API;
 
 
 public: // Not intended for application developers
index b6ea20b..e9a866e 100644 (file)
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 #include <dali-toolkit/internal/visuals/color/color-visual.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
 
 namespace Dali
 {
@@ -457,11 +460,25 @@ Vector4 Control::GetBackgroundColor() const
 void Control::SetBackground( const Property::Map& map )
 {
   Actor self( Self() );
-  InitializeVisual( self, mImpl->mBackgroundVisual, map );
-  if( mImpl->mBackgroundVisual )
+  Toolkit::Visual::Base backgroundVisual;
+  InitializeVisual( self, backgroundVisual, map );
+
+  // if new visual created, replace existing one
+  if( backgroundVisual )
   {
+    mImpl->mBackgroundVisual = backgroundVisual;
     mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND );
   }
+  // ...otherwise process map and apply it to the existing visual
+  else if( mImpl->mBackgroundVisual )
+  {
+    Property::Value* premultipliedAlpha = map.Find( Toolkit::DevelVisual::Property::PREMULTIPLIED_ALPHA, Toolkit::Internal::PREMULTIPLIED_ALPHA );
+    if( premultipliedAlpha )
+    {
+      bool value( premultipliedAlpha->Get<bool>() );
+      Toolkit::GetImplementation( mImpl->mBackgroundVisual ).EnablePreMultipliedAlpha( value );
+    }
+  }
 }
 
 void Control::SetBackgroundImage( Image image )
@@ -743,10 +760,12 @@ void Control::OnInitialize()
 
 void Control::OnControlChildAdd( Actor& child )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: OnControlChildAdd() is deprecated and will be removed from next release. Override OnChildAdd instead.\n" );
 }
 
 void Control::OnControlChildRemove( Actor& child )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: OnControlChildRemove() is deprecated and will be removed from next release. Override OnChildRemove instead.\n" );
 }
 
 void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
index d185f7e..9db5391 100644 (file)
@@ -460,7 +460,7 @@ public: // API for derived classes to override
    * @SINCE_1_0.0
    * @param[in] child The added actor.
    */
-  virtual void OnControlChildAdd( Actor& child );
+  virtual void OnControlChildAdd( Actor& child ) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.30. Override OnChildRemove instead.
@@ -472,7 +472,7 @@ public: // API for derived classes to override
    * @SINCE_1_0.0
    * @param[in] child The removed actor.
    */
-  virtual void OnControlChildRemove( Actor& child );
+  virtual void OnControlChildRemove( Actor& child ) DALI_DEPRECATED_API;
 
   // Styling
 
index 18eaeeb..b83a652 100644 (file)
@@ -18,6 +18,9 @@
 // CLASS HEADER
 #include <dali-toolkit/public-api/controls/control.h>
 
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 
@@ -106,11 +109,15 @@ const std::string& Control::GetStyleName() const
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
+
   Internal::GetImplementation(*this).SetBackgroundColor( color );
 }
 
 Vector4 Control::GetBackgroundColor() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetBackgroundColor() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
+
   return Internal::GetImplementation(*this).GetBackgroundColor();
 }
 
index 7da7cd5..6e8f9bf 100644 (file)
@@ -330,7 +330,7 @@ public:
    * @SINCE_1_0.0
    * @return The background color of the control.
    */
-  Vector4 GetBackgroundColor() const;
+  Vector4 GetBackgroundColor() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2_8, use Property::BACKGROUND instead
@@ -340,7 +340,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The image to set as the background.
    */
-  void SetBackgroundImage( Image image );
+  void SetBackgroundImage( Image image ) DALI_DEPRECATED_API;
 
   /**
    * @brief Clears the background.
index 2726af5..02d3e0d 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
 // EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/property-map.h>
 
@@ -60,6 +61,8 @@ ImageView ImageView::New()
 
 ImageView ImageView::New( Image image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: New() is deprecated and will be removed from next release. use New( const std::string& ) instead.\n" );
+
   ImageView imageView = Internal::ImageView::New();
   imageView.SetImage( image );
   return imageView;
@@ -86,6 +89,8 @@ ImageView ImageView::DownCast( BaseHandle handle )
 
 void ImageView::SetImage( Image image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetImage() is deprecated and will be removed from next release. Use SetImage( const std::string& ) instead.\n" );
+
   Dali::Toolkit::GetImpl( *this ).SetImage( image );
 }
 
@@ -101,6 +106,8 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
 
 Image ImageView::GetImage() const
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetImage() is deprecated and will be removed from next release.\n" );
+
   return Dali::Toolkit::GetImpl( *this ).GetImage();
 }
 
index 94336c6..40a19ea 100644 (file)
@@ -139,7 +139,7 @@ public:
    * @param[in] image The Image instance to display.
    * @return A handle to a newly allocated ImageView.
    */
-  static ImageView New( Image image );
+  static ImageView New( Image image ) DALI_DEPRECATED_API;
 
   /**
    * @brief Create an initialized ImageView from an URL to an image resource.
@@ -218,7 +218,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] image The Image instance to display.
    */
-  void SetImage( Image image );
+  void SetImage( Image image ) DALI_DEPRECATED_API;
 
   /**
    * @brief Sets this ImageView from the given URL.
@@ -254,7 +254,7 @@ public:
    * @SINCE_1_0.0
    * @return The Image instance currently used by the ImageView.
    */
-  Image GetImage() const;
+  Image GetImage() const DALI_DEPRECATED_API;
 
 public: // Not intended for application developers