[dali_1.2.2] Merge branch 'devel/master' 81/84581/1
authorFerran Sole <ferran.sole@samsung.com>
Fri, 19 Aug 2016 10:00:08 +0000 (11:00 +0100)
committerFerran Sole <ferran.sole@samsung.com>
Fri, 19 Aug 2016 10:00:08 +0000 (11:00 +0100)
Change-Id: Ia4c85347ab31c11c89a5d9fedca2103fab6d1f43

108 files changed:
automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-DebugRendering.cpp [moved from automated-tests/src/dali-toolkit/utc-Dali-DebugVisual.cpp with 92% similarity]
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-Visual.cpp
dali-toolkit/devel-api/visual-factory/visual-base.cpp
dali-toolkit/internal/builder/builder-impl.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/styling/style-manager-impl.cpp
dali-toolkit/internal/text/input-style.h
dali-toolkit/internal/text/logical-model-impl.cpp
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/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/border/border-visual.h
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.h
dali-toolkit/internal/visuals/image/batch-image-visual.cpp
dali-toolkit/internal/visuals/image/batch-image-visual.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.h
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/visual-factory-cache.cpp
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp [moved from dali-toolkit/internal/visuals/debug/debug-visual.cpp with 85% similarity]
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h [moved from dali-toolkit/internal/visuals/debug/debug-visual.h with 78% similarity]
dali-toolkit/public-api/controls/buttons/check-box-button.h
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/text-controls/text-editor.cpp
dali-toolkit/public-api/controls/text-controls/text-editor.h
dali-toolkit/public-api/controls/text-controls/text-field.cpp
dali-toolkit/public-api/controls/text-controls/text-field.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/styling/style-manager.h
dali-toolkit/public-api/visuals/visual-properties.h
doc/dali-toolkit-doc.h
docs/content/images/debug-rendering/debug-blocks.png [moved from docs/content/images/debug-visual/debug-blocks.png with 100% similarity]
docs/content/images/visuals/wireframe-visual.png [new file with mode: 0644]
docs/content/main.md
docs/content/programming-guide/handle-body-idiom.h
docs/content/programming-guide/hello-world.h
docs/content/programming-guide/image-view.h
docs/content/programming-guide/properties.h
docs/content/programming-guide/styling.h
docs/content/shared-javascript-and-cpp-documentation/accessibility.md
docs/content/shared-javascript-and-cpp-documentation/animation.md
docs/content/shared-javascript-and-cpp-documentation/copy-and-paste.md
docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md
docs/content/shared-javascript-and-cpp-documentation/dali-introduction.md
docs/content/shared-javascript-and-cpp-documentation/debug-rendering.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/debug-visual.md [deleted file]
docs/content/shared-javascript-and-cpp-documentation/documentation-guide.md
docs/content/shared-javascript-and-cpp-documentation/emscripten.md
docs/content/shared-javascript-and-cpp-documentation/flex-container.md
docs/content/shared-javascript-and-cpp-documentation/font-selection.md
docs/content/shared-javascript-and-cpp-documentation/fundamentals.md
docs/content/shared-javascript-and-cpp-documentation/javascript-wrapping-guide.md
docs/content/shared-javascript-and-cpp-documentation/layer.md
docs/content/shared-javascript-and-cpp-documentation/markup-style.md
docs/content/shared-javascript-and-cpp-documentation/multi-touch-guide.md
docs/content/shared-javascript-and-cpp-documentation/performance-profiling.md
docs/content/shared-javascript-and-cpp-documentation/performance-tips.md
docs/content/shared-javascript-and-cpp-documentation/popup.md
docs/content/shared-javascript-and-cpp-documentation/resource-image-scaling.md
docs/content/shared-javascript-and-cpp-documentation/resources.md
docs/content/shared-javascript-and-cpp-documentation/script-hello.md
docs/content/shared-javascript-and-cpp-documentation/script-json-specification.md
docs/content/shared-javascript-and-cpp-documentation/script-overview.md
docs/content/shared-javascript-and-cpp-documentation/stage-hand.md
docs/content/shared-javascript-and-cpp-documentation/text-auto-scrolling.md
docs/content/shared-javascript-and-cpp-documentation/text-field.md
docs/content/shared-javascript-and-cpp-documentation/visuals.md
packaging/dali-addon.spec
packaging/dali-toolkit.spec

index d82faf3..8d93d9c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include <dali/devel-api/adaptor-framework/style-monitor.h>
+
 #include <iostream>
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
@@ -162,7 +164,6 @@ void dali_style_manager_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-
 int UtcDaliStyleManagerConstructorP(void)
 {
   ToolkitTestApplication application;
@@ -573,9 +574,9 @@ int UtcDaliStyleManagerApplyStyle(void)
 }
 
 
-int UtcDaliStyleManagerStyleChangedSignal(void)
+int UtcDaliStyleManagerStyleChangedSignalFontFamily(void)
 {
-  tet_infoline("Test that the StyleChange signal is fired when the font size is altered" );
+  tet_infoline("Test that the StyleChange signal is fired when the font family is altered" );
   Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
                                           defaultTheme );
 
@@ -589,7 +590,7 @@ int UtcDaliStyleManagerStyleChangedSignal(void)
   Stage::GetCurrent().Add( label2 );
 
   StyleChangedSignalChecker styleChangedSignalHandler;
-  StyleMonitor styleMonitor = StyleMonitor::Get();
+  Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
   StyleManager styleManager = StyleManager::Get();
 
   styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged);
@@ -611,3 +612,251 @@ int UtcDaliStyleManagerStyleChangedSignal(void)
 
   END_TEST;
 }
+
+int UtcDaliStyleManagerStyleChangedSignalFontSize(void)
+{
+  tet_infoline("Test that the StyleChange signal is fired when the font size is altered" );
+
+  const char* defaultTheme =
+    "{\n"
+    "  \"styles\":\n"
+    "  {\n"
+    "    \"textlabelFontSize0\":\n"
+    "    {\n"
+    "      \"pointSize\":10\n"
+    "    },\n"
+    "    \"textlabelFontSize1\":\n"
+    "    {\n"
+    "      \"pointSize\":10\n"
+    "    },\n"
+    "    \"textlabelFontSize2\":\n"
+    "    {\n"
+    "      \"pointSize\":12\n"
+    "    },\n"
+    "    \"textlabelFontSize3\":\n"
+    "    {\n"
+    "      \"pointSize\":14\n"
+    "    },\n"
+    "    \"textlabelFontSize4\":\n"
+    "    {\n"
+    "      \"pointSize\":16\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme );
+
+  ToolkitTestApplication application;
+
+  std::string labelStr("Label");
+  Toolkit::TextLabel label = Toolkit::TextLabel::New(labelStr);
+  Stage::GetCurrent().Add( label );
+
+  Toolkit::TextLabel label2 = Toolkit::TextLabel::New(labelStr);
+  Stage::GetCurrent().Add( label2 );
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  StyleMonitor styleMonitor = StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  label.SetProperty(TextLabel::Property::POINT_SIZE, 10.0f);
+
+  styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged);
+
+  Test::StyleMonitor::SetDefaultFontSize(2);
+  styleMonitor.StyleChangeSignal().Emit( styleMonitor,  StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+
+  tet_infoline("Test that the StyleChanged signal is received only once");
+  DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION );
+
+  tet_infoline("Test that the label's font size has been altered\n");
+  Property::Value pointSizeValue = label.GetProperty(TextLabel::Property::POINT_SIZE);
+  float pointSize;
+  pointSizeValue.Get( pointSize );
+
+  DALI_TEST_EQUALS( pointSize, 12.0f, 0.001, TEST_LOCATION );
+
+  styleChangedSignalHandler.signalCount = 0;
+
+  Test::StyleMonitor::SetDefaultFontSize(4);
+  styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+
+  tet_infoline("Test that the StyleChanged signal is received only once");
+  DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION );
+
+  // Check that the label's font style has been altered
+  pointSizeValue = label.GetProperty(TextLabel::Property::POINT_SIZE);
+  pointSizeValue.Get( pointSize );
+
+  DALI_TEST_EQUALS( pointSize, 16.0f, 0.001, TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+
+int UtcDaliStyleManagerStyleChangedSignalFontSizeTextField(void)
+{
+  tet_infoline("Test that the StyleChange signal is fired when the font size is altered" );
+
+  const char* defaultTheme =
+    "{\n"
+    "  \"styles\":\n"
+    "  {\n"
+    "    \"textfieldFontSize0\":\n"
+    "    {\n"
+    "      \"pointSize\":8\n"
+    "    },\n"
+    "    \"textfieldFontSize1\":\n"
+    "    {\n"
+    "      \"pointSize\":10\n"
+    "    },\n"
+    "    \"textfieldFontSize2\":\n"
+    "    {\n"
+    "      \"pointSize\":12\n"
+    "    },\n"
+    "    \"textfieldFontSize3\":\n"
+    "    {\n"
+    "      \"pointSize\":14\n"
+    "    },\n"
+    "    \"textfieldFontSize4\":\n"
+    "    {\n"
+    "      \"pointSize\":16\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme );
+
+  ToolkitTestApplication application;
+
+  std::string fieldStr("Field");
+  Toolkit::TextField field = Toolkit::TextField::New();
+  field.SetProperty( Toolkit::TextField::Property::TEXT, fieldStr );
+  Stage::GetCurrent().Add( field );
+
+  Toolkit::TextField field2 = Toolkit::TextField::New();
+  Stage::GetCurrent().Add( field2 );
+  field2.SetProperty( Toolkit::TextField::Property::TEXT, fieldStr );
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  StyleMonitor styleMonitor = StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  field.SetProperty(TextField::Property::POINT_SIZE, 10.0f);
+
+  styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged);
+
+  Test::StyleMonitor::SetDefaultFontSize(2);
+  styleMonitor.StyleChangeSignal().Emit( styleMonitor,  StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+
+  tet_infoline("Test that the StyleChanged signal is received only once");
+  DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION );
+
+  tet_infoline("Test that the field's font size has been altered\n");
+  Property::Value pointSizeValue = field.GetProperty(TextField::Property::POINT_SIZE);
+  float pointSize;
+  pointSizeValue.Get( pointSize );
+
+  DALI_TEST_EQUALS( pointSize, 12.0f, 0.001, TEST_LOCATION );
+
+  styleChangedSignalHandler.signalCount = 0;
+
+  Test::StyleMonitor::SetDefaultFontSize(4);
+  styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+
+  tet_infoline("Test that the StyleChanged signal is received only once");
+  DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION );
+
+  // Check that the field's font style has been altered
+  pointSizeValue = field.GetProperty(TextField::Property::POINT_SIZE);
+  pointSizeValue.Get( pointSize );
+
+  DALI_TEST_EQUALS( pointSize, 16.0f, 0.001, TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+int UtcDaliStyleManagerStyleChangedSignalFontSizeTextEditor(void)
+{
+  tet_infoline("Test that the StyleChange signal is fired when the font size is altered" );
+
+  const char* defaultTheme =
+    "{\n"
+    "  \"styles\":\n"
+    "  {\n"
+    "    \"texteditorFontSize0\":\n"
+    "    {\n"
+    "      \"pointSize\":10\n"
+    "    },\n"
+    "    \"texteditorFontSize1\":\n"
+    "    {\n"
+    "      \"pointSize\":12\n"
+    "    },\n"
+    "    \"texteditorFontSize2\":\n"
+    "    {\n"
+    "      \"pointSize\":14\n"
+    "    },\n"
+    "    \"texteditorFontSize3\":\n"
+    "    {\n"
+    "      \"pointSize\":18\n"
+    "    },\n"
+    "    \"texteditorFontSize4\":\n"
+    "    {\n"
+    "      \"pointSize\":25\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme );
+
+  ToolkitTestApplication application;
+
+  std::string editorStr("Editor");
+  Toolkit::TextEditor editor = Toolkit::TextEditor::New();
+  editor.SetProperty( Toolkit::TextEditor::Property::TEXT, editorStr );
+  Stage::GetCurrent().Add( editor );
+
+  Toolkit::TextEditor editor2 = Toolkit::TextEditor::New();
+  Stage::GetCurrent().Add( editor2 );
+  editor2.SetProperty( Toolkit::TextEditor::Property::TEXT, editorStr );
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  StyleMonitor styleMonitor = StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.0f);
+
+  styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged);
+
+  Test::StyleMonitor::SetDefaultFontSize(2);
+  styleMonitor.StyleChangeSignal().Emit( styleMonitor,  StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+
+  tet_infoline("Test that the StyleChanged signal is received only once");
+  DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION );
+
+  tet_infoline("Test that the editor's font size has been altered\n");
+  Property::Value pointSizeValue = editor.GetProperty(TextEditor::Property::POINT_SIZE);
+  float pointSize;
+  pointSizeValue.Get( pointSize );
+
+  DALI_TEST_EQUALS( pointSize, 14.0f, 0.001, TEST_LOCATION );
+
+  styleChangedSignalHandler.signalCount = 0;
+
+  Test::StyleMonitor::SetDefaultFontSize(4);
+  styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+
+  tet_infoline("Test that the StyleChanged signal is received only once");
+  DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION );
+
+  // Check that the editor's font style has been altered
+  pointSizeValue = editor.GetProperty(TextEditor::Property::POINT_SIZE);
+  pointSizeValue.Get( pointSize );
+
+  DALI_TEST_EQUALS( pointSize, 25.0f, 0.001, TEST_LOCATION );
+
+
+  END_TEST;
+}
index 0db0538..c3723e0 100644 (file)
@@ -50,13 +50,14 @@ SET(TC_SOURCES
    utc-Dali-Model3dView.cpp
    utc-Dali-Visual.cpp
    utc-Dali-VisualFactory.cpp
-   utc-Dali-DebugVisual.cpp
+   utc-Dali-DebugRendering.cpp
    utc-Dali-ImageAtlas.cpp
    utc-Dali-VideoView.cpp
 )
 
 # Append list of test harness files (Won't get parsed for test cases)
 LIST(APPEND TC_SOURCES
+   dali-toolkit-test-utils/toolkit-adaptor.cpp
    dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
    dali-toolkit-test-utils/toolkit-application.cpp
    dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
index 1a6a0b3..e53798f 100644 (file)
 
 // INTERNAL INCLUDES
 
-// dali-test-suite-utils.h needed first, but want to prevent certain headers
-// from being read, as we want to override as much of their behaviour as possible.
-#define __DALI_STYLE_MONITOR_H__
-#define __DALI_ACCESSIBILITY_MANAGER_H__
-#define __DALI_TIMER_H__
-#define __DALI_CLIPBOARD_H__
-#define __DALI_IMF_MANAGER_H__
-
 #include <dali-test-suite-utils.h>
-
 #include "toolkit-test-application.h"
 #include "toolkit-application.h"
 
index fcf6825..80fb6ec 100644 (file)
@@ -85,6 +85,16 @@ void DummyControlImpl::UnregisterVisual( Property::Index index )
   Control::UnregisterVisual( index );
 }
 
+Toolkit::Visual::Base DummyControlImpl::GetVisual( Property::Index index )
+{
+  return Control::GetVisual( index );
+}
+
+Actor DummyControlImpl::GetPlacementActor( Property::Index index )
+{
+  return Control::GetPlacementActor( index );
+}
+
 DummyControl DummyControlImplOverride::New()
 {
   IntrusivePtr< DummyControlImplOverride > impl = new DummyControlImplOverride;
index 897fc17..3c88685 100644 (file)
@@ -73,6 +73,8 @@ public:
 
   void RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual);
   void UnregisterVisual( Property::Index index );
+  Toolkit::Visual::Base GetVisual( Property::Index index );
+  Actor GetPlacementActor( Property::Index index );
 
   // Used to test signal connections
   void CustomSlot1( Actor actor );
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h
new file mode 100644 (file)
index 0000000..5e71771
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef __DALI_TOOLKIT_ADAPTOR_IMPL_H__
+#define __DALI_TOOLKIT_ADAPTOR_IMPL_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.
+ *
+ */
+
+#include <dali/devel-api/adaptor-framework/render-surface.h>
+
+namespace Dali
+{
+class EglInterface;
+class DisplayConnection;
+class ThreadSynchronizationInterface;
+
+namespace Integration
+{
+
+class GlAbstraction;
+
+} // namespace Integration
+
+class TestRenderSurface : public RenderSurface
+{
+public:
+  virtual PositionSize GetPositionSize() const { PositionSize size; return size; }
+
+  virtual void InitializeEgl( EglInterface& egl ) {}
+
+  virtual void CreateEglSurface( EglInterface& egl ) {}
+
+  virtual void DestroyEglSurface( EglInterface& egl ) {}
+
+  virtual bool ReplaceEGLSurface( EglInterface& egl ) { return false; }
+
+  virtual void MoveResize( Dali::PositionSize positionSize ) {}
+
+  virtual void SetViewMode( ViewMode viewMode ) {}
+
+  virtual void StartRender() {}
+
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) { return false; }
+
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) {}
+
+  virtual void StopRender() {}
+
+  virtual void ReleaseLock() {}
+
+  virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {}
+
+  virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::ECORE_RENDER_SURFACE; }
+};
+
+namespace Internal
+{
+namespace Adaptor
+{
+
+class Adaptor: public BaseObject
+{
+public:
+  static Dali::Adaptor& Get();
+  Adaptor();
+  ~Adaptor();
+
+public:
+  static Dali::RenderSurface& GetSurface();
+  static Dali::Adaptor::AdaptorSignalType& AdaptorSignal();
+  static bool mAvailable;
+  static Vector<CallbackBase*> mCallbacks;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_ADAPTOR_IMPL_H__
index 4e884e0..4b25c5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/integration-api/adaptors/adaptor.h>
 
 #include <dali/public-api/object/base-object.h>
-#include <dali/devel-api/adaptor-framework/render-surface.h>
 
-namespace Dali
-{
-
-class EglInterface;
-class DisplayConnection;
-class ThreadSynchronizationInterface;
-
-namespace Integration
-{
+#include <toolkit-adaptor-impl.h>
 
-class GlAbstraction;
-
-} // namespace Integration
-
-class TestRenderSurface : public RenderSurface
+namespace Dali
 {
-public:
-  virtual PositionSize GetPositionSize() const { PositionSize size; return size; }
-
-  virtual void InitializeEgl( EglInterface& egl ) {}
-
-  virtual void CreateEglSurface( EglInterface& egl ) {}
-
-  virtual void DestroyEglSurface( EglInterface& egl ) {}
-
-  virtual bool ReplaceEGLSurface( EglInterface& egl ) { return false; }
-
-  virtual void MoveResize( Dali::PositionSize positionSize ) {}
-
-  virtual void SetViewMode( ViewMode viewMode ) {}
-
-  virtual void StartRender() {}
-
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) { return false; }
-
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) {}
-
-  virtual void StopRender() {}
-
-  virtual void ReleaseLock() {}
-
-  virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {}
-
-  virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::ECORE_RENDER_SURFACE; }
-};
 
 namespace Internal
 {
 namespace Adaptor
 {
 
-class Adaptor: public BaseObject
-{
-public:
-  static Dali::Adaptor& Get();
-  Adaptor();
-  ~Adaptor();
-
-public:
-  static Dali::RenderSurface& GetSurface();
-  static Dali::Adaptor::AdaptorSignalType& AdaptorSignal();
-};
+bool Adaptor::mAvailable = false;
+Vector<CallbackBase*> Adaptor::mCallbacks = Vector<CallbackBase*>();
 
 Dali::Adaptor& Adaptor::Get()
 {
   Dali::Adaptor* adaptor = new Dali::Adaptor;
+  Adaptor::mAvailable = true;
   return *adaptor;
 }
 
@@ -102,12 +52,8 @@ Dali::Adaptor::AdaptorSignalType& Adaptor::AdaptorSignal()
   return *signal;
 }
 
-}
-}
-}
-
-namespace Dali
-{
+} // namespace Adaptor
+} // namespace Internal
 
 Adaptor& Adaptor::New( Window window )
 {
@@ -151,7 +97,34 @@ void Adaptor::Stop()
 
 bool Adaptor::AddIdle( CallbackBase* callback )
 {
-  return false;
+  const bool isAvailable = IsAvailable();
+
+  if( isAvailable )
+  {
+    Internal::Adaptor::Adaptor::mCallbacks.PushBack( callback );
+  }
+
+  return isAvailable;
+}
+
+void Adaptor::RemoveIdle( CallbackBase* callback )
+{
+  const bool isAvailable = IsAvailable();
+
+  if( isAvailable )
+  {
+    for( Vector<CallbackBase*>::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(),
+           endIt = Internal::Adaptor::Adaptor::mCallbacks.End();
+         it != endIt;
+         ++it )
+    {
+      if( callback == *it )
+      {
+        Internal::Adaptor::Adaptor::mCallbacks.Remove( it );
+        return;
+      }
+    }
+  }
 }
 
 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
@@ -198,7 +171,7 @@ Adaptor& Adaptor::Get()
 
 bool Adaptor::IsAvailable()
 {
-  return false;
+  return Internal::Adaptor::Adaptor::mAvailable;
 }
 
 void Adaptor::NotifySceneCreated()
index 97c0df1..034e416 100644 (file)
@@ -41,6 +41,8 @@ public:
 
 public:
 
+  static std::string GetResourcePath();
+
   //Orientation& GetOrientation();
 
 public: // static methods
@@ -74,6 +76,10 @@ Application::~Application()
   //delete mOrientation;
 }
 
+std::string Application::GetResourcePath()
+{
+  return "";
+}
 //Orientation& Application::GetOrientation()
 //{
 //  return *mOrientation;
index e35ce05..11dfca9 100644 (file)
@@ -267,6 +267,10 @@ const std::string& ImfManager::GetSurroundingText() const
   return Internal::Adaptor::ImfManager::GetImplementation(*this).GetSurroundingText();
 }
 
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+}
+
 ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal()
 {
   return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal();
index d90e9d4..7049354 100644 (file)
@@ -212,6 +212,11 @@ public:
    */
   const std::string& GetSurroundingText() const;
 
+  /**
+  * @brief Notifies IMF context that text input is set to multi line or not
+  */
+  void NotifyTextInputMultiLine( bool multiLine );
+
 public:
 
   // Signals
index a7e0b46..b4f20a2 100644 (file)
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/signals/dali-signal.h>
 
-namespace Dali
-{
-const std::string Dali::StyleMonitor::DEFAULT_FONT_FAMILY("DefaultFont");
-const std::string Dali::StyleMonitor::DEFAULT_FONT_STYLE("Regular");
-const float       Dali::StyleMonitor::DEFAULT_FONT_SIZE(1.0f);
-}
-
 namespace
 {
 const char* DEFAULT_THEME=
@@ -57,9 +50,9 @@ typedef std::vector< NamedTheme > NamedThemes;
 NamedThemes gThemes;
 
 std::string gTheme;
-std::string gFontFamily = Dali::StyleMonitor::DEFAULT_FONT_FAMILY;
-std::string gFontStyle  = Dali::StyleMonitor::DEFAULT_FONT_STYLE;
-float       gFontSize   = Dali::StyleMonitor::DEFAULT_FONT_SIZE;
+std::string gFontFamily("LucidaSans");
+std::string gFontStyle("Regular");
+int         gFontSize(1);
 }
 
 namespace Dali
@@ -134,7 +127,6 @@ std::string StyleMonitor::GetDefaultFontStyle() const
 float StyleMonitor::GetDefaultFontSize() const
 {
   return gFontSize;
-
 }
 
 const std::string& StyleMonitor::GetTheme() const
@@ -220,7 +212,7 @@ std::string StyleMonitor::GetDefaultFontStyle() const
   return GetImplementation(*this).GetDefaultFontStyle();
 }
 
-float StyleMonitor::GetDefaultFontSize() const
+int StyleMonitor::GetDefaultFontSize() const
 {
   return GetImplementation(*this).GetDefaultFontSize();
 }
@@ -230,7 +222,7 @@ const std::string& StyleMonitor::GetTheme() const
   return GetImplementation(*this).GetTheme();
 }
 
-void StyleMonitor::SetTheme(std::string themeFilePath)
+void StyleMonitor::SetTheme(const std::string& themeFilePath)
 {
   GetImplementation(*this).SetTheme(themeFilePath);
 }
@@ -240,11 +232,6 @@ StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
   return GetImplementation(*this).StyleChangeSignal();
 }
 
-void StyleMonitor::EmitStyleChangeSignal(StyleChange::Type styleChange)
-{
-  GetImplementation(*this).EmitStyleChangeSignal(styleChange);
-}
-
 bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& output )
 {
   return GetImplementation(*this).LoadThemeFile(filename, output);
index b69a7db..dc9a018 100644 (file)
 #include <string>
 
 // INTERNAL INCLUDES
-#define __DALI_STYLE_MONITOR_H__
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/dali-signal.h>
 #include <dali/public-api/adaptor-framework/style-change.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-namespace Adaptor
-{
-class StyleMonitor;
-}
-}
-
-class StyleMonitor : public BaseHandle
-{
-public: // Typedefs
-  typedef Signal< void (StyleMonitor, StyleChange::Type) > StyleChangeSignalType;
-  static const std::string DEFAULT_FONT_FAMILY;
-  static const std::string DEFAULT_FONT_STYLE;
-  static const float       DEFAULT_FONT_SIZE;
-
-public: // Creation & Destruction
-  StyleMonitor();
-  StyleMonitor(const StyleMonitor& monitor);
-  static StyleMonitor Get();
-  ~StyleMonitor();
-  static StyleMonitor DownCast( BaseHandle handle );
-
-public: // Style Information
-  std::string GetDefaultFontFamily() const;
-  std::string GetDefaultFontStyle() const;
-  float GetDefaultFontSize() const;
-  const std::string& GetTheme() const;
-  void SetTheme(std::string themeFilePath);
-  bool LoadThemeFile( const std::string& filename, std::string& output );
-
-public: // Signals
-  StyleChangeSignalType& StyleChangeSignal();
-  void EmitStyleChangeSignal(StyleChange::Type handle);
-
-public: // Operators
-  StyleMonitor& operator=(const StyleMonitor& monitor);
-
-public:
-  StyleMonitor(Internal::Adaptor::StyleMonitor* styleMonitor);
-};
-
-
-} // namespace Dali
+#include <dali/devel-api/adaptor-framework/style-monitor.h>
 
 namespace Test
 {
index 384c22b..5cc5bef 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TEST_APPLICATION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@
 // INTERNAL INCLUDES
 #include <dali-test-suite-utils.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/adaptors/adaptor.h>
+#include <toolkit-adaptor-impl.h>
 
 namespace Dali
 {
@@ -60,6 +62,39 @@ public:
   //return mOrientation;
   //}
 
+  /**
+   * @brief Creates an adaptor implementation for those controls like the
+   * text-field and the text-editor which connects a callback to the idle signal.
+   */
+  void CreateAdaptor()
+  {
+    Adaptor::Get();
+  }
+
+  /**
+   * @brief Executes the idle callbacks.
+   *
+   * Some controls like the text-field and the text-editor connect callbacks to the
+   * idle signal.
+   */
+  void RunIdles()
+  {
+    if( Adaptor::IsAvailable() )
+    {
+      for( Vector<CallbackBase*>::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(),
+             endIt = Internal::Adaptor::Adaptor::mCallbacks.End();
+           it != endIt;
+           ++it )
+      {
+        CallbackBase* callback = *it;
+
+        CallbackBase::Execute( *callback );
+      }
+
+      Internal::Adaptor::Adaptor::mCallbacks.Clear();
+    }
+  }
+
 private:
   //ToolkitOrientation mOrientation;
 };
index 09d1dd7..2e691af 100644 (file)
@@ -956,6 +956,9 @@ int UtcDaliControlImplRegisterThenReRegisterVisual(void)
   Property::Index index =1;
   Actor placementActor = Actor::New();
 
+  DALI_TEST_CHECK( !dummyImpl.GetVisual( index )  );
+  DALI_TEST_CHECK( !dummyImpl.GetPlacementActor( index ) );
+
   Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
   Toolkit::Visual::Base visual;
 
@@ -969,6 +972,8 @@ int UtcDaliControlImplRegisterThenReRegisterVisual(void)
   // Register index with a color visual
   dummyImpl.RegisterVisual( index, placementActor, visual );
 
+  DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
 
   Property::Map newMap;
   newMap[Visual::Property::TYPE] = Visual::COLOR;
@@ -980,6 +985,9 @@ int UtcDaliControlImplRegisterThenReRegisterVisual(void)
   // ReRegister with altered color visual
   dummyImpl.RegisterVisual( index, placementActor, visual );
 
+  DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
+
   tet_result(TET_PASS);
 
   END_TEST;
@@ -1008,9 +1016,15 @@ int UtcDaliControlImplRegisterVisaulThenReRegisterToSelf(void)
   // Register index with a color visual
   dummyImpl.RegisterVisual( index, placementActor, visual );
 
+  DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
+
   // ReRegister to self
   dummyImpl.RegisterVisual( index, dummy, visual );
 
+  DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == dummy );
+
   END_TEST;
 }
 
@@ -1041,6 +1055,8 @@ int UtcDaliControlImplRegisterVisualToSelf(void)
     // Register to self
     dummyImpl.RegisterVisual( index, dummy, visual );
     DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
+    DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+    DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == dummy );
   }
 
   DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
@@ -1085,6 +1101,12 @@ int UtcDaliControlImplRegisterTwoVisuals(void)
   // ReRegister with altered color visual
   dummyImpl.RegisterVisual( index2, secondPlacementActor, secondVisual );
 
+  DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
+
+  DALI_TEST_CHECK( dummyImpl.GetVisual( index2 ) == secondVisual );
+  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index2 ) == secondPlacementActor );
+
   END_TEST;
 }
 
@@ -1111,8 +1133,14 @@ int UtcDaliControlImplRegisterUnregisterVisual(void)
   // Register index with a color visual
   dummyImpl.RegisterVisual( index, placementActor, visual );
 
+  DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
+
   // Unregister visual
   dummyImpl.UnregisterVisual( index );
 
+  DALI_TEST_CHECK( !dummyImpl.GetVisual( index ) );
+  DALI_TEST_CHECK( !dummyImpl.GetPlacementActor( index ) );
+
   END_TEST;
 }
@@ -42,7 +42,7 @@ bool IsDebugVisual( Visual::Base& visual )
   Property::Value* typeValue = propertyMap.Find( Visual::Property::TYPE,  Property::INTEGER );
   if ( typeValue )
   {
-    isDebugVisualType = ( typeValue->Get<int>() == Visual::DEBUG );
+    isDebugVisualType = ( typeValue->Get<int>() == Visual::WIREFRAME ); // Debug Rendering uses the WireframeVisual
   }
 
   Actor actor = Actor::New();
@@ -54,21 +54,21 @@ bool IsDebugVisual( Visual::Base& visual )
 }
 }
 
-void dali_debug_renderer_startup(void)
+void dali_debug_rendering_startup(void)
 {
   test_return_value = TET_UNDEF;
 }
 
-void dali_debug_renderer_cleanup(void)
+void dali_debug_rendering_cleanup(void)
 {
   test_return_value = TET_PASS;
 }
 
-int UtcDaliDebugVisualGetVisual1(void)
+int UtcDaliDebugRenderingGetVisual1(void)
 {
   EnvironmentVariable::SetTestingEnvironmentVariable(true);
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliDebugVisualGetVisual1:  Request visual with a Property::Map" );
+  tet_infoline( "UtcDaliDebugRenderingGetVisual1:  Request visual with a Property::Map" );
 
   VisualFactory factory = VisualFactory::Get();
   DALI_TEST_CHECK( factory );
@@ -130,11 +130,11 @@ int UtcDaliDebugVisualGetVisual1(void)
   END_TEST;
 }
 
-int UtcDaliDebugVisualGetVisual2(void)
+int UtcDaliDebugRenderingGetVisual2(void)
 {
   EnvironmentVariable::SetTestingEnvironmentVariable(true);
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliDebugVisualGetVisual2: Request visual with various parameters" );
+  tet_infoline( "UtcDaliDebugRenderingGetVisual2: Request visual with various parameters" );
 
   VisualFactory factory = VisualFactory::Get();
   DALI_TEST_CHECK( factory );
index dfc5c86..e9dd5e8 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <iostream>
 #include <stdlib.h>
+#include <unistd.h>
+
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/tap-gesture-event.h>
@@ -92,7 +94,26 @@ const float TO_SECONDS = 1.f / TO_MILLISECONDS;
 const float SCROLL_THRESHOLD = 10.f;
 const float SCROLL_SPEED = 300.f;
 
+const unsigned int DEFAULT_FONT_SIZE = 1152u;
+const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
+
 static bool gTextChangedCallBackCalled;
+static bool gInputStyleChangedCallbackCalled;
+static Dali::Toolkit::TextEditor::InputStyle::Mask gInputStyleMask;
+
+struct CallbackFunctor
+{
+  CallbackFunctor(bool* callbackFlag)
+  : mCallbackFlag( callbackFlag )
+  {
+  }
+
+  void operator()()
+  {
+    *mCallbackFlag = true;
+  }
+  bool* mCallbackFlag;
+};
 
 static void TestTextChangedCallback( TextEditor control )
 {
@@ -101,6 +122,14 @@ static void TestTextChangedCallback( TextEditor control )
   gTextChangedCallBackCalled = true;
 }
 
+static void TestInputStyleChangedCallback( TextEditor control, TextEditor::InputStyle::Mask mask )
+{
+  tet_infoline(" TestInputStyleChangedCallback");
+
+  gInputStyleChangedCallbackCalled = true;
+  gInputStyleMask = mask;
+}
+
 // Generate a TapGestureEvent to send to Core.
 Integration::TapGestureEvent GenerateTap(
     Gesture::State state,
@@ -485,11 +514,16 @@ int utcDaliTextEditorTextChangedP(void)
 
   Stage::GetCurrent().Add( editor );
 
-  editor.TextChangedSignal().Connect(&TestTextChangedCallback);
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  editor.TextChangedSignal().Connect( &TestTextChangedCallback );
+  bool textChangedSignal = false;
+  editor.ConnectSignal( testTracker, "textChanged",   CallbackFunctor(&textChangedSignal) );
 
   gTextChangedCallBackCalled = false;
   editor.SetProperty( TextEditor::Property::TEXT, "ABC" );
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_CHECK( textChangedSignal );
 
   application.SendNotification();
 
@@ -502,6 +536,464 @@ int utcDaliTextEditorTextChangedP(void)
   END_TEST;
 }
 
+int utcDaliTextEditorInputStyleChanged01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorInputStyleChanged01");
+
+  // The text-editor emits signals when the input style changes. These changes of style are
+  // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
+  // can't be emitted during the size negotiation as the callbacks may update the UI.
+  // The text-editor adds an idle callback to the adaptor to emit the signals after the size negotiation.
+  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
+  application.CreateAdaptor();
+
+  // Load some fonts.
+
+  char* pathNamePtr = get_current_dir_name();
+  const std::string pathName( pathNamePtr );
+  free( pathNamePtr );
+
+  TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+  fontClient.SetDpi( 93u, 93u );
+
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif.ttf", DEFAULT_FONT_SIZE );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif-Bold.ttf", DEFAULT_FONT_SIZE );
+
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK( editor );
+
+
+  editor.SetSize( 300.f, 50.f );
+  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+  editor.SetProperty( TextEditor::Property::TEXT, "<font family='DejaVuSerif' size='18'>He<color value='green'>llo</color> <font weight='bold'>world</font> demo</font>" );
+
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  editor.InputStyleChangedSignal().Connect( &TestInputStyleChangedCallback );
+  bool inputStyleChangedSignal = false;
+  editor.ConnectSignal( testTracker, "inputStyleChanged",   CallbackFunctor(&inputStyleChangedSignal) );
+
+  Stage::GetCurrent().Add( editor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 18.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 18.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextEditor::InputStyle::FONT_FAMILY | TextEditor::InputStyle::POINT_SIZE ), TEST_LOCATION );
+
+    const std::string fontFamily = editor.GetProperty( TextEditor::Property::INPUT_FONT_FAMILY ).Get<std::string>();
+    DALI_TEST_EQUALS( fontFamily, "DejaVuSerif", TEST_LOCATION );
+
+    const float pointSize = editor.GetProperty( TextEditor::Property::INPUT_POINT_SIZE ).Get<float>();
+    DALI_TEST_EQUALS( pointSize, 18.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 43.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 43.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextEditor::InputStyle::COLOR ), TEST_LOCATION );
+
+    const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::GREEN, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 88.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 88.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextEditor::InputStyle::COLOR | TextEditor::InputStyle::FONT_STYLE ), TEST_LOCATION );
+
+    const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
+
+    const std::string style = editor.GetProperty( TextEditor::Property::INPUT_FONT_STYLE ).Get<std::string>();
+    DALI_TEST_EQUALS( style, "{\"weight\":\"bold\"}", TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 115.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 115.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 164.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 164.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextEditor::InputStyle::FONT_STYLE ), TEST_LOCATION );
+
+    const std::string style = editor.GetProperty( TextEditor::Property::INPUT_FONT_STYLE ).Get<std::string>();
+    DALI_TEST_CHECK( style.empty() );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 191.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 191.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  END_TEST;
+}
+
+int utcDaliTextEditorInputStyleChanged02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorInputStyleChanged02");
+
+  // The text-editor emits signals when the input style changes. These changes of style are
+  // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
+  // can't be emitted during the size negotiation as the callbacks may update the UI.
+  // The text-editor adds an idle callback to the adaptor to emit the signals after the size negotiation.
+  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
+  application.CreateAdaptor();
+
+  // Load some fonts.
+
+  char* pathNamePtr = get_current_dir_name();
+  const std::string pathName( pathNamePtr );
+  free( pathNamePtr );
+
+  TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+  fontClient.SetDpi( 93u, 93u );
+
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif.ttf", DEFAULT_FONT_SIZE );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif-Bold.ttf", DEFAULT_FONT_SIZE );
+
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK( editor );
+
+
+  editor.SetSize( 300.f, 50.f );
+  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+  editor.SetProperty( TextEditor::Property::TEXT, "<font family='DejaVuSerif' size='18'>He<color value='blue'> l</color><color value='green'>lo</color> <font weight='bold'>world</font> demo</font>" );
+
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  editor.InputStyleChangedSignal().Connect( &TestInputStyleChangedCallback );
+  bool inputStyleChangedSignal = false;
+  editor.ConnectSignal( testTracker, "inputStyleChanged",   CallbackFunctor(&inputStyleChangedSignal) );
+
+  Stage::GetCurrent().Add( editor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 53.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 53.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 53.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 53.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextEditor::InputStyle::FONT_FAMILY |
+                                                 TextEditor::InputStyle::POINT_SIZE  |
+                                                 TextEditor::InputStyle::COLOR ),
+                      TEST_LOCATION );
+
+    const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::GREEN, TEST_LOCATION );
+
+    const std::string fontFamily = editor.GetProperty( TextEditor::Property::INPUT_FONT_FAMILY ).Get<std::string>();
+    DALI_TEST_EQUALS( fontFamily, "DejaVuSerif", TEST_LOCATION );
+
+    const float pointSize = editor.GetProperty( TextEditor::Property::INPUT_POINT_SIZE ).Get<float>();
+    DALI_TEST_EQUALS( pointSize, 18.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextEditor::InputStyle::COLOR ),
+                      TEST_LOCATION );
+
+    const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLUE, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextEditor::InputStyle::COLOR ),
+                      TEST_LOCATION );
+
+    const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  editor.SetProperty( TextEditor::Property::INPUT_COLOR, Color::YELLOW );
+
+  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"weight\":\"thin\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+  editor.SetProperty( TextEditor::Property::INPUT_POINT_SIZE, 20.f );
+  editor.SetProperty( TextEditor::Property::INPUT_LINE_SPACING, 5.f );
+
+  editor.SetProperty( TextEditor::Property::INPUT_UNDERLINE, "underline" );
+  editor.SetProperty( TextEditor::Property::INPUT_SHADOW, "shadow" );
+  editor.SetProperty( TextEditor::Property::INPUT_EMBOSS, "emboss" );
+  editor.SetProperty( TextEditor::Property::INPUT_OUTLINE, "outline" );
+
+  application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 63.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 63.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextEditor::InputStyle::COLOR |
+                                                 TextEditor::InputStyle::POINT_SIZE |
+                                                 TextEditor::InputStyle::FONT_STYLE |
+                                                 TextEditor::InputStyle::LINE_SPACING |
+                                                 TextEditor::InputStyle::UNDERLINE |
+                                                 TextEditor::InputStyle::SHADOW |
+                                                 TextEditor::InputStyle::EMBOSS |
+                                                 TextEditor::InputStyle::OUTLINE ),
+                      TEST_LOCATION );
+
+    const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextEditor::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  editor.SetProperty( TextEditor::Property::FONT_FAMILY, "DejaVuSerif" );
+  editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"weight\":\"black\",\"width\":\"expanded\",\"slant\":\"oblique\"}" );
+
+  // Create a tap event to touch the text editor.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextEditor::InputStyle::COLOR |
+                                                 TextEditor::InputStyle::POINT_SIZE |
+                                                 TextEditor::InputStyle::FONT_STYLE ),
+                      TEST_LOCATION );
+
+    const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::YELLOW, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  END_TEST;
+}
+
 int utcDaliTextEditorEvent01(void)
 {
   ToolkitTestApplication application;
index cd3985a..3cc605c 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <iostream>
 #include <stdlib.h>
+#include <unistd.h>
+
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/tap-gesture-event.h>
@@ -105,8 +107,13 @@ const float TO_SECONDS = 1.f / TO_MILLISECONDS;
 const float SCROLL_THRESHOLD = 10.f;
 const float SCROLL_SPEED = 300.f;
 
+const unsigned int DEFAULT_FONT_SIZE = 1152u;
+const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
+
 static bool gTextChangedCallBackCalled;
 static bool gMaxCharactersCallBackCalled;
+static bool gInputStyleChangedCallbackCalled;
+static Dali::Toolkit::TextField::InputStyle::Mask gInputStyleMask;
 
 static void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
 {
@@ -206,6 +213,19 @@ static int Wait(ToolkitTestApplication& application, int duration = 0)
   return time;
 }
 
+struct CallbackFunctor
+{
+  CallbackFunctor(bool* callbackFlag)
+  : mCallbackFlag( callbackFlag )
+  {
+  }
+
+  void operator()()
+  {
+    *mCallbackFlag = true;
+  }
+  bool* mCallbackFlag;
+};
 
 static void TestTextChangedCallback( TextField control )
 {
@@ -221,6 +241,14 @@ static void TestMaxLengthReachedCallback( TextField control )
   gMaxCharactersCallBackCalled = true;
 }
 
+static void TestInputStyleChangedCallback( TextField control, TextField::InputStyle::Mask mask )
+{
+  tet_infoline(" TestInputStyleChangedCallback");
+
+  gInputStyleChangedCallbackCalled = true;
+  gInputStyleMask = mask;
+}
+
 // Generate a TapGestureEvent to send to Core.
 Integration::TapGestureEvent GenerateTap(
     Gesture::State state,
@@ -641,11 +669,16 @@ int utcDaliTextFieldTextChangedP(void)
 
   Stage::GetCurrent().Add( field );
 
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
   field.TextChangedSignal().Connect(&TestTextChangedCallback);
+  bool textChangedSignal = false;
+  field.ConnectSignal( testTracker, "textChanged",   CallbackFunctor(&textChangedSignal) );
 
   gTextChangedCallBackCalled = false;
   field.SetProperty( TextField::Property::TEXT, "ABC" );
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_CHECK( textChangedSignal );
 
   application.SendNotification();
 
@@ -668,11 +701,16 @@ int utcDaliTextFieldTextChangedN(void)
 
   Stage::GetCurrent().Add( field );
 
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
   field.TextChangedSignal().Connect(&TestTextChangedCallback);
+  bool textChangedSignal = false;
+  field.ConnectSignal( testTracker, "textChanged",   CallbackFunctor(&textChangedSignal) );
 
   gTextChangedCallBackCalled = false;
   field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "ABC" ); // Setting placeholder, not TEXT
   DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+  DALI_TEST_CHECK( !textChangedSignal );
 
   END_TEST;
 }
@@ -692,13 +730,19 @@ int utcDaliTextFieldMaxCharactersReachedP(void)
 
   field.SetKeyInputFocus();
 
-  gMaxCharactersCallBackCalled = false;
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
   field.MaxLengthReachedSignal().Connect(&TestMaxLengthReachedCallback);
+  bool maxLengthReachedSignal = false;
+  field.ConnectSignal( testTracker, "maxLengthReached",   CallbackFunctor(&maxLengthReachedSignal) );
+
+  gMaxCharactersCallBackCalled = false;
 
   application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
   application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
 
   DALI_TEST_CHECK( gMaxCharactersCallBackCalled );
+  DALI_TEST_CHECK( maxLengthReachedSignal );
 
   END_TEST;
 }
@@ -718,13 +762,441 @@ int utcDaliTextFieldMaxCharactersReachedN(void)
 
   field.SetKeyInputFocus();
 
-  gMaxCharactersCallBackCalled = false;
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
   field.MaxLengthReachedSignal().Connect(&TestMaxLengthReachedCallback);
+  bool maxLengthReachedSignal = false;
+  field.ConnectSignal( testTracker, "maxLengthReached",   CallbackFunctor(&maxLengthReachedSignal) );
+
+  gMaxCharactersCallBackCalled = false;
 
   application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
   application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
 
   DALI_TEST_CHECK( !gMaxCharactersCallBackCalled );
+  DALI_TEST_CHECK( !maxLengthReachedSignal );
+
+  END_TEST;
+}
+
+int utcDaliTextFieldInputStyleChanged01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldInputStyleChanged01");
+
+  // The text-field emits signals when the input style changes. These changes of style are
+  // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
+  // can't be emitted during the size negotiation as the callbacks may update the UI.
+  // The text-field adds an idle callback to the adaptor to emit the signals after the size negotiation.
+  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
+  application.CreateAdaptor();
+
+  // Load some fonts.
+
+  char* pathNamePtr = get_current_dir_name();
+  const std::string pathName( pathNamePtr );
+  free( pathNamePtr );
+
+  TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+  fontClient.SetDpi( 93u, 93u );
+
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif.ttf", DEFAULT_FONT_SIZE );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif-Bold.ttf", DEFAULT_FONT_SIZE );
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+
+
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  field.SetProperty( TextField::Property::ENABLE_MARKUP, true );
+  field.SetProperty( TextField::Property::TEXT, "<font family='DejaVuSerif' size='18'>He<color value='green'>llo</color> <font weight='bold'>world</font> demo</font>" );
+
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  field.InputStyleChangedSignal().Connect( &TestInputStyleChangedCallback );
+  bool inputStyleChangedSignal = false;
+  field.ConnectSignal( testTracker, "inputStyleChanged",   CallbackFunctor(&inputStyleChangedSignal) );
+
+  Stage::GetCurrent().Add( field );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 18.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 18.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextField::InputStyle::FONT_FAMILY | TextField::InputStyle::POINT_SIZE ), TEST_LOCATION );
+
+    const std::string fontFamily = field.GetProperty( TextField::Property::INPUT_FONT_FAMILY ).Get<std::string>();
+    DALI_TEST_EQUALS( fontFamily, "DejaVuSerif", TEST_LOCATION );
+
+    const float pointSize = field.GetProperty( TextField::Property::INPUT_POINT_SIZE ).Get<float>();
+    DALI_TEST_EQUALS( pointSize, 18.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 43.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 43.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextField::InputStyle::COLOR ), TEST_LOCATION );
+
+    const Vector4 color = field.GetProperty( TextField::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::GREEN, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 88.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 88.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextField::InputStyle::COLOR | TextField::InputStyle::FONT_STYLE ), TEST_LOCATION );
+
+    const Vector4 color = field.GetProperty( TextField::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
+
+    const std::string style = field.GetProperty( TextField::Property::INPUT_FONT_STYLE ).Get<std::string>();
+    DALI_TEST_EQUALS( style, "{\"weight\":\"bold\"}", TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 115.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 115.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 164.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 164.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextField::InputStyle::FONT_STYLE ), TEST_LOCATION );
+
+    const std::string style = field.GetProperty( TextField::Property::INPUT_FONT_STYLE ).Get<std::string>();
+    DALI_TEST_CHECK( style.empty() );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 191.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 191.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  END_TEST;
+}
+
+int utcDaliTextFieldInputStyleChanged02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldInputStyleChanged02");
+
+  // The text-field emits signals when the input style changes. These changes of style are
+  // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
+  // can't be emitted during the size negotiation as the callbacks may update the UI.
+  // The text-field adds an idle callback to the adaptor to emit the signals after the size negotiation.
+  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
+  application.CreateAdaptor();
+
+  // Load some fonts.
+
+  char* pathNamePtr = get_current_dir_name();
+  const std::string pathName( pathNamePtr );
+  free( pathNamePtr );
+
+  TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+  fontClient.SetDpi( 93u, 93u );
+
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif.ttf", DEFAULT_FONT_SIZE );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSerif-Bold.ttf", DEFAULT_FONT_SIZE );
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+
+
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  field.SetProperty( TextField::Property::ENABLE_MARKUP, true );
+  field.SetProperty( TextField::Property::TEXT, "<font family='DejaVuSerif' size='18'>He<color value='blue'> l</color><color value='green'>lo</color> <font weight='bold'>world</font> demo</font>" );
+
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  field.InputStyleChangedSignal().Connect( &TestInputStyleChangedCallback );
+  bool inputStyleChangedSignal = false;
+  field.ConnectSignal( testTracker, "inputStyleChanged",   CallbackFunctor(&inputStyleChangedSignal) );
+
+  Stage::GetCurrent().Add( field );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 53.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 53.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 53.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 53.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextField::InputStyle::FONT_FAMILY |
+                                                 TextField::InputStyle::POINT_SIZE  |
+                                                 TextField::InputStyle::COLOR ),
+                      TEST_LOCATION );
+
+    const Vector4 color = field.GetProperty( TextField::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::GREEN, TEST_LOCATION );
+
+    const std::string fontFamily = field.GetProperty( TextField::Property::INPUT_FONT_FAMILY ).Get<std::string>();
+    DALI_TEST_EQUALS( fontFamily, "DejaVuSerif", TEST_LOCATION );
+
+    const float pointSize = field.GetProperty( TextField::Property::INPUT_POINT_SIZE ).Get<float>();
+    DALI_TEST_EQUALS( pointSize, 18.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextField::InputStyle::COLOR ),
+                      TEST_LOCATION );
+
+    const Vector4 color = field.GetProperty( TextField::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLUE, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextField::InputStyle::COLOR ),
+                      TEST_LOCATION );
+
+    const Vector4 color = field.GetProperty( TextField::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
+
+  gInputStyleChangedCallbackCalled = false;
+  gInputStyleMask = TextField::InputStyle::NONE;
+  inputStyleChangedSignal = false;
+
+  field.SetProperty( TextField::Property::INPUT_COLOR, Color::YELLOW );
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"thin\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+  field.SetProperty( TextField::Property::INPUT_POINT_SIZE, 20.f );
+
+  field.SetProperty( TextField::Property::INPUT_UNDERLINE, "underline" );
+  field.SetProperty( TextField::Property::INPUT_SHADOW, "shadow" );
+  field.SetProperty( TextField::Property::INPUT_EMBOSS, "emboss" );
+  field.SetProperty( TextField::Property::INPUT_OUTLINE, "outline" );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( !gInputStyleChangedCallbackCalled );
+  DALI_TEST_CHECK( !inputStyleChangedSignal );
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 63.f, 25.f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 63.f, 25.f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Executes the idle callbacks added by the text control on the change of input style.
+  application.RunIdles();
+
+  DALI_TEST_CHECK( gInputStyleChangedCallbackCalled );
+  if( gInputStyleChangedCallbackCalled )
+  {
+    DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ),
+                      static_cast<unsigned int>( TextField::InputStyle::COLOR |
+                                                 TextField::InputStyle::POINT_SIZE |
+                                                 TextField::InputStyle::FONT_STYLE |
+                                                 TextField::InputStyle::UNDERLINE |
+                                                 TextField::InputStyle::SHADOW |
+                                                 TextField::InputStyle::EMBOSS |
+                                                 TextField::InputStyle::OUTLINE ),
+                      TEST_LOCATION );
+
+    const Vector4 color = field.GetProperty( TextField::Property::INPUT_COLOR ).Get<Vector4>();
+    DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( inputStyleChangedSignal );
 
   END_TEST;
 }
index f3667bc..b061cf1 100644 (file)
@@ -883,3 +883,210 @@ int UtcDaliVisualGetPropertyMapBatchImageVisualNoAtlas(void)
 
   END_TEST;
 }
+
+int UtcDaliVisualAnimateBorderVisual01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimateBorderVisual Color" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::BORDER);
+  propertyMap.Insert(BorderVisual::Property::COLOR,  Color::BLUE);
+  propertyMap.Insert(BorderVisual::Property::SIZE,  5.f);
+  Visual::Base borderVisual = factory.CreateVisual( propertyMap );
+
+  Actor actor = Actor::New();
+  actor.SetSize(2000, 2000);
+  actor.SetParentOrigin(ParentOrigin::CENTER);
+  Stage::GetCurrent().Add(actor);
+  borderVisual.SetOnStage( actor );
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index index = renderer.GetPropertyIndex( BorderVisual::Property::COLOR );
+
+  Animation animation = Animation::New(4.0f);
+  animation.AnimateTo( Property(renderer, index), Color::WHITE );
+  animation.Play();
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render(2000u); // halfway point between blue and white
+
+  Vector4 color = renderer.GetProperty<Vector4>( index );
+  Vector4 testColor = (Color::BLUE + Color::WHITE)*0.5f;
+  DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", testColor ), true, TEST_LOCATION );
+
+  application.Render(2000u); // halfway point between blue and white
+
+  color = renderer.GetProperty<Vector4>( index );
+  DALI_TEST_EQUALS( color, Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", Color::WHITE ), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliVisualAnimateBorderVisual02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimateBorderVisual Size" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::BORDER);
+  propertyMap.Insert(BorderVisual::Property::COLOR,  Color::BLUE);
+  propertyMap.Insert(BorderVisual::Property::SIZE,  5.f);
+  Visual::Base borderVisual = factory.CreateVisual( propertyMap );
+
+  Actor actor = Actor::New();
+  actor.SetSize(2000, 2000);
+  actor.SetParentOrigin(ParentOrigin::CENTER);
+  Stage::GetCurrent().Add(actor);
+  borderVisual.SetOnStage( actor );
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index index = renderer.GetPropertyIndex( BorderVisual::Property::SIZE );
+
+  Animation animation = Animation::New(4.0f);
+  animation.AnimateTo( Property(renderer, index), 9.0f );
+  animation.Play();
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render(2000u); // halfway point
+
+  float size = renderer.GetProperty<float>( index );
+  DALI_TEST_EQUALS( size, 7.0f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("borderSize", 7.0f ), true, TEST_LOCATION );
+
+  application.Render(2000u); // halfway point between blue and white
+
+  size = renderer.GetProperty<float>( index );
+  DALI_TEST_EQUALS( size, 9.0f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("borderSize", 9.0f ), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliVisualAnimateColorVisual(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimateColorVisual mixColor" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+  Visual::Base borderVisual = factory.CreateVisual( propertyMap );
+
+  Actor actor = Actor::New();
+  actor.SetSize(2000, 2000);
+  actor.SetParentOrigin(ParentOrigin::CENTER);
+  Stage::GetCurrent().Add(actor);
+  borderVisual.SetOnStage( actor );
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index index = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
+
+  Animation animation = Animation::New(4.0f);
+  animation.AnimateTo( Property(renderer, index), Color::WHITE );
+  animation.Play();
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render(2000u); // halfway point
+
+  Vector4 color = renderer.GetProperty<Vector4>( index );
+  Vector4 testColor = (Color::BLUE + Color::WHITE)*0.5f;
+  DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", testColor ), true, TEST_LOCATION );
+
+  application.Render(2000u); // halfway point between blue and white
+
+  color = renderer.GetProperty<Vector4>( index );
+  DALI_TEST_EQUALS( color, Color::WHITE, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", Color::WHITE ), true, TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+
+int UtcDaliVisualAnimatePrimitiveVisual(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimatePrimitiveVisual color" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+  Visual::Base borderVisual = factory.CreateVisual( propertyMap );
+
+  Actor actor = Actor::New();
+  actor.SetSize(2000, 2000);
+  actor.SetParentOrigin(ParentOrigin::CENTER);
+  actor.SetColor(Color::BLACK);
+  Stage::GetCurrent().Add(actor);
+  borderVisual.SetOnStage( actor );
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::COLOR );
+
+  // The property isn't registered on the renderer, it's instead registered on the shader.
+  DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION );
+
+  Animation animation = Animation::New(4.0f);
+  animation.AnimateTo( Property(actor, Actor::Property::COLOR), Color::WHITE );
+  animation.Play();
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render(2000u); // halfway point
+
+  // Actor color overrides renderer color.
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f )), true, TEST_LOCATION );
+
+  application.Render(2000u); // halfway point between blue and white
+
+  DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE ), true, TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+int UtcDaliVisualWireframeVisual(void)
+{
+  ToolkitTestApplication application;
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert( Visual::Property::TYPE, Visual::WIREFRAME );
+
+  // Create the visual.
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+
+  DALI_TEST_CHECK( visual );
+
+  Property::Map resultMap;
+  visual.CreatePropertyMap( resultMap );
+
+  // Check the property values from the returned map from visual
+  Property::Value* value = resultMap.Find( Visual::Property::TYPE, Property::INTEGER );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<int>() == Visual::WIREFRAME );
+  END_TEST;
+}
index 0b3193f..072ea6b 100644 (file)
@@ -27,69 +27,66 @@ namespace Dali
 namespace Toolkit
 {
 
-namespace Visual
-{
-
-Base::Base()
+Visual::Base::Base()
 {
 }
 
-Base::~Base()
+Visual::Base::~Base()
 {
 }
 
-Base::Base( const Base& handle )
+Visual::Base::Base( const Visual::Base& handle )
 : BaseHandle( handle )
 {
 }
 
-Base& Base::operator=( const Base& handle )
+Visual::Base& Visual::Base::operator=( const Visual::Base& handle )
 {
   BaseHandle::operator=( handle );
   return *this;
 }
 
-Base::Base(Internal::Visual::Base *impl)
+Visual::Base::Base(Internal::Visual::Base *impl)
 : BaseHandle( impl )
 {
 }
 
-void Base::SetSize( const Vector2& size )
+void Visual::Base::SetSize( const Vector2& size )
 {
   GetImplementation( *this ).SetSize( size );
 }
 
-const Vector2& Base::GetSize() const
+const Vector2& Visual::Base::GetSize() const
 {
   return GetImplementation( *this ).GetSize();
 }
 
-void Base::GetNaturalSize(Vector2& naturalSize ) const
+void Visual::Base::GetNaturalSize(Vector2& naturalSize ) const
 {
   GetImplementation( *this ).GetNaturalSize( naturalSize );
 }
 
-void Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( float index )
 {
   GetImplementation( *this ).SetDepthIndex( index );
 }
 
-float Base::GetDepthIndex() const
+float Visual::Base::GetDepthIndex() const
 {
   return GetImplementation( *this ).GetDepthIndex();
 }
 
-void Base::SetOnStage( Actor& actor )
+void Visual::Base::SetOnStage( Actor& actor )
 {
   GetImplementation( *this ).SetOnStage( actor );
 }
 
-void Base::SetOffStage( Actor& actor )
+void Visual::Base::SetOffStage( Actor& actor )
 {
   GetImplementation( *this ).SetOffStage( actor );
 }
 
-void Base::RemoveAndReset( Actor& actor )
+void Visual::Base::RemoveAndReset( Actor& actor )
 {
   if( actor && *this )
   {
@@ -98,13 +95,11 @@ void Base::RemoveAndReset( Actor& actor )
   Reset();
 }
 
-void Base::CreatePropertyMap( Property::Map& map ) const
+void Visual::Base::CreatePropertyMap( Property::Map& map ) const
 {
   GetImplementation( *this ).CreatePropertyMap( map );
 }
 
-} // namespace Visual
-
 } // namespace Toolkit
 
 } // namespace Dali
index 1d648c3..8203437 100644 (file)
@@ -102,7 +102,7 @@ bool GetMappingKey( const std::string& str, std::string& key )
 }
 
 /*
- * Recursively collects all stylesin a node (An array of style names).
+ * Recursively collects all styles in a node (An array of style names).
  *
  * stylesCollection The set of styles from the json file (a json object of named styles)
  * style The style array to begin the collection from
index 75780c3..2f333d4 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/integration-api/adaptors/adaptor.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -121,6 +122,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "outline",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputOutline",                         STRING,    INPUT_OUTLINE                        )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged",        SIGNAL_TEXT_CHANGED )
+DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -904,6 +906,10 @@ bool TextEditor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface
   {
     editor.TextChangedSignal().Connect( tracker, functor );
   }
+  else if( 0 == strcmp( signalName.c_str(), SIGNAL_INPUT_STYLE_CHANGED ) )
+  {
+    editor.InputStyleChangedSignal().Connect( tracker, functor );
+  }
   else
   {
     // signalName does not match any signal
@@ -918,6 +924,11 @@ Toolkit::TextEditor::TextChangedSignalType& TextEditor::TextChangedSignal()
   return mTextChangedSignal;
 }
 
+Toolkit::TextEditor::InputStyleChangedSignalType& TextEditor::InputStyleChangedSignal()
+{
+  return mInputStyleChangedSignal;
+}
+
 void TextEditor::OnInitialize()
 {
   Actor self = Self();
@@ -988,13 +999,7 @@ void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange:
 
     case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
     {
-      DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor::OnStyleChange StyleChange::DEFAULT_FONT_SIZE_CHANGE (%f)\n", mController->GetDefaultPointSize() );
-
-      if ( (mController->GetDefaultPointSize() <= 0.0f) ) // If DefaultPointSize not set by Property system it will be 0.0f
-      {
-        // Property system did not set the PointSize so should update it.
-        // todo instruct text-controller to update model
-      }
+      GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
       break;
     }
     case StyleChange::THEME_CHANGE:
@@ -1040,6 +1045,25 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
     EnableClipping( true, size );
     RenderText( updateTextType );
   }
+
+  // The text-editor emits signals when the input style changes. These changes of style are
+  // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
+  // can't be emitted during the size negotiation as the callbacks may update the UI.
+  // The text-editor adds an idle callback to the adaptor to emit the signals after the size negotiation.
+  if( !mController->IsInputStyleChangedSignalsQueueEmpty() )
+  {
+    if( Adaptor::IsAvailable() )
+    {
+      Adaptor& adaptor = Adaptor::Get();
+
+      if( NULL == mIdleCallback )
+      {
+        // @note: The callback manager takes the ownership of the callback object.
+        mIdleCallback = MakeCallback( this, &TextEditor::OnIdleSignal );
+        adaptor.AddIdle( mIdleCallback );
+      }
+    }
+  }
 }
 
 void TextEditor::RenderText( Text::Controller::UpdateTextType updateTextType )
@@ -1237,6 +1261,60 @@ void TextEditor::TextChanged()
   mTextChangedSignal.Emit( handle );
 }
 
+void TextEditor::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
+{
+  Dali::Toolkit::TextEditor handle( GetOwner() );
+
+  Toolkit::TextEditor::InputStyle::Mask editorInputStyleMask = Toolkit::TextEditor::InputStyle::NONE;
+
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_COLOR ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::COLOR );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_FAMILY ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::FONT_FAMILY );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_POINT_SIZE ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::POINT_SIZE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_WEIGHT ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::FONT_STYLE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_WIDTH ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::FONT_STYLE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_SLANT ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::FONT_STYLE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_LINE_SPACING ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::LINE_SPACING );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_UNDERLINE ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::UNDERLINE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_SHADOW ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::SHADOW );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_EMBOSS ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::EMBOSS );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_OUTLINE ) )
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>( editorInputStyleMask | Toolkit::TextEditor::InputStyle::OUTLINE );
+  }
+
+  mInputStyleChangedSignal.Emit( handle, editorInputStyleMask );
+}
+
 void TextEditor::MaxLengthReached()
 {
   // Nothing to do as TextEditor doesn't emit a max length reached signal.
@@ -1339,8 +1417,18 @@ bool TextEditor::OnTouched( Actor actor, const TouchData& touch )
   return true;
 }
 
+void TextEditor::OnIdleSignal()
+{
+  // Emits the change of input style signals.
+  mController->ProcessInputStyleChangedSignals();
+
+  // Set the pointer to null as the callback manager deletes the callback after execute it.
+  mIdleCallback = NULL;
+}
+
 TextEditor::TextEditor()
 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+  mIdleCallback( NULL ),
   mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
   mHasBeenStaged( false )
 {
@@ -1349,6 +1437,12 @@ TextEditor::TextEditor()
 TextEditor::~TextEditor()
 {
   mClipper.Reset();
+
+  if( ( NULL != mIdleCallback ) && Adaptor::IsAvailable() )
+  {
+    // Removes the callback from the callback manager in case the text-editor is destroyed before the callback is executed.
+    Adaptor::Get().RemoveIdle( mIdleCallback );
+  }
 }
 
 } // namespace Internal
index 1c7376d..cb40406 100644 (file)
@@ -87,6 +87,11 @@ public:
    */
   Toolkit::TextEditor::TextChangedSignalType&  TextChangedSignal();
 
+  /**
+   * @copydoc TextEditor::TextChangedSignal()
+   */
+  Toolkit::TextEditor::InputStyleChangedSignalType& InputStyleChangedSignal();
+
 private: // From Control
 
   /**
@@ -171,6 +176,11 @@ private: // From Control
    */
   virtual void MaxLengthReached();
 
+  /**
+   * @copydoc Text::ControlInterface::InputStyleChanged()
+   */
+  virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+
 private: // Implementation
 
   /**
@@ -216,6 +226,13 @@ private: // Implementation
   bool OnTouched( Actor actor, const TouchData& touch );
 
   /**
+   * @brief Callbacks called on idle.
+   *
+   * If there are notifications of change of input style on the queue, Toolkit::TextEditor::InputStyleChangedSignal() are emitted.
+   */
+  void OnIdleSignal();
+
+  /**
    * Construct a new TextEditor.
    */
   TextEditor();
@@ -241,6 +258,7 @@ private: // Data
 
   // Signals
   Toolkit::TextEditor::TextChangedSignalType mTextChangedSignal;
+  Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal;
 
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
@@ -249,6 +267,7 @@ private: // Data
   std::vector<Actor> mClippingDecorationActors;   ///< Decoration actors which need clipping.
 
   Actor mRenderableActor;
+  CallbackBase* mIdleCallback;
 
   int mRenderingBackend;
   bool mHasBeenStaged:1;
index 655b63b..13b0323 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/integration-api/adaptors/adaptor.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -135,6 +136,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputOutline",
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached",   SIGNAL_MAX_LENGTH_REACHED )
+DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -1080,6 +1082,10 @@ bool TextField::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface*
   {
     field.MaxLengthReachedSignal().Connect( tracker, functor );
   }
+  else if( 0 == strcmp( signalName.c_str(), SIGNAL_INPUT_STYLE_CHANGED ) )
+  {
+    field.InputStyleChangedSignal().Connect( tracker, functor );
+  }
   else
   {
     // signalName does not match any signal
@@ -1099,6 +1105,11 @@ Toolkit::TextField::MaxLengthReachedSignalType& TextField::MaxLengthReachedSigna
   return mMaxLengthReachedSignal;
 }
 
+Toolkit::TextField::InputStyleChangedSignalType& TextField::InputStyleChangedSignal()
+{
+  return mInputStyleChangedSignal;
+}
+
 void TextField::OnInitialize()
 {
   Actor self = Self();
@@ -1168,13 +1179,7 @@ void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::
 
     case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
     {
-      DALI_LOG_INFO( gLogFilter, Debug::General, "TextField::OnStyleChange StyleChange::DEFAULT_FONT_SIZE_CHANGE (%f)\n", mController->GetDefaultPointSize() );
-
-      if ( (mController->GetDefaultPointSize() <= 0.0f) ) // If DefaultPointSize not set by Property system it will be 0.0f
-      {
-        // Property system did not set the PointSize so should update it.
-        // todo instruct text-controller to update model
-      }
+      GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
       break;
     }
     case StyleChange::THEME_CHANGE:
@@ -1220,9 +1225,28 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
     EnableClipping( ( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy ), size );
     RenderText( updateTextType );
   }
+
+  // The text-field emits signals when the input style changes. These changes of style are
+  // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
+  // can't be emitted during the size negotiation as the callbacks may update the UI.
+  // The text-field adds an idle callback to the adaptor to emit the signals after the size negotiation.
+  if( !mController->IsInputStyleChangedSignalsQueueEmpty() )
+  {
+    if( Adaptor::IsAvailable() )
+    {
+      Adaptor& adaptor = Adaptor::Get();
+
+      if( NULL == mIdleCallback )
+      {
+        // @note: The callback manager takes the ownership of the callback object.
+        mIdleCallback = MakeCallback( this, &TextField::OnIdleSignal );
+        adaptor.AddIdle( mIdleCallback );
+      }
+    }
+  }
 }
 
-void TextField::RenderText( Text::Controller::UpdateTextType updateTextType )
+  void TextField::RenderText( Text::Controller::UpdateTextType updateTextType )
 {
   Actor self = Self();
   Actor renderableActor;
@@ -1418,6 +1442,56 @@ void TextField::TextChanged()
   mTextChangedSignal.Emit( handle );
 }
 
+void TextField::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
+{
+  Dali::Toolkit::TextField handle( GetOwner() );
+
+  Toolkit::TextField::InputStyle::Mask fieldInputStyleMask = Toolkit::TextField::InputStyle::NONE;
+
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_COLOR ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::COLOR );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_FAMILY ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_FAMILY );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_POINT_SIZE ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::POINT_SIZE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_WEIGHT ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_STYLE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_WIDTH ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_STYLE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_FONT_SLANT ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_STYLE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_UNDERLINE ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::UNDERLINE );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_SHADOW ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::SHADOW );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_EMBOSS ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::EMBOSS );
+  }
+  if( InputStyle::NONE != static_cast<InputStyle::Mask>( inputStyleMask & InputStyle::INPUT_OUTLINE ) )
+  {
+    fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>( fieldInputStyleMask | Toolkit::TextField::InputStyle::OUTLINE );
+  }
+
+  mInputStyleChangedSignal.Emit( handle, fieldInputStyleMask );
+}
+
 void TextField::OnStageConnect( Dali::Actor actor )
 {
   if ( mHasBeenStaged )
@@ -1521,8 +1595,18 @@ bool TextField::OnTouched( Actor actor, const TouchData& touch )
   return true;
 }
 
+void TextField::OnIdleSignal()
+{
+  // Emits the change of input style signals.
+  mController->ProcessInputStyleChangedSignals();
+
+  // Set the pointer to null as the callback manager deletes the callback after execute it.
+  mIdleCallback = NULL;
+}
+
 TextField::TextField()
 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+  mIdleCallback( NULL ),
   mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
   mExceedPolicy( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP ),
   mHasBeenStaged( false )
@@ -1532,6 +1616,11 @@ TextField::TextField()
 TextField::~TextField()
 {
   mClipper.Reset();
+
+  if( ( NULL != mIdleCallback ) && Adaptor::IsAvailable() )
+  {
+    Adaptor::Get().RemoveIdle( mIdleCallback );
+  }
 }
 
 } // namespace Internal
index c574bb8..558cced 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -92,6 +92,11 @@ public:
    */
   Toolkit::TextField::MaxLengthReachedSignalType&  MaxLengthReachedSignal();
 
+  /**
+   * @copydoc TextField::TextChangedSignal()
+   */
+  Toolkit::TextField::InputStyleChangedSignalType& InputStyleChangedSignal();
+
 private: // From Control
 
   /**
@@ -176,6 +181,11 @@ private: // From Control
    */
   virtual void MaxLengthReached();
 
+  /**
+   * @copydoc Text::ControlInterface::InputStyleChanged()
+   */
+  virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+
 private: // Implementation
 
   /**
@@ -221,6 +231,13 @@ private: // Implementation
   bool OnTouched( Actor actor, const TouchData& touch );
 
   /**
+   * @brief Callbacks called on idle.
+   *
+   * If there are notifications of change of input style on the queue, Toolkit::TextField::InputStyleChangedSignal() are emitted.
+   */
+  void OnIdleSignal();
+
+  /**
    * Construct a new TextField.
    */
   TextField();
@@ -247,6 +264,7 @@ private: // Data
   // Signals
   Toolkit::TextField::TextChangedSignalType mTextChangedSignal;
   Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal;
+  Toolkit::TextField::InputStyleChangedSignalType mInputStyleChangedSignal;
 
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
@@ -255,6 +273,7 @@ private: // Data
   std::vector<Actor> mClippingDecorationActors;   ///< Decoration actors which need clipping.
 
   Actor mRenderableActor;
+  CallbackBase* mIdleCallback;
 
   int mRenderingBackend;
   int mExceedPolicy;
index 308f947..037a3ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -680,13 +680,7 @@ void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::
 
     case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
     {
-      DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_SIZE_CHANGE (%f)\n", mController->GetDefaultPointSize() );
-
-      if ( (mController->GetDefaultPointSize() <= 0.0f) ) // If DefaultPointSize not set by Property system it will be 0.0f
-      {
-        // Property system did not set the PointSize so should update it.
-        // todo instruct text-controller to update model
-      }
+      GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
       break;
     }
     case StyleChange::THEME_CHANGE:
@@ -812,7 +806,7 @@ void TextLabel::OnStageConnection( int depth )
 
 void TextLabel::TextChanged()
 {
-  // TextLabel does not provide a signal for this
+  // TextLabel does not provide a signal for this.
 }
 
 void TextLabel::MaxLengthReached()
@@ -820,6 +814,11 @@ 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 c2dd485..298ba1a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,6 +119,11 @@ private: // From Control
    */
   virtual void MaxLengthReached();
 
+  /**
+   * @copydoc Text::ControlInterface::InputStyleChanged()
+   */
+  virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+
 private: // from TextScroller
 
   /**
index 1954782..e644d65 100644 (file)
@@ -18,18 +18,18 @@ toolkit_src_files = \
    $(toolkit_src_dir)/visuals/visual-string-constants.cpp \
    $(toolkit_src_dir)/visuals/border/border-visual.cpp \
    $(toolkit_src_dir)/visuals/color/color-visual.cpp \
-   $(toolkit_src_dir)/visuals/debug/debug-visual.cpp \
-   $(toolkit_src_dir)/visuals/image/image-visual.cpp \
-   $(toolkit_src_dir)/visuals/npatch/npatch-visual.cpp \
    $(toolkit_src_dir)/visuals/gradient/gradient.cpp \
    $(toolkit_src_dir)/visuals/gradient/linear-gradient.cpp \
    $(toolkit_src_dir)/visuals/gradient/radial-gradient.cpp \
    $(toolkit_src_dir)/visuals/gradient/gradient-visual.cpp \
-   $(toolkit_src_dir)/visuals/svg/svg-rasterize-thread.cpp \
-   $(toolkit_src_dir)/visuals/svg/svg-visual.cpp \
+   $(toolkit_src_dir)/visuals/image/batch-image-visual.cpp \
+   $(toolkit_src_dir)/visuals/image/image-visual.cpp \
    $(toolkit_src_dir)/visuals/mesh/mesh-visual.cpp \
+   $(toolkit_src_dir)/visuals/npatch/npatch-visual.cpp \
    $(toolkit_src_dir)/visuals/primitive/primitive-visual.cpp \
-   $(toolkit_src_dir)/visuals/image/batch-image-visual.cpp \
+   $(toolkit_src_dir)/visuals/svg/svg-rasterize-thread.cpp \
+   $(toolkit_src_dir)/visuals/svg/svg-visual.cpp \
+   $(toolkit_src_dir)/visuals/wireframe/wireframe-visual.cpp \
    $(toolkit_src_dir)/controls/alignment/alignment-impl.cpp \
    $(toolkit_src_dir)/controls/bloom-view/bloom-view-impl.cpp \
    $(toolkit_src_dir)/controls/bubble-effect/bubble-emitter-impl.cpp \
index 71baa96..7e08cf4 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/adaptor-framework/application.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
@@ -39,6 +40,8 @@ const char* FONT_SIZE_QUALIFIER = "FontSize";
 const char* DEFAULT_THEME = DALI_STYLE_DIR "dali-toolkit-default-theme.json";
 
 const char* PACKAGE_PATH_KEY = "PACKAGE_PATH";
+const char* APPLICATION_RESOURCE_PATH_KEY = "APPLICATION_RESOURCE_PATH";
+
 const char* DEFAULT_PACKAGE_PATH = DALI_DATA_READ_ONLY_DIR "/toolkit/";
 
 } // namespace
@@ -104,12 +107,12 @@ StyleManager::StyleManager()
 {
   // Add theme builder constants
   mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH;
+  mThemeBuilderConstants[ APPLICATION_RESOURCE_PATH_KEY ] = Application::GetResourcePath();
 
   mStyleMonitor = StyleMonitor::Get();
   if( mStyleMonitor )
   {
     mStyleMonitor.StyleChangeSignal().Connect( this, &StyleManager::StyleMonitorChange );
-
     mDefaultFontSize = mStyleMonitor.GetDefaultFontSize();
   }
 
index 63add2d..54d5e80 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/common/constants.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/text-definitions.h>
@@ -38,6 +38,22 @@ namespace Text
  */
 struct InputStyle
 {
+  enum Mask
+  {
+    NONE               = 0x0000,
+    INPUT_COLOR        = 0x0001,
+    INPUT_FONT_FAMILY  = 0x0002,
+    INPUT_POINT_SIZE   = 0x0004,
+    INPUT_FONT_WEIGHT  = 0x0008,
+    INPUT_FONT_WIDTH   = 0x0010,
+    INPUT_FONT_SLANT   = 0x0020,
+    INPUT_LINE_SPACING = 0x0040,
+    INPUT_UNDERLINE    = 0x0080,
+    INPUT_SHADOW       = 0x0100,
+    INPUT_EMBOSS       = 0x0200,
+    INPUT_OUTLINE      = 0x0400
+  };
+
   InputStyle()
   : textColor( Color::BLACK ),
     familyName(),
@@ -51,17 +67,150 @@ struct InputStyle
     embossProperties(),
     outlineProperties(),
     isDefaultColor( true ),
-    familyDefined( false ),
-    weightDefined( false ),
-    widthDefined( false ),
-    slantDefined( false ),
-    sizeDefined( false ),
-    lineSpacingDefined( false )
-  {}
+    isFamilyDefined( false ),
+    isWeightDefined( false ),
+    isWidthDefined( false ),
+    isSlantDefined( false ),
+    isSizeDefined( false ),
+    isLineSpacingDefined( false ),
+    isUnderlineDefined( false ),
+    isShadowDefined( false ),
+    isEmbossDefined( false ),
+    isOutlineDefined( false )
+    {}
 
   ~InputStyle()
   {};
 
+  /**
+   * @brief
+   *
+   * Does not copy the font-style, underline, shadow, emboss and outline property strings.
+   */
+  void Copy( const InputStyle& inputStyle )
+  {
+    isDefaultColor = inputStyle.isDefaultColor;
+    textColor = inputStyle.textColor;
+
+    isFamilyDefined = inputStyle.isFamilyDefined;
+    familyName = inputStyle.familyName;
+
+    isWeightDefined = inputStyle.isWeightDefined;
+    weight = inputStyle.weight;
+
+    isWidthDefined = inputStyle.isWidthDefined;
+    width = inputStyle.width;
+
+    isSlantDefined = inputStyle.isSlantDefined;
+    slant = inputStyle.slant;
+
+    isSizeDefined = inputStyle.isSizeDefined;
+    size = inputStyle.size;
+
+    isLineSpacingDefined = inputStyle.isLineSpacingDefined;
+    lineSpacing = inputStyle.lineSpacing;
+
+    isUnderlineDefined = inputStyle.isUnderlineDefined;
+    underlineProperties = inputStyle.underlineProperties;
+
+    isShadowDefined = inputStyle.isShadowDefined;
+    shadowProperties = inputStyle.shadowProperties;
+
+    isEmbossDefined = inputStyle.isEmbossDefined;
+    embossProperties = inputStyle.embossProperties;
+
+    isOutlineDefined = inputStyle.isOutlineDefined;
+    outlineProperties = inputStyle.outlineProperties;
+  }
+
+  /**
+   * @brief
+   *
+   * Does not compare the font-style, underline, shadow, emboss and outline property strings.
+   */
+  bool Equal( const InputStyle& inputStyle ) const
+  {
+    if( ( isDefaultColor != inputStyle.isDefaultColor )             ||
+        ( isFamilyDefined != inputStyle.isFamilyDefined )           ||
+        ( isWeightDefined != inputStyle.isWeightDefined )           ||
+        ( isWidthDefined != inputStyle.isWidthDefined )             ||
+        ( isSlantDefined != inputStyle.isSlantDefined )             ||
+        ( isSizeDefined != inputStyle.isSizeDefined )               ||
+        ( isLineSpacingDefined != inputStyle.isLineSpacingDefined ) ||
+        ( isUnderlineDefined != inputStyle.isUnderlineDefined )     ||
+        ( isShadowDefined != inputStyle.isShadowDefined )           ||
+        ( isEmbossDefined != inputStyle.isEmbossDefined )           ||
+        ( isOutlineDefined != inputStyle.isOutlineDefined )         ||
+        ( textColor != inputStyle.textColor )                       ||
+        ( familyName != inputStyle.familyName )                     ||
+        ( weight != inputStyle.weight )                             ||
+        ( width != inputStyle.width )                               ||
+        ( slant != inputStyle.slant )                               ||
+        ( size != inputStyle.size )                                 ||
+        ( lineSpacing != inputStyle.lineSpacing )                   ||
+        ( underlineProperties != inputStyle.underlineProperties )   ||
+        ( shadowProperties != inputStyle.shadowProperties )         ||
+        ( embossProperties != inputStyle.embossProperties )         ||
+        ( outlineProperties != inputStyle.outlineProperties ) )
+    {
+      return false;
+    }
+
+    return true;
+  }
+
+  Mask GetInputStyleChangeMask( const InputStyle& inputStyle ) const
+  {
+    Mask mask = NONE;
+
+    if( textColor != inputStyle.textColor )
+    {
+      mask = static_cast<Mask>( mask | INPUT_COLOR );
+    }
+    if( familyName != inputStyle.familyName )
+    {
+      mask = static_cast<Mask>( mask | INPUT_FONT_FAMILY );
+    }
+    if( weight != inputStyle.weight )
+    {
+      mask = static_cast<Mask>( mask | INPUT_FONT_WEIGHT );
+    }
+    if( width != inputStyle.width )
+    {
+      mask = static_cast<Mask>( mask | INPUT_FONT_WIDTH );
+    }
+    if( slant != inputStyle.slant )
+    {
+      mask = static_cast<Mask>( mask | INPUT_FONT_SLANT );
+    }
+    if( size != inputStyle.size )
+    {
+      mask = static_cast<Mask>( mask | INPUT_POINT_SIZE );
+    }
+    if( lineSpacing != inputStyle.lineSpacing )
+    {
+      mask = static_cast<Mask>( mask | INPUT_LINE_SPACING );
+    }
+    if( underlineProperties != inputStyle.underlineProperties )
+    {
+      mask = static_cast<Mask>( mask | INPUT_UNDERLINE );
+    }
+    if( shadowProperties != inputStyle.shadowProperties )
+    {
+      mask = static_cast<Mask>( mask | INPUT_SHADOW );
+    }
+    if( embossProperties != inputStyle.embossProperties )
+    {
+      mask = static_cast<Mask>( mask | INPUT_EMBOSS );
+    }
+    if( outlineProperties != inputStyle.outlineProperties )
+    {
+      mask = static_cast<Mask>( mask | INPUT_OUTLINE );
+    }
+
+    return mask;
+  }
+
   Vector4     textColor;           ///< The text's color.
   std::string familyName;          ///< The font's family name.
   FontWeight  weight;              ///< The font's weight.
@@ -70,19 +219,24 @@ struct InputStyle
   float       size;                ///< The font's size.
 
   float       lineSpacing;         ///< The line's spacing.
+
   std::string underlineProperties; ///< The underline properties string.
   std::string shadowProperties;    ///< The shadow properties string.
   std::string embossProperties;    ///< The emboss properties string.
   std::string outlineProperties;   ///< The outline properties string.
 
-  bool        isDefaultColor     : 1; ///< Whether the text's color is the default.
-  bool        familyDefined      : 1; ///< Whether the font's family is defined.
-  bool        weightDefined      : 1; ///< Whether the font's weight is defined.
-  bool        widthDefined       : 1; ///< Whether the font's width is defined.
-  bool        slantDefined       : 1; ///< Whether the font's slant is defined.
-  bool        sizeDefined        : 1; ///< Whether the font's size is defined.
-
-  bool        lineSpacingDefined : 1; ///< Whether the line spacing is defined.
+  bool        isDefaultColor       : 1; ///< Whether the text's color is the default.
+  bool        isFamilyDefined      : 1; ///< Whether the font's family is defined.
+  bool        isWeightDefined      : 1; ///< Whether the font's weight is defined.
+  bool        isWidthDefined       : 1; ///< Whether the font's width is defined.
+  bool        isSlantDefined       : 1; ///< Whether the font's slant is defined.
+  bool        isSizeDefined        : 1; ///< Whether the font's size is defined.
+
+  bool        isLineSpacingDefined : 1; ///< Whether the line spacing is defined.
+  bool        isUnderlineDefined   : 1; ///< Whether the underline parameters are defined.
+  bool        isShadowDefined      : 1; ///< Whether the shadow parameters are defined.
+  bool        isEmbossDefined      : 1; ///< Whether the emboss parameters are defined.
+  bool        isOutlineDefined     : 1; ///< Whether the outline parameters are defined.
 };
 
 } // namespace Text
index dcfb3e4..9b66925 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -380,7 +380,7 @@ void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
     const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + nameIndex );
 
     style.familyName = std::string( fontDescriptionRun.familyName, fontDescriptionRun.familyLength );
-    style.familyDefined = true;
+    style.isFamilyDefined = true;
   }
 
   // Set the font's weight if it's overriden.
@@ -389,7 +389,7 @@ void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
     const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + weightIndex );
 
     style.weight = fontDescriptionRun.weight;
-    style.weightDefined = true;
+    style.isWeightDefined = true;
   }
 
   // Set the font's width if it's overriden.
@@ -398,7 +398,7 @@ void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
     const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + widthIndex );
 
     style.width = fontDescriptionRun.width;
-    style.widthDefined = true;
+    style.isWidthDefined = true;
   }
 
   // Set the font's slant if it's overriden.
@@ -407,7 +407,7 @@ void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
     const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + slantIndex );
 
     style.slant = fontDescriptionRun.slant;
-    style.slantDefined = true;
+    style.isSlantDefined = true;
   }
 
   // Set the font's size if it's overriden.
@@ -416,7 +416,7 @@ void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
     const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + sizeIndex );
 
     style.size = static_cast<float>( fontDescriptionRun.size ) / 64.f;
-    style.sizeDefined = true;
+    style.isSizeDefined = true;
   }
 }
 
index ede1531..f5346e0 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/input-style.h>
+
 namespace Dali
 {
 
@@ -68,6 +71,13 @@ public:
    * @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
index 14670ae..b6efd59 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -73,6 +73,7 @@ EventData::EventData( DecoratorPtr decorator )
   mPlaceholderTextInactive(),
   mPlaceholderTextColor( 0.8f, 0.8f, 0.8f, 0.8f ),
   mEventQueue(),
+  mInputStyleChangedQueue(),
   mState( INACTIVE ),
   mPrimaryCursorPosition( 0u ),
   mLeftSelectionPosition( 0u ),
@@ -262,6 +263,10 @@ bool Controller::Impl::ProcessInputEvents()
 
   if( mEventData->mUpdateInputStyle )
   {
+    // Keep a copy of the current input style.
+    InputStyle currentInputStyle;
+    currentInputStyle.Copy( mEventData->mInputStyle );
+
     // Set the default style first.
     RetrieveDefaultInputStyle( mEventData->mInputStyle );
 
@@ -271,6 +276,16 @@ bool Controller::Impl::ProcessInputEvents()
     // Retrieve the style from the style runs stored in the logical model.
     mLogicalModel->RetrieveStyle( styleIndex, mEventData->mInputStyle );
 
+    // Compare if the input style has changed.
+    const bool hasInputStyleChanged = !currentInputStyle.Equal( mEventData->mInputStyle );
+
+    if( hasInputStyleChanged )
+    {
+      const InputStyle::Mask styleChangedMask = currentInputStyle.GetInputStyleChangeMask( mEventData->mInputStyle );
+      // Queue the input style changed signal.
+      mEventData->mInputStyleChangedQueue.PushBack( styleChangedMask );
+    }
+
     mEventData->mUpdateInputStyle = false;
   }
 
@@ -307,6 +322,15 @@ void Controller::Impl::NotifyImfManager()
   }
 }
 
+void Controller::Impl::NotifyImfMultiLineStatus()
+{
+  if ( mEventData )
+  {
+    LayoutEngine::Layout layout = mLayoutEngine.GetLayout();
+    mEventData->mImfManager.NotifyTextInputMultiLine( layout == LayoutEngine::MULTI_LINE_BOX );
+  }
+}
+
 CharacterIndex Controller::Impl::GetLogicalCursorPosition() const
 {
   CharacterIndex cursorPosition = 0u;
@@ -997,11 +1021,25 @@ void Controller::Impl::RetrieveDefaultInputStyle( InputStyle& inputStyle )
   inputStyle.slant = TextAbstraction::FontSlant::NORMAL;
   inputStyle.size = 0.f;
 
-  inputStyle.familyDefined = false;
-  inputStyle.weightDefined = false;
-  inputStyle.widthDefined = false;
-  inputStyle.slantDefined = false;
-  inputStyle.sizeDefined = false;
+  inputStyle.lineSpacing = 0.f;
+
+  inputStyle.underlineProperties.clear();
+  inputStyle.shadowProperties.clear();
+  inputStyle.embossProperties.clear();
+  inputStyle.outlineProperties.clear();
+
+  inputStyle.isFamilyDefined = false;
+  inputStyle.isWeightDefined = false;
+  inputStyle.isWidthDefined = false;
+  inputStyle.isSlantDefined = false;
+  inputStyle.isSizeDefined = false;
+
+  inputStyle.isLineSpacingDefined = false;
+
+  inputStyle.isUnderlineDefined = false;
+  inputStyle.isShadowDefined = false;
+  inputStyle.isEmbossDefined = false;
+  inputStyle.isOutlineDefined = false;
 
   // Sets the default font's family name, weight, width, slant and size.
   if( mFontDefaults )
@@ -1009,31 +1047,31 @@ void Controller::Impl::RetrieveDefaultInputStyle( InputStyle& inputStyle )
     if( mFontDefaults->familyDefined )
     {
       inputStyle.familyName = mFontDefaults->mFontDescription.family;
-      inputStyle.familyDefined = true;
+      inputStyle.isFamilyDefined = true;
     }
 
     if( mFontDefaults->weightDefined )
     {
       inputStyle.weight = mFontDefaults->mFontDescription.weight;
-      inputStyle.weightDefined = true;
+      inputStyle.isWeightDefined = true;
     }
 
     if( mFontDefaults->widthDefined )
     {
       inputStyle.width = mFontDefaults->mFontDescription.width;
-      inputStyle.widthDefined = true;
+      inputStyle.isWidthDefined = true;
     }
 
     if( mFontDefaults->slantDefined )
     {
       inputStyle.slant = mFontDefaults->mFontDescription.slant;
-      inputStyle.slantDefined = true;
+      inputStyle.isSlantDefined = true;
     }
 
     if( mFontDefaults->sizeDefined )
     {
       inputStyle.size = mFontDefaults->mDefaultPointSize;
-      inputStyle.sizeDefined = true;
+      inputStyle.isSizeDefined = true;
     }
   }
 }
@@ -1633,9 +1671,23 @@ void Controller::Impl::RetrieveSelection( std::string& selectedText, bool delete
 
     if( deleteAfterRetrieval ) // Only delete text if copied successfully
     {
+      // Keep a copy of the current input style.
+      InputStyle currentInputStyle;
+      currentInputStyle.Copy( mEventData->mInputStyle );
+
       // Set as input style the style of the first deleted character.
       mLogicalModel->RetrieveStyle( startOfSelectedText, mEventData->mInputStyle );
 
+      // Compare if the input style has changed.
+      const bool hasInputStyleChanged = !currentInputStyle.Equal( mEventData->mInputStyle );
+
+      if( hasInputStyleChanged )
+      {
+        const InputStyle::Mask styleChangedMask = currentInputStyle.GetInputStyleChangeMask( mEventData->mInputStyle );
+        // Queue the input style changed signal.
+        mEventData->mInputStyleChangedQueue.PushBack( styleChangedMask );
+      }
+
       mLogicalModel->UpdateTextStyleRuns( startOfSelectedText, -static_cast<int>( lengthOfSelectedText ) );
 
       // Mark the paragraphs to be updated.
index b220be6..af3c7c6 100644 (file)
@@ -116,6 +116,8 @@ struct EventData
    */
   std::vector<Event> mEventQueue;              ///< The queue of touch events etc.
 
+  Vector<InputStyle::Mask> mInputStyleChangedQueue; ///< Queue of changes in the input style. Used to emit the signal in the iddle callback.
+
   InputStyle         mInputStyle;              ///< The style to be set to the new inputed text.
 
   State              mPreviousState;           ///< Stores the current state before it's updated with the new one.
@@ -439,6 +441,11 @@ struct Controller::Impl
   void NotifyImfManager();
 
   /**
+   * @brief Helper to notify IMF manager with multi line status.
+   */
+  void NotifyImfMultiLineStatus();
+
+  /**
    * @brief Retrieve the current cursor position.
    *
    * @return The cursor position.
index dbbf523..07eb23b 100644 (file)
@@ -640,11 +640,25 @@ bool Controller::RemoveText( int cursorOffset,
 
       if( UPDATE_INPUT_STYLE == type )
       {
+        // Keep a copy of the current input style.
+        InputStyle currentInputStyle;
+        currentInputStyle.Copy( mImpl->mEventData->mInputStyle );
+
         // Set first the default input style.
         mImpl->RetrieveDefaultInputStyle( mImpl->mEventData->mInputStyle );
 
         // Update the input style.
         mImpl->mLogicalModel->RetrieveStyle( cursorIndex, mImpl->mEventData->mInputStyle );
+
+        // Compare if the input style has changed.
+        const bool hasInputStyleChanged = !currentInputStyle.Equal( mImpl->mEventData->mInputStyle );
+
+        if( hasInputStyleChanged )
+        {
+          const InputStyle::Mask styleChangedMask = currentInputStyle.GetInputStyleChangeMask( mImpl->mEventData->mInputStyle );
+          // Queue the input style changed signal.
+          mImpl->mEventData->mInputStyleChangedQueue.PushBack( styleChangedMask );
+        }
       }
 
       // Updates the text style runs by removing characters. Runs with no characters are removed.
@@ -896,7 +910,7 @@ void Controller::SetInputFontFamily( const std::string& fontFamily )
   if( NULL != mImpl->mEventData )
   {
     mImpl->mEventData->mInputStyle.familyName = fontFamily;
-    mImpl->mEventData->mInputStyle.familyDefined = true;
+    mImpl->mEventData->mInputStyle.isFamilyDefined = true;
 
     if( EventData::SELECTING == mImpl->mEventData->mState )
     {
@@ -955,7 +969,7 @@ void Controller::SetInputFontWeight( FontWeight weight )
   if( NULL != mImpl->mEventData )
   {
     mImpl->mEventData->mInputStyle.weight = weight;
-    mImpl->mEventData->mInputStyle.weightDefined = true;
+    mImpl->mEventData->mInputStyle.isWeightDefined = true;
 
     if( EventData::SELECTING == mImpl->mEventData->mState )
     {
@@ -1000,7 +1014,7 @@ bool Controller::IsInputFontWeightDefined() const
 
   if( NULL != mImpl->mEventData )
   {
-    defined = mImpl->mEventData->mInputStyle.weightDefined;
+    defined = mImpl->mEventData->mInputStyle.isWeightDefined;
   }
 
   return defined;
@@ -1021,7 +1035,7 @@ void Controller::SetInputFontWidth( FontWidth width )
   if( NULL != mImpl->mEventData )
   {
     mImpl->mEventData->mInputStyle.width = width;
-    mImpl->mEventData->mInputStyle.widthDefined = true;
+    mImpl->mEventData->mInputStyle.isWidthDefined = true;
 
     if( EventData::SELECTING == mImpl->mEventData->mState )
     {
@@ -1066,7 +1080,7 @@ bool Controller::IsInputFontWidthDefined() const
 
   if( NULL != mImpl->mEventData )
   {
-    defined = mImpl->mEventData->mInputStyle.widthDefined;
+    defined = mImpl->mEventData->mInputStyle.isWidthDefined;
   }
 
   return defined;
@@ -1087,7 +1101,7 @@ void Controller::SetInputFontSlant( FontSlant slant )
   if( NULL != mImpl->mEventData )
   {
     mImpl->mEventData->mInputStyle.slant = slant;
-    mImpl->mEventData->mInputStyle.slantDefined = true;
+    mImpl->mEventData->mInputStyle.isSlantDefined = true;
 
     if( EventData::SELECTING == mImpl->mEventData->mState )
     {
@@ -1132,7 +1146,7 @@ bool Controller::IsInputFontSlantDefined() const
 
   if( NULL != mImpl->mEventData )
   {
-    defined = mImpl->mEventData->mInputStyle.slantDefined;
+    defined = mImpl->mEventData->mInputStyle.isSlantDefined;
   }
 
   return defined;
@@ -1153,6 +1167,7 @@ void Controller::SetInputFontPointSize( float size )
   if( NULL != mImpl->mEventData )
   {
     mImpl->mEventData->mInputStyle.size = size;
+    mImpl->mEventData->mInputStyle.isSizeDefined = true;
 
     if( EventData::SELECTING == mImpl->mEventData->mState )
     {
@@ -1207,6 +1222,7 @@ void Controller::SetInputLineSpacing( float lineSpacing )
   if( NULL != mImpl->mEventData )
   {
     mImpl->mEventData->mInputStyle.lineSpacing = lineSpacing;
+    mImpl->mEventData->mInputStyle.isLineSpacingDefined = true;
   }
 }
 
@@ -1616,6 +1632,33 @@ void Controller::ProcessModifyEvents()
   events.Clear();
 }
 
+bool Controller::IsInputStyleChangedSignalsQueueEmpty()
+{
+  return ( NULL == mImpl->mEventData ) || ( 0u == mImpl->mEventData->mInputStyleChangedQueue.Count() );
+}
+
+void Controller::ProcessInputStyleChangedSignals()
+{
+  if( NULL == mImpl->mEventData )
+  {
+    // Nothing to do.
+    return;
+  }
+
+  for( Vector<InputStyle::Mask>::ConstIterator it = mImpl->mEventData->mInputStyleChangedQueue.Begin(),
+         endIt = mImpl->mEventData->mInputStyleChangedQueue.End();
+       it != endIt;
+       ++it )
+  {
+    const InputStyle::Mask mask = *it;
+
+    // Emit the input style changed signal.
+    mImpl->mControlInterface.InputStyleChanged( mask );
+  }
+
+  mImpl->mEventData->mInputStyleChangedQueue.Clear();
+}
+
 void Controller::ResetText()
 {
   // Reset buffers.
@@ -1992,7 +2035,7 @@ void Controller::KeyboardFocusGainEvent()
       mImpl->ChangeState( EventData::EDITING );
       mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered.
     }
-
+    mImpl->NotifyImfMultiLineStatus();
     if( mImpl->IsShowingPlaceholderText() )
     {
       // Show alternative placeholder-text when editing
@@ -2761,9 +2804,6 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons
   {
     mImpl->mOperationsPending = ALL_OPERATIONS;
     mImpl->RequestRelayout();
-
-    // Do this last since it provides callbacks into application code
-    mImpl->mControlInterface.TextChanged();
   }
 
   std::string text;
@@ -2793,6 +2833,12 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons
 
   ImfManager::ImfCallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false );
 
+  if( requestRelayout )
+  {
+    // Do this last since it provides callbacks into application code
+    mImpl->mControlInterface.TextChanged();
+  }
+
   return callbackData;
 }
 
index 7b1e2ba..ebad670 100644 (file)
@@ -782,6 +782,19 @@ public:
   void ProcessModifyEvents();
 
   /**
+   * @return Whether the queue of input style changed signals is empty.
+   */
+  bool IsInputStyleChangedSignalsQueueEmpty();
+
+  /**
+   * @brief Process all pending input style changed signals.
+   *
+   * Calls the Text::ControlInterface::InputStyleChanged() method which is overriden by the
+   * text controls. Text controls may send signals to state the input style has changed.
+   */
+  void ProcessInputStyleChangedSignals();
+
+  /**
    * @brief Used to remove placeholder text.
    */
   void ResetText();
index a56402f..f5d8053 100644 (file)
@@ -137,23 +137,16 @@ void BorderVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap
   }
 }
 
-void BorderVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
 void BorderVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
 
-  mBorderColorIndex = (mImpl->mRenderer).RegisterProperty( COLOR_NAME, mBorderColor );
+  mBorderColorIndex = (mImpl->mRenderer).RegisterProperty( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor );
   if( mBorderColor.a < 1.f || mAntiAliasing)
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
-  mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( SIZE_NAME, mBorderSize );
+  mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize );
 }
 
 void BorderVisual::DoCreatePropertyMap( Property::Map& map ) const
index 6973a79..b7ca048 100644 (file)
@@ -61,13 +61,6 @@ public:
    */
   virtual ~BorderVisual();
 
-public:  // from Visual
-
-  /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
 protected:
 
   /**
index 17cf68a..572220b 100644 (file)
@@ -91,18 +91,6 @@ void ColorVisual::SetSize( const Vector2& size )
   // ToDo: renderer responds to the size change
 }
 
-void ColorVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void ColorVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void ColorVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
@@ -133,7 +121,7 @@ void ColorVisual::InitializeRenderer()
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
 
-  mMixColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mMixColor );
+  mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME, mMixColor );
   if( mMixColor.a < 1.f )
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
index f458152..9367ffa 100644 (file)
@@ -63,16 +63,6 @@ public:  // from Visual
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 22f9026..1588b83 100644 (file)
@@ -229,18 +229,6 @@ void GradientVisual::SetSize( const Vector2& size )
   Visual::Base::SetSize( size );
 }
 
-void GradientVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void GradientVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void GradientVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
index be191be..9f2cad4 100644 (file)
@@ -99,16 +99,6 @@ public:  // from Visual
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 5e24418..30eeeda 100644 (file)
@@ -168,11 +168,6 @@ void BatchImageVisual::GetNaturalSize( Vector2& naturalSize ) const
   naturalSize = Vector2::ZERO;
 }
 
-void BatchImageVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-}
-
 void BatchImageVisual::InitializeRenderer( const std::string& imageUrl )
 {
   if( imageUrl.empty() )
index 71f85f9..646dad7 100644 (file)
@@ -61,11 +61,6 @@ public:  // from Visual
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::Base::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
    * @copydoc Visual::Base::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 6d980f6..0984326 100644 (file)
@@ -134,7 +134,7 @@ const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER(
     \n
     void main()\n
     {\n
-      mediump vec2 texCoord = mix( uAtlasRect.xy, uAtlasRect.zw, clamp( vTexCoord, 0.0, 1.0 ) );\n
+      mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
       gl_FragColor = texture2D( sTexture, texCoord ) * uColor;\n
     }\n
 );
@@ -147,17 +147,20 @@ const char* FRAGMENT_SHADER_ATLAS_VARIOUS_WRAP = DALI_COMPOSE_SHADER(
     uniform lowp vec2 wrapMode;\n
     uniform lowp vec4 uColor;\n
     \n
-    mediump float wrapCoordinate( mediump float coordinate, lowp float wrap )\n
+    mediump float wrapCoordinate( mediump vec2 range, mediump float coordinate, lowp float wrap )\n
     {\n
-      if( abs(wrap-2.0) < 0.5 )\n // REFLECT
-        return 1.0-abs(fract(coordinate*0.5)*2.0 - 1.0);\n
+      mediump float coord;\n
+      if( wrap > 1.5 )\n // REFLECT
+        coord = 1.0-abs(fract(coordinate*0.5)*2.0 - 1.0);\n
       else \n// warp == 0 or 1
-        return mix( clamp( coordinate, 0.0, 1.0 ), fract( coordinate ), wrap);\n
+        coord = mix(coordinate, fract( coordinate ), wrap);\n
+      return clamp( mix(range.x, range.y, coord), range.x, range.y );
     }\n
+    \n
     void main()\n
     {\n
-      mediump vec2 texCoord = mix( uAtlasRect.xy, uAtlasRect.zw,
-                              vec2( wrapCoordinate( vTexCoord.x, wrapMode.x ), wrapCoordinate( vTexCoord.y, wrapMode.y ) ) );\n
+      mediump vec2 texCoord = vec2( wrapCoordinate( uAtlasRect.xz, vTexCoord.x, wrapMode.x ),
+                                    wrapCoordinate( uAtlasRect.yw, vTexCoord.y, wrapMode.y ) );\n
       gl_FragColor = texture2D( sTexture, texCoord ) * uColor;\n
     }\n
 );
index 597de7b..2c56eae 100644 (file)
@@ -369,18 +369,6 @@ void MeshVisual::SetSize( const Vector2& size )
   // ToDo: renderer responds to the size change
 }
 
-void MeshVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void MeshVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void MeshVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
index b801ce8..67e1fe1 100644 (file)
@@ -75,16 +75,6 @@ public:  // from Visual
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 7ef3a6e..5dc9e04 100644 (file)
@@ -254,17 +254,6 @@ void NPatchVisual::GetNaturalSize( Vector2& naturalSize ) const
   }
 }
 
-void NPatchVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-  //ToDo: renderer responds to the clipRect change
-}
-
-void NPatchVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 Geometry NPatchVisual::CreateGeometry()
 {
   Geometry geometry;
index d8ad11c..498bcc2 100644 (file)
@@ -73,16 +73,6 @@ public:  // from Visual
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index fe14601..1955db5 100644 (file)
@@ -367,18 +367,6 @@ void PrimitiveVisual::GetNaturalSize( Vector2& naturalSize ) const
   naturalSize.y = mObjectDimensions.y;
 }
 
-void PrimitiveVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void PrimitiveVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void PrimitiveVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
@@ -431,7 +419,7 @@ void PrimitiveVisual::UpdateShaderUniforms()
   mShader.RegisterProperty( STAGE_OFFSET_UNIFORM_NAME, Vector2( width, height ) / 2.0f );
   mShader.RegisterProperty( LIGHT_POSITION_UNIFORM_NAME, mLightPosition );
   mShader.RegisterProperty( OBJECT_MATRIX_UNIFORM_NAME, scaleMatrix );
-  mShader.RegisterProperty( COLOR_UNIFORM_NAME, mColor );
+  mShader.RegisterProperty( Toolkit::PrimitiveVisual::Property::COLOR, COLOR_UNIFORM_NAME, mColor );
   mShader.RegisterProperty( OBJECT_DIMENSIONS_UNIFORM_NAME, mObjectDimensions );
 }
 
index 01b5885..45b536b 100644 (file)
@@ -121,16 +121,6 @@ public:  // from Visual
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index fb8ae32..524057e 100644 (file)
@@ -65,7 +65,6 @@ struct Base::Impl
   CustomShader* mCustomShader;
 
   Vector2   mSize;
-  Vector2   mOffset;
   float     mDepthIndex;
   int       mFlags;
 
index 9d0c964..58e4d38 100644 (file)
@@ -36,21 +36,18 @@ namespace Toolkit
 namespace Internal
 {
 
-namespace Visual
-{
-
-Base::Base( VisualFactoryCache& factoryCache )
+Visual::Base::Base( VisualFactoryCache& factoryCache )
 : mImpl( new Impl() ),
   mFactoryCache( factoryCache )
 {
 }
 
-Base::~Base()
+Visual::Base::~Base()
 {
   delete mImpl;
 }
 
-void Base::SetCustomShader( const Property::Map& shaderMap )
+void Visual::Base::SetCustomShader( const Property::Map& shaderMap )
 {
   if( mImpl->mCustomShader )
   {
@@ -62,7 +59,7 @@ void Base::SetCustomShader( const Property::Map& shaderMap )
   }
 }
 
-void Base::Initialize( Actor& actor, const Property::Map& propertyMap )
+void Visual::Base::Initialize( Actor& actor, const Property::Map& propertyMap )
 {
   Property::Value* customShaderValue = propertyMap.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
   if( customShaderValue )
@@ -77,31 +74,22 @@ void Base::Initialize( Actor& actor, const Property::Map& propertyMap )
   DoInitialize( actor, propertyMap );
 }
 
-void Base::SetSize( const Vector2& size )
+void Visual::Base::SetSize( const Vector2& size )
 {
   mImpl->mSize = size;
 }
 
-const Vector2& Base::GetSize() const
+const Vector2& Visual::Base::GetSize() const
 {
   return mImpl->mSize;
 }
 
-void Base::GetNaturalSize( Vector2& naturalSize ) const
+void Visual::Base::GetNaturalSize( Vector2& naturalSize ) const
 {
   naturalSize = Vector2::ZERO;
 }
 
-void Base::SetClipRect( const Rect<int>& clipRect )
-{
-}
-
-void Base::SetOffset( const Vector2& offset )
-{
-  mImpl->mOffset = offset;
-}
-
-void Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( float index )
 {
   mImpl->mDepthIndex = index;
   if( mImpl->mRenderer )
@@ -110,12 +98,12 @@ void Base::SetDepthIndex( float index )
   }
 }
 
-float Base::GetDepthIndex() const
+float Visual::Base::GetDepthIndex() const
 {
   return mImpl->mDepthIndex;
 }
 
-void Base::SetOnStage( Actor& actor )
+void Visual::Base::SetOnStage( Actor& actor )
 {
   DoSetOnStage( actor );
 
@@ -126,7 +114,7 @@ void Base::SetOnStage( Actor& actor )
   mImpl->mFlags |= Impl::IS_ON_STAGE;
 }
 
-void Base::SetOffStage( Actor& actor )
+void Visual::Base::SetOffStage( Actor& actor )
 {
   if( GetIsOnStage() )
   {
@@ -136,7 +124,7 @@ void Base::SetOffStage( Actor& actor )
   }
 }
 
-void Base::EnablePreMultipliedAlpha( bool preMultipled )
+void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
 {
   if(preMultipled)
   {
@@ -153,22 +141,22 @@ void Base::EnablePreMultipliedAlpha( bool preMultipled )
   }
 }
 
-bool Base::IsPreMultipliedAlphaEnabled() const
+bool Visual::Base::IsPreMultipliedAlphaEnabled() const
 {
   return mImpl->mFlags & Impl::IS_PREMULTIPLIED_ALPHA;
 }
 
-void Base::DoSetOnStage( Actor& actor )
+void Visual::Base::DoSetOnStage( Actor& actor )
 {
 }
 
-void Base::DoSetOffStage( Actor& actor )
+void Visual::Base::DoSetOffStage( Actor& actor )
 {
   actor.RemoveRenderer( mImpl->mRenderer );
   mImpl->mRenderer.Reset();
 }
 
-void Base::CreatePropertyMap( Property::Map& map ) const
+void Visual::Base::CreatePropertyMap( Property::Map& map ) const
 {
   DoCreatePropertyMap( map );
 
@@ -178,18 +166,16 @@ void Base::CreatePropertyMap( Property::Map& map ) const
   }
 }
 
-bool Base::GetIsOnStage() const
+bool Visual::Base::GetIsOnStage() const
 {
   return mImpl->mFlags & Impl::IS_ON_STAGE;
 }
 
-bool Base::GetIsFromCache() const
+bool Visual::Base::GetIsFromCache() const
 {
   return mImpl->mFlags & Impl::IS_FROM_CACHE;
 }
 
-} // namespace Visual
-
 } // namespace Internal
 
 } // namespace Toolkit
index da15492..8068dd8 100644 (file)
@@ -90,25 +90,6 @@ public:
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * ToDo: Add this function to Toolkit::Visual when it is fully implemented.
-   *
-   * Set the clip rectangular of this visual.
-   * The contents of the visual will not be visible outside this rectangular.
-   *
-   * @param [in] clipRect The clipping rectangular.
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   *ToDo: Add this function to Toolkit::Visual when it is fully implemented.
-   *
-   * Reposition this visual with a 2D offset.
-   *
-   * @param[in] offset The offset to reposition the visual.
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Toolkit::Visual::Base::SetDepthIndex
    */
   void SetDepthIndex( float index );
index da86201..248270b 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -150,14 +150,14 @@ bool VisualFactoryCache::CleanRendererCache( const std::string& key )
   return false;
 }
 
-void VisualFactoryCache::CacheDebugRenderer( Renderer& renderer )
+void VisualFactoryCache::CacheWireframeRenderer( Renderer& renderer )
 {
-  mDebugRenderer = renderer;
+  mWireframeRenderer = renderer;
 }
 
-Renderer VisualFactoryCache::GetDebugRenderer()
+Renderer VisualFactoryCache::GetWireframeRenderer()
 {
-  return mDebugRenderer;
+  return mWireframeRenderer;
 }
 
 Geometry VisualFactoryCache::CreateQuadGeometry()
index 6f67a66..cb1b890 100644 (file)
@@ -171,14 +171,14 @@ public:
   bool CleanRendererCache( const std::string& key );
 
   /**
-   * @brief Cache the debug renderer
+   * @brief Cache the wireframe renderer
    */
-  void CacheDebugRenderer( Renderer& renderer );
+  void CacheWireframeRenderer( Renderer& renderer );
 
   /**
-   * @brief Request the debug renderer;
+   * @brief Request the wireframe renderer;
    */
-  Renderer GetDebugRenderer();
+  Renderer GetWireframeRenderer();
 
   /**
    * Get the image atlas manager.
@@ -245,7 +245,7 @@ private:
   HashVector mRendererHashes;
   CachedRenderers mRenderers;
 
-  Renderer mDebugRenderer;
+  Renderer mWireframeRenderer;
 
   ImageAtlasManagerPtr mAtlasManager;
   SvgRasterizeThread*  mSvgRasterizeThread;
index 80f4420..e35c98b 100644 (file)
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
 #include <dali-toolkit/internal/visuals/border/border-visual.h>
 #include <dali-toolkit/internal/visuals/color/color-visual.h>
-#include <dali-toolkit/internal/visuals/debug/debug-visual.h>
 #include <dali-toolkit/internal/visuals/gradient/gradient-visual.h>
-#include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
+#include <dali-toolkit/internal/visuals/image/batch-image-visual.h>
 #include <dali-toolkit/internal/visuals/image/image-visual.h>
-#include <dali-toolkit/internal/visuals/svg/svg-visual.h>
 #include <dali-toolkit/internal/visuals/mesh/mesh-visual.h>
+#include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
 #include <dali-toolkit/internal/visuals/primitive/primitive-visual.h>
+#include <dali-toolkit/internal/visuals/svg/svg-visual.h>
+#include <dali-toolkit/internal/visuals/wireframe/wireframe-visual.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
-#include <dali-toolkit/internal/visuals/image/batch-image-visual.h>
 
 namespace Dali
 {
@@ -61,7 +61,7 @@ DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, GRADIENT )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, IMAGE )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, MESH )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, PRIMITIVE )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, DEBUG )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, WIREFRAME )
 DALI_ENUM_TO_STRING_TABLE_END( VISUAL_TYPE )
 
 const char * const VISUAL_TYPE( "visualType" );
@@ -95,10 +95,10 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
     mFactoryCache = new VisualFactoryCache();
   }
 
-  // Return a new DebugVisual if we have debug enabled
+  // Return a new WireframeVisual if we have debug enabled
   if( mDebugEnabled )
   {
-    return Toolkit::Visual::Base( new DebugVisual( *( mFactoryCache.Get() ) ) );
+    return Toolkit::Visual::Base( new WireframeVisual( *( mFactoryCache.Get() ) ) );
   }
 
   Visual::Base* visualPtr = NULL;
@@ -176,9 +176,9 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
       break;
     }
 
-    case Toolkit::Visual::DEBUG:
+    case Toolkit::Visual::WIREFRAME:
     {
-      visualPtr = new DebugVisual( *( mFactoryCache.Get() ) );
+      visualPtr = new WireframeVisual( *( mFactoryCache.Get() ) );
       break;
     }
 
@@ -206,7 +206,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Image& image )
 
   if( mDebugEnabled )
   {
-    return Toolkit::Visual::Base( new DebugVisual( *( mFactoryCache.Get() ) ) );
+    return Toolkit::Visual::Base( new WireframeVisual( *( mFactoryCache.Get() ) ) );
   }
 
   NinePatchImage npatchImage = NinePatchImage::DownCast( image );
@@ -236,7 +236,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const std::string& url, Image
 
   if( mDebugEnabled )
   {
-    return Toolkit::Visual::Base( new DebugVisual( *( mFactoryCache.Get() ) ) );
+    return Toolkit::Visual::Base( new WireframeVisual( *( mFactoryCache.Get() ) ) );
   }
 
   if( NinePatchImage::IsNinePatchUrl( url ) )
@@ -17,7 +17,7 @@
 
 
 // CLASS HEADER
-#include "debug-visual.h"
+#include "wireframe-visual.h"
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
@@ -65,39 +65,39 @@ void main()\n
 }
 
 
-DebugVisual::DebugVisual( VisualFactoryCache& factoryCache )
+WireframeVisual::WireframeVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache )
 {
 }
 
-DebugVisual::~DebugVisual()
+WireframeVisual::~WireframeVisual()
 {}
 
-void DebugVisual::DoSetOnStage( Actor& actor )
+void WireframeVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
 }
 
-void DebugVisual::DoCreatePropertyMap( Property::Map& map ) const
+void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
-  map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::DEBUG );
+  map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::WIREFRAME );
 }
 
-void DebugVisual::InitializeRenderer()
+void WireframeVisual::InitializeRenderer()
 {
-  mImpl->mRenderer = mFactoryCache.GetDebugRenderer();
+  mImpl->mRenderer = mFactoryCache.GetWireframeRenderer();
   if( !mImpl->mRenderer )
   {
     Geometry geometry = CreateQuadWireframeGeometry();
     Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
 
     mImpl->mRenderer = Renderer::New( geometry, shader);
-    mFactoryCache.CacheDebugRenderer( mImpl->mRenderer );
+    mFactoryCache.CacheWireframeRenderer( mImpl->mRenderer );
   }
 }
 
-Geometry DebugVisual::CreateQuadWireframeGeometry()
+Geometry WireframeVisual::CreateQuadWireframeGeometry()
 {
   const float halfWidth = 0.5f;
   const float halfHeight = 0.5f;
@@ -1,8 +1,8 @@
-#ifndef DALI_TOOLKIT_INTERNAL_DEBUG_VISUAL_H
-#define DALI_TOOLKIT_INTERNAL_DEBUG_VISUAL_H
+#ifndef DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
+#define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,10 @@ namespace Internal
 {
 
 /**
- * The visual which renders a wireframe outline to the control's quad for debugging
+ * The visual which renders a wireframe outline to the control's quad.
  *
  */
-class DebugVisual: public Visual::Base
+class WireframeVisual: public Visual::Base
 {
 public:
 
@@ -43,12 +43,12 @@ public:
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
    */
-  DebugVisual( VisualFactoryCache& factoryCache );
+  WireframeVisual( VisualFactoryCache& factoryCache );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
    */
-  virtual ~DebugVisual();
+  virtual ~WireframeVisual();
 
 protected:
 
@@ -78,10 +78,10 @@ private:
 private:
 
   // Undefined
-  DebugVisual( const DebugVisual& debugVisual);
+  WireframeVisual( const WireframeVisual& visual);
 
   // Undefined
-  DebugVisual& operator=( const DebugVisual& debugVisual );
+  WireframeVisual& operator=( const WireframeVisual& visual );
 
 };
 
@@ -91,4 +91,4 @@ private:
 
 } // namespace Dali
 
-#endif /* DALI_TOOLKIT_INTERNAL_DEBUG_VISUAL_H */
+#endif // DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
index 91f0157..ca5c288 100644 (file)
@@ -52,6 +52,30 @@ class CheckBoxButton;
  *
  * When the button is disabled, \e background image and \e selected image are replaced by \e disabled images.
  *
+ * Usage example: -
+ *
+ * @code
+ * // in Creating a DALi Application
+ * void HelloWorldExample::Create( Application& application )
+ * {
+ *   CheckBoxButton button = CheckBoxButton::New();
+ *   button.SetParentOrigin( ParentOrigin::CENTER );
+ *   button.SetLabelText( "Check" );
+ *   button.SetSize( 200, 40 );
+ *   button.SetBackgroundColor( Color::WHITE );
+ *   Stage::GetCurrent().Add( button );
+ *
+ *   // Connect to a button signal emitted by the button
+ *   button.StateChangedSignal().Connect( this, &HelloWorldExample::OnButtonStateChanged );
+ * }
+ *
+ * bool HelloWorldExample::OnButtonStateChanged( Button button )
+ * {
+ *   // Do something when the button state is changed
+ *   // You can get the state using button.IsSelected() call
+ *   return true;
+ * }
+ * @endcode
  * @SINCE_1_0.0
  */
 class DALI_IMPORT_API CheckBoxButton : public Button
index 4beab96..603601d 100644 (file)
@@ -46,6 +46,42 @@ class PushButton;
  * By default a PushButton emits a Button::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when it's clicked
  * and a Button::ReleasedSignal() signal when it's released or having pressed it, the touch point leaves the boundary of the button.
  *
+ * Usage example: -
+ *
+ * @code
+ * // in Creating a DALi Application
+ * void HelloWorldExample::Create( Application& application )
+ * {
+ *   PushButton button = PushButton::New();
+ *   button.SetParentOrigin( ParentOrigin::CENTER );
+ *   button.SetLabelText( "Press" );
+ *   Stage::GetCurrent().Add( button );
+ *
+ *   // Connect to button signals emitted by the button
+ *   button.ClickedSignal().Connect( this, &HelloWorldExample::OnButtonClicked );
+ *   button.PressedSignal().Connect( this, &HelloWorldExample::OnButtonPressed );
+ *   button.ReleasedSignal().Connect( this, &HelloWorldExample::OnButtonReleased );
+ * }
+ *
+ * bool HelloWorldExample::OnButtonClicked( Button button )
+ * {
+ *   // Do something when the button is clicked
+ *   return true;
+ * }
+ *
+ * bool HelloWorldExample::OnButtonPressed( Button button )
+ * {
+ *   // Do something when the button is pressed
+ *   return true;
+ * }
+ *
+ * bool HelloWorldExample::OnButtonReleased( Button button )
+ * {
+ *   // Do something when the button is released
+ *   return true;
+ * }
+ * @endcode
+ *
  * See Button for more detail on signals and modifying appearance via properties.
  * @SINCE_1_0.0
  */
index 253f3a2..23745bb 100644 (file)
@@ -691,6 +691,35 @@ void Control::UnregisterVisual( Property::Index index )
    }
 }
 
+Toolkit::Visual::Base Control::GetVisual( Property::Index index )
+{
+  std::vector< RegisteredVisual >::iterator iter;
+  if ( FindVisual( index, mImpl->mVisuals, iter ) )
+  {
+    return (*iter).visual;
+  }
+
+  return Toolkit::Visual::Base();
+}
+
+Actor Control::GetPlacementActor( Property::Index index )
+{
+  std::vector< RegisteredVisual >::iterator iter;
+  if ( FindVisual( index, mImpl->mVisuals, iter ) )
+  {
+    if( (*iter).placementActor )
+    {
+      return (*iter).placementActor;
+    }
+    else
+    {
+      return Self();
+    }
+  }
+
+  return Actor();
+}
+
 bool Control::OnAccessibilityActivated()
 {
   return false; // Accessibility activation is not handled by default
index 7cd1dcd..e8a71fe 100644 (file)
@@ -316,6 +316,28 @@ protected: // For derived classes to call
     */
    void UnregisterVisual( Property::Index index );
 
+   /**
+    * @brief Retrieve the visual associated with the given property index.
+    *
+    * @SINCE_1_2.2
+    *
+    * @param[in] index The Property index of the visual.
+    * @return The registered visual if exist, otherwise empty handle.
+    * @note For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
+    */
+   Toolkit::Visual::Base GetVisual( Property::Index index );
+
+   /**
+    * @brief Retrieve the placement actor associated with the given index.
+    *
+    * @SINCE_1_2.2
+    *
+    * @@param[in] index The Property index of the visual.
+    * @return Then placement actor if exist, otherwise empty handle.
+    * @note For managing object life-cycle, do not store the returned placement actor as a member which increments its reference count.
+    */
+   Actor GetPlacementActor( Property::Index index );
+
   /**
    * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
    *
index fa81f24..4098e8b 100644 (file)
@@ -64,6 +64,11 @@ TextEditor::TextChangedSignalType& TextEditor::TextChangedSignal()
   return Dali::Toolkit::GetImpl( *this ).TextChangedSignal();
 }
 
+TextEditor::InputStyleChangedSignalType& TextEditor::InputStyleChangedSignal()
+{
+  return Dali::Toolkit::GetImpl( *this ).InputStyleChangedSignal();
+}
+
 TextEditor::TextEditor( Internal::TextEditor& implementation )
 : Control( implementation )
 {
index fc7b701..e6e05f8 100644 (file)
@@ -40,9 +40,10 @@ class TextEditor;
  * @brief A control which provides a multi-line editable text editor.
  *
  *  * Signals
- * | %Signal Name         | Method                                              |
- * |----------------------|-----------------------------------------------------|
- * | textChanged          | @ref TextChangedSignal()                            |
+ * | %Signal Name         | Method                         |                    |
+ * |----------------------|--------------------------------|--------------------|
+ * | textChanged          | @ref TextChangedSignal()       | @SINCE_1_1.37      |
+ * | inputStyleChanged    | @ref InputStyleChangedSignal() | @SINCE_1_2.2       |
  *
  */
 class DALI_IMPORT_API TextEditor : public Control
@@ -51,6 +52,7 @@ public:
 
   /**
    * @brief The start and end property ranges for this control.
+   * @SINCE_1_1.37
    */
   enum PropertyRange
   {
@@ -60,6 +62,7 @@ public:
 
   /**
    * @brief An enumeration of properties belonging to the TextEditor class.
+   * @SINCE_1_1.37
    */
   struct Property
   {
@@ -108,25 +111,61 @@ public:
     };
   };
 
+  /**
+   * @brief Mask used by the signal InputStyleChangedSignal(). Notifies which parameters of the input style have changed.
+   *
+   * @SINCE_1_2.2
+   */
+  struct InputStyle
+  {
+    enum Mask
+    {
+      NONE         = 0x0000, ///< @SINCE_1_2.2
+      COLOR        = 0x0001, ///< @SINCE_1_2.2
+      FONT_FAMILY  = 0x0002, ///< @SINCE_1_2.2
+      POINT_SIZE   = 0x0004, ///< @SINCE_1_2.2
+      FONT_STYLE   = 0x0008, ///< @SINCE_1_2.2
+      LINE_SPACING = 0x0010, ///< @SINCE_1_2.2
+      UNDERLINE    = 0x0020, ///< @SINCE_1_2.2
+      SHADOW       = 0x0040, ///< @SINCE_1_2.2
+      EMBOSS       = 0x0080, ///< @SINCE_1_2.2
+      OUTLINE      = 0x0100  ///< @SINCE_1_2.2
+    };
+  };
+
   // Type Defs
 
-  /// @brief Text changed signal type.
+  /**
+   * @brief Text changed signal type.
+   * @SINCE_1_1.37
+   */
   typedef Signal<void ( TextEditor ) > TextChangedSignalType;
 
   /**
+   * @brief Input Style changed signal type.
+   * @SINCE_1_2.2
+   */
+  typedef Signal<void ( TextEditor, InputStyle::Mask ) > InputStyleChangedSignalType;
+
+  /**
    * @brief Create the TextEditor control.
+   *
+   * @SINCE_1_1.37
    * @return A handle to the TextEditor control.
    */
   static TextEditor New();
 
   /**
    * @brief Creates an empty handle.
+   *
+   * @SINCE_1_1.37
    */
   TextEditor();
 
   /**
    * @brief Copy constructor.
    *
+   * @SINCE_1_1.37
    * @param[in] handle The handle to copy from.
    */
   TextEditor( const TextEditor& handle );
@@ -134,6 +173,7 @@ public:
   /**
    * @brief Assignment operator.
    *
+   * @SINCE_1_1.37
    * @param[in] handle The handle to copy from.
    * @return A reference to this.
    */
@@ -143,6 +183,7 @@ public:
    * @brief Destructor.
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   * @SINCE_1_1.37
    */
   ~TextEditor();
 
@@ -152,6 +193,7 @@ public:
    * If the BaseHandle points is a TextEditor the downcast returns a valid handle.
    * If not the returned handle is left empty.
    *
+   * @SINCE_1_1.37
    * @param[in] handle Handle to an object.
    * @return handle to a TextEditor or an empty handle.
    */
@@ -166,16 +208,33 @@ public:
    * @code
    *   void YourCallbackName( TextEditor textEditor );
    * @endcode
+   *
+   * @SINCE_1_1.37
    * @return The signal to connect to.
    */
   TextChangedSignalType& TextChangedSignal();
 
+  /**
+   * @brief This signal is emitted when the input style is updated as a consequence of a change in the cursor position.
+   * i.e. The signal is not emitted when the input style is updated through the property system.
+   *
+   * A callback of the following type may be connected. The @p mask parameter notifies which parts of the style have changed.
+   * @code
+   *   void YourCallbackName( TextEditor textEditor, TextEditor::InputStyle::Mask mask );
+   * @endcode
+   *
+   * @SINCE_1_2.2
+   * @return The signal to connect to.
+   */
+  InputStyleChangedSignalType& InputStyleChangedSignal();
+
 public: // Not intended for application developers
 
   /// @cond internal
   /**
    * @brief Creates a handle using the Toolkit::Internal implementation.
    *
+   * @SINCE_1_1.37
    * @param[in] implementation The Control implementation.
    */
   DALI_INTERNAL TextEditor( Internal::TextEditor& implementation );
@@ -183,6 +242,7 @@ public: // Not intended for application developers
   /**
    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
    *
+   * @SINCE_1_1.37
    * @param[in]  internal  A pointer to the internal CustomActor.
    */
   explicit DALI_INTERNAL TextEditor( Dali::Internal::CustomActor* internal );
index 3a833f3..fc58261 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -69,6 +69,11 @@ TextField::MaxLengthReachedSignalType& TextField::MaxLengthReachedSignal()
   return Dali::Toolkit::GetImpl( *this ).MaxLengthReachedSignal();
 }
 
+TextField::InputStyleChangedSignalType& TextField::InputStyleChangedSignal()
+{
+  return Dali::Toolkit::GetImpl( *this ).InputStyleChangedSignal();
+}
+
 TextField::TextField( Internal::TextField& implementation )
 : Control(implementation)
 {
index fc29af4..f33483c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TEXT_FIELD_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,12 +40,11 @@ class TextField;
  * @brief A control which provides a single-line editable text field.
  *
  *  * Signals
- * | %Signal Name         | Method                                              |
- * |----------------------|-----------------------------------------------------|
- * | textChanged          | @ref TextChangedSignal()                            |
- * | maxLengthReached     | @ref MaxLengthReachedSignal()                       |
- *
- * @SINCE_1_0.0
+ * | %Signal Name         | Method                         |                    |
+ * |----------------------|--------------------------------|--------------------|
+ * | textChanged          | @ref TextChangedSignal()       | @SINCE_1_0.0       |
+ * | maxLengthReached     | @ref MaxLengthReachedSignal()  | @SINCE_1_0.0       |
+ * | inputStyleChanged    | @ref InputStyleChangedSignal() | @SINCE_1_2.2       |
  */
 class DALI_IMPORT_API TextField : public Control
 {
@@ -131,14 +130,48 @@ public:
     EXCEED_POLICY_CLIP             ///< The end of text will be clipped to fit within the TextField. @SINCE_1_0.0
   };
 
+  /**
+   * @brief Mask used by the signal InputStyleChangedSignal(). Notifies which parameters of the input style have changed.
+   *
+   * @SINCE_1_2.2
+   */
+  struct InputStyle
+  {
+    enum Mask
+    {
+      NONE         = 0x0000, ///< @SINCE_1_2.2
+      COLOR        = 0x0001, ///< @SINCE_1_2.2
+      FONT_FAMILY  = 0x0002, ///< @SINCE_1_2.2
+      POINT_SIZE   = 0x0004, ///< @SINCE_1_2.2
+      FONT_STYLE   = 0x0008, ///< @SINCE_1_2.2
+      UNDERLINE    = 0x0010, ///< @SINCE_1_2.2
+      SHADOW       = 0x0020, ///< @SINCE_1_2.2
+      EMBOSS       = 0x0040, ///< @SINCE_1_2.2
+      OUTLINE      = 0x0080  ///< @SINCE_1_2.2
+    };
+  };
+
   // Type Defs
 
-  /// @brief Text changed signal type.
+  /**
+   * @brief Text changed signal type.
+   * @SINCE_1_0.0
+   */
   typedef Signal<void ( TextField ) > TextChangedSignalType;
-  /// @brief Max Characters Exceed signal type.
+
+  /**
+   * @brief Max Characters Exceed signal type.
+   * @SINCE_1_0.0
+   */
   typedef Signal<void ( TextField ) > MaxLengthReachedSignalType;
 
   /**
+   * @brief Input Style changed signal type.
+   * @SINCE_1_2.2
+   */
+  typedef Signal<void ( TextField, InputStyle::Mask ) > InputStyleChangedSignalType;
+
+  /**
    * @brief Create the TextField control.
    * @SINCE_1_0.0
    * @return A handle to the TextField control.
@@ -214,6 +247,20 @@ public:
    */
   MaxLengthReachedSignalType& MaxLengthReachedSignal();
 
+  /**
+   * @brief This signal is emitted when the input style is updated as a consequence of a change in the cursor position.
+   * i.e. The signal is not emitted when the input style is updated through the property system.
+   *
+   * A callback of the following type may be connected. The @p mask parameter notifies which parts of the style have changed.
+   * @code
+   *   void YourCallbackName( TextField textField, TextField::InputStyle::Mask mask );
+   * @endcode
+   *
+   * @SINCE_1_2.2
+   * @return The signal to connect to.
+   */
+  InputStyleChangedSignalType& InputStyleChangedSignal();
+
 public: // Not intended for application developers
 
   /**
index efc15bb..b946778 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 1;
+const unsigned int TOOLKIT_MICRO_VERSION = 2;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 7b8efbb..bb84ea5 100644 (file)
@@ -54,6 +54,11 @@ class StyleManager;
  * If the application wants to customize the theme, RequestThemeChange
  * needs to be called.
  *
+ * To supply resource paths ( in json ) the following constant is available: APPLICATION_RESOURCE_PATH.
+ * It provides the path to the  application resource root folder, from there the filename can an be specified along with
+ * any sub folders, e.g Images, Models etc.
+ * The APPLICATION_RESOURCE_PATH can be retrieved using Application::GetResourcePath()
+ *
  * Signals
  * | %Signal Name            | Method                           |
  * |------------------------------------------------------------|
@@ -106,7 +111,7 @@ public:
    *
    * @SINCE_1_1.32
    * @param[in] themeFile If a relative path is specified, then this is relative
-   * to the directory returned by app_get_resource_path().
+   * to the directory returned by Application::GetResourcePath().
    */
   void ApplyTheme( const std::string& themeFile );
 
@@ -150,7 +155,7 @@ public:
    * @param[in] control The control to which to apply the style.
    * @param[in] jsonFileName The name of the JSON style file to apply. If a
    * relative path is specified, then this is relative to the directory
-   * returned by app_get_resource_path().
+   * returned by Application::GetResourcePath().
    * @param[in] styleName The name of the style within the JSON file to apply.
    */
   void ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName );
index 4c1ff57..cab8986 100644 (file)
@@ -42,7 +42,7 @@ enum Type
   IMAGE, ///< Renders an image into the control's quad. @SINCE_1_1.45
   MESH, ///< Renders a mesh using an "obj" file, optionally with textures provided by an "mtl" file. @SINCE_1_1.45
   PRIMITIVE, ///< Renders a simple 3D shape, such as a cube or sphere. @SINCE_1_1.45
-  DEBUG, ///< Renders a simple wire-frame outlining a quad. @SINCE_1_1.45
+  WIREFRAME, ///< Renders a simple wire-frame outlining a quad. @SINCE_1_2.2
 };
 
 namespace Property
index 41cf322..b2bd746 100644 (file)
  * </tr>
  * <tr>
  *    <td style="padding-left:1em">@ref dali_toolkit_controls_scroll_bar</td>
- *    <td>ScrollBar control.</td>
+ *    <td>ScrollBar is a component that can be linked to the scrollable objects.</td>
  * </tr>
  * <tr>
  *    <td style="padding-left:1em">@ref dali_toolkit_controls_scrollable</td>
- *    <td>Scrollable container controls.</td>
+ *    <td>Scrollable contains scrolled controls.</td>
  * </tr>
  * <tr>
  *    <td style="padding-left:2em">@ref dali_toolkit_controls_item_view</td>
  *     @brief ImageView is a control displying an image.
 
  *     @defgroup dali_toolkit_controls_scroll_bar Scroll Bar
- *     @brief ScrollBar control.
+ *     @brief ScrollBar is a component that can be linked to the scrollable objects.
 
  *     @defgroup dali_toolkit_controls_scrollable Scrollable
- *     @brief Scrollable container controls.
+ *     @brief Scrollable contains scrolled controls.
 
  *     @{
  *       @defgroup dali_toolkit_controls_item_view Item View
diff --git a/docs/content/images/visuals/wireframe-visual.png b/docs/content/images/visuals/wireframe-visual.png
new file mode 100644 (file)
index 0000000..b22bd94
Binary files /dev/null and b/docs/content/images/visuals/wireframe-visual.png differ
index e2ff92e..f6eeb25 100644 (file)
@@ -77,7 +77,7 @@
  + Environment Variables
  + [Resource Tracking](@ref resourcetracking)
  + Logging
- + [Debug Visual](@ref debugvisual)
+ + [Visual Debug Rendering](@ref debugrendering)
  + [Stagehand - DALi Visual Debugger](@ref stagehand)
 
 ### Viewing Modes
index 05be5f1..6ea7dc7 100644 (file)
@@ -18,7 +18,7 @@ Each Dali::Object contains a single reference counted object which can be intiti
 This means that C++ new/delete operators do not have to be used (or paired) in the user code (RAII idiom).
 Of course there's no way of stopping users from allocating heap memory, but calls to the new operator can be minimised.
 
-<h2 class="pg">What does 'implicit smart-pointer semantics' mean in the case of Dali?</h2>
+<h2 class="pg">What does 'implicit smart-pointer semantics' mean in the case of DALi?</h2>
 
 Since DALi objects are just handles, they can be copied by value. When a DALi object is copied, both the copy and original will point to the same DALi resource.
 The internal DALi resources are reference counted; copying a DALi object will increase the reference count. A resource will not be deleted until all its Dali::Object handles are destroyed, or reset.
@@ -99,4 +99,3 @@ To sum up implicit pointer semantics, Objects can be:
 - returned from functions
 
 */
-
index c7b5ddd..780ad3e 100644 (file)
@@ -1,6 +1,6 @@
 /*! \page hello-world Hello World - explained
 
-The following steps are required for displaying the sentence 'Hello World' with Dali:
+The following steps are required for displaying the sentence 'Hello World' with DALi:
 
 - initialize the DALi library
 - create an Actor showing text
index 60e119f..9960a3e 100644 (file)
@@ -12,7 +12,7 @@
  * The Image View is constructed by passing a Dali::Image object or by a url path.<br>
  *
  * <h3 class="pg">Loading from a url path</h3>
- * Image View will load a file from a given url path. Using a url path is the prefered way of displaying an image as the Dali engine can do optimsations to
+ * Image View will load a file from a given url path. Using a url path is the prefered way of displaying an image as the DALi engine can do optimisations to
  * reuse shaders and perform automatic image atlassing.<br>
  * This can be a path to a image file:
  * @code
index 3492e67..40ce183 100644 (file)
@@ -10,12 +10,12 @@ This could be from within DALi or externally by an application.
 Properties can be set externally by an application, allowing that application to change the configuration or behaviour of an actor.
 This could include the physical geometry of the actor, or how it is drawn or moves.
 
-Properties can also be read. This feature can be used in conjunction with constraints to allow changes to a property within one actor to cause changes to the property of another actor. For example, an actor following the movement of another separate actor (that it is not a child of). 
+Properties can also be read. This feature can be used in conjunction with constraints to allow changes to a property within one actor to cause changes to the property of another actor. For example, an actor following the movement of another separate actor (that it is not a child of).
 
 Properties can be used to expose any useful information or behaviour of an actor.
 Other actor variables that are used to implement this bevahiour, or do not make useful sense from an application developers point of view should not be exposed.
 
-<h2 class="pg">How to implement a property within Dali-core:</h2>
+<h2 class="pg">How to implement a property within DALi Core:</h2>
 
 <b>There are two stages:</b>
 
@@ -79,7 +79,7 @@ DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
 - The parameter to DALI_PROPERTY_TABLE_END should match the start index of the property enumeration.
 
 <br>
-<h2 class="pg">How to implement a property within Dali-toolkit controls and application-side custom controls:</h2>
+<h2 class="pg">How to implement a property within DALi Toolkit controls and application-side custom controls:</h2>
 
 Macros are used to define properties for the following reasons:
 
index d6c197f..f28eb47 100644 (file)
@@ -58,5 +58,15 @@ Each style selector can have resource folders associated with it.
 Images for that style should be in their own folder named images.
 
 Common images not specific for a particular style will be in the images-common folder located in the style folder.
+
+All application resources are stored in a defined path (application resource path), from this path sub directories can be specified.
+
+The application resource path  can be retrieved using Application::GetResourcePath()
+
+Alternatively to supply resource paths in json the following constant is available: APPLICATION_RESOURCE_PATH.
+
+It provides the path to the  application resource root folder, from there the filename can an be specified along with any sub folders, e.g Images, Models etc.
+
+
 *
 */
index a9fc67c..d0ca80c 100644 (file)
@@ -11,7 +11,7 @@
 Accessibility describes functionality designed to aid usage by the visually impaired.
   
 This includes:
-- Reading out selections or other on-screen items via text-to-speach.
+- Reading out selections or other on-screen items via text-to-speech.
 - Item selection being controlled with gestures to aid selecting other small hard to select entities.
   
 
@@ -19,7 +19,7 @@ This includes:
 
 DALi will pick up the system's current accessibility state (and subsequent changes to it) and enable its internal accessibility mode based on this.
   
-DALi includes an Accessibility Manager which prodives public API control of the order of object selection by gesture, and text to be read out per actor or control.
+DALi includes an Accessibility Manager which provides public API control of the order of object selection by gesture, and text to be read out per actor or control.
   
 It further provides many signals that represent accessibility gestures. These gestures can range from a simple actor selection through to a more control-specific concept like "page-up", which an application developer may want to provide an implementation for.
   
@@ -35,17 +35,17 @@ The AccessibilityManager lives within DALi Toolkit. Please see accessibility-man
     ![ ](../assets/img/accessibility/accessibility-focus.png) ![ ](./accessibility-focus.png)
 </div>
 
-Visibily, when enabled, accessibility will typically show an actor (or actors) as focused. This is represented by default with yellow rectangular frame around the actor. See this section for [modifying the appearance of the accessibility focus](#accessibilityfocusappearance).
+Visibly, when enabled, accessibility will typically show an actor (or actors) as focused. This is represented by default with yellow rectangular frame around the actor. See this section for [modifying the appearance of the accessibility focus](#accessibilityfocusappearance).
   
 Once in accessibility mode, normal control is disabled and accessibility gestures must be used to access content.
 DALi actors and controls will no longer receive tap gestures or click events when they are touched once (as they normally would).
   
-Note: The accessibility focus is also refered to as the Focus Indicator.
+Note: The accessibility focus is also referred to as the Focus Indicator.
 
 
 ### Moving the focus with gestures {#accessibilitygestures}
 
-Accessibility recognises many gesture types to move the accessibility focus from actor to actor.
+Accessibility recognizes many gesture types to move the accessibility focus from actor to actor.
   
 Note:
   
@@ -68,7 +68,7 @@ Note: The gestures that perform these actions are platform specific. These are t
 Activation describes an operation performed on a selected actor, typically an on-tap or on-click event.
   
 Activating an actor in accessibility mode will call a virtual function, as well as signal, for that actor.
-Depending on the platform this can br triggered in different ways.
+Depending on the platform this can be triggered in different ways.
 When activated, the built in actor types (like PushButton) will do the equivalent of a tap.
   
 Custom-built actor types will need to implement activation in order to perform a specific behaviour. See the [Custom Controls](#accessibilitycustomcontrol) section.
@@ -128,7 +128,7 @@ accessibilityManager.SetCurrentFocusActor( table.GetChildAt( 0 ) );
 
 ### Modifying the appearance of the accessibility focus {#accessibilityfocusappearance}
 
-The focus graphic itself can be customised.
+The focus graphic itself can be customized.
 It can be an image (EG. A nine-patch border) or any other type of actor.
   
 It can be set using this method within C++:
@@ -185,7 +185,7 @@ accessibilityManager.SetGroupMode( true );
 
 Wrap mode allows the focus to wrap back to the beginning once the end is reached.
   
-In group mode this will move to the beggining of the current focus group.
+In group mode this will move to the beginning of the current focus group.
   
 ~~~{.cpp}
 AccessibilityManager accessibilityManager = AccessibilityManager::Get();
@@ -202,7 +202,7 @@ accessibilityManager.SetWrapMode( true );
 This example sets up a 3 by 3 grid of actors with the following accessibility functionality:
   
   - They have a focus order that moves from top left to bottom right (when using the accessibility next and previous gestures).
-  - They contain text that will be spoken out loud (via text-to-speach) when the focus changes.
+  - They contain text that will be spoken out loud (via text-to-speech) when the focus changes.
   
 Note that all the above is set via the AccessibilityManager and not as properties within the actors.
   
@@ -226,7 +226,7 @@ for( int row = 0; row < 3; ++row )
     // Set the focus order of this actor.
     accessibilityManager.SetFocusOrder( tile, tileNumber );
 
-    // Set up the accessibility information for this actor (this will be read out with text-to-speach).
+    // Set up the accessibility information for this actor (this will be read out with text-to-speech).
     accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_LABEL, tileNames[tileNumber] );
     accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_TRAIT, "Tile" );
     accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_HINT, "You can run this example");
@@ -247,10 +247,10 @@ Accessibility behaviour can be customized in a custom UI control by overriding a
 | Method                     | Description                                                                                                                                                                |
 |----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
 | OnAccessibilityActivated   | When the control is *activated* or selected, in accessibility mode.                                                                                                        |
-| OnAccessibilityPan         | When an accessibility pan gesture occurs while this control is focussed.                                                                                                   |
+| OnAccessibilityPan         | When an accessibility pan gesture occurs while this control is focused.                                                                                                   |
 | OnAccessibilityTouch       | Touch events are delivered differently in Accessibility mode. This method should be overridden if some special behaviour is required when these touch events are received. |
-| OnAccessibilityValueChange | When a value is changed while this control is focussed (e.g. value change of a slider control).                                                                            |
-| OnAccessibilityZoom        | Should be overridden if behaviour is required when the magnification level changes when this control is focussed.                                                          |
+| OnAccessibilityValueChange | When a value is changed while this control is focused (e.g. value change of a slider control).                                                                            |
+| OnAccessibilityZoom        | Should be overridden if behaviour is required when the magnification level changes when this control is focused.                                                          |
  
 If these events are consumed, then the method should return true.
 The default behaviour in the control base classes returns false, i.e. not consumed.
@@ -259,7 +259,7 @@ The default behaviour in the control base classes returns false, i.e. not consum
 
 For more specific control of functionality when accessibility is enabled, there are several signals within the accessibility manager's public API that can be connected to.
   
-The main catagories of signals are:
+The main categories of signals are:
   
 - The signal when the accessibility status is detected as being toggled on or off: StatusChangedSignal()
 - Focus changes can cause FocusChangedSignal() and FocusOvershotSignal(). These can be connected to in order to provide custom actions when the focus is moved around the screen.
index 422839e..0e927a6 100644 (file)
@@ -15,7 +15,7 @@ Dali::Animation animation = Animation::New( 3.0f );
 
 ### Animating Properties
 
-There are two distint ways in which properties can be animated within DALi:
+There are two distinct ways in which properties can be animated within DALi:
 - **AnimateTo:** The property will animate **TO** the value in the given time.
 - **AnimateBy:** The property will animate **BY** the value in the given time.
 
index 759de31..668359a 100644 (file)
@@ -17,9 +17,9 @@ Below shows how the popup will look depending on the state of the text-control.
 |[PASTE][CLIPBOARD] buttons shown| [CUT][COPY], [SELECT ALL] unless all text selected and [PASTE][CLIPBOARD] if content to paste. |
 |    ![ ](../assets/img/text-controls/EmptyTextClipboardHasContent.png) ![ ](./EmptyTextClipboardHasContent.png) |   ![ ](../assets/img/text-controls/SelectingText.png) ![ ](./SelectingText.png) |
 | Condition: Long press/double tap popup when text-control contains just whitespace | Condition: Empty text & clipboard empty |
-| Whitespace treated as regular text, [CUT][COPY] shown and [PASTE][CLIPBOARD] if content to paste. As all text is selected there is no need for [SELECT ALL] |  No popup shown after longpress/double tap|
+| Whitespace treated as regular text, [CUT][COPY] shown and [PASTE][CLIPBOARD] if content to paste. As all text is selected there is no need for [SELECT ALL] |  No popup shown after long press/double tap|
 |  ![ ](../assets/img/text-controls/SelectAllWhitespace.png) ![ ](./SelectAllWhitespace.png) | ![ ](../assets/img/text-controls/EmptyTextAndNoContentToPaste.png) ![ ](./EmptyTextAndNoContentToPaste.png)|
-| Condition: Longpress/(double tap) on whitespace which is following text | Condition: Tapping text or panning grab handle |
+| Condition: Long press/(double tap) on whitespace which is following text | Condition: Tapping text or panning grab handle |
 | [PASTE][CLIPBOARD] shown if something to paste. [SELECT ALL] as more text to select | If content in clipboard [PASTE][CLIPBOARD] popup will be shown. |
 | ![ ](../assets/img/text-controls/SelectWhitespaceAfterText.png) ![ ](./SelectWhitespaceAfterText.png) | ![ ](../assets/img/text-controls/TapAfterCopyingText.png) ![ ](./TapAfterCopyingText.png) |
 
index c6e1380..27239b3 100644 (file)
@@ -149,7 +149,7 @@ ________________________________________________________________________________
 + A **hover event** is when a pointer moves within the bounds of a custom actor (e.g. mouse pointer or hover pointer).
 + A **wheel event** is when the mouse wheel (or similar) is moved while hovering over an actor (via a mouse pointer or hover pointer).
  
-If the control needs to utilise hover and wheel events, then the correct behaviour flag should be used when constructing the control and then the appropriate method should be overridden.
+If the control needs to utilize hover and wheel events, then the correct behaviour flag should be used when constructing the control and then the appropriate method should be overridden.
 ~~~{.cpp}
 // C++
 bool MyUIControlImpl::OnHoverEvent( const HoverEvent& event )
index 67ec0a6..7cdb3aa 100644 (file)
@@ -23,7 +23,7 @@ the OpenGL API from developers and provides a clean cross-platform C++ & JavaScr
  + Provides Layers to aid in 2D UI layout
  + Easy to use Animation framework
  + Automatic background loading of resources ( images / text / meshes )
- + Runs all animations in a seperate thread. This helps maintain 60 FPS even if JavaScript is performing a long operation ( e.g. Garbage Collection ).
+ + Runs all animations in a separate thread. This helps maintain 60 FPS even if JavaScript is performing a long operation ( e.g. Garbage Collection ).
  + Provides keyboard / touch / mouse handling
 
 ![ ](screen-shot.png)
diff --git a/docs/content/shared-javascript-and-cpp-documentation/debug-rendering.md b/docs/content/shared-javascript-and-cpp-documentation/debug-rendering.md
new file mode 100644 (file)
index 0000000..f71eec2
--- /dev/null
@@ -0,0 +1,19 @@
+<!--
+/**-->
+
+# Debug rendering {#debugrendering}
+
+Setting DALI_DEBUG_RENDERING environment variable will enable the visual debugging.
+
+Then, every concrete visual ( ColorVisual, BorderVisual, ImageVisual, GradientVisual, etc. ) is replaced with a wireframe visual.
+The wireframe visual renders a simple quad wireframe, so that the control layout and scene structure is clearly displayed.
+
+## Example:
+~~~{.bash}
+sh-4.1$ DALI_DEBUG_RENDERING=1 /usr/apps/com.samsung.dali-demo/bin/blocks.example
+~~~
+
+![ ](../assets/img/debug-rendering/debug-blocks.png)
+![ ](debug-blocks.png)
+
+
diff --git a/docs/content/shared-javascript-and-cpp-documentation/debug-visual.md b/docs/content/shared-javascript-and-cpp-documentation/debug-visual.md
deleted file mode 100644 (file)
index 47aac92..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-/**-->
-
-# Debug Visual {#debugvisual}
-
-## Enable debug rendering
-
-Setting DALI_DEBUG_RENDERING environment variable will enable the visual debuging.
-
-Then, every concrete visual ( ColorVisual, BorderVisual, ImageVisual, GradientVisual, etc. ) is replaced with a DebugVisual object.
-Debug visual renders a simple quad wireframe, so that the control layout and scene structure is clearly displayed.
-
-### Example:
-~~~{.bash}
-sh-4.1$ DALI_DEBUG_RENDERING=1 /usr/apps/com.samsung.dali-demo/bin/blocks.example
-~~~
-
-![ ](../assets/img/debug-visual/debug-blocks.png)
-![ ](debug-blocks.png)
-
-
index af3b3e7..397428a 100644 (file)
@@ -1,7 +1,7 @@
 <!--
 /**-->
 
-# Writing documentation for the DALi programing guide  {#documentationguide}
+# Writing documentation for the DALi programming guide  {#documentationguide}
 
 To allow documentation to be shared between C++ and JavaScript, please follow these guidelines:
 
@@ -41,7 +41,7 @@ Which will allow you to link to this section as follows:
 [Go To MyChapter](@ref my-chapter)
 ~~~
 
-Code blocks can be enclosed within 2 blocks of 3 tildas(~).
+Code blocks can be enclosed within 2 blocks of 3 tildes(~).
 
 You can even specify your language type, for example:
 ~~~{.md}
index 81c963e..9960e35 100644 (file)
@@ -16,9 +16,9 @@ This can then be run within a web browser at near native speed (without plugins)
 Dali-Core can be built using with Emscripten producing a Javascript version of DALi.
 A web page can then be made with HTML, and by embedding Javascript can reference and control the DALi Javascript canvas.
   
-This allows you to have a DALi canvas within a webpage that can either:
+This allows you to have a DALi canvas within a web page that can either:
 - Run autonomously
-- Be controlled by HTML / Javascript controls elsewhere on the webpage
+- Be controlled by HTML / Javascript controls elsewhere on the web page
   
 The necessary scripts for building are included within each DALi repository.
   
@@ -33,9 +33,9 @@ In summary, this process involves:
 - Building dali-adaptor Emscripten replacement with a separate build script found in dali-adaptor
 - Installing the examples within the dali-demo repository
   
-## Build Artefacts {#emscripten-artefacts}
+## Build Artifacts {#emscripten-artifacts}
   
-Each step in the build process will produce artefacts that will be written to the DALi environment directory.
+Each step in the build process will produce artifacts that will be written to the DALi environment directory.
   
 - dali-core: Produces a dali-core.so in bytecode.
 - dali-adaptor: Produces:
@@ -94,14 +94,14 @@ chromium-browser ./dali-doc-demo.html
 # Running The Live Unit Tests {#emscripten-tests}
   
 Included are some live unit tests.
-These run as a webpage within a browser, a DALi canvas is created and used to run each test.
+These run as a web page within a browser, a DALi canvas is created and used to run each test.
 The QUnit test suite is used (included within the repository for compatibility).
   
 ![ ](../assets/img/emscripten/emscripten-tests.png) ![ ](./emscripten-tests.png)
   
 <br>
 
-For the tests to work correctly, the webpage should be run through a webserver, rather than directly with a browser.
+For the tests to work correctly, the web page should be run through a web server, rather than directly with a browser.
 This can be achieved simply using npms's zero configuration command line server: "http-server".
   
 To install "http-server":
index 09392c8..cbe2e6d 100644 (file)
@@ -342,14 +342,14 @@ item1.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::ALIGN_SELF, Dali
 flexContainer.Add( item1 );
 
 Dali::Toolkit::Control item2 = Dali::Toolkit::Control::New();
-flexContainer.Add( item2 ); // item2 is aligned at the beginning of ther container
+flexContainer.Add( item2 ); // item2 is aligned at the beginning of the container
 
 Dali::Toolkit::Control item3 = Dali::Toolkit::Control::New();
 item3.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::ALIGN_SELF, Dali::Toolkit::FlexContainer::ALIGN_FLEX_END ); // Align item3 at the bottom of the container
 flexContainer.Add( item3 );
 
 Dali::Toolkit::Control item4 = Dali::Toolkit::Control::New();
-flexContainer.Add( item4 ); // item4 is aligned at the beginning of ther container
+flexContainer.Add( item4 ); // item4 is aligned at the beginning of the container
 
 ~~~
 
@@ -371,14 +371,14 @@ item1.alignSelf = "center"; // Align item1 at the center of the container
 flexContainer.add(item1);
 
 var item2 = new dali.Control();
-flexContainer.add(item2); // item2 is aligned at the beginning of ther container
+flexContainer.add(item2); // item2 is aligned at the beginning of the container
 
 var item3 = new dali.Control();
 item1.alignSelf = "flexEnd"; // Align item3 at the bottom of the container
 flexContainer.add(item3);
 
 var item4 = new dali.Control();
-flexContainer.add(item4); // item4 is aligned at the beginning of ther container
+flexContainer.add(item4); // item4 is aligned at the beginning of the container
 
 ~~~
 ___________________________________________________________________________________________________
index c8f46da..d2bda2d 100644 (file)
@@ -70,7 +70,11 @@ However the text control will fall-back to using the default font, if the reques
 
 ### Font Styles
 
-Setting a font size programmatically is not ideal for applications which support multiple screen resolutions etc.
+Setting a font size programmatically is not ideal for applications which support multiple
+screen resolutions and platforms which support multiple logical font sizes.  Also, any
+changes to the platform font settings will override any sizes that have been programmatically
+set.
+
 A more flexible approach is to prepare various JSON stylesheets, and request a different style for each platform:
 
 ~~~{.cpp}
@@ -96,7 +100,13 @@ To change the font for standard text controls, this JSON syntax can be used:
 ~~~
 
 However the same pointSize is unlikely to be suitable for all text controls in an application.
-To set custom sizes simply set a "style name" for each case, and then provide a style override in JSON:
+To define custom styles for existing controls, simply set a style name for each case, and
+then provide a style override in JSON.
+
+To provide flexibility for the end user, the platform offers a mechanism to alter the logical
+font size between 0 and 4 inclusive. This logical size is mapped to a physical size using the
+stylesheets, by appending FontSizeN to the style name. These sections ("textlabelFontSizeN")
+in the style sheet are applied after the base section ("textlabel"), so take precedence.
 
 ~~~{.cpp}
   // C++
@@ -106,7 +116,7 @@ To set custom sizes simply set a "style name" for each case, and then provide a
 ~~~{.js}
   // JavaScript
 
-  label.styleName = "custom"';
+  label.styleName = "customLabel"';
 ~~~
 
 ~~~{.json}
@@ -117,17 +127,59 @@ To set custom sizes simply set a "style name" for each case, and then provide a
     {
       "fontFamily":"FreeSerif",
       "fontStyle":"{\"weight\":\"bold\",\"slant\":\"italic\"}",
+    },
+
+    "textlabelFontSize0":
+    {
       "pointSize":8
     },
+    "textlabelFontSize1":
+    {
+      "pointSize":10
+    },
+    "textlabelFontSize2":
+    {
+      "pointSize":15
+    },
+    "textlabelFontSize3":
+    {
+      "pointSize":19
+    },
+    "textlabelFontSize4":
+    {
+      "pointSize":25
+    },
 
-    "custom":
+    "customLabel":
+    {
+      "fontFamily":"TimesNewRoman",
+      "fontStyle":"{\"weight\":\"regular\",\"slant\":\"regular\"}",
+    },
+    "customLabelFontSize0":
     {
       "pointSize":10
+    },
+    "customLabelFontSize1":
+    {
+      "pointSize":12
+    },
+    "customLabelFontSize2":
+    {
+      "pointSize":15
+    },
+    "customLabelFontSize3":
+    {
+      "pointSize":20
+    },
+    "customLabelFontSize4":
+    {
+      "pointSize":28
     }
   }
 }
 ~~~
 
-In the example above, standard text labels will have pointSize 8, and "custom" labels will have pointSize 10.
+In the example above, at platform logical text size 0, standard text labels will have pointSize 8, and custom labels will have pointSize 10.
+
 
 */
index 2442180..cce3bd4 100644 (file)
@@ -6,7 +6,7 @@
 ## Actors and the Stage {#actors-and-stage}
 
 Actor is the primary object with which DALi applications interact.
-A DALi application uses a hierachy of Dali::Actor objects to position visible content.
+A DALi application uses a hierarchy of Dali::Actor objects to position visible content.
 An actor inherits a position relative to its parent, and can be moved relative to this point.
 UI controls can be built by combining multiple actors.
 
@@ -65,7 +65,7 @@ Note that since DALi is a 3D toolkit, this behaviour is the result of a default
 
 ## Scene Graph {#scene-graph}
 
-From wikipedia...
+From Wikipedia...
   
 A scene graph is a collection of nodes in a graph or tree structure.
 A node may have many children but often only a single parent,
index b235b61..b2eef34 100644 (file)
@@ -28,7 +28,7 @@ The current file / folder structure is as follows:
 
 ### New property has been added
 - No code change required.
-- It will be automatically avalable using the dot notation. E.g. actor.my_new_property = true;
+- It will be automatically available using the dot notation. E.g. actor.my_new_property = true;
 
 ### New property type has been added
 - modify property-value-wrapper.h / .cpp to support the new type
@@ -36,7 +36,7 @@ The current file / folder structure is as follows:
 ### New function added to an object
 - Add the function name to function table in my-object-wrapper.cpp
 - Add the forwarding function to my-object-api.cpp/.h
-- Ensure you have created YUIDOC documention above the function
+- Ensure you have created YUIDOC documentation above the function
   
 ![ ](../assets/img/javascript-wrapping-guide/adding-function.png)
 ![ ](adding-function.png)
@@ -68,7 +68,7 @@ var light = new dali.Light();
 If Light inherits from Handle then use path-wrapper and path-api as a template to create light-wrapper and light-api
 ( inherits from HandleWrapper)
   
-Otherwise use animation-wrapper and animation-api as a template ( inherts from BaseWrappedObject)
+Otherwise use animation-wrapper and animation-api as a template ( inherits from BaseWrappedObject)
 
 
 
@@ -112,4 +112,4 @@ when DALi shuts down
 
 @class _Guide_JavaScript_Wrapping
 
-*/
\ No newline at end of file
+*/
index 99bb82f..3cde152 100644 (file)
@@ -166,7 +166,7 @@ Currently Layer::TREE_DEPTH_MULTIPLIER == 1000:
  +++-> Actor3   ( depth Index offset of 3000)
  +++-> Actor4   ( depth Index offset of 3000)
  +++-> Actor5   ( depth Index offset of 3000)
- +++-> Layer1   ( depth Index has no meaning for layers, layer draw order is independent of the heirachy).
+ +++-> Layer1   ( depth Index has no meaning for layers, layer draw order is independent of the hierarchy).
  ++++-> Actor6   ( depth Index offset of 4000)
  ++++-> Actor7   ( depth Index offset of 4000)
  ++++-> Actor8   ( depth Index offset of 4000)
@@ -266,7 +266,7 @@ myActor3.add( myActor5);  // the depth index of actor 4 and 5 renderers will det
 
 ### Layer Actor Specific Properties
 
-| Name                   |    Type    | Writeable     | Animatable|
+| Name                   |    Type    | Writable     | Animatable|
 |------------------------|------------|--------------|-----------|
 | clippingEnable         |BOOLEAN     | 0     |  X |
 | clippingBox            | ARRAY [0,0,400,600]) | 0 | X|
index dd40aa1..1893273 100644 (file)
@@ -25,7 +25,8 @@ field.enableMarkup = true;
 dali.stage.add( field );
 ~~~
 
-Note the mark-up processor doesn't check the correctness of the mark-up string. This may cause the text to be badly rendered.
+Note the mark-up processor doesn't check the correctness of the mark-up string. This may
+cause the text to be badly rendered.
 
 The table below describes the priorities when styles are applied while rendering text.
 |  |  |  |  |
@@ -34,6 +35,20 @@ The table below describes the priorities when styles are applied while rendering
 | Priority 2 | Style set through the control properties. | Will override the default platform style. |  |
 | Priority 3 | Default platform style. |  |  |
 
+Font size has slightly different priorities - the size provided by the platform is a logical
+size, and can be mapped to physical point sizes using style sheets. There is a default set of
+sizes defined for DALi, and these can be overridden by application specific stylesheets. Thus
+the priorities are:
+
+|  |  |  |
+|--|--|--|
+| Priority 1 | Size set by markup string. | Will override the style set through the stylesheets. |
+| Priority 2 | Physical Size set by application style sheet | |
+| Priority 2 | Logical Size set by application style sheet | Mapping from platform logical to physical |
+| Priority 3 | Logical Size set by DALi style sheet | Mapping from platform logical to physical |
+
+See [Font Selection](@ref font-selection) for more details.
+
 Current supported tags are:
 
 ## \<color\>
index d58019f..f870d4b 100644 (file)
@@ -34,7 +34,7 @@ For JavaScript use actor.connect( "touch", myCallback ) and actor.connect("hover
 
  - Actors
    - The final part of hit testing is performed by walking through the actor tree within a layer.
-   - The following pseudocode shows the algorithm used:
+   - The following pseudo-code shows the algorithm used:
 
 
 ~~~
@@ -107,7 +107,7 @@ Hit Priority of above Actor tree (all overlays): 1 - Lowest. 6 - Highest.
      actor (and its parents).  There will be NO touch signal delivery for the hit actors of the
      other touch points.
    - The local coordinates are from the top-left (0.0f, 0.0f, 0.5f) of the hit actor.
-   - The following pseudocode shows the delivery mechanism:
+   - The following pseudo-code shows the delivery mechanism:
 
 ~~~
   EMIT-TOUCH-SIGNAL( ACTOR )
index c53bee7..99a05b4 100644 (file)
@@ -4,7 +4,7 @@
 # Performance Profiling  {#performanceprofiling}
 
 
-DALi has many mechanisms for analysing performance including kernel, system and network logging.
+DALi has many mechanisms for analyzing performance including kernel, system and network logging.
 
 
 ## Background
@@ -52,7 +52,7 @@ This type of logging is used for recording individual time stamped events.
   
 Setting DALI_PERFORMANCE_TIMESTAMP_OUTPUT environment variable will enable time stamps.
 
-Tools such as Tizen dynamic analyser and StageHand can be used to provide a GUI display of
+Tools such as Tizen dynamic analyzer and StageHand can be used to provide a GUI display of
 the output.
 
 
@@ -62,7 +62,7 @@ The log options are:
 |------|--------------------------|--------------|
 |   0  |  log markers to DALi log (dlog on Tizen) | DALI_PERFORMANCE_TIMESTAMP_OUTPUT=1 dali-demo |
 |   1  |  log markers to kernel trace ( logs to ftrace )| DALI_PERFORMANCE_TIMESTAMP_OUTPUT=2 dali-demo |
-|   2  |  log markers to system trace ( ttrace on Tizen for Tizen analyser) | DALI_PERFORMANCE_TIMESTAMP_OUTPUT=4 dali-demo |
+|   2  |  log markers to system trace ( ttrace on Tizen for Tizen analyzer) | DALI_PERFORMANCE_TIMESTAMP_OUTPUT=4 dali-demo |
 |   3  |  log markers to network client (tcp port 3001+) | DALI_PERFORMANCE_TIMESTAMP_OUTPUT=8 dali-demo |
 
   
@@ -193,11 +193,11 @@ DALI_PERFORMANCE_TIMESTAMP_OUTPUT=2 dali-demo
 ~~~
 
 Ftrace is a kernel tracer designed to help developers find out what is going on inside the kernel.
-It can be used for analysing how long DALi takes to perform different tasks and
+It can be used for analyzing how long DALi takes to perform different tasks and
 what DALi is doing in relation to other system processes / interrupts.
   
 On Tizen if the kernel has been built with ftrace enabled, then DALi can log out to ftrace.
-This gives exact time stamps of the main events in Dali.
+This gives exact time stamps of the main events in DALi.
 Current markers that are logged:
 
 
index 782c05b..7a9617f 100644 (file)
@@ -8,7 +8,7 @@
   - Try to reduce actor count ( less actors == less processing)
   - Delete any actors that are not visible, or move them off stage
   - Use TextureAtlases ( reduces OpenGL driver calls to glBindTexture
-  - Optimise / reduce any constraints used
+  - Optimize / reduce any constraints used
 
 ## High GPU occupancy
 
@@ -17,7 +17,7 @@
 
 ~~~{.cpp}
 // C++
-// In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
+// In this mode depth testing is turned off and order is determined by the hierarchy (depth-first search order).
 // Not always recommended if there is going to be a lot of overdraw ( if lots of actors are on top of each other)
 
 Actor::SetDrawMode( DrawMode::OVERLAY_2D ); // C++
@@ -25,7 +25,7 @@ Actor::SetDrawMode( DrawMode::OVERLAY_2D ); // C++
 
 ~~~{.js}
 // JavaScript
-// In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
+// In this mode depth testing is turned off and order is determined by the hierarchy (depth-first search order).
 // Not always recommended if there is going to be a lot of overdraw ( if lots of actors are on top of each other)
 
 actor.drawMode = dali.DRAW_MODE_OVERLAY_2D;
@@ -36,7 +36,7 @@ actor.drawMode = dali.DRAW_MODE_OVERLAY_2D;
   - Use Dali::NinePatchImage  where possible.
   - Avoid using too many textures which contain alpha and require blending
   - Avoid using too many Dali::Layer with depth testing enabled. Otherwise the layer has to clear the depth buffer.
-  - Optimise any shaders used. Pixel shaders should be kept as lean as possible.
+  - Optimize any shaders used. Pixel shaders should be kept as lean as possible.
 
 
 @class _Guide_Performance_Tips
index 02b7e59..af526f4 100644 (file)
@@ -86,7 +86,7 @@ The default to fading in and out.
   
 The Popup can be configured to a preset type by using named types within the type-registry.
   
-These types are modifications / specialisations of a Popup. They provide the library user with a shortcut way of creating a specific type of Popup.
+These types are modifications / specializations of a Popup. They provide the library user with a shortcut way of creating a specific type of Popup.
   
 
 The Popup control features a "Toast" popup type. This is a Popup that appears at the bottom of the screen, typically with some text. They are normally for informational purposes only.
@@ -180,7 +180,7 @@ The ConfirmationPopup control provides a simple interface for providing automati
   
 ConfirmationPopup will automatically provide signals for 1 or 2 controls.
 Note: The controls do not need to be PushButtons.
-These signals are dynamically created. The controls (typically PushButtons) must be specifially named so the ConfirmationPopup can locate them.
+These signals are dynamically created. The controls (typically PushButtons) must be specifically named so the ConfirmationPopup can locate them.
   
 ## Step 1 {#popupconfirmationstep1}
 Name your controls.
@@ -204,8 +204,8 @@ Connect to the following respective signals within ConfirmationPopup:
   
 The ConfirmationPopup will dynamically make the connection between the signalling control, and your signal handler.
   
-This allows connection of signals within both C++, JSON and Javascript APIs.
-If more manual control or customisable layout is needed, then it is recommended to use the Popup widget directly for full control.
+This allows connection of signals within both C++, JSON and JavaScript APIs.
+If more manual control or customizable layout is needed, then it is recommended to use the Popup widget directly for full control.
   
 The JSON code example at the bottom of this document uses the ConfirmationPopup to allow signal connection from within the JSON description.
   
index 3976541..5401fcd 100644 (file)
@@ -12,7 +12,7 @@ This operation is performed at load time.
   
 ### Developer options:
 * A target size of the image - this could be the full screen size for example.
-* A Fitting mMde - This determines how the image is fitted to the target dimensions. If necessary the image will be cropped, or have borders added automatically.
+* A Fitting mode - This determines how the image is fitted to the target dimensions. If necessary the image will be cropped, or have borders added automatically.
 * A Sampling Mode - This determines the quality of the scaling (by specifying the type of filtering to use).
   
 ### Benefits of Resource Image Scaling:
@@ -25,14 +25,14 @@ While common uses of images in DALi applications involve fixed sized images unde
 
 There are more code examples later in this document under [API usage](#resourceimagescaling-apidetails). For now we will just give one full code example to show how this feature is used..
   
-Let's say we are writing a home-screen application for a smartphone.
+Let's say we are writing a home-screen application for a smart phone.
 Here we have a large, square image that we want to set as the wallpaper on a tall and narrow phone screen.
 We want to fill the screen without distorting the image or having black borders, and wasting as few pixels from the source image as possible.
   
 ![ ](../assets/img/image-scaling/example-scale-to-fill-problem.jpg)
 ![ ](example-scale-to-fill-problem.jpg)
   
-DALi provides the concept of a `FittingMode` to specify how a source image is mapped into a target rectangle, and the one we need here is `FittingMode::SCALE_TO_FILL` as it guarrentees to cover all of the pixels of the target dimensions specified.
+DALi provides the concept of a `FittingMode` to specify how a source image is mapped into a target rectangle, and the one we need here is `FittingMode::SCALE_TO_FILL` as it guarantees to cover all of the pixels of the target dimensions specified.
 A second concept of a `SamplingMode` controls how source image pixels are combined during the scaling and allows the developer to trade speed for quality.
 Since our image is to be loaded once and reused, we use `SamplingMode::BOX_THEN_LINEAR` which is the highest quality option.
   
@@ -72,7 +72,7 @@ The workflow for achieving the final scaled image is (in order):
 - Target Size: Determine target size (from source image size and any user specified target dimensions).
 - Target Image Dimensions: Determine the size the image should be scaled to (taking Fitting Mode into account)
 - Scaling: Perform a scale to target image dimensions using the specified Sampling mode.
-- Crop or Add Borders: Automatically perfomed as necessary to maintain final target aspect (actual stored data size could be smaller).
+- Crop or Add Borders: Automatically performed as necessary to maintain final target aspect (actual stored data size could be smaller).
   
 
 
@@ -110,8 +110,8 @@ The operation of each of these modes is as follows:
   
 | `FittingMode` | **Operation** |
 | ------------- | ------------- |
-| `SCALE_TO_FILL` | Centers the image on the target box and uniformly scales it so that it matches the target in one dimension and extends outside the target in the other. Chooses the dimension to match that results in the fewest pixels outside the target. Trims away the parts of the image outside the target box so as to match it exactly. This guarentees all of the target area is filled. |
-| `SHRINK_TO_FIT` | Centers the image on the target box and uniformly scales it so that it matches the target in one dimension and fits inside it in the other. This guarentees that all of the source image area is visible. |
+| `SCALE_TO_FILL` | Centers the image on the target box and uniformly scales it so that it matches the target in one dimension and extends outside the target in the other. Chooses the dimension to match that results in the fewest pixels outside the target. Trims away the parts of the image outside the target box so as to match it exactly. This guarantees all of the target area is filled. |
+| `SHRINK_TO_FIT` | Centers the image on the target box and uniformly scales it so that it matches the target in one dimension and fits inside it in the other. This guarantees that all of the source image area is visible. |
 | `FIT_WIDTH` | Centers the image on the target box and uniformly scales it so that it matches the target width without regard for the target height. |
 | `FIT_HEIGHT` | Centers the image on the target box and uniformly scales it so that it matches the target in height without regard for the target width. |
   
index 98c175a..4dc718d 100644 (file)
@@ -1,6 +1,6 @@
 <!--
 /**-->
-# Resources {#resoources}
+# Resources {#resources}
 
 ## Resource Image {#resource-image}
 
@@ -16,7 +16,7 @@ Resources are loaded in separate threads.
 The application can connect to the Dali::ResourceImage::LoadingFinishedSignal() to get notified when the image has loaded.
 
 By default, resource images start loading immediately and the data is released only when the ResourceImage handle is destroyed.
-To optimise an application's memory footprint, the application can ask resources to be only loaded when actually required and
+To optimize an application's memory footprint, the application can ask resources to be only loaded when actually required and
 their data to be released automatically when they are no longer being used (not being used by Actors).
 ~~~{.cpp}
 Dali::ResourceImage image = Dali::ResourceImage::New( "/my-path/my-image.png", Dali::ResourceImage::ON_DEMAND, Dali::Image::UNUSED );
index 4f2e234..ff15954 100644 (file)
@@ -43,7 +43,7 @@
 ~~~
  ## Hello World - Javascript
 
- The DALi script application is needed to run the Javascript which provides a Javascript runtime and an interface to Dali.
+ The DALi script application is needed to run the Javascript which provides a Javascript runtime and an interface to DALi.
 
 ~~~
  scripting.example hello-world.js
@@ -66,4 +66,4 @@
 
 @class _Guide_Script_Hello_World
 
-*/
\ No newline at end of file
+*/
index 2575417..9950b4d 100644 (file)
@@ -82,7 +82,7 @@ The JSON format deviates from the formal JSON specification and allows C style c
 
 ## Includes {#includes}
 
-The "includes" section is an array of filenames to be merged in order to
+The "includes" section is an array of file names to be merged in order to
 create a final in memory JSON tree.
 
 The merge process will walk key, value attributes from the root JSON
@@ -255,7 +255,7 @@ Builder.AnimateTo("light-theme", myActor, TimePeriod(0, 10));
 ~~~
 
 When applied to an actor tree the actors are referenced by name. Names
-are not unique in Dali.
+are not unique in DALi.
 
 When a style is applied in code DALi will perform a depth first search
 stopping with the first matching name.
@@ -369,7 +369,7 @@ Shader uniforms can be animated as if they are properties of the actor.
 
 When the animation is created from code (or from a signal) the property
 name search begins on the actor, if it isn't found the search continues
-on the attached shader object.
+on the attached renderer, and then on the attached shader object.
 
 The actor property names and shader uniform names must not clash for the
 uniform to animate correctly. The convention in DALi is to prepend
@@ -418,7 +418,7 @@ uniforms with 'u'.
 The stage section supports the immediate creation of actors at the time
 the JSON is loaded.
 
-The stage is a tree of actors that can be added to Dali's stage object.
+The stage is a tree of actors that can be added to DALi's stage object.
 
 ~~~
 // C++
@@ -461,7 +461,7 @@ builder.addActors( dali.stage.getRootLayer() );
 
 # Actor and Control Properties {#actorprop}
 
-Each control has a set of supported properties documented in the "Dali
+Each control has a set of supported properties documented in the "DALi
 UI Control Specification".
 
 Please refer to the above document for further information about specific
index 4f64f72..6d671db 100644 (file)
@@ -14,7 +14,7 @@ DALi has:
 - JavaScript to support:
  - Rapid Application Development
  - Hybrid C++/JavaScript applications
- - Leaverage third party JavaScript modules (backbone.js etc)
+ - Leverage third party JavaScript modules (backbone.js etc)
 
 JSON support is built in to DALi.
 
@@ -262,4 +262,4 @@ script.ExecuteFile( scriptFileName );
 
 @class _Guide_JSON_and_JavaScript_overview
 
-*/
\ No newline at end of file
+*/
index d1283e0..c4e93f2 100644 (file)
@@ -93,7 +93,7 @@ Click screen shot to get overlay current screen
 ![ ](../assets/img/stage-hand/stagehand-screenshot.png)
 ![ ](stagehand-screenshot.png)
 
-To cycle through the actor hierachy, keep clicking the same spot. Alternatively, select using the actor tree.
+To cycle through the actor hierarchy, keep clicking the same spot. Alternatively, select using the actor tree.
 
   
 ![ ](../assets/img/stage-hand/stagehand-mainscreen.png)
@@ -165,4 +165,4 @@ Make sure  DALi application is run using launch_app:
 launch_app [APP_ID] __AUL_SDK__ DEBUG __DLP_DEBUG_ARG__ :10003
 ~~~
 
-@class _Guide_Visual_Debugger
\ No newline at end of file
+@class _Guide_Visual_Debugger
index ba7270d..8bfc4c4 100644 (file)
@@ -16,7 +16,7 @@ If loop count is set to 3 for example it will scroll the text 3 times.
 
 ### Usage
 
-At version 1.1.35 auto scrolling is only supported in single line, mutliline text will not scroll and Text should be BEGIN aligned.
+At version 1.1.35 auto scrolling is only supported in single line, multiline text will not scroll and Text should be BEGIN aligned.
 
 The ENABLE_AUTO_SCROLL property should be set to TRUE to enable scrolling.
 
@@ -25,7 +25,7 @@ The scroll speed, gap and loop count can be set in the stylesheet or provided by
 Once enabled it will start scrolling until the loop count is completed or the ENABLE_AUTO_SCROLL set to false, setting ENABLE_AUTO_SCROLL to false will let the
 text complete it's current scrolling loop then stop.
 
-## The additional properties below can be set to customise the scrolling behaviour
+## The additional properties below can be set to customize the scrolling behaviour
 
 #### AUTO_SCROLL_SPEED
 
@@ -48,7 +48,7 @@ Provide the distance in pixels.
 
 ### Scroll Direction
 
-The scroll direction is choosen automatically with the following rules:
+The scroll direction is chosen automatically with the following rules:
 
 If the text is single-lined it will scroll left when the text is Left to Right (LTR) or scroll right if text is Right to Left (RTL).
 
index 74b8cfd..9010ecf 100644 (file)
@@ -11,7 +11,7 @@ The Dali::Toolkit::TextField is a control which provides a single-line editable
 
 Before any text has been entered, the TextField can display some placeholder text.
 An alternative placeholder can be displayed when the TextField has keyboard focus.
-For example a TextField used to enter a username could initially show "Unknown Name", and then show "Enter Name." when the cursor is shown.
+For example a TextField used to enter a user name could initially show "Unknown Name", and then show "Enter Name." when the cursor is shown.
 
 Note *CR+LF* new line characters are replaced by a *LF* one.
 
index 1c8b016..728f080 100644 (file)
@@ -7,7 +7,7 @@ Visuals provide reusable rendering logic which can be used by all controls.
 This means that custom controls do not have to create actors, they can just reuse the existing visuals which increases performance.
  
 Visuals reuse geometry, shaders etc. across controls and manages the renderer and material to exist only when the control is on-stage.
-Additionaly, they respond to actor size and color change, while also providing clipping at the renderer level.
+Additionally, they respond to actor size and color change, while also providing clipping at the renderer level.
  
 DALi provides the following visuals:
  + [Color](@ref color-visual)
@@ -16,6 +16,7 @@ DALi provides the following visuals:
  + [Border](@ref border-visual)
  + [Mesh](@ref mesh-visual)
  + [Primitive](@ref primitive-visual)
+ + [Wireframe](@ref wireframe-visual)
  
 Controls can provide properties that allow users to specify the visual type ( visualType ).
 Setting visual properties are done via a property map.
@@ -606,6 +607,42 @@ map[ PrimitiveVisual::Property::BEVEL_PERCENTAGE ] = 0.4f;
 
 control.SetProperty( Control::Property::BACKGROUND, map );
 ~~~
+___________________________________________________________________________________________________
+
+## Wireframe Visual {#wireframe-visual}
+
+Renders a wireframe around a control's quad.
+Is mainly used for debugging and is the visual that replaces all other visuals when [Visual Debug Rendering](@ref debugrendering) is turned on.
+![ ](../assets/img/visuals/wireframe-visual.png)
+![ ](visuals/wireframe-visual.png)
+
+### Properties
+
+**VisualType:** Dali::Toolkit::Visual::WIREFRAME, "WIREFRAME"
+
+### Usage
+
+~~~{.cpp}
+// C++
+Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
+
+Dali::Property::Map map;
+map[ Visual::Property::TYPE ] = Dali::Toolkit::Visual::WIREFRAME;
+
+control.SetProperty( Control::Property::BACKGROUND, map );
+~~~
+
+~~~{.js}
+// JavaScript
+var control = new dali.Control( "Control" );
+
+control.background =
+{
+  visualType : "WIREFRAME"
+};
+~~~
+
 
 @class _Guide_Control_Visuals
 
index 2ebb7cb..95ced62 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-addon
 Summary:    DALi module for Node.JS
-Version:    1.2.1
+Version:    1.2.2
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index ea42460..60435b0 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.1
+Version:    1.2.2
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT