Merge "Calculate a new height when full relayout needed" into devel/master
authorHyunJu Shin <hyunjushin@samsung.com>
Fri, 14 Jul 2017 07:56:59 +0000 (07:56 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 14 Jul 2017 07:56:59 +0000 (07:56 +0000)
91 files changed:
automated-tests/resources/empty.bmp [new file with mode: 0644]
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Cursor.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit-styling/CMakeLists.txt
automated-tests/src/dali-toolkit-styling/default-theme.json
automated-tests/src/dali-toolkit-third-party/CMakeLists.txt
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.cpp [deleted file]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h [deleted file]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.h
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/builder/builder.cpp
dali-toolkit/devel-api/builder/builder.h
dali-toolkit/devel-api/controls/control-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h
dali-toolkit/devel-api/controls/text-controls/text-field-devel.h
dali-toolkit/devel-api/controls/text-controls/text-label-devel.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/image-loader/async-image-loader-devel.cpp [new file with mode: 0644]
dali-toolkit/devel-api/image-loader/async-image-loader-devel.h [new file with mode: 0644]
dali-toolkit/devel-api/styling/style-manager-devel.cpp [new file with mode: 0644]
dali-toolkit/devel-api/styling/style-manager-devel.h [new file with mode: 0644]
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.h
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/model3d-view/obj-loader.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.h
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h
dali-toolkit/internal/image-loader/async-image-loader-impl.cpp
dali-toolkit/internal/image-loader/async-image-loader-impl.h
dali-toolkit/internal/image-loader/image-atlas-impl.cpp
dali-toolkit/internal/image-loader/image-load-thread.cpp
dali-toolkit/internal/image-loader/image-load-thread.h
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.h
dali-toolkit/internal/text/cursor-helper-functions.cpp
dali-toolkit/internal/text/cursor-helper-functions.h
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-font-style.cpp
dali-toolkit/internal/text/text-font-style.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp [changed mode: 0644->0755]
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/texture-manager.cpp
dali-toolkit/internal/visuals/texture-manager.h
dali-toolkit/public-api/controls/buttons/button.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/text-controls/text-editor.h
dali-toolkit/public-api/controls/text-controls/text-field.h
dali-toolkit/public-api/controls/text-controls/text-label.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/image-loader/sync-image-loader.cpp
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
packaging/dali-toolkit.spec

diff --git a/automated-tests/resources/empty.bmp b/automated-tests/resources/empty.bmp
new file mode 100644 (file)
index 0000000..29df0c2
Binary files /dev/null and b/automated-tests/resources/empty.bmp differ
index 6ec6207..366c44c 100755 (executable)
@@ -7,24 +7,25 @@ SET(CAPI_LIB "dali-toolkit-internal")
 
 # List of test case sources (Only these get parsed for test cases)
 SET(TC_SOURCES
+ utc-Dali-BidirectionalSupport.cpp
+ utc-Dali-ColorConversion.cpp
+ utc-Dali-DebugRendering.cpp
+ utc-Dali-ItemView-internal.cpp
+ utc-Dali-LogicalModel.cpp
+ utc-Dali-PropertyHelper.cpp
  utc-Dali-Text-CharacterSetConversion.cpp
+ utc-Dali-Text-Controller.cpp
  utc-Dali-Text-Cursor.cpp
- utc-Dali-Text-Segmentation.cpp
- utc-Dali-Text-MultiLanguage.cpp
- utc-Dali-LogicalModel.cpp
- utc-Dali-BidirectionalSupport.cpp
- utc-Dali-Text-Shaping.cpp
- utc-Dali-VisualModel.cpp
  utc-Dali-Text-Layout.cpp
- utc-Dali-Text-Controller.cpp
- utc-Dali-VisualUrl.cpp
  utc-Dali-Text-Markup.cpp
+ utc-Dali-Text-MultiLanguage.cpp
+ utc-Dali-Text-Segmentation.cpp
+ utc-Dali-Text-Shaping.cpp
  utc-Dali-Text-Typesetter.cpp
  utc-Dali-Text-ViewModel.cpp
- utc-Dali-DebugRendering.cpp
- utc-Dali-ItemView-internal.cpp
- utc-Dali-PropertyHelper.cpp
- utc-Dali-ColorConversion.cpp
+ utc-Dali-TextureManager.cpp
+ utc-Dali-VisualModel.cpp
+ utc-Dali-VisualUrl.cpp
 )
 
 # Append list of test harness files (Won't get parsed for test cases)
@@ -67,7 +68,8 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
     dali-toolkit
 )
 
-SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror")
+ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
+ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
 
 ADD_DEFINITIONS(-DTEST_RESOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../resources\" )
 
@@ -85,7 +87,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
     ${${CAPI_LIB}_LIBRARIES}
-    -lpthread
+    -lpthread --coverage
 )
 
 INSTALL(PROGRAMS ${EXEC_NAME}
index 1e2b72d..2a5ae46 100644 (file)
@@ -206,13 +206,18 @@ bool GetCursorPositionTest( const GetCursorPositionData& data )
                    visualModel,
                    metrics );
 
+  GetCursorPositionParameters parameters;
+  parameters.visualModel = visualModel;
+  parameters.logicalModel = logicalModel;
+  parameters.metrics = metrics;
+  parameters.isMultiline = true;
+
   for( unsigned int index = 0; index < data.numberOfTests; ++index )
   {
     CursorInfo cursorInfo;
-    GetCursorPosition( visualModel,
-                       logicalModel,
-                       metrics,
-                       data.logicalIndex[index],
+    parameters.logical = data.logicalIndex[index];
+
+    GetCursorPosition( parameters,
                        cursorInfo );
 
     if( cursorInfo.primaryPosition.x != data.visualX[index] )
diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp
new file mode 100644 (file)
index 0000000..c38a70c
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+
+#include <stdlib.h>
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-upload-observer.h>
+
+using namespace Dali::Toolkit::Internal;
+
+class TestObserver : public Dali::Toolkit::TextureUploadObserver
+{
+public:
+  TestObserver()
+  : mLoaded(false),
+    mObserverCalled(false)
+  {
+  }
+
+  void UploadComplete( bool loadSuccess, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect )
+  {
+    mLoaded = loadSuccess;
+    mObserverCalled = true;
+  }
+
+  bool mLoaded;
+  bool mObserverCalled;
+};
+
+
+int UtcTextureManagerRequestLoad(void)
+{
+  ToolkitTestApplication application;
+
+  TextureManager textureManager; // Create new texture manager
+
+  TestObserver observer;
+  std::string filename("image.png");
+
+  TextureManager::TextureId textureId = textureManager.RequestLoad(
+    filename,
+    ImageDimensions(),
+    FittingMode::SCALE_TO_FILL,
+    SamplingMode::BOX_THEN_LINEAR,
+    TextureManager::NO_ATLAS,
+    &observer );
+
+  const VisualUrl& url = textureManager.GetVisualUrl( textureId );
+
+  DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );
+
+  END_TEST;
+}
index caa901e..51f2551 100644 (file)
@@ -16,7 +16,6 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-color-controller.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
@@ -61,7 +60,8 @@ PKG_CHECK_MODULES(DALI_ADAPTOR REQUIRED
   dali-adaptor
 )
 
-SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror")
+ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
+ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
 
 ADD_DEFINITIONS(-DTEST_RESOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../resources\" )
 
@@ -79,7 +79,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
   ${${CAPI_LIB}_LIBRARIES}
-  -lpthread -ldl
+  -lpthread -ldl --coverage
 )
 
 INSTALL(PROGRAMS ${EXEC_NAME}
index c9e87f8..6b3ddd1 100644 (file)
@@ -1,4 +1,8 @@
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "constants":
   {
     "CONFIG_SCRIPT_LOG_LEVEL":"NoLogging"
index ea5ce5c..9417822 100644 (file)
@@ -50,7 +50,14 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
     dali-toolkit
 )
 
-SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror")
+#ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
+# ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
+# This works for a homogenous C++ project, but not for mixed C++/C project
+# On CMake >= 3.3, could use
+# ADD_COMPILE_OPTIONS( "$<$<COMPILE_LANGUAGE:CXX>:${${CAPI_LIB}_CFLAGS_OTHER}>" )
+# However, we need to support CMake 2.8, so instead, fall back to setting the CXX_FLAGS directly:
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror" )
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${CAPI_LIB}_CFLAGS_OTHER}" )
 
 FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS})
     SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${directory}")
@@ -65,7 +72,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
     ${${CAPI_LIB}_LIBRARIES}
-    -lpthread
+    -lpthread --coverage
 )
 
 INSTALL(PROGRAMS ${EXEC_NAME}
index 9b8bd63..39b37de 100755 (executable)
@@ -70,7 +70,6 @@ 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
    dali-toolkit-test-utils/toolkit-clipboard.cpp
    dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
@@ -84,6 +83,7 @@ LIST(APPEND TC_SOURCES
    dali-toolkit-test-utils/toolkit-tts-player.cpp
    dali-toolkit-test-utils/toolkit-native-image-source.cpp
    dali-toolkit-test-utils/toolkit-video-player.cpp
+   dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp
    dali-toolkit-test-utils/dali-test-suite-utils.cpp
    dali-toolkit-test-utils/dummy-control.cpp
    dali-toolkit-test-utils/mesh-builder.cpp
@@ -108,7 +108,8 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
     dali-toolkit
 )
 
-SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror")
+ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
+ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
 
 ADD_DEFINITIONS(-DTEST_RESOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../resources\" )
 
@@ -125,7 +126,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
     ${${CAPI_LIB}_LIBRARIES}
-    -lpthread
+    -lpthread --coverage
 )
 
 INSTALL(PROGRAMS ${EXEC_NAME}
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
deleted file mode 100644 (file)
index 61cbe4d..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// CLASS HEADER
-#include "toolkit-bitmap-loader.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
-#include <cstring>
-#include <semaphore.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-namespace
-{
-Dali::BitmapLoader gBitmapLoader;
-}
-
-
-namespace Internal
-{
-
-class BitmapLoader : public BaseObject
-{
-public:
-  static IntrusivePtr<BitmapLoader> New( const std::string& url,
-                                         ImageDimensions size,
-                                         FittingMode::Type fittingMode,
-                                         SamplingMode::Type samplingMode,
-                                         bool orientationCorrection)
-  {
-    IntrusivePtr<BitmapLoader> internal = new BitmapLoader( url, size, fittingMode, samplingMode, orientationCorrection );
-    return internal;
-  }
-
-  BitmapLoader(const std::string& url,
-               ImageDimensions size,
-               FittingMode::Type fittingMode,
-               SamplingMode::Type samplingMode,
-               bool orientationCorrection)
-  : mSize(size),
-    mPixelData(),
-    mUrl(url)
-  {
-    sem_init( &mySemaphore, 0, 0 );
-  }
-
-  ~BitmapLoader(){}
-
-  void Load()
-  {
-    size_t bufferSize  = mSize.GetWidth() * mSize.GetHeight() * 4;
-    unsigned char* buffer = static_cast<unsigned char*>(malloc(bufferSize));
-    memset(buffer, 0, bufferSize);
-
-    mPixelData = Dali::PixelData::New( buffer, bufferSize, mSize.GetWidth(), mSize.GetHeight(), Pixel::RGBA8888, Dali::PixelData::FREE);
-
-    sem_post( &mySemaphore );
-  }
-
-  Dali::PixelData GetPixelData() const
-  {
-    return mPixelData;
-  }
-
-  const std::string& GetUrl() const
-  {
-    return mUrl;
-  }
-
-  bool IsLoaded()
-  {
-    return mPixelData ? true : false;
-  }
-
-  void WaitForLoading()
-  {
-    if( mPixelData )
-    {
-      return;
-    }
-    sem_wait( &mySemaphore );
-  }
-
-  ImageDimensions mSize;
-  Dali::PixelData mPixelData;
-  const std::string mUrl;
-  sem_t mySemaphore;
-};
-
-} // internal
-
-inline Internal::BitmapLoader& GetImplementation(Dali::BitmapLoader& handle)
-{
-  DALI_ASSERT_ALWAYS( handle && "handle is empty" );
-  BaseObject& object = handle.GetBaseObject();
-  return static_cast<Internal::BitmapLoader&>(object);
-}
-
-inline const Internal::BitmapLoader& GetImplementation(const Dali::BitmapLoader& handle)
-{
-  DALI_ASSERT_ALWAYS( handle && "handle is empty" );
-  const BaseObject& object = handle.GetBaseObject();
-  return static_cast<const Internal::BitmapLoader&>(object);
-}
-
-Dali::BitmapLoader Dali::BitmapLoader::New(std::string const&url, Dali::Uint16Pair size, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode, bool orientationCorrection)
-{
-  IntrusivePtr<Internal::BitmapLoader> internal = Internal::BitmapLoader::New(url, size, fittingMode, samplingMode, orientationCorrection);
-  gBitmapLoader = BitmapLoader(internal.Get());
-  return gBitmapLoader;
-}
-
-BitmapLoader::BitmapLoader()
-{
-}
-
-Dali::BitmapLoader::BitmapLoader(Dali::BitmapLoader const& handle)
-:BaseHandle(handle)
-{
-}
-Dali::BitmapLoader::BitmapLoader(Internal::BitmapLoader* internal)
-:BaseHandle(internal)
-{
-}
-Dali::BitmapLoader::~BitmapLoader()
-{
-}
-BitmapLoader& BitmapLoader::operator=(const BitmapLoader& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
-void Dali::BitmapLoader::Load()
-{
-  GetImplementation(*this).Load();
-}
-PixelData Dali::BitmapLoader::GetPixelData() const
-{
-  return GetImplementation(*this).GetPixelData();
-}
-std::string Dali::BitmapLoader::GetUrl() const
-{
-  return GetImplementation(*this).GetUrl();
-}
-bool Dali::BitmapLoader::IsLoaded()
-{
-  return GetImplementation(*this).IsLoaded();
-}
-void Dali::BitmapLoader::WaitForLoading()
-{
-  GetImplementation(*this).WaitForLoading();
-}
-
-BitmapLoader Dali::BitmapLoader::GetLatestCreated()
-{
-  return gBitmapLoader;
-}
-
-void Dali::BitmapLoader::ResetLatestCreated()
-{
-  gBitmapLoader.Reset();
-}
-
-} // Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h
deleted file mode 100644 (file)
index acdc94a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef DALI_TOOLKIT_BITMAP_LOADER_H
-#define DALI_TOOLKIT_BITMAP_LOADER_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.
- */
-
-#define DALI_BITMAP_LOADER_H
-
-#include <string>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/images/image-operations.h>
-#include <dali/public-api/images/pixel.h>
-#include <dali/public-api/images/pixel-data.h>
-#include <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-namespace Internal
-{
-class BitmapLoader;
-}
-
-class DALI_IMPORT_API BitmapLoader : public BaseHandle
-{
-public:
-
-  static BitmapLoader New( const std::string& url,
-                           ImageDimensions size = ImageDimensions( 0, 0 ),
-                           FittingMode::Type fittingMode = FittingMode::DEFAULT,
-                           SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
-                           bool orientationCorrection = true);
-  BitmapLoader();
-  ~BitmapLoader();
-  BitmapLoader(const BitmapLoader& handle);
-  BitmapLoader& operator=(const BitmapLoader& rhs);
-
-public:
-  void Load();
-  bool IsLoaded();
-  std::string GetUrl() const;
-  PixelData GetPixelData() const;
-
-  void WaitForLoading();
-  static BitmapLoader GetLatestCreated(); // return the latest created BitmapLoader
-  static void ResetLatestCreated();
-
-public: // Not intended for application developers
-
-  explicit DALI_INTERNAL BitmapLoader(Internal::BitmapLoader*);
-};
-
-} // Dali
-
-#endif // DALI_TOOLKIT_BITMAP_LOADER_H
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp
new file mode 100644 (file)
index 0000000..e2d0855
--- /dev/null
@@ -0,0 +1,54 @@
+
+#include <dali/integration-api/adaptors/trigger-event-interface.h>
+#include <dali/integration-api/adaptors/trigger-event-factory.h>
+#include <dali/public-api/signals/callback.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Toolkit
+{
+
+class TriggerEvent: public Dali::TriggerEventInterface
+{
+public:
+
+  TriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options Options );
+  ~TriggerEvent(){}
+
+  void Trigger();
+
+private:
+  Dali::CallbackBase* mCallback;
+
+};
+
+TriggerEvent::TriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options Options )
+  : mCallback( callback )
+{
+}
+
+void TriggerEvent::Trigger()
+{
+  Dali::CallbackBase::Execute( *mCallback );
+}
+
+} // namespace Toolkit
+
+} // namespace Internal
+
+} // namespace Dali
+
+Dali::TriggerEventInterface* Dali::TriggerEventFactory::CreateTriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options options )
+{
+  return new Dali::Internal::Toolkit::TriggerEvent( callback, options );
+}
+
+void Dali::TriggerEventFactory::DestroyTriggerEvent( Dali::TriggerEventInterface* triggerEventInterface )
+{
+  Dali::Internal::Toolkit::TriggerEvent* triggerEvent( static_cast< Dali::Internal::Toolkit::TriggerEvent *>(triggerEventInterface) );
+  delete triggerEvent;
+}
index 05e66d8..eee723b 100644 (file)
@@ -200,6 +200,10 @@ int VideoPlayer::GetPlayPosition()
   return 0;
 }
 
+void VideoPlayer::SetDisplayArea( DisplayArea area )
+{
+}
+
 void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
 {
 }
@@ -214,5 +218,13 @@ Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
   return Internal::Adaptor::GetImplementation( *this ).mFinishedSignal;
 }
 
+void VideoPlayer::Forward( int millisecond )
+{
+}
+
+void VideoPlayer::Backward( int millisecond )
+{
+}
+
 } // namespace Dali;
 
index 717a243..199fa12 100644 (file)
@@ -87,12 +87,18 @@ public:
 
   int GetPlayPosition();
 
+  void SetDisplayArea( DisplayArea area );
+
   void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
 
   Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation();
 
   Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal();
 
+  void Forward( int millisecond );
+
+  void Backward( int millisecond );
+
 private:
 
   VideoPlayer( Internal::Adaptor::VideoPlayer* internal );
index 60f4a1b..f134be3 100644 (file)
@@ -1820,3 +1820,33 @@ int UtcDaliBuilderActionsWithParams(void)
 
   END_TEST;
 }
+
+int UtcDaliBuilderConfigurationP(void)
+{
+  ToolkitTestApplication application;
+
+  // JSON with a quit event when the actor is touched
+  std::string json(
+      "{\n"
+      "  \"config\":\n"
+      "  {\n"
+      "    \"alwaysShowFocus\":true\n"
+      "  }\n"
+      "}\n"
+  );
+
+  Builder builder = Builder::New();
+  builder.LoadFromString( json );
+
+  Property::Map map = builder.GetConfigurations();
+
+  Dali::Property::Value* pValue = map.Find( "alwaysShowFocus" );
+
+  DALI_TEST_CHECK( pValue );
+
+  bool value = pValue->Get<bool>();
+
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
index 32d16e4..4d4a35e 100644 (file)
@@ -27,6 +27,8 @@
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/align-enums.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <toolkit-event-thread-callback.h>
 
 #include "dummy-control.h"
 
@@ -68,6 +70,9 @@ static void TestKeyInputFocusCallback( Control control )
   gKeyInputFocusCallBackCalled = true;
 }
 
+const char* TEST_LARGE_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR "/tbcol.png";
+const char* TEST_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+
 } // namespace
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -803,3 +808,61 @@ int UtcDaliControlSetTransformSize(void)
 
   END_TEST;
 }
+
+
+int UtcDaliControlResourcesReady(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "Register 2 visuals and check ResourceReady when a visual is disabled" );
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  Property::Map propertyMapLarge;
+  propertyMapLarge.Insert( Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMapLarge.Insert( ImageVisual::Property::URL,  TEST_LARGE_IMAGE_FILE_NAME );
+
+  Property::Map propertyMapSmall;
+  propertyMapSmall.Insert( Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMapSmall.Insert( ImageVisual::Property::URL,  TEST_IMAGE_FILE_NAME );
+
+  Visual::Base smallVisual = factory.CreateVisual( propertyMapSmall );
+  smallVisual.SetName("smallVisual");
+  DALI_TEST_CHECK( smallVisual );
+
+  DummyControl actor = DummyControl::New();
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, smallVisual );
+
+  actor.SetSize( 200.f, 200.f );
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), false, TEST_LOCATION );
+
+  Stage::GetCurrent().Add( actor );
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), true, TEST_LOCATION );
+
+  Visual::Base largeVisual = factory.CreateVisual( propertyMapLarge );
+  largeVisual.SetName("largeVisual");
+  DALI_TEST_CHECK( largeVisual );
+
+  tet_infoline( "Register Visual but set disabled, IsResourceReady should be true" );
+
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, largeVisual, false );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), true, TEST_LOCATION );
+
+  END_TEST;
+}
index 5efd46d..8d8cefb 100644 (file)
@@ -23,9 +23,9 @@
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <dali/public-api/images/buffer-image.h>
-
+#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 
 
 using namespace Dali;
@@ -431,9 +431,8 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void)
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
 
-  BitmapLoader loader = BitmapLoader::New( "Image.jpg" );
-  loader.Load();
-  PixelData pixelData = loader.GetPixelData();
+  Devel::PixelBuffer pixelBuffer = LoadImageFromFile(TEST_RESOURCE_DIR "/gallery-small-1.jpg");
+  PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
   Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
   texture.Upload( pixelData );
 
@@ -489,9 +488,8 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
 
-  BitmapLoader loader = BitmapLoader::New( "Image.jpg" );
-  loader.Load();
-  PixelData pixelData = loader.GetPixelData();
+  Devel::PixelBuffer pixelBuffer = LoadImageFromFile(TEST_RESOURCE_DIR "/gallery-small-1.jpg");
+  PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
   Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
   texture.Upload( pixelData );
 
index cca026f..848a282 100644 (file)
@@ -38,8 +38,8 @@ static const char* gImage_50_RGBA = TEST_RESOURCE_DIR "/icon-delete.png";
 // resolution: 128*128, pixel format: RGB888
 static const char* gImage_128_RGB = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
 
-// this is image is not exist, for negative test
-static const char* gImageNonExist = "non-exist.jpg";
+// Empty image, for testing broken image loading
+static const char* gEmptyImage = TEST_RESOURCE_DIR "/empty.bmp";
 
 const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
 
@@ -194,26 +194,27 @@ int UtcDaliImageAtlasSetBrokenImage(void)
   unsigned int size = 200;
   ImageAtlas atlas = ImageAtlas::New( size, size );
 
-  Vector4 textureRect;
-  atlas.Upload( textureRect, gImageNonExist );
-  DALI_TEST_EQUALS( textureRect, Vector4::ZERO, TEST_LOCATION );
-
   // Set broken image
   TestPlatformAbstraction& platform = application.GetPlatform();
   platform.SetClosestImageSize(Vector2( 34, 34));
   atlas.SetBrokenImage( gImage_34_RGBA );
 
-  // the non-exit image will be replaced with the broken image
-  platform.SetClosestImageSize(Vector2( 0, 0));
-  atlas.Upload( textureRect, gImageNonExist );
+  Vector4 textureRect;
+
+  // the empty image will be replaced with the broken image
+  platform.SetClosestImageSize(Vector2( 20, 20));
+  atlas.Upload( textureRect, gEmptyImage );
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
   Rect<int> pixelArea = TextureCoordinateToPixelArea(textureRect, size);
-  DALI_TEST_EQUALS( pixelArea.width, 34, TEST_LOCATION );
-  DALI_TEST_EQUALS( pixelArea.height, 34, TEST_LOCATION );
+  DALI_TEST_EQUALS( pixelArea.width, 20, TEST_LOCATION );
+  DALI_TEST_EQUALS( pixelArea.height, 20, TEST_LOCATION );
 
   END_TEST;
 }
 
+
+
 int UtcDaliImageAtlasUploadP(void)
 {
   ToolkitTestApplication application;
index d1beb09..e8198ca 100644 (file)
@@ -18,7 +18,6 @@
 // Need to override adaptor classes for toolkit test harness, so include
 // test harness headers before dali headers.
 #include <dali-toolkit-test-suite-utils.h>
-#include <toolkit-bitmap-loader.h>
 #include <toolkit-event-thread-callback.h>
 
 #include <dali-toolkit/dali-toolkit.h>
@@ -29,6 +28,7 @@
 
 #include <test-native-image.h>
 #include <sstream>
+#include <unistd.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -77,6 +77,9 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 const char* TEST_IMAGE_FILE_NAME =  "gallery_image_01.jpg";
 const char* TEST_IMAGE_FILE_NAME2 =  "gallery_image_02.jpg";
 
+const char* TEST_IMAGE_1 = TEST_RESOURCE_DIR "/TB-gloss.png";
+const char* TEST_IMAGE_2 = TEST_RESOURCE_DIR "/tb-norm.png";
+
 // resolution: 34*34, pixel format: RGBA8888
 static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png";
 // resolution: 600*600, pixel format: RGB888
@@ -427,20 +430,28 @@ int UtcDaliImageViewPixelArea(void)
 int UtcDaliImageViewAsyncLoadingWithoutAltasing(void)
 {
   ToolkitTestApplication application;
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  const std::vector<GLuint>& textures = gl.GetBoundTextures();
+  size_t numTextures = textures.size();
 
   // Async loading, no atlasing for big size image
   ImageView imageView = ImageView::New( gImage_600_RGB );
 
   // By default, Aysnc loading is used
   Stage::GetCurrent().Add( imageView );
+  imageView.SetSize(100, 100);
+  imageView.SetParentOrigin( ParentOrigin::CENTER );
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
   application.SendNotification();
   application.Render(16);
-  application.Render(16);
   application.SendNotification();
 
-  // BitmapLoader is not used
-  BitmapLoader loader = BitmapLoader::GetLatestCreated();
-  DALI_TEST_CHECK( !loader );
+  const std::vector<GLuint>& textures2 = gl.GetBoundTextures();
+  DALI_TEST_GREATER( textures2.size(), numTextures, TEST_LOCATION );
+
+
 
   END_TEST;
 }
@@ -547,35 +558,22 @@ int UtcDaliImageViewSyncLoading(void)
     // Sync loading is used
     syncLoadingMap[ ImageVisual::Property::URL ] = gImage_600_RGB;
     imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
-
-
-    // BitmapLoader is used, and the loading is started immediately even the actor is not on stage.
-    BitmapLoader loader = BitmapLoader::GetLatestCreated();
-    DALI_TEST_CHECK( loader );
   }
 
   // Sync loading, automatic atlasing for small size image
   {
-    BitmapLoader::ResetLatestCreated();
     TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
     callStack.Reset();
     callStack.Enable(true);
 
     ImageView imageView = ImageView::New( );
+
     // Sync loading is used
     syncLoadingMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
     syncLoadingMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
     syncLoadingMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
     imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
 
-    // loading is started even if the actor is offStage
-    BitmapLoader loader = BitmapLoader::GetLatestCreated();
-    DALI_TEST_CHECK( loader );
-
-    loader.WaitForLoading();
-
-    DALI_TEST_CHECK( loader.IsLoaded() );
-
     Stage::GetCurrent().Add( imageView );
     application.SendNotification();
     application.Render(16);
@@ -598,7 +596,6 @@ int UtcDaliImageViewSyncLoading02(void)
 
   // Sync loading, automatic atlasing for small size image
   {
-    BitmapLoader::ResetLatestCreated();
     TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
     callStack.Reset();
     callStack.Enable(true);
@@ -614,14 +611,6 @@ int UtcDaliImageViewSyncLoading02(void)
     syncLoadingMap[ "atlasing" ] = true;
     imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
 
-    // loading is started even if the actor is offStage
-    BitmapLoader loader = BitmapLoader::GetLatestCreated();
-    DALI_TEST_CHECK( loader );
-
-    loader.WaitForLoading();
-
-    DALI_TEST_CHECK( loader.IsLoaded() );
-
     Stage::GetCurrent().Add( imageView );
     application.SendNotification();
     application.Render(16);
@@ -1316,3 +1305,52 @@ int UtcDaliImageViewGetImageN(void)
 
   END_TEST;
 }
+
+
+int UtcDaliImageViewReplaceImage(void)
+{
+  ToolkitTestApplication application;
+
+  gResourceReadySignalFired = false;
+
+  int width = 100;
+  int height = 200;
+  Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
+
+  // Check ImageView with background and main image, to ensure both visuals are marked as loaded
+  ImageView imageView = ImageView::New( TEST_IMAGE_1 );
+
+  DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), false, TEST_LOCATION );
+
+  Toolkit::DevelControl::ResourceReadySignal( imageView ).Connect( &ResourceReadySignal);
+
+  Stage::GetCurrent().Add( imageView );
+
+  application.SendNotification();
+  application.Render(16);
+
+  // loading started, this waits for the loader thread for max 30 seconds
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+
+  gResourceReadySignalFired = false;
+
+  imageView.SetImage(TEST_IMAGE_2);
+
+  application.SendNotification();
+  application.Render(16);
+
+  // loading started, this waits for the loader thread for max 30 seconds
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+
+  END_TEST;
+}
index f6d34b9..25779d5 100644 (file)
@@ -18,7 +18,6 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-timer.h>
-#include <toolkit-bitmap-loader.h>
 #include <toolkit-event-thread-callback.h>
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/public-api/rendering/texture-set.h>
@@ -451,11 +450,6 @@ int UtcDaliImageVisualCustomWrapModePixelArea(void)
   application.SendNotification();
   application.Render();
 
-  BitmapLoader loader = BitmapLoader::GetLatestCreated();
-  DALI_TEST_CHECK( loader );
-  loader.WaitForLoading();// waiting until the image to be loaded
-  DALI_TEST_CHECK( loader.IsLoaded() );
-
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
 
   DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
@@ -534,11 +528,6 @@ int UtcDaliImageVisualCustomWrapModeNoAtlas(void)
   application.SendNotification();
   application.Render();
 
-  BitmapLoader loader = BitmapLoader::GetLatestCreated();
-  DALI_TEST_CHECK( loader );
-  loader.WaitForLoading();// waiting until the image to be loaded
-  DALI_TEST_CHECK( loader.IsLoaded() );
-
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
 
   DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
@@ -853,6 +842,58 @@ int UtcDaliImageVisualTextureCancelRemoteLoad(void)
   END_TEST;
 }
 
+int UtcDaliImageVisualTextureCancelAsyncLoad(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "Load image asynchronosly, cancel loading, then load again" );
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  Property::Map propertyMap;
+  propertyMap.Insert( Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable( true );
+  TraceCallStack& drawTrace = gl.GetDrawTrace();
+  drawTrace.Enable( true );
+
+  DummyControl actor = DummyControl::New();
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( Control::Property::BACKGROUND, visual );
+
+  Stage::GetCurrent().Add( actor );
+
+  // Cancel loading
+  Stage::GetCurrent().Remove( actor );
+
+  Stage::GetCurrent().Add( actor );
+
+  // Create another visual with the same image
+  visual = factory.CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  dummyImpl.RegisterVisual( Control::Property::BACKGROUND, visual );
+
+  application.SendNotification();
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliImageVisualSetInvalidAsyncImage(void)
 {
   ToolkitTestApplication application;
index 56cd9e8..cf1a006 100644 (file)
@@ -250,7 +250,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation01(void)
   manager.SetFocus( dummy3 );
   DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
 
-  Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", DevelKeyEvent::DeviceClass::TOUCH );
+  Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", DevelDevice::Class::TOUCH, DevelDevice::Subclass::NONE );
   application.ProcessEvent(event);
 
   DALI_TEST_CHECK( callback1.mIsCalled );
@@ -296,7 +296,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation02(void)
   manager.SetFocus( dummy3 );
   DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
 
-  Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", DevelKeyEvent::DeviceClass::TOUCH );
+  Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", DevelDevice::Class::TOUCH, DevelDevice::Subclass::NONE );
   application.ProcessEvent(event);
 
   DALI_TEST_CHECK( !callback1.mIsCalled );
index f1cccda..8957dd6 100644 (file)
@@ -865,7 +865,7 @@ int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void)
   FocusedActorActivatedCallback focusedActorActivatedCallback(focusedActorActivatedSignalVerified);
   manager.FocusedActorEnterKeySignal().Connect( &focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback );
 
-  Integration::KeyEvent returnEvent( "Return", "", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+  Integration::KeyEvent returnEvent( "Return", "", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
 
   // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
   // It makes mIsFocusIndicatorEnabled true
@@ -923,8 +923,8 @@ int UtcDaliKeyboardFocusManagerSignalFocusGroupChanged(void)
   FocusGroupChangedCallback focusGroupChangedCallback(focusGroupChangedSignalVerified);
   manager.FocusGroupChangedSignal().Connect( &focusGroupChangedCallback, &FocusGroupChangedCallback::Callback );
 
-  Integration::KeyEvent tabEvent( "Tab", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
-  Integration::KeyEvent shiftTabEvent( "Tab", "", 0, 1, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+  Integration::KeyEvent tabEvent( "Tab", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
+  Integration::KeyEvent shiftTabEvent( "Tab", "", 0, 1, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
 
   // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
   // It makes mIsFocusIndicatorEnabled true
@@ -1046,12 +1046,12 @@ int UtcDaliKeyboardFocusManagerChangeFocusDirectionByKeyEvents(void)
   FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
   manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
 
-  Integration::KeyEvent leftEvent( "Left", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
-  Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
-  Integration::KeyEvent upEvent( "Up", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
-  Integration::KeyEvent downEvent( "Down", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
-  Integration::KeyEvent pageUpEvent( "Prior", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
-  Integration::KeyEvent pageDownEvent( "Next", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+  Integration::KeyEvent leftEvent( "Left", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
+  Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
+  Integration::KeyEvent upEvent( "Up", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
+  Integration::KeyEvent downEvent( "Down", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
+  Integration::KeyEvent pageUpEvent( "Prior", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
+  Integration::KeyEvent pageDownEvent( "Next", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
 
   // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
   // It makes mIsFocusIndicatorEnabled true
index 9a8b579..0b95d1f 100644 (file)
@@ -179,8 +179,9 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                    int keyModifier,
                                    unsigned long timeStamp,
                                    const Integration::KeyEvent::State& keyState,
-                                   const std::string& deviceName,
-                                   const DevelKeyEvent::DeviceClass::Type& deviceClass
+                                   const std::string& deviceName = "",
+                                   const DevelDevice::Class::Type& deviceClass = DevelDevice::Class::NONE,
+                                   const DevelDevice::Subclass::Type& deviceSubclass = DevelDevice::Subclass::NONE
                                    )
 {
   return Integration::KeyEvent( keyName,
@@ -190,7 +191,8 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                 timeStamp,
                                 keyState,
                                 deviceName,
-                                deviceClass );
+                                deviceClass,
+                                deviceSubclass );
 }
 
 } // Anonymous namespace
@@ -1430,7 +1432,7 @@ int UtcDaliPopupOnKeyEvent(void)
 
   popup.SetKeyInputFocus();
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", DevelKeyEvent::DeviceClass::TOUCH ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", DevelDevice::Class::TOUCH, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
 
index 57b39a5..7ea83bc 100644 (file)
@@ -48,6 +48,7 @@ void utc_dali_toolkit_pushbutton_cleanup(void)
 namespace
 {
 static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+static const char* TEST_IMAGE_TWO = TEST_RESOURCE_DIR "/icon-delete.jpg";
 
 static const Vector2 INSIDE_TOUCH_POINT_POSITON  = Vector2( 240, 400 );
 static const Vector3 BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS  = Vector3( 200, 360, 0 );
@@ -1816,3 +1817,37 @@ int UtcDaliPushButtonSetDisabledSelectedImageWithActorDeprecatedP(void)
 
   END_TEST;
 }
+
+int UtcDaliPushButtonReplaceButtonImageP2(void)
+{
+  tet_infoline("Set button image then replace with new image and query url");
+
+  ToolkitTestApplication application;
+
+  ResourceImage setImage = ResourceImage::New( TEST_IMAGE_ONE );
+  DALI_TEST_CHECK(setImage);
+
+  Actor imgActorSet = ImageView::New(setImage);
+  DALI_TEST_CHECK(imgActorSet);
+
+  PushButton pushButton = PushButton::New();
+  pushButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_TWO );
+
+
+  Stage::GetCurrent().Add( pushButton );
+
+  pushButton.SetButtonImage( imgActorSet );
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Get button image before it has been able to load");
+
+  ImageView imageView = ImageView::DownCast(pushButton.GetButtonImage());
+
+  ResourceImage getImage = ResourceImage::DownCast( imageView.GetImage() );
+
+  tet_infoline("Check if url matches last assignment even if not loaded yet");
+  DALI_TEST_EQUALS( getImage.GetUrl(), setImage.GetUrl() , TEST_LOCATION );
+
+  END_TEST;
+}
index bb9ae72..70e229c 100644 (file)
@@ -96,6 +96,8 @@ const char* const PROPERTY_NAME_PIXEL_SIZE                           = "pixelSiz
 const char* const PROPERTY_NAME_LINE_COUNT                           = "lineCount";
 const char* const PROPERTY_NAME_PLACEHOLDER_TEXT                     = "placeholderText";
 const char* const PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR               = "placeholderTextColor";
+const char* const PROPERTY_NAME_ENABLE_SELECTION                     = "enableSelection";
+const char* const PROPERTY_NAME_PLACEHOLDER                          = "placeholder";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
@@ -194,8 +196,9 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                    int keyModifier,
                                    unsigned long timeStamp,
                                    const Integration::KeyEvent::State& keyState,
-                                   const std::string& deviceName,
-                                   const DevelKeyEvent::DeviceClass::Type& deviceClass )
+                                   const std::string& deviceName = DEFAULT_DEVICE_NAME,
+                                   const DevelDevice::Class::Type& deviceClass = DevelDevice::Class::NONE,
+                                   const DevelDevice::Subclass::Type& deviceSubclass = DevelDevice::Subclass::NONE )
 {
   return Integration::KeyEvent( keyName,
                                 keyString,
@@ -204,7 +207,8 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                 timeStamp,
                                 keyState,
                                 deviceName,
-                                deviceClass );
+                                deviceClass,
+                                deviceSubclass );
 }
 
 /**
@@ -465,6 +469,8 @@ int UtcDaliTextEditorGetPropertyP(void)
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_LINE_COUNT) == DevelTextEditor::Property::LINE_COUNT );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == DevelTextEditor::Property::ENABLE_SELECTION );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == DevelTextEditor::Property::PLACEHOLDER );
 
   END_TEST;
 }
@@ -771,6 +777,74 @@ int UtcDaliTextEditorSetPropertyP(void)
   editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR, Color::RED );
   DALI_TEST_EQUALS( editor.GetProperty<Vector4>( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR ), Color::RED, TEST_LOCATION );
 
+  // Check the enable selection property
+  editor.SetProperty( DevelTextEditor::Property::ENABLE_SELECTION, false );
+  DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_SELECTION ), false, TEST_LOCATION );
+
+  // Check the placeholder property with pixel size
+  Property::Map placeholderPixelSizeMapSet;
+  Property::Map placeholderPixelSizeMapGet;
+  Property::Map placeholderFontstyleMap;
+  placeholderPixelSizeMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderPixelSizeMapSet["placeholderColor"] = Color::BLUE;
+  placeholderPixelSizeMapSet["placeholderFontFamily"] = "Arial";
+  placeholderPixelSizeMapSet["placeholderPixelSize"] = 15.0f;
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderPixelSizeMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderPixelSizeMapSet );
+
+  placeholderPixelSizeMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderPixelSizeMapGet.Count(), placeholderPixelSizeMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderPixelSizeMapGet, placeholderPixelSizeMapSet ), true, TEST_LOCATION );
+
+  // Check the placeholder property with point size
+  Property::Map placeholderMapSet;
+  Property::Map placeholderMapGet;
+  placeholderMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderMapSet["placeholderColor"] = Color::RED;
+  placeholderMapSet["placeholderFontFamily"] = "Arial";
+  placeholderMapSet["placeholderPointSize"] = 12.0f;
+
+  // Check the placeholder font style property
+  placeholderFontstyleMap.Clear();
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderFontstyleMap.Insert( "width", "condensed" );
+  placeholderFontstyleMap.Insert( "slant", "italic" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  // Reset font style.
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "weight", "normal" );
+  placeholderFontstyleMap.Insert( "slant", "oblique" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "slant", "roman" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+
+  placeholderFontstyleMap.Clear();
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+  placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -830,7 +904,7 @@ int utcDaliTextEditorTextChangedP(void)
   editor.SetKeyInputFocus();
 
   gTextChangedCallBackCalled = false;
-  application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
 
   END_TEST;
@@ -1150,7 +1224,7 @@ int utcDaliTextEditorInputStyleChanged02(void)
   gInputStyleMask = TextEditor::InputStyle::NONE;
   inputStyleChangedSignal = false;
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1175,7 +1249,7 @@ int utcDaliTextEditorInputStyleChanged02(void)
   gInputStyleMask = TextEditor::InputStyle::NONE;
   inputStyleChangedSignal = false;
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1191,7 +1265,7 @@ int utcDaliTextEditorInputStyleChanged02(void)
   gInputStyleMask = TextEditor::InputStyle::NONE;
   inputStyleChangedSignal = false;
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1232,7 +1306,7 @@ int utcDaliTextEditorInputStyleChanged02(void)
   editor.SetProperty( TextEditor::Property::INPUT_EMBOSS, "emboss" );
   editor.SetProperty( TextEditor::Property::INPUT_OUTLINE, "outline" );
 
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1340,7 +1414,7 @@ int utcDaliTextEditorEvent01(void)
   application.Render();
 
   // Add a key event but as the text editor has not the focus it should do nothing.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1357,8 +1431,8 @@ int utcDaliTextEditorEvent01(void)
   application.Render();
 
   // Now the text editor has the focus, so it can handle the key events.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1389,8 +1463,8 @@ int utcDaliTextEditorEvent01(void)
   application.Render();
 
   // The second text editor has the focus. It should handle the key events.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1446,8 +1520,8 @@ int utcDaliTextEditorEvent02(void)
   DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
   // Now the text editor has the focus, so it can handle the key events.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1471,8 +1545,8 @@ int utcDaliTextEditorEvent02(void)
   // Move the cursor and check the position changes.
   Vector3 position1 = cursor.GetCurrentPosition();
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1482,8 +1556,8 @@ int utcDaliTextEditorEvent02(void)
 
   DALI_TEST_CHECK( position2.x < position1.x );
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1521,8 +1595,8 @@ int utcDaliTextEditorEvent02(void)
   DALI_TEST_CHECK( position5.x > position4.x );
 
   // Remove all the text.
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   editor.SetProperty( TextEditor::Property::TEXT, "" );
 
   // Render and notify
@@ -1663,8 +1737,8 @@ int utcDaliTextEditorEvent04(void)
   application.Render();
 
   // Move at the end of the text.
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1672,8 +1746,8 @@ int utcDaliTextEditorEvent04(void)
 
   for( unsigned int index = 0u; index < 10u; ++index )
   {
-    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
     // Render and notify
     application.SendNotification();
@@ -1681,7 +1755,7 @@ int utcDaliTextEditorEvent04(void)
   }
 
   // Add a character
-  application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1690,8 +1764,8 @@ int utcDaliTextEditorEvent04(void)
   DALI_TEST_EQUALS( "Hello\nworld", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
 
   // Add some key events
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1699,8 +1773,8 @@ int utcDaliTextEditorEvent04(void)
 
   for( unsigned int index = 0u; index < 10u; ++index )
   {
-    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
     // Render and notify
     application.SendNotification();
@@ -1708,7 +1782,7 @@ int utcDaliTextEditorEvent04(void)
   }
 
   // Add a character
-  application.ProcessEvent( GenerateKey( " ", " ", KEY_WHITE_SPACE_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( " ", " ", KEY_WHITE_SPACE_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1758,8 +1832,8 @@ int utcDaliTextEditorEvent05(void)
   application.Render();
 
   // Move at the end of the text.
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1768,7 +1842,7 @@ int utcDaliTextEditorEvent05(void)
   for( unsigned int index = 0u; index < 10u; ++index )
   {
     // Add a character
-    application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+    application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
     // Render and notify
     application.SendNotification();
@@ -1780,7 +1854,7 @@ int utcDaliTextEditorEvent05(void)
   // Continuous scroll left to increase coverage
   for( unsigned int index = 0u; index < 10u; ++index )
   {
-    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+    application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
     // Render and notify
     application.SendNotification();
@@ -1793,7 +1867,7 @@ int utcDaliTextEditorEvent05(void)
   DALI_TEST_EQUALS( editor.GetProperty<float>( DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Press Escape to increase coverage
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
 
@@ -1836,7 +1910,7 @@ int utcDaliTextEditorEvent06(void)
   application.Render();
 
   // Move to seconds line of the text.
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1846,12 +1920,12 @@ int utcDaliTextEditorEvent06(void)
 
 
   // Add  another script characters ( glyph height is defferent )
-  application.ProcessEvent( GenerateKey( "d", "ㅁ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "d", "ኢ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "ㅁ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "ኢ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Delete characters
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   DALI_TEST_EQUALS( layoutHeight, editor.GetHeightForWidth( 100.f ), TEST_LOCATION );
 
index 2c1aa44..b1f4d07 100644 (file)
@@ -98,6 +98,8 @@ const char* const PROPERTY_NAME_INPUT_OUTLINE                        = "inputOut
 
 const char* const PROPERTY_NAME_HIDDEN_INPUT_SETTINGS                = "hiddenInputSettings";
 const char* const PROPERTY_NAME_PIXEL_SIZE                           = "pixelSize";
+const char* const PROPERTY_NAME_ENABLE_SELECTION                     = "enableSelection";
+const char* const PROPERTY_NAME_PLACEHOLDER                          = "placeholder";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
@@ -305,8 +307,9 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                    int keyModifier,
                                    unsigned long timeStamp,
                                    const Integration::KeyEvent::State& keyState,
-                                   const std::string& deviceName,
-                                   const DevelKeyEvent::DeviceClass::Type& deviceClass )
+                                   const std::string& deviceName = DEFAULT_DEVICE_NAME,
+                                   const DevelDevice::Class::Type& deviceClass = DevelDevice::Class::NONE,
+                                   const DevelDevice::Subclass::Type& deviceSubclass = DevelDevice::Subclass::NONE )
 {
   return Integration::KeyEvent( keyName,
                                 keyString,
@@ -315,7 +318,8 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                 timeStamp,
                                 keyState,
                                 deviceName,
-                                deviceClass );
+                                deviceClass,
+                                deviceSubclass );
 }
 
 bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
@@ -507,6 +511,8 @@ int UtcDaliTextFieldGetPropertyP(void)
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_OUTLINE ) == TextField::Property::INPUT_OUTLINE );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_HIDDEN_INPUT_SETTINGS ) == DevelTextField::Property::HIDDEN_INPUT_SETTINGS );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == DevelTextField::Property::PIXEL_SIZE );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == DevelTextField::Property::ENABLE_SELECTION );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == DevelTextField::Property::PLACEHOLDER );
 
   END_TEST;
 }
@@ -845,6 +851,74 @@ int UtcDaliTextFieldSetPropertyP(void)
   field.SetProperty( DevelTextField::Property::PIXEL_SIZE, 20.f );
   DALI_TEST_EQUALS( field.GetProperty<float>( DevelTextField::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
+  // Check the enable selection property
+  field.SetProperty( DevelTextField::Property::ENABLE_SELECTION, false );
+  DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::ENABLE_SELECTION ), false, TEST_LOCATION );
+
+  // Check the placeholder property with pixel size
+  Property::Map placeholderPixelSizeMapSet;
+  Property::Map placeholderPixelSizeMapGet;
+  Property::Map placeholderFontstyleMap;
+  placeholderPixelSizeMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderPixelSizeMapSet["placeholderColor"] = Color::BLUE;
+  placeholderPixelSizeMapSet["placeholderFontFamily"] = "Arial";
+  placeholderPixelSizeMapSet["placeholderPixelSize"] = 15.0f;
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderPixelSizeMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderPixelSizeMapSet );
+
+  placeholderPixelSizeMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderPixelSizeMapGet.Count(), placeholderPixelSizeMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderPixelSizeMapGet, placeholderPixelSizeMapSet ), true, TEST_LOCATION );
+
+  // Check the placeholder property with point size
+  Property::Map placeholderMapSet;
+  Property::Map placeholderMapGet;
+  placeholderMapSet["placeholderText"] = "Setting Placeholder Text";
+  placeholderMapSet["placeholderColor"] = Color::RED;
+  placeholderMapSet["placeholderFontFamily"] = "Arial";
+  placeholderMapSet["placeholderPointSize"] = 12.0f;
+
+  // Check the placeholder font style property
+  placeholderFontstyleMap.Clear();
+
+  placeholderFontstyleMap.Insert( "weight", "bold" );
+  placeholderFontstyleMap.Insert( "width", "condensed" );
+  placeholderFontstyleMap.Insert( "slant", "italic" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  // Reset font style.
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "weight", "normal" );
+  placeholderFontstyleMap.Insert( "slant", "oblique" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+  placeholderFontstyleMap.Clear();
+  placeholderFontstyleMap.Insert( "slant", "roman" );
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+
+  placeholderFontstyleMap.Clear();
+  placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+
+  field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+  placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+  DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -904,7 +978,7 @@ int utcDaliTextFieldTextChangedP(void)
   field.SetKeyInputFocus();
 
   gTextChangedCallBackCalled = false;
-  application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
 
   END_TEST;
@@ -957,8 +1031,8 @@ int utcDaliTextFieldMaxCharactersReachedP(void)
 
   gMaxCharactersCallBackCalled = false;
 
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   DALI_TEST_CHECK( gMaxCharactersCallBackCalled );
   DALI_TEST_CHECK( maxLengthReachedSignal );
@@ -989,8 +1063,8 @@ int utcDaliTextFieldMaxCharactersReachedN(void)
 
   gMaxCharactersCallBackCalled = false;
 
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   DALI_TEST_CHECK( !gMaxCharactersCallBackCalled );
   DALI_TEST_CHECK( !maxLengthReachedSignal );
@@ -1307,7 +1381,7 @@ int utcDaliTextFieldInputStyleChanged02(void)
   gInputStyleMask = TextField::InputStyle::NONE;
   inputStyleChangedSignal = false;
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1332,7 +1406,7 @@ int utcDaliTextFieldInputStyleChanged02(void)
   gInputStyleMask = TextField::InputStyle::NONE;
   inputStyleChangedSignal = false;
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1348,7 +1422,7 @@ int utcDaliTextFieldInputStyleChanged02(void)
   gInputStyleMask = TextField::InputStyle::NONE;
   inputStyleChangedSignal = false;
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1455,7 +1529,7 @@ int utcDaliTextFieldEvent01(void)
   application.Render();
 
   // Add a key event but as the text field has not the focus it should do nothing.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1472,8 +1546,8 @@ int utcDaliTextFieldEvent01(void)
   application.Render();
 
   // Now the text field has the focus, so it can handle the key events.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1504,8 +1578,8 @@ int utcDaliTextFieldEvent01(void)
   application.Render();
 
   // The second text field has the focus. It should handle the key events.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1563,8 +1637,8 @@ int utcDaliTextFieldEvent02(void)
   DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
   // Now the text field has the focus, so it can handle the key events.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1588,8 +1662,8 @@ int utcDaliTextFieldEvent02(void)
   // Move the cursor and check the position changes.
   Vector3 position1 = cursor.GetCurrentPosition();
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1599,8 +1673,8 @@ int utcDaliTextFieldEvent02(void)
 
   DALI_TEST_CHECK( position2.x < position1.x );
 
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -1638,8 +1712,8 @@ int utcDaliTextFieldEvent02(void)
   DALI_TEST_CHECK( position5.x > position4.x );
 
   // Remove all the text.
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   field.SetProperty( TextField::Property::TEXT, "" );
 
   // Render and notify
@@ -1654,6 +1728,16 @@ int utcDaliTextFieldEvent02(void)
   // Should not be a renderer.
   DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
 
+  // Chanege exceed policy (EXCEED_POLICY_ORIGINAL doesn't use stencil )
+  field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
+  field.SetProperty( TextField::Property::EXCEED_POLICY, Dali::Toolkit::TextField::EXCEED_POLICY_ORIGINAL );
+
+  application.SendNotification();
+  application.Render();
+
+  // There are renderer and decorator layer
+  DALI_TEST_EQUALS( field.GetChildCount(), 2u, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -2046,14 +2130,14 @@ int utcDaliTextFieldEvent09(void)
   Property::Map map;
   map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_NONE;
   field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
-  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
 
   map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_ALL;
   map[ HiddenInput::Property::SUBSTITUTE_CHARACTER ] = 0x23;
   field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
-  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
 
@@ -2062,7 +2146,7 @@ int utcDaliTextFieldEvent09(void)
   field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
   for( unsigned int index = 0u; index < 5u; ++index )
   {
-    application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+    application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
     application.SendNotification();
     application.Render();
   }
@@ -2072,7 +2156,7 @@ int utcDaliTextFieldEvent09(void)
   field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
   for( unsigned int index = 0u; index < 5u; ++index )
   {
-    application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+    application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
     application.SendNotification();
     application.Render();
   }
@@ -2080,16 +2164,16 @@ int utcDaliTextFieldEvent09(void)
   map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::SHOW_LAST_CHARACTER;
   map[ HiddenInput::Property::SHOW_DURATION ] = 0;
   field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
 
   map[ HiddenInput::Property::SHOW_DURATION ] = 100;
   field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
-  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
 
@@ -2201,7 +2285,7 @@ int utcDaliTextFieldStyleWhilstSelected(void)
   DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   // Press Escape to increase coverage
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
   application.SendNotification();
   application.Render();
 
@@ -2235,8 +2319,8 @@ int utcDaliTextFieldEscKeyLoseFocus(void)
   application.Render();
 
   // Add a key event but as the text field has not the focus it should do nothing.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -2253,10 +2337,10 @@ int utcDaliTextFieldEscKeyLoseFocus(void)
   application.Render();
 
   // Now the text field has the focus, so it can handle the key events.
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -2265,8 +2349,8 @@ int utcDaliTextFieldEscKeyLoseFocus(void)
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("ad"), TEST_LOCATION );
 
   // Generate a Esc key event. The text field should lose the focus.
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -2275,8 +2359,8 @@ int utcDaliTextFieldEscKeyLoseFocus(void)
   DALI_TEST_EQUALS( false, field.HasKeyInputFocus(), TEST_LOCATION );
 
   // No more text should be introduced
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
@@ -2341,24 +2425,24 @@ int utcDaliTextFieldSomeSpecialKeys(void)
   application.Render();
 
   // Generate a Esc key event. The text field should lose the focus.
-  application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Generate a Esc key event. The text field should lose the focus.
-  application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Generate a Esc key event. The text field should lose the focus.
-  application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
-  application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE ) );
+  application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
 
   // Render and notify
   application.SendNotification();
index 983ac77..884efc4 100644 (file)
@@ -31,6 +31,34 @@ const char* const VOLUME_LEFT( "volumeLeft" );
 const char* const VOLUME_RIGHT( "volumeRight" );
 const char* const RENDERING_TYPE( "renderingTarget" );
 
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  varying mediump vec2 vTexCoord;\n
+  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+    vertexPosition.xyz *= uSize;\n
+    vertexPosition = uMvpMatrix * vertexPosition;\n
+    \n
+    vTexCoord = aPosition + vec2(0.5);\n
+    gl_Position = vertexPosition;\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vTexCoord;\n
+  uniform sampler2D sTexture;\n
+  uniform lowp vec4 uColor;\n
+  \n
+  void main()\n
+  {\n
+    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+  }\n
+);
+
 }
 
 void video_view_startup(void)
@@ -312,3 +340,68 @@ int UtcDaliVideoViewMethodsForRenderType(void)
 
   END_TEST;
 }
+
+int UtcDaliVideoViewCustomShaderForCoverage(void)
+{
+  ToolkitTestApplication application;
+  VideoView videoView = VideoView::New();
+  DALI_TEST_CHECK( videoView );
+
+  Stage::GetCurrent().Add( videoView );
+  videoView.SetProperty( VideoView::Property::VIDEO, "testvideo" );
+
+  Property::Map customShader;
+  customShader.Insert( "vertexShader", VERTEX_SHADER );
+  customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
+
+  Property::Map map;
+  map.Insert( "shader", customShader );
+
+  videoView.SetProperty( VideoView::Property::VIDEO, map );
+
+  Property::Map map2;
+  Property::Value value = videoView.GetProperty( VideoView::Property::VIDEO );
+
+  DALI_TEST_CHECK( !value.Get( map2 ) );
+  END_TEST;
+}
+
+int UtcDaliVideoViewMethodsForCoverage2(void)
+{
+  ToolkitTestApplication application;
+  VideoView videoView = VideoView::New();
+  DALI_TEST_CHECK( videoView );
+
+  Property::Map windowSurfaceTarget;
+
+  windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" );
+
+  Stage::GetCurrent().Add( videoView );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map map;
+  Property::Value value;
+  videoView.SetProperty( VideoView::Property::VIDEO, windowSurfaceTarget );
+
+  value = videoView.GetProperty( VideoView::Property::VIDEO );
+  DALI_TEST_CHECK( value.Get( map ) );
+
+  Property::Value* type = map.Find( RENDERING_TYPE );
+  DALI_TEST_CHECK( type );
+  DALI_TEST_EQUALS( "windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION );
+
+  Vector3 vector(100.0f, 100.0f, 0.0f);
+
+  DALI_TEST_CHECK(vector != videoView.GetCurrentSize());
+  videoView.SetSize( vector );
+
+  application.SendNotification();
+  application.Render();
+
+  // Check the size in the new frame
+  DALI_TEST_CHECK(vector == videoView.GetCurrentSize());
+
+  END_TEST;
+}
index bec918e..f8e61b8 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/rendering/shader.h>
 #include <dali/devel-api/object/handle-devel.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
@@ -1770,8 +1771,10 @@ int UtcDaliNPatchVisualCustomShader(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map properties;
   Property::Map shader;
+  const std::string vertexShader = "Foobar";
   const std::string fragmentShader = "Foobar";
   shader[Dali::Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
+  shader[Dali::Toolkit::Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
 
   Property::Map transformMap;
   transformMap["size"] = Vector2( 0.5f, 0.5f ) ;
@@ -1809,10 +1812,11 @@ int UtcDaliNPatchVisualCustomShader(void)
   DALI_TEST_EQUALS( renderer.GetProperty( index ), Property::Value(Vector2(0.5, 0.5)), 0.001, TEST_LOCATION );
 
   Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
-  // *map["vertex"]; is default here so not verifying it
-
   DALI_TEST_EQUALS( fragmentShader, fragment->Get<std::string>(), TEST_LOCATION );
 
+  Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
+  DALI_TEST_EQUALS( vertexShader, vertex->Get<std::string>(), TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -2139,6 +2143,42 @@ int UtcDaliRegisterVisualOrder(void)
   END_TEST;
 }
 
+int UtcDaliRegisterVisualOrder02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "Register Visual Order with Background Set" );
+
+  DummyControl dummyControl = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+  const int backgroundDepthIndex = Toolkit::DepthIndex::BACKGROUND;
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+
+  tet_printf( "Register a control background visual, should have depth index of %d\n", backgroundDepthIndex );
+
+  dummyControl.SetProperty( Control::Property::BACKGROUND, propertyMap );
+
+  const int TEST_VISUAL_1_DEPTH_INDEX = 0;
+  tet_printf( "Register visual, should have depth index of %d\n", TEST_VISUAL_1_DEPTH_INDEX );
+  Visual::Base testVisual1 = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, testVisual1 );
+  DALI_TEST_EQUALS( testVisual1.GetDepthIndex(), TEST_VISUAL_1_DEPTH_INDEX , TEST_LOCATION );
+
+  tet_printf( "Register another visual, should have a depth index greater than previous(%d)\n", TEST_VISUAL_1_DEPTH_INDEX );
+  Visual::Base testVisual2 = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2 );
+  DALI_TEST_CHECK( testVisual2.GetDepthIndex() >  testVisual1.GetDepthIndex() );
+
+  dummyControl.SetSize(200.f, 200.f);
+  Stage::GetCurrent().Add( dummyControl );
+
+  END_TEST;
+}
+
 int UtcDaliRegisterVisualWithDepthIndex(void)
 {
   ToolkitTestApplication application;
index 2e7e268..337fb24 100644 (file)
@@ -18,7 +18,6 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-timer.h>
-#include <toolkit-bitmap-loader.h>
 #include <toolkit-event-thread-callback.h>
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/public-api/rendering/texture-set.h>
index a766f83..c2f73c3 100644 (file)
@@ -118,6 +118,7 @@ develapifocusmanagerdir =       $(develapidir)/focus-manager
 develapiimageloaderdir =        $(develapidir)/image-loader
 develapiscriptingdir =          $(develapidir)/scripting
 develapishadereffectsdir =      $(develapidir)/shader-effects
+develapistylingdir =            $(develapidir)/styling
 develapitransitioneffectsdir =  $(develapidir)/transition-effects
 develapitoolbardir =            $(develapicontrolsdir)/tool-bar
 develapitooltipdir =            $(develapicontrolsdir)/tooltip
@@ -149,6 +150,7 @@ develapivisuals_HEADERS =           $(devel_api_visuals_header_files)
 develapiscripting_HEADERS =         $(devel_api_scripting_header_files)
 develapishadowview_HEADERS =        $(devel_api_shadow_view_header_files)
 develapishadereffects_HEADERS =     $(devel_api_shader_effects_header_files)
+develapistyling_HEADERS =           $(devel_api_styling_header_files)
 develapisuperblurview_HEADERS =     $(devel_api_super_blur_view_header_files)
 develapitoolbar_HEADERS =           $(devel_api_tool_bar_header_files)
 develapitooltip_HEADERS =           $(devel_api_tooltip_header_files)
index 4270b1e..64a08a0 100644 (file)
@@ -64,6 +64,11 @@ void Builder::AddConstant( const std::string& key, const Property::Value& value
   GetImpl(*this).AddConstant( key, value );
 }
 
+const Property::Map& Builder::GetConfigurations() const
+{
+  return GetImpl(*this).GetConfigurations();
+}
+
 const Property::Map& Builder::GetConstants() const
 {
   return GetImpl(*this).GetConstants();
index 530a81a..422a517 100644 (file)
@@ -187,6 +187,14 @@ class DALI_IMPORT_API Builder : public BaseHandle
   void AddConstant( const std::string& key, const Property::Value& value );
 
   /**
+   * @brief Gets all currently defined configurations.
+   *
+   * @pre The Builder has been initialized.
+   * @return A reference to the currently defined configurations.
+   */
+  const Property::Map& GetConfigurations() const;
+
+  /**
    * @brief Gets all currently defined constants.
    *
    * e.g.
index 59fd144..58b76f3 100644 (file)
@@ -46,63 +46,63 @@ ResourceReadySignalType&  ResourceReadySignal( Control& control )
 bool IsResourceReady( const Control& control )
 {
   const Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
-  const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
+  const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
 
-  return controlImpl.IsResourceReady();
+  return controlDataImpl.IsResourceReady();
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual );
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual, depthIndex );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual, depthIndex );
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual, enabled );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual, enabled );
 }
 
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.RegisterVisual( index, visual, enabled, depthIndex );
 }
 
 void UnregisterVisual( Internal::Control& control, Dali::Property::Index index )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.UnregisterVisual( index );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.UnregisterVisual( index );
 }
 
 Toolkit::Visual::Base GetVisual( const Internal::Control& control, Dali::Property::Index index )
 {
-  const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  return controlImpl.GetVisual( index );
+  const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  return controlDataImpl.GetVisual( index );
 }
 
 void EnableVisual( Internal::Control& control, Dali::Property::Index index, bool enable )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  controlImpl.EnableVisual( index, enable );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  controlDataImpl.EnableVisual( index, enable );
 }
 
 bool IsVisualEnabled( const Internal::Control& control, Dali::Property::Index index )
 {
-  const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  return controlImpl.IsVisualEnabled( index );
+  const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  return controlDataImpl.IsVisualEnabled( index );
 }
 
 Dali::Animation CreateTransition( Internal::Control& control, const Toolkit::TransitionData& handle )
 {
-  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
-  return controlImpl.CreateTransition( handle );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+  return controlDataImpl.CreateTransition( handle );
 }
 
 
index f95fc94..e09207c 100644 (file)
@@ -107,6 +107,9 @@ namespace Property
 
       /**
        * @brief The size of font in pixels.
+       *
+       * Conversion from Point size to Pixel size :
+       *  Pixel size = Point size * DPI / 72
        * @details name "pixelSize", type float
        */
       PIXEL_SIZE,
@@ -128,7 +131,36 @@ namespace Property
        * @brief The placeholder-text color.
        * @details name "placeholderTextColor", type vector4
        */
-      PLACEHOLDER_TEXT_COLOR
+      PLACEHOLDER_TEXT_COLOR,
+
+      /**
+       * @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color.
+       * @details name "enableSelection", type bool
+       */
+      ENABLE_SELECTION,
+
+      /**
+       * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+       *
+       * @code
+       *   Property::Map propertyMap;
+       *   propertyMap["placeholderText"] = "Setting Placeholder Text";
+       *   propertyMap["placeholderColor"] = Color::RED;
+       *   propertyMap["placeholderFontFamily"] = "Arial";
+       *   propertyMap["placeholderPointSize"] = 12.0f;
+       *
+       *   Property::Map fontStyleMap;
+       *   fontstyleMap.Insert( "weight", "bold" );
+       *   fontstyleMap.Insert( "width", "condensed" );
+       *   fontstyleMap.Insert( "slant", "italic" );
+       *   propertyMap["placeholderFontStyle"] = fontStyleMap;
+       *
+       *   editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, propertyMap );
+       * @endcode
+       *
+       * @details name "placeholder", type MAP
+       */
+      PLACEHOLDER
   };
 } // namespace Property
 
index 21e2d56..b678508 100644 (file)
@@ -92,9 +92,41 @@ namespace Property
 
       /**
        * @brief The size of font in pixels.
+       *
+       * Conversion from Point size to Pixel size :
+       *  Pixel size = Point size * DPI / 72
        * @details name "pixelSize", type float
        */
       PIXEL_SIZE = INPUT_OUTLINE + 2,
+
+      /**
+       * @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color.
+       * @details name "enableSelection", type bool
+       */
+      ENABLE_SELECTION = INPUT_OUTLINE + 3,
+
+      /**
+       * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+       *
+       * @code
+       *   Property::Map propertyMap;
+       *   propertyMap["placeholderText"] = "Setting Placeholder Text";
+       *   propertyMap["placeholderColor"] = Color::RED;
+       *   propertyMap["placeholderFontFamily"] = "Arial";
+       *   propertyMap["placeholderPointSize"] = 12.0f;
+       *
+       *   Property::Map fontStyleMap;
+       *   fontstyleMap.Insert( "weight", "bold" );
+       *   fontstyleMap.Insert( "width", "condensed" );
+       *   fontstyleMap.Insert( "slant", "italic" );
+       *   propertyMap["placeholderFontStyle"] = fontStyleMap;
+       *
+       *   field.SetProperty( DevelTextField::Property::PLACEHOLDER, propertyMap );
+       * @endcode
+       *
+       * @details name "placeholder", type MAP
+       */
+      PLACEHOLDER = INPUT_OUTLINE + 4
   };
 } // namespace Property
 
index 12e9c75..2721dc1 100644 (file)
@@ -61,6 +61,9 @@ namespace Property
 
       /**
        * @brief The size of font in pixels.
+       *
+       * Conversion from Point size to Pixel size :
+       *  Pixel size = Point size * DPI / 72
        * @details name "pixelSize", type float
        */
       PIXEL_SIZE = OUTLINE + 1,
index fe8ef2b..7f4308b 100644 (file)
@@ -27,9 +27,11 @@ devel_api_src_files = \
   $(devel_api_src_dir)/controls/tool-bar/tool-bar.cpp \
   $(devel_api_src_dir)/focus-manager/keyinput-focus-manager.cpp \
   $(devel_api_src_dir)/focus-manager/keyboard-focus-manager-devel.cpp \
+  $(devel_api_src_dir)/image-loader/async-image-loader-devel.cpp \
   $(devel_api_src_dir)/image-loader/atlas-upload-observer.cpp \
   $(devel_api_src_dir)/image-loader/image-atlas.cpp \
   $(devel_api_src_dir)/scripting/script.cpp \
+  $(devel_api_src_dir)/styling/style-manager-devel.cpp \
   $(devel_api_src_dir)/transition-effects/cube-transition-cross-effect.cpp \
   $(devel_api_src_dir)/transition-effects/cube-transition-effect.cpp \
   $(devel_api_src_dir)/transition-effects/cube-transition-fold-effect.cpp \
@@ -112,6 +114,7 @@ devel_api_focus_manager_header_files = \
   $(devel_api_src_dir)/focus-manager/keyboard-focus-manager-devel.h
 
 devel_api_image_loader_header_files = \
+  $(devel_api_src_dir)/image-loader/async-image-loader-devel.h \
   $(devel_api_src_dir)/image-loader/atlas-upload-observer.h \
   $(devel_api_src_dir)/image-loader/image-atlas.h
 
@@ -131,6 +134,9 @@ devel_api_shader_effects_header_files = \
   $(devel_api_src_dir)/shader-effects/motion-blur-effect.h \
   $(devel_api_src_dir)/shader-effects/motion-stretch-effect.h
 
+devel_api_styling_header_files= \
+  $(devel_api_src_dir)/styling/style-manager-devel.h
+
 devel_api_super_blur_view_header_files = \
   $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.h
 
diff --git a/dali-toolkit/devel-api/image-loader/async-image-loader-devel.cpp b/dali-toolkit/devel-api/image-loader/async-image-loader-devel.cpp
new file mode 100644 (file)
index 0000000..690f078
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
+#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace DevelAsyncImageLoader
+{
+
+PixelBufferLoadedSignalType& PixelBufferLoadedSignal( AsyncImageLoader asyncImageLoader )
+{
+  return GetImplementation( asyncImageLoader ).PixelBufferLoadedSignal();
+}
+
+} // Devel
+} // Toolkit
+} // Dali
diff --git a/dali-toolkit/devel-api/image-loader/async-image-loader-devel.h b/dali-toolkit/devel-api/image-loader/async-image-loader-devel.h
new file mode 100644 (file)
index 0000000..2af2be9
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef DALI_TOOLKIT_DEVEL_API_IMAGE_LOADER_ASYNC_IMAGE_LOADER_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_IMAGE_LOADER_ASYNC_IMAGE_LOADER_DEVEL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/public-api/signals/dali-signal.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali-toolkit/public-api/image-loader/async-image-loader.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace DevelAsyncImageLoader
+{
+
+typedef Signal< void ( uint32_t, Devel::PixelBuffer ) > PixelBufferLoadedSignalType;
+
+/**
+ * Connect to this signal if you want to load a PixelBuffer instead of a PixelData.
+ * @note Connecting to this signal prevents the emission of the ImageLoadedSignal.
+ */
+DALI_IMPORT_API PixelBufferLoadedSignalType&  PixelBufferLoadedSignal( AsyncImageLoader asyncImageLoader );
+
+}
+} // Toolkit
+} // Dali
+
+#endif
diff --git a/dali-toolkit/devel-api/styling/style-manager-devel.cpp b/dali-toolkit/devel-api/styling/style-manager-devel.cpp
new file mode 100644 (file)
index 0000000..7ac5a64
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
+#include <dali-toolkit/internal/styling/style-manager-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelStyleManager
+{
+
+const Property::Map GetConfigurations( StyleManager styleManager )
+{
+  return GetImpl(styleManager).GetConfigurations();
+}
+
+} // namespace DevelStyleManager
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/devel-api/styling/style-manager-devel.h b/dali-toolkit/devel-api/styling/style-manager-devel.h
new file mode 100644 (file)
index 0000000..faf3c57
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
+#define DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/styling/style-manager.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelStyleManager
+{
+
+
+/**
+ * @brief Gets all currently defined configurations.
+ *
+ * @pre The Builder has been initialized.
+ * @param[in] styleManager The instance of StyleManager
+ * @return A property map to the currently defined configurations
+**/
+DALI_IMPORT_API const Property::Map GetConfigurations( StyleManager styleManager );
+
+} // namespace DevelStyleManager
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
index e4ef639..4a23ed1 100644 (file)
@@ -179,9 +179,10 @@ void Builder::LoadFromString( std::string const& data, Dali::Toolkit::Builder::U
   }
   else
   {
+    // load configuration map
+    LoadConfiguration( *parser.GetRoot(), mConfigurationMap );
     // load constant map (allows the user to override the constants in the json after loading)
     LoadConstants( *parser.GetRoot(), mReplacementMap );
-
     // merge includes
     if( OptionalChild includes = IsChild(*parser.GetRoot(), KEYNAME_INCLUDES) )
     {
@@ -228,6 +229,11 @@ void Builder::AddConstant( const std::string& key, const Property::Value& value
   mReplacementMap[key] = value;
 }
 
+const Property::Map& Builder::GetConfigurations() const
+{
+  return mConfigurationMap;
+}
+
 const Property::Map& Builder::GetConstants() const
 {
   return mReplacementMap;
@@ -773,6 +779,25 @@ Builder::~Builder()
 {
 }
 
+void Builder::LoadConfiguration( const TreeNode& root, Property::Map& intoMap )
+{
+  Replacement replacer(intoMap);
+
+  if( OptionalChild constants = IsChild(root, "config") )
+  {
+    for(TreeNode::ConstIterator iter = (*constants).CBegin();
+        iter != (*constants).CEnd(); ++iter)
+    {
+      Dali::Property::Value property;
+      if( (*iter).second.GetName() )
+      {
+        DeterminePropertyFromNode( (*iter).second, property, replacer );
+        intoMap[ (*iter).second.GetName() ] = property;
+      }
+    }
+  }
+}
+
 void Builder::LoadConstants( const TreeNode& root, Property::Map& intoMap )
 {
   Replacement replacer(intoMap);
index ea0b635..8a90b03 100644 (file)
@@ -95,6 +95,11 @@ public:
   void AddConstant( const std::string& key, const Property::Value& value );
 
   /**
+   * @copydoc Toolkit::Builder::GetConfigurations
+   */
+  const Property::Map& GetConfigurations() const;
+
+  /**
    * @copydoc Toolkit::Builder::GetConstants
    */
   const Property::Map& GetConstants() const;
@@ -257,6 +262,8 @@ private:
 
   void LoadConstants( const TreeNode& root, Property::Map& intoMap );
 
+  void LoadConfiguration( const TreeNode& root, Property::Map& intoMap );
+
   Animation CreateAnimation( const std::string& animationName,
                              const Replacement& replacement,
                              Dali::Actor        sourceActor );
@@ -384,6 +391,7 @@ private:
   LinearConstrainerLut                mLinearConstrainerLut;
   SlotDelegate<Builder>               mSlotDelegate;
   Property::Map                       mReplacementMap;
+  Property::Map                       mConfigurationMap;
   MappingsLut                         mCompleteMappings;
   Dictionary<StylePtr>                mStyles; // State based styles
   Toolkit::Builder::BuilderSignalType mQuitSignal;
index 81fa035..2469beb 100644 (file)
@@ -151,6 +151,19 @@ Toolkit::Visual::Base GetVisualByName(
 }
 
 /**
+ * Move visual from source to destination container
+ */
+void MoveVisual( RegisteredVisualContainer::Iterator sourceIter, RegisteredVisualContainer& source, RegisteredVisualContainer& destination )
+{
+   Toolkit::Visual::Base visual = (*sourceIter)->visual;
+   if( visual )
+   {
+     RegisteredVisual* rv = source.Release( sourceIter );
+     destination.PushBack( rv );
+   }
+}
+
+/**
  * Performs actions as requested using the action name.
  * @param[in] object The object on which to perform the action.
  * @param[in] actionName The action to perform.
@@ -262,6 +275,24 @@ TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &Do
 
 DALI_TYPE_REGISTRATION_END()
 
+/**
+ * @brief Iterate through given container and setOffStage any visual found
+ *
+ * @param[in] container Container of visuals
+ * @param[in] parent Parent actor to remove visuals from
+ */
+void SetVisualsOffStage( const RegisteredVisualContainer& container, Actor parent )
+{
+  for( auto iter = container.Begin(), end = container.End() ; iter!= end; iter++)
+  {
+    if( (*iter)->visual )
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::SetOffStage Setting visual(%d) off stage\n", (*iter)->index );
+      Toolkit::GetImplementation((*iter)->visual).SetOffStage( parent );
+    }
+  }
+}
+
 } // unnamed namespace
 
 
@@ -341,48 +372,6 @@ void Control::Impl::LongPressDetected(Actor actor, const LongPressGesture& longP
   mControlImpl.OnLongPress(longPress);
 }
 
-// Called by a Visual when it's resource is ready
-void Control::Impl::ResourceReady( Visual::Base& object)
-{
-
-  // go through and check if all the visuals are ready, if they are emit a signal
-  for ( RegisteredVisualContainer::ConstIterator visualIter = mVisuals.Begin();
-        visualIter != mVisuals.End(); ++visualIter )
-  {
-    const Toolkit::Visual::Base visual = (*visualIter)->visual;
-    const Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
-
-    // one of the visuals is not ready
-    if( !visualImpl.IsResourceReady() )
-    {
-      return;
-    }
-  }
-
-  // all the visuals are ready
-  Dali::Toolkit::Control handle( mControlImpl.GetOwner() );
-  mResourceReadySignal.Emit( handle );
-
-}
-
-bool Control::Impl::IsResourceReady() const
-{
-  // go through and check all the visuals are ready
-  for ( RegisteredVisualContainer::ConstIterator visualIter = mVisuals.Begin();
-         visualIter != mVisuals.End(); ++visualIter )
-   {
-     const Toolkit::Visual::Base visual = (*visualIter)->visual;
-     const Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
-
-     // one of the visuals is not ready
-     if( !visualImpl.IsResourceReady()  )
-     {
-       return false;
-     }
-   }
-  return true;
-}
-
 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual )
 {
   RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::NOT_SET );
@@ -405,33 +394,69 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
 
 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "RegisterVisual:%d \n", index );
+
   bool visualReplaced ( false );
   Actor self = mControlImpl.Self();
 
+  // Set the depth index, if not set by caller this will be either the current visual depth, max depth of all visuals
+  // or zero.
+  int requiredDepthIndex = visual.GetDepthIndex();
+
+  if( depthIndexValueSet == DepthIndexValue::SET )
+  {
+    requiredDepthIndex = depthIndex;
+  }
+
+  // Visual replacement, existing visual should only be removed from stage when replacement ready.
   if( !mVisuals.Empty() )
   {
-    RegisteredVisualContainer::Iterator iter;
-    // Check if visual (index) is already registered.  Replace if so.
-    if ( FindVisual( index, mVisuals, iter ) )
+    RegisteredVisualContainer::Iterator registeredVisualsiter;
+    // Check if visual (index) is already registered, this is the current visual.
+    if( FindVisual( index, mVisuals, registeredVisualsiter ) )
     {
-      if( (*iter)->visual && self.OnStage() )
+      Toolkit::Visual::Base& currentRegisteredVisual = (*registeredVisualsiter)->visual;
+      if( currentRegisteredVisual )
       {
-        Toolkit::GetImplementation((*iter)->visual).SetOffStage( self );
-      }
+        // Store current visual depth index as may need to set the replacement visual to same depth
+        const int currentDepthIndex = (*registeredVisualsiter)->visual.GetDepthIndex();
 
-      // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
-      if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
-          ( visual.GetDepthIndex() == 0 ) )
-      {
-        const int currentDepthIndex = (*iter)->visual.GetDepthIndex();
-        visual.SetDepthIndex( currentDepthIndex );
-      }
+        // No longer required to know if the replaced visual's resources are ready
+        StopObservingVisual( currentRegisteredVisual );
+
+        // If control staged and visual enabled then visuals will be swapped once ready
+        if(  self.OnStage() && enabled )
+        {
+          // Check if visual is currently in the process of being replaced ( is in removal container )
+          RegisteredVisualContainer::Iterator visualQueuedForRemoval;
+          if ( FindVisual( index, mRemoveVisuals, visualQueuedForRemoval ) )
+          {
+            // Visual with same index is already in removal container so current visual pending
+            // Only the the last requested visual will be displayed so remove current visual which is staged but not ready.
+            Toolkit::GetImplementation( currentRegisteredVisual ).SetOffStage( self );
+            mVisuals.Erase( registeredVisualsiter );
+          }
+          else
+          {
+            // current visual not already in removal container so add now.
+            DALI_LOG_INFO( gLogFilter, Debug::Verbose, "RegisterVisual Move current registered visual to removal Queue: %d \n", index );
+            MoveVisual( registeredVisualsiter, mVisuals, mRemoveVisuals );
+          }
+        }
+        else
+        {
+          // Control not staged or visual disabled so can just erase from registered visuals and new visual will be added later.
+          mVisuals.Erase( registeredVisualsiter );
+        }
 
-      StopObservingVisual( (*iter)->visual );
-      StartObservingVisual( visual );
+        // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
+        if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
+            ( visual.GetDepthIndex() == 0 ) )
+        {
+          requiredDepthIndex = currentDepthIndex;
+        }
+      }
 
-      (*iter)->visual = visual;
-      (*iter)->enabled = ( enabled == VisualState::ENABLED ) ? true : false;
       visualReplaced = true;
     }
   }
@@ -458,14 +483,12 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
 
   if( !visualReplaced ) // New registration entry
   {
-    mVisuals.PushBack( new RegisteredVisual( index, visual, ( enabled == VisualState::ENABLED ? true : false ) ) );
-
-    // monitor when the visuals resources are ready
+    // monitor when the visual resources are ready
     StartObservingVisual( visual );
 
     // If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest
     if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
-        ( mVisuals.Size() > 1 ) &&
+        ( mVisuals.Size() > 0 ) &&
         ( visual.GetDepthIndex() == 0 ) )
     {
       int maxDepthIndex = std::numeric_limits< int >::min();
@@ -480,28 +503,34 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
           maxDepthIndex = visualDepthIndex;
         }
       }
-
       ++maxDepthIndex; // Add one to the current maximum depth index so that our added visual appears on top
-      visual.SetDepthIndex( maxDepthIndex );
+      requiredDepthIndex = std::max( 0, maxDepthIndex ); // Start at zero if maxDepth index belongs to a background
     }
   }
 
   if( visual )
   {
-    // If the caller has set the depth-index, then set it here
-    if( depthIndexValueSet == DepthIndexValue::SET )
-    {
-      visual.SetDepthIndex( depthIndex );
-    }
+    // Set determined depth index
+    visual.SetDepthIndex( requiredDepthIndex );
+
+    // Monitor when the visual resources are ready
+    StartObservingVisual( visual );
+
+    DALI_LOG_INFO( gLogFilter, Debug::Concise, "New Visual registration index[%d] depth[%d]\n", index, requiredDepthIndex );
+    RegisteredVisual* newRegisteredVisual  = new RegisteredVisual( index, visual,
+                                             ( enabled == VisualState::ENABLED ? true : false ),
+                                             ( visualReplaced && enabled ) ) ;
+    mVisuals.PushBack( newRegisteredVisual );
 
     // Put on stage if enabled and the control is already on the stage
+    // Visual must be set on stage for the renderer to be created and the ResourceReady triggered.
     if( ( enabled == VisualState::ENABLED ) && self.OnStage() )
     {
       Toolkit::GetImplementation(visual).SetOnStage( self );
     }
   }
 
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n",  visual.GetName().c_str(), index, enabled?"T":"F" );
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n",  visual.GetName().c_str(), index, enabled?"true":"false" );
 }
 
 void Control::Impl::UnregisterVisual( Property::Index index )
@@ -532,6 +561,8 @@ Toolkit::Visual::Base Control::Impl::GetVisual( Property::Index index ) const
 
 void Control::Impl::EnableVisual( Property::Index index, bool enable )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Visual (%d)\n", index);
+
   RegisteredVisualContainer::Iterator iter;
   if ( FindVisual( index, mVisuals, iter ) )
   {
@@ -585,6 +616,65 @@ void Control::Impl::StartObservingVisual( Toolkit::Visual::Base& visual)
   visualImpl.AddResourceObserver( *this );
 }
 
+// Called by a Visual when it's resource is ready
+void Control::Impl::ResourceReady( Visual::Base& object)
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceReady replacements pending[%d]\n", mRemoveVisuals.Count() );
+
+  Actor self = mControlImpl.Self();
+
+  // A resource is ready, find resource in the registered visuals container and get its index
+  for( auto registeredIter = mVisuals.Begin(),  end = mVisuals.End(); registeredIter != end; ++registeredIter )
+  {
+    Internal::Visual::Base& registeredVisualImpl = Toolkit::GetImplementation( (*registeredIter)->visual );
+
+    if( &object == &registeredVisualImpl )
+    {
+      RegisteredVisualContainer::Iterator visualToRemoveIter;
+      // Find visual with the same index in the removal container
+      // Set if off stage as it's replacement is now ready.
+      // Remove if from removal list as now removed from stage.
+      // Set Pending flag on the ready visual to false as now ready.
+      if( FindVisual( (*registeredIter)->index, mRemoveVisuals, visualToRemoveIter ) )
+      {
+        (*registeredIter)->pending = false;
+        Toolkit::GetImplementation( (*visualToRemoveIter)->visual ).SetOffStage( self );
+        mRemoveVisuals.Erase( visualToRemoveIter );
+      }
+      break;
+    }
+  }
+
+  // A visual is ready so control may need relayouting
+  mControlImpl.RelayoutRequest();
+
+  // Emit signal if all enabled visuals registered by the control are ready.
+  if( IsResourceReady() )
+  {
+    Dali::Toolkit::Control handle( mControlImpl.GetOwner() );
+    mResourceReadySignal.Emit( handle );
+  }
+}
+
+bool Control::Impl::IsResourceReady() const
+{
+  // Iterate through and check all the enabled visuals are ready
+  for( auto visualIter = mVisuals.Begin();
+         visualIter != mVisuals.End(); ++visualIter )
+  {
+    const Toolkit::Visual::Base visual = (*visualIter)->visual;
+    const Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
+
+    // one of the enabled visuals is not ready
+    if( !visualImpl.IsResourceReady() && (*visualIter)->enabled )
+    {
+      return false;
+    }
+  }
+  return true;
+}
+
+
 Dali::Animation Control::Impl::CreateTransition( const Toolkit::TransitionData& handle )
 {
   Dali::Animation transition;
@@ -1182,6 +1272,32 @@ void Control::Impl::SetSubState( const std::string& subStateName, bool withTrans
   }
 }
 
+void Control::Impl::OnStageDisconnection()
+{
+  Actor self = mControlImpl.Self();
+
+  // Any visuals set for replacement but not yet ready should still be registered.
+  // Reason: If a request was made to register a new visual but the control removed from stage before visual was ready
+  // then when this control appears back on stage it should use that new visual.
+
+  // Iterate through all registered visuals and set off stage
+  SetVisualsOffStage( mVisuals, self );
+
+  // Visuals pending replacement can now be taken out of the removal list and set off stage
+  // Iterate through all replacement visuals and add to a move queue then set off stage
+  for( auto removalIter = mRemoveVisuals.Begin(), end = mRemoveVisuals.End(); removalIter != end; removalIter++ )
+  {
+    Toolkit::GetImplementation((*removalIter)->visual).SetOffStage( self );
+  }
+
+  for( auto replacedIter = mVisuals.Begin(), end = mVisuals.End(); replacedIter != end; replacedIter++ )
+  {
+    (*replacedIter)->pending = false;
+  }
+
+  mRemoveVisuals.Clear();
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index eceaa31..73c4626 100644 (file)
@@ -41,20 +41,21 @@ namespace Toolkit
 namespace Internal
 {
 
-/**
+ /**
   * Struct used to store Visual within the control, index is a unique key for each visual.
   */
- struct RegisteredVisual
- {
-   Property::Index index;
-   Toolkit::Visual::Base visual;
-   bool enabled;
-
-   RegisteredVisual( Property::Index aIndex, Toolkit::Visual::Base &aVisual, bool aEnabled)
-   : index(aIndex), visual(aVisual), enabled(aEnabled)
-   {
-   }
- };
+struct RegisteredVisual
+{
+  Property::Index index;
+  Toolkit::Visual::Base visual;
+  bool enabled : 1;
+  bool pending : 1;
+
+  RegisteredVisual( Property::Index aIndex, Toolkit::Visual::Base &aVisual, bool aEnabled, bool aPendingReplacement )
+  : index(aIndex), visual(aVisual), enabled(aEnabled), pending( aPendingReplacement )
+  {
+  }
+};
 
 typedef Dali::OwnerContainer< RegisteredVisual* > RegisteredVisualContainer;
 
@@ -259,6 +260,11 @@ public:
    */
   bool IsResourceReady() const;
 
+  /**
+   * @copydoc CustomActorImpl::OnStageDisconnection()
+   */
+  void OnStageDisconnection();
+
 private:
 
   /**
@@ -288,10 +294,13 @@ private:
   /**
    * @brief Adds the visual to the list of registered visuals.
    * @param[in] index The Property index of the visual, used to reference visual
-   * @param[in] visual The visual to register
+   * @param[in,out] visual The visual to register, which can be altered in this function
    * @param[in] enabled false if derived class wants to control when visual is set on stage
    * @param[in] depthIndexValueSet Set to true if the depthIndex has actually been set manually
    * @param[in] depthIndex The visual's depth-index is set to this
+   *
+   * @note Registering a visual with an index that already has a registered visual will replace it. The replacement will
+   *       occur once the replacement visual is ready (loaded).
    */
   void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex = 0 );
 
@@ -329,6 +338,8 @@ public:
   bool mIsKeyboardNavigationSupported :1;  ///< Stores whether keyboard navigation is supported by the control.
   bool mIsKeyboardFocusGroup :1;           ///< Stores whether the control is a focus group.
 
+  RegisteredVisualContainer mRemoveVisuals;         ///< List of visuals that are being replaced by another visual once ready
+
   // Properties - these need to be members of Internal::Control::Impl as they access private methods/data of Internal::Control and Internal::Control::Impl.
   static const PropertyRegistration PROPERTY_1;
   static const PropertyRegistration PROPERTY_2;
index 65e043e..4183b89 100644 (file)
@@ -87,6 +87,13 @@ Toolkit::ImageView ImageView::New()
 
 /////////////////////////////////////////////////////////////
 
+void ImageView::OnInitialize()
+{
+  // ImageView can relayout in the OnImageReady, alternative to a signal would be to have a upcall from the Control to ImageView
+  Dali::Toolkit::Control handle( GetOwner() );
+  Toolkit::DevelControl::ResourceReadySignal( handle ).Connect( this, &ImageView::OnResourceReady );
+}
+
 void ImageView::SetImage( Image image )
 {
   // Don't bother comparing if we had a visual previously, just drop old visual and create new one
@@ -94,10 +101,13 @@ void ImageView::SetImage( Image image )
   mUrl.clear();
   mPropertyMap.Clear();
 
-  mVisual =  Toolkit::VisualFactory::Get().CreateVisual( image );
-  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual  );
+  Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( image );
+  if (!mVisual)
+  {
+    mVisual = visual;
+  }
 
-  RelayoutRequest();
+  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual  );
 }
 
 void ImageView::SetImage( const Property::Map& map )
@@ -106,11 +116,14 @@ void ImageView::SetImage( const Property::Map& map )
   mPropertyMap = map;
   mUrl.clear();
   mImage.Reset();
+  Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
+  // Don't set mVisual until it is ready and shown. Getters will still use current visual.
+  if (!mVisual)
+  {
+    mVisual = visual;
+  }
 
-  mVisual =  Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
-  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual  );
-
-  RelayoutRequest();
+  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual  );
 }
 
 void ImageView::SetImage( const std::string& url, ImageDimensions size )
@@ -120,10 +133,14 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
   mImage.Reset();
   mPropertyMap.Clear();
 
-  mVisual =  Toolkit::VisualFactory::Get().CreateVisual( url, size );
-  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual );
+  // Don't set mVisual until it is ready and shown. Getters will still use current visual.
+  Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( url, size );
+  if (!mVisual)
+  {
+    mVisual = visual;
+  }
 
-  RelayoutRequest();
+  DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual );
 }
 
 Image ImageView::GetImage() const
@@ -197,6 +214,9 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   Control::OnRelayout( size, container );
 
+  // If visual is being replaced then mVisual will be the replacement visual even if not ready.
+  mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+
   if( mVisual )
   {
     // Pass in an empty map which uses default transform values meaning our visual fills the control
@@ -205,6 +225,10 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
   }
 }
 
+void ImageView::OnResourceReady( Toolkit::Control control )
+{
+}
+
 ///////////////////////////////////////////////////////////
 //
 // Properties
index ac76e78..f335ce7 100644 (file)
@@ -123,6 +123,11 @@ public:
 private: // From Control
 
   /**
+   * @copydoc Toolkit::Control::OnInitialize
+   */
+  void OnInitialize();
+
+  /**
    * @copydoc Toolkit::Control::GetNaturalSize
    */
   virtual Vector3 GetNaturalSize();
@@ -143,6 +148,14 @@ private: // From Control
   virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
 private:
+
+  /**
+   * @brief Callback for ResourceReadySignal
+   * param[in] control signal prototype
+   */
+  void OnResourceReady( Toolkit::Control control );
+
+private:
   // Undefined
   ImageView( const ImageView& );
   ImageView& operator=( const ImageView& );
index 9c22982..3830f62 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/adaptor-framework/file-loader.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/model3d-view/obj-loader.h>
@@ -60,12 +60,11 @@ enum TextureIndex
 Texture LoadTexture( const char* imageUrl )
 {
   Texture texture;
-  Dali::BitmapLoader loader = Dali::BitmapLoader::New( imageUrl );
-  loader.Load();
-  PixelData pixelData = loader.GetPixelData();
-  if( pixelData )
+  Devel::PixelBuffer pixelBuffer = LoadImageFromFile( imageUrl );
+  if( pixelBuffer )
   {
-    texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+    texture = Texture::New( TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
+    PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
     texture.Upload( pixelData );
     texture.GenerateMipmaps();
   }
index 6717bab..fca57b4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -364,7 +364,7 @@ bool ObjLoader::LoadObject( char* objBuffer, std::streampos fileSize )
 
   std::string strMatActual;
 
-  std::string input = objBuffer;
+  std::string input( objBuffer, fileSize );
   std::istringstream ss(input);
   ss.imbue( std::locale( "C" ) );
 
@@ -442,7 +442,7 @@ bool ObjLoader::LoadObject( char* objBuffer, std::streampos fileSize )
       }
 
       int numIndices = 0;
-      while( isline >> vet[numIndices] && numIndices < MAX_POINT_INDICES )
+      while( ( numIndices < MAX_POINT_INDICES ) && ( isline >> vet[numIndices] ) )
       {
         numIndices++;
       }
@@ -566,7 +566,7 @@ void ObjLoader::LoadMaterial( char* objBuffer, std::streampos fileSize, std::str
 
   std::string info;
 
-  std::string input = objBuffer;
+  std::string input( objBuffer, fileSize );
   std::istringstream ss(input);
   ss.imbue(std::locale("C"));
 
index 7374138..c7dd2e4 100644 (file)
@@ -919,7 +919,6 @@ Toolkit::Control Popup::CreateBacking()
 
   // Must always be positioned top-left of stage, regardless of parent.
   backing.SetInheritPosition(false);
-  backing.SetAnchorPoint( AnchorPoint::TOP_LEFT );
 
   // Always the full size of the stage.
   backing.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
index fb97a76..1e4d168 100644 (file)
@@ -139,6 +139,8 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "pixelSize",
 DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "lineCount",            INTEGER,   LINE_COUNT                           )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText",                STRING,    PLACEHOLDER_TEXT                     )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderTextColor",           VECTOR4,   PLACEHOLDER_TEXT_COLOR               )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableSelection",                BOOLEAN,   ENABLE_SELECTION                     )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholder",                    MAP,       PLACEHOLDER                          )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED )
@@ -691,6 +693,25 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::ENABLE_SELECTION:
+      {
+        if( impl.mController )
+        {
+          const bool enableSelection = value.Get< bool >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p ENABLE_SELECTION %d\n", impl.mController.Get(), enableSelection );
+          impl.mController->SetSelectionEnabled( enableSelection );
+        }
+        break;
+      }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+      {
+        const Property::Map* map = value.GetMap();
+        if( map )
+        {
+          impl.mController->SetPlaceholderProperty( *map );
+        }
+        break;
+      }
     } // switch
   } // texteditor
 }
@@ -1052,6 +1073,21 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::ENABLE_SELECTION:
+      {
+        if( impl.mController )
+        {
+          value = impl.mController->IsSelectionEnabled();
+        }
+        break;
+      }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+      {
+        Property::Map map;
+        impl.mController->GetPlaceholderProperty( map );
+        value = map;
+        break;
+      }
     } //switch
   }
 
@@ -1157,8 +1193,8 @@ void TextEditor::OnInitialize()
 
   // Creates an extra control to be used as stencil buffer.
   mStencil = Control::New();
-  mStencil.SetAnchorPoint( AnchorPoint::CENTER );
-  mStencil.SetParentOrigin( ParentOrigin::CENTER );
+  mStencil.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mStencil.SetParentOrigin( ParentOrigin::TOP_LEFT );
 
   // Creates a background visual. Even if the color is transparent it updates the stencil.
   mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND,
@@ -1212,14 +1248,32 @@ Vector3 TextEditor::GetNaturalSize()
 
 float TextEditor::GetHeightForWidth( float width )
 {
-  return mController->GetHeightForWidth( width );
+  Padding padding;
+  Self().GetPadding( padding );
+  return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
 }
 
 void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor OnRelayout\n");
 
-  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
+  Actor self = Self();
+  Padding padding;
+
+  self.GetPadding( padding );
+  Vector2 contentSize( size.x - ( padding.left + padding.right ), size.y - ( padding.top + padding.bottom ) );
+
+  if( mStencil )
+  {
+    mStencil.SetPosition( padding.left , padding.top  );
+  }
+  if( mActiveLayer )
+  {
+    mActiveLayer.SetPosition( padding.left , padding.top  );
+  }
+
+
+  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize );
 
   if( ( Text::Controller::NONE_UPDATED != updateTextType ) ||
       !mRenderer )
@@ -1238,6 +1292,7 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
     }
 
     RenderText( updateTextType );
+
   }
 
   // The text-editor emits signals when the input style changes. These changes of style are
@@ -1361,7 +1416,9 @@ void TextEditor::OnTap( const TapGesture& gesture )
   mImfManager.Activate();
 
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
-  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y );
+  Padding padding;
+  Self().GetPadding( padding );
+  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
@@ -1375,7 +1432,9 @@ void TextEditor::OnLongPress( const LongPressGesture& gesture )
 {
   mImfManager.Activate();
 
-  mController->LongPressEvent( gesture.state, gesture.localPoint.x, gesture.localPoint.y );
+  Padding padding;
+  Self().GetPadding( padding );
+  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
@@ -1478,7 +1537,10 @@ void TextEditor::AddDecoration( Actor& actor, bool needsClipping )
     }
     else
     {
+      actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+      actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       Self().Add( actor );
+      mActiveLayer = actor;
     }
   }
 }
index 3c2cec4..6fbced9 100644 (file)
@@ -296,6 +296,7 @@ private: // Data
   std::vector<Actor> mClippingDecorationActors;   ///< Decoration actors which need clipping.
 
   Actor mRenderableActor;
+  Actor mActiveLayer;
   CallbackBase* mIdleCallback;
 
   float mAlignmentOffset;
index 6083974..d392b92 100644 (file)
@@ -140,6 +140,8 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "outline",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputOutline",                         MAP,       INPUT_OUTLINE                        )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "hiddenInputSettings",            MAP,       HIDDEN_INPUT_SETTINGS                )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "pixelSize",                      FLOAT,     PIXEL_SIZE                           )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableSelection",                BOOLEAN,   ENABLE_SELECTION                     )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder",                    MAP,       PLACEHOLDER                          )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached",   SIGNAL_MAX_LENGTH_REACHED )
@@ -751,6 +753,25 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::DevelTextField::Property::ENABLE_SELECTION:
+      {
+        if( impl.mController )
+        {
+          const bool enableSelection = value.Get< bool >();
+           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p ENABLE_SELECTION %d\n", impl.mController.Get(), enableSelection );
+          impl.mController->SetSelectionEnabled( enableSelection );
+        }
+        break;
+      }
+      case Toolkit::DevelTextField::Property::PLACEHOLDER:
+      {
+        const Property::Map* map = value.GetMap();
+        if( map )
+        {
+          impl.mController->SetPlaceholderProperty( *map );
+        }
+        break;
+      }
     } // switch
   } // textfield
 }
@@ -1129,6 +1150,21 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
+      case Toolkit::DevelTextField::Property::ENABLE_SELECTION:
+      {
+        if( impl.mController )
+        {
+          value = impl.mController->IsSelectionEnabled();
+        }
+        break;
+      }
+      case Toolkit::DevelTextField::Property::PLACEHOLDER:
+      {
+        Property::Map map;
+        impl.mController->GetPlaceholderProperty( map );
+        value = map;
+        break;
+      }
     } //switch
   }
 
@@ -1280,14 +1316,31 @@ Vector3 TextField::GetNaturalSize()
 
 float TextField::GetHeightForWidth( float width )
 {
-  return mController->GetHeightForWidth( width );
+  Padding padding;
+  Self().GetPadding( padding );
+  return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
 }
 
 void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField OnRelayout\n");
 
-  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
+  Actor self = Self();
+  Padding padding;
+
+  self.GetPadding( padding );
+  Vector2 contentSize( size.x - ( padding.left + padding.right ), size.y - ( padding.top + padding.bottom ) );
+
+  if( mStencil )
+  {
+    mStencil.SetPosition( padding.left , padding.top  );
+  }
+  if( mActiveLayer )
+  {
+    mActiveLayer.SetPosition( padding.left , padding.top  );
+  }
+
+  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize );
 
   if( ( Text::Controller::NONE_UPDATED != updateTextType ) ||
       !mRenderer )
@@ -1306,6 +1359,7 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
     }
 
     RenderText( updateTextType );
+
   }
 
   // The text-field emits signals when the input style changes. These changes of style are
@@ -1352,7 +1406,17 @@ void TextField::RenderText( Text::Controller::UpdateTextType updateTextType )
   {
     const Vector2& scrollOffset = mController->GetTextModel()->GetScrollPosition();
 
-    mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset, scrollOffset.y );
+    if( mStencil )
+    {
+       mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset, scrollOffset.y );
+    }
+    else
+    {
+       Padding padding;
+       Self().GetPadding( padding );
+       mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset + padding.left, scrollOffset.y + padding.top );
+    }
+
 
     // Make sure the actors are parented correctly with/without clipping
     Actor self = mStencil ? mStencil : Self();
@@ -1431,7 +1495,9 @@ void TextField::OnTap( const TapGesture& gesture )
   mImfManager.Activate();
 
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
-  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y );
+  Padding padding;
+  Self().GetPadding( padding );
+  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
@@ -1445,7 +1511,9 @@ void TextField::OnLongPress( const LongPressGesture& gesture )
 {
   mImfManager.Activate();
 
-  mController->LongPressEvent( gesture.state, gesture.localPoint.x, gesture.localPoint.y );
+  Padding padding;
+  Self().GetPadding( padding );
+  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
@@ -1545,7 +1613,10 @@ void TextField::AddDecoration( Actor& actor, bool needsClipping )
     }
     else
     {
+      actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+      actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       Self().Add( actor );
+      mActiveLayer = actor;
     }
   }
 }
@@ -1589,8 +1660,8 @@ void TextField::EnableClipping()
   {
     // Creates an extra control to be used as stencil buffer.
     mStencil = Control::New();
-    mStencil.SetAnchorPoint( AnchorPoint::CENTER );
-    mStencil.SetParentOrigin( ParentOrigin::CENTER );
+    mStencil.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mStencil.SetParentOrigin( ParentOrigin::TOP_LEFT );
 
     // Creates a background visual. Even if the color is transparent it updates the stencil.
     mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND,
index 0b7b629..b8f49ee 100644 (file)
@@ -274,6 +274,7 @@ private: // Data
   Dali::InputMethodOptions mInputMethodOptions;
 
   Actor mRenderableActor;
+  Actor mActiveLayer;
   CallbackBase* mIdleCallback;
 
   float mAlignmentOffset;
index 5f17f00..784a5c8 100644 (file)
@@ -814,14 +814,21 @@ Vector3 TextLabel::GetNaturalSize()
 
 float TextLabel::GetHeightForWidth( float width )
 {
-  return mController->GetHeightForWidth( width );
+  Padding padding;
+  Self().GetPadding( padding );
+  return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
 }
 
 void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnRelayout\n" );
 
-  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
+  Padding padding;
+  Self().GetPadding( padding );
+  Vector2 contentSize( size.x - ( padding.left + padding.right ), size.y - ( padding.top + padding.bottom ) );
+
+
+  const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize );
 
   if( ( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) ) ||
       !mRenderer )
@@ -861,7 +868,9 @@ void TextLabel::RenderText()
     if( renderableActor )
     {
       const Vector2& scrollOffset = mController->GetTextModel()->GetScrollPosition();
-      renderableActor.SetPosition( scrollOffset.x + alignmentOffset, scrollOffset.y );
+      Padding padding;
+      self.GetPadding( padding );
+      renderableActor.SetPosition( scrollOffset.x + alignmentOffset + padding.left, scrollOffset.y + padding.top );
 
       self.Add( renderableActor );
     }
index 1fd4be5..b09de6b 100644 (file)
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/animation/constraint.h>
+#include <dali/devel-api/actors/actor-devel.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 
 namespace Dali
 {
@@ -71,20 +79,72 @@ const char* const RENDERING_TARGET( "renderingTarget" );
 const char* const WINDOW_SURFACE_TARGET( "windowSurfaceTarget" );
 const char* const NATIVE_IMAGE_TARGET( "nativeImageTarget" );
 
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+    vertexPosition.xyz *= uSize;\n
+    gl_Position = uMvpMatrix * vertexPosition;\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  uniform lowp vec4 uColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
+  \n
+  void main()\n
+  {\n
+    gl_FragColor = vec4(mixColor, opacity)*uColor;\n
+  }\n
+);
+
+struct TriggerFunctor
+{
+  TriggerFunctor( TriggerEventInterface* notification )
+  : mNotification( notification )
+  {
+  }
+
+  void operator()( bool& current, const PropertyInputContainer& inputs )
+  {
+    if( mNotification != NULL )
+    {
+      mNotification->Trigger();
+    }
+  }
+
+  TriggerEventInterface* mNotification;
+};
+
 } // anonymous namepsace
 
 VideoView::VideoView()
 : Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
+  mUpdateTriggerPropertyIndex( Property::INVALID_INDEX),
+  mNotification( NULL ),
   mCurrentVideoPlayPosition( 0 ),
   mIsNativeImageTarget( true ),
   mIsPlay( false ),
   mIsPause( false )
 {
   mVideoPlayer = Dali::VideoPlayer::New();
+
+  TriggerEventFactory triggerEventFactory;
+  mNotification = triggerEventFactory.CreateTriggerEvent( MakeCallback(this, &VideoView::UpdateDisplayArea ),
+                                                               TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
 }
 
 VideoView::~VideoView()
 {
+  if( mNotification != NULL )
+  {
+    delete mNotification;
+  }
 }
 
 Toolkit::VideoView VideoView::New()
@@ -105,6 +165,8 @@ void VideoView::OnInitialize()
 
   mVideoPlayer.SetRenderingTarget( nativeImageSourcePtr );
   mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
+
+  mUpdateTriggerPropertyIndex = Self().RegisterProperty( "updateTrigger", true );
 }
 
 void VideoView::SetUrl( const std::string& url )
@@ -151,6 +213,18 @@ void VideoView::SetPropertyMap( Property::Map map )
     }
   }
 
+  Property::Value* target = map.Find( RENDERING_TARGET );
+  std::string targetType;
+
+  if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET )
+  {
+    this->SetWindowSurfaceTarget();
+  }
+  else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET )
+  {
+    this->SetNativeImageTarget();
+  }
+
   RelayoutRequest();
 }
 
@@ -327,25 +401,33 @@ void VideoView::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::VideoView::Property::VIDEO:
       {
         std::string videoUrl;
+        Property::Map map;
+
         if( value.Get( videoUrl ) )
         {
           impl.SetUrl( videoUrl );
         }
-
-        Property::Map map;
-        if( value.Get( map ) )
+        else if( value.Get( map ) )
         {
-          impl.SetPropertyMap( map );
+          Property::Value* shaderValue = map.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
 
-          Property::Value* target = map.Find( RENDERING_TARGET );
-          std::string targetType;
-          if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET )
+          if( map.Count() > 1u || !shaderValue )
           {
-            impl.SetWindowSurfaceTarget();
+            impl.SetPropertyMap( map );
           }
-          else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET )
+          else if( impl.mVisual && map.Count() == 1u && shaderValue )
           {
-            impl.SetNativeImageTarget();
+            Property::Map shaderMap;
+            if( shaderValue->Get( shaderMap ) )
+            {
+              Internal::Visual::Base& visual = Toolkit::GetImplementation( impl.mVisual );
+              visual.SetCustomShader( shaderMap );
+              if( videoView.OnStage() )
+              {
+                visual.SetOffStage( videoView );
+                visual.SetOnStage( videoView );
+              }
+            }
           }
         }
         break;
@@ -519,6 +601,11 @@ void VideoView::SetWindowSurfaceTarget()
     mVisual.Reset();
   }
 
+  Constraint constraint = Constraint::New<bool>( self, mUpdateTriggerPropertyIndex, TriggerFunctor( mNotification ) );
+  constraint.AddSource( Source( self, Actor::Property::POSITION ) );
+  constraint.AddSource( Source( self, Actor::Property::SIZE ) );
+  constraint.Apply();
+
   mVideoPlayer.SetRenderingTarget( Dali::Adaptor::Get().GetNativeWindowHandle() );
   mVideoPlayer.SetUrl( mUrl );
 
@@ -534,6 +621,18 @@ void VideoView::SetWindowSurfaceTarget()
     mVideoPlayer.Pause();
   }
   mVideoPlayer.SetPlayPosition( curPos );
+
+  // For underlay rendering mode, video display area have to be transparent.
+  Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
+  Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+  Renderer renderer = Renderer::New( geometry, shader );
+
+  renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::ZERO );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA, BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ZERO );
+  self.AddRenderer( renderer );
 }
 
 void VideoView::SetNativeImageTarget()
@@ -564,8 +663,26 @@ void VideoView::SetNativeImageTarget()
   mVideoPlayer.SetPlayPosition( curPos );
 }
 
+void VideoView::UpdateDisplayArea()
+{
+  Actor self( Self() );
+
+  bool positionUsesAnchorPoint = self.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >();
+  Vector3 actorSize = self.GetCurrentSize() * self.GetCurrentScale();
+  Vector3 anchorPointOffSet = actorSize * ( positionUsesAnchorPoint ? self.GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
+
+  Vector2 screenPosition = self.GetProperty( DevelActor::Property::SCREEN_POSITION ).Get< Vector2 >();
+
+  mDisplayArea.x = screenPosition.x - anchorPointOffSet.x;
+  mDisplayArea.y = screenPosition.y - anchorPointOffSet.y;
+  mDisplayArea.width = actorSize.x;
+  mDisplayArea.height = actorSize.y;
+
+  mVideoPlayer.SetDisplayArea( mDisplayArea );
+}
+
 } // namespace Internal
 
-} // namespace Toolkit
+} // namespace toolkit
 
 } // namespace Dali
index a662802..130d2c2 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/images/native-image.h>
 #include <dali/devel-api/adaptor-framework/video-player.h>
+#include <dali/integration-api/adaptors/trigger-event-factory.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/image/image-visual.h>
@@ -195,8 +196,22 @@ public:
    */
   static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes );
 
+  /**
+   * Connects a callback function with the object's signals.
+   * @param[in] object The object providing the signal.
+   * @param[in] tracker Used to disconnect the signal.
+   * @param[in] signalName The signal to connect to.
+   * @param[in] functor A newly allocated FunctorDelegate.
+   * @return True if the signal was connected.
+   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the c
+   */
   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
 
+  /*
+   * @brief Updates video display area for window rendering target
+   */
+  void UpdateDisplayArea();
+
 private: // From Control
 
   /**
@@ -249,6 +264,11 @@ private:
   Dali::NativeImage mNativeImage; ///< Native image handle for video rendering by texture streaming
   Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal;
   std::string mUrl;
+  Dali::DisplayArea mDisplayArea;
+
+  Property::Index mUpdateTriggerPropertyIndex;
+  TriggerEventInterface* mNotification;
+
   int mCurrentVideoPlayPosition;
   bool mIsNativeImageTarget;
   bool mIsPlay;
index 15e5366..5225c46 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/object/property-map.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/integration-api/debug.h>
 
@@ -38,6 +39,8 @@
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
 
 namespace Dali
 {
@@ -116,8 +119,8 @@ KeyboardFocusManager::KeyboardFocusManager()
   mFocusedActorEnterKeySignal(),
   mCurrentFocusActor(),
   mFocusIndicatorActor(),
+  mIsFocusIndicatorEnabled( -1 ),
   mFocusGroupLoopEnabled( false ),
-  mIsFocusIndicatorEnabled( false ),
   mIsWaitingKeyboardFocusChangeCommit( false ),
   mFocusHistory(),
   mSlotDelegate( this ),
@@ -132,10 +135,25 @@ KeyboardFocusManager::~KeyboardFocusManager()
 {
 }
 
+void KeyboardFocusManager::GetConfigurationFromStyleManger()
+{
+    Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+    if( styleManager )
+    {
+      Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
+      mIsFocusIndicatorEnabled = static_cast<int>(config["alwaysShowFocus"].Get<bool>());
+    }
+}
+
 bool KeyboardFocusManager::SetCurrentFocusActor( Actor actor )
 {
   DALI_ASSERT_DEBUG( !mIsWaitingKeyboardFocusChangeCommit && "Calling this function in the PreFocusChangeSignal callback?" );
 
+  if( mIsFocusIndicatorEnabled == -1 )
+  {
+    GetConfigurationFromStyleManger();
+  }
+
   return DoSetCurrentFocusActor( actor );
 }
 
@@ -523,7 +541,7 @@ void KeyboardFocusManager::ClearFocus()
   }
 
   mCurrentFocusActor.Reset();
-  mIsFocusIndicatorEnabled = false;
+  mIsFocusIndicatorEnabled = 0;
 }
 
 void KeyboardFocusManager::SetFocusGroupLoop(bool enabled)
@@ -623,6 +641,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
 
   std::string keyName = event.keyPressedName;
 
+  if( mIsFocusIndicatorEnabled == -1 )
+  {
+    GetConfigurationFromStyleManger();
+  }
+
   bool isFocusStartableKey = false;
 
   if(event.state == KeyEvent::Down)
@@ -634,7 +657,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         if(!mIsFocusIndicatorEnabled)
         {
           // Show focus indicator
-          mIsFocusIndicatorEnabled = true;
+          mIsFocusIndicatorEnabled = 1;
         }
         else
         {
@@ -657,7 +680,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         if(!mIsFocusIndicatorEnabled)
         {
           // Show focus indicator
-          mIsFocusIndicatorEnabled = true;
+          mIsFocusIndicatorEnabled = 1;
         }
         else
         {
@@ -678,7 +701,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -693,7 +716,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -708,7 +731,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -723,7 +746,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -738,7 +761,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
@@ -754,7 +777,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
 
       isFocusStartableKey = true;
@@ -765,7 +788,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
 
       isFocusStartableKey = true;
@@ -785,7 +808,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       if(!mIsFocusIndicatorEnabled && !isAccessibilityEnabled)
       {
         // Show focus indicator
-        mIsFocusIndicatorEnabled = true;
+        mIsFocusIndicatorEnabled = 1;
       }
       else
       {
index 298b3a7..7283b1e 100644 (file)
@@ -165,6 +165,11 @@ private:
   typedef FocusStack::Iterator FocusStackIterator; ///< Define FocusStack::Iterator as FocusStackIterator to navigate FocusStack
 
   /**
+   * Get configuration from StyleManager.
+   */
+  void GetConfigurationFromStyleManger();
+
+  /**
    * Get the focus group of current focused actor.
    * @pre The FocusManager has been initialized.
    * @return A handle to the parent of the current focused actor which is a focus group,
@@ -253,9 +258,9 @@ private:
 
   Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the keyboard focusable actors for highlight
 
-  bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group
+  int mIsFocusIndicatorEnabled; ///< Whether indicator should be shown / hidden when getting focus. It could be enabled when keyboard focus feature is enabled and navigation keys or 'Tab' key are pressed.
 
-  bool mIsFocusIndicatorEnabled:1; ///< Whether indicator should be shown / hidden. It could be enabled when keyboard focus feature enabled and navigation keys or 'Tab' key pressed.
+  bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group
 
   bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet.
 
index 8454992..966da79 100644 (file)
@@ -71,6 +71,11 @@ Toolkit::AsyncImageLoader::ImageLoadedSignalType& AsyncImageLoader::ImageLoadedS
   return mLoadedSignal;
 }
 
+Toolkit::DevelAsyncImageLoader::PixelBufferLoadedSignalType& AsyncImageLoader::PixelBufferLoadedSignal()
+{
+  return mPixelBufferLoadedSignal;
+}
+
 bool AsyncImageLoader::Cancel( uint32_t loadingTaskId )
 {
   return mLoadThread.CancelTask( loadingTaskId );
@@ -85,7 +90,20 @@ void AsyncImageLoader::ProcessLoadedImage()
 {
   while( LoadingTask *next = mLoadThread.NextCompletedTask() )
   {
-    mLoadedSignal.Emit( next->id, next->pixelData );
+    if( mPixelBufferLoadedSignal.GetConnectionCount() > 0 )
+    {
+      mPixelBufferLoadedSignal.Emit( next->id, next->pixelBuffer );
+    }
+    else if( mLoadedSignal.GetConnectionCount() > 0 )
+    {
+      PixelData pixelData;
+      if( next->pixelBuffer )
+      {
+        pixelData = Devel::PixelBuffer::Convert( next->pixelBuffer );
+      }
+      mLoadedSignal.Emit( next->id, pixelData );
+    }
+
     delete next;
   }
 }
index fe4c73b..ce40f5a 100644 (file)
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/image-loader/async-image-loader.h>
+#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
 #include <dali-toolkit/internal/image-loader/image-load-thread.h>
 
 namespace Dali
@@ -63,6 +64,11 @@ public:
   Toolkit::AsyncImageLoader::ImageLoadedSignalType& ImageLoadedSignal();
 
   /**
+   * @copydoc Toolkit::AsyncImageLoader::PixelBufferLoadedSignal
+   */
+  Toolkit::DevelAsyncImageLoader::PixelBufferLoadedSignalType& PixelBufferLoadedSignal();
+
+  /**
    * @copydoc Toolkit::AsyncImageLoader::Cancel
    */
   bool Cancel( uint32_t loadingTaskId );
@@ -86,6 +92,7 @@ protected:
 
 private:
   Toolkit::AsyncImageLoader::ImageLoadedSignalType mLoadedSignal;
+  Toolkit::DevelAsyncImageLoader::PixelBufferLoadedSignalType mPixelBufferLoadedSignal;
 
   ImageLoadThread mLoadThread;
   uint32_t        mLoadTaskId;
index 30f1ba7..b69adbd 100644 (file)
@@ -22,7 +22,6 @@
 #include <string.h>
 #include <dali/public-api/signals/callback.h>
 #include <dali/devel-api/adaptor-framework/image-loading.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <dali/integration-api/debug.h>
 
 namespace Dali
@@ -262,10 +261,9 @@ void ImageAtlas::UploadToAtlas( uint32_t id, PixelData pixelData )
 
 void ImageAtlas::UploadBrokenImage( const Rect<unsigned int>& area )
 {
-  BitmapLoader loader = BitmapLoader::New(mBrokenImageUrl, ImageDimensions( area.width, area.height ) );
-  loader.Load();
-  SizeType loadedWidth = loader.GetPixelData().GetWidth();
-  SizeType loadedHeight = loader.GetPixelData().GetHeight();
+  Devel::PixelBuffer brokenBuffer = LoadImageFromFile( mBrokenImageUrl, ImageDimensions( area.width, area.height ) );
+  SizeType loadedWidth = brokenBuffer.GetWidth();
+  SizeType loadedHeight = brokenBuffer.GetHeight();
 
   bool needBackgroundClear = false;
   SizeType packX = area.x;
@@ -285,16 +283,18 @@ void ImageAtlas::UploadBrokenImage( const Rect<unsigned int>& area )
   if( needBackgroundClear )
   {
     SizeType size = area.width * area.height * Pixel::GetBytesPerPixel( mPixelFormat );
-    PixelBuffer* buffer = new PixelBuffer [size];
-    PixelData background = PixelData::New( buffer, size, area.width, area.height, mPixelFormat, PixelData::DELETE_ARRAY );
+    Devel::PixelBuffer background = Devel::PixelBuffer::New( area.width, area.height, mPixelFormat );
+    unsigned char* buffer = background.GetBuffer();
     for( SizeType idx = 0; idx < size; idx++ )
     {
       buffer[idx] = 0x00;
     }
-    mAtlas.Upload( background, 0u, 0u, area.x, area.y, area.width, area.height );
+    PixelData pixelData = Devel::PixelBuffer::Convert( background );
+    mAtlas.Upload( pixelData, 0u, 0u, area.x, area.y, area.width, area.height );
   }
 
-  mAtlas.Upload( loader.GetPixelData(), 0u, 0u, packX, packY, loadedWidth, loadedHeight );
+  PixelData brokenPixelData = Devel::PixelBuffer::Convert( brokenBuffer );
+  mAtlas.Upload( brokenPixelData, 0u, 0u, packX, packY, loadedWidth, loadedHeight );
 }
 
 } // namespace Internal
index a06953e..c1b4a91 100644 (file)
@@ -32,7 +32,7 @@ namespace Internal
 
 LoadingTask::LoadingTask( uint32_t id, const VisualUrl& url, ImageDimensions dimensions,
                           FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
-: pixelData(),
+: pixelBuffer(),
   url( url ),
   id( id ),
   dimensions( dimensions ),
@@ -46,11 +46,11 @@ void LoadingTask::Load()
 {
   if( url.IsLocal() )
   {
-    pixelData = Dali::LoadImageFromFile( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
+    pixelBuffer = Dali::LoadImageFromFile( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
   }
   else
   {
-    pixelData = Dali::DownloadImageSynchronously ( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
+    pixelBuffer = Dali::DownloadImageSynchronously ( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
   }
 }
 
index f3d9632..3d0ad24 100644 (file)
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/images/image-operations.h>
-#include <dali/public-api/images/pixel-data.h>
 #include <dali/devel-api/threading/conditional-wait.h>
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/devel-api/threading/thread.h>
 #include <dali/devel-api/adaptor-framework/event-thread-callback.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <dali-toolkit/internal/visuals/visual-url.h>
 
 namespace Dali
@@ -70,7 +70,7 @@ private:
 
 public:
 
-  PixelData          pixelData;     ///< pixelData handle after successfull load
+  Devel::PixelBuffer pixelBuffer;   ///< pixelBuffer handle after successful load
   VisualUrl          url;           ///< url of the image to load
   uint32_t           id;            ///< The unique id associated with this task.
   ImageDimensions    dimensions;    ///< dimensions to load
index ba89d88..df885d9 100644 (file)
@@ -228,15 +228,22 @@ void StyleManager::SetTheme( const std::string& themeFile )
 {
   bool themeLoaded = false;
 
-  mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
-
-  // Always load the default theme first, then merge in the custom theme if present
-  themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
-  mThemeFile = themeFile;
+  if( mThemeFile.compare(DEFAULT_THEME) == 0 && mThemeBuilder )
+  {
+    // We have already loaded the default theme into mThemeBuilder
+  }
+  else
+  {
+    // Reload the default theme
+    mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+    themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+  }
 
   if( themeFile.compare(DEFAULT_THEME) != 0 )
   {
-    themeLoaded = LoadJSON( mThemeBuilder, mThemeFile );
+    // The theme is different to the default: Merge it
+    themeLoaded = LoadJSON( mThemeBuilder, themeFile );
+    mThemeFile = themeFile;
   }
 
   if( themeLoaded )
@@ -254,6 +261,32 @@ void StyleManager::SetTheme( const std::string& themeFile )
   }
 }
 
+const Property::Map StyleManager::GetConfigurations()
+{
+  Property::Map result;
+  if( mThemeBuilder )
+  {
+    result = mThemeBuilder.GetConfigurations();
+  }
+  else
+  {
+    bool themeLoaded = false;
+
+    mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+
+    // Load default theme because this is first try to load stylesheet.
+    themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+    mThemeFile = DEFAULT_THEME;
+
+    if( themeLoaded )
+    {
+      result = mThemeBuilder.GetConfigurations();
+    }
+  }
+
+  return result;
+}
+
 bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut )
 {
   DALI_ASSERT_DEBUG( 0 != filename.length());
index aa514ea..d6bc4a1 100644 (file)
@@ -94,6 +94,11 @@ public: // Public API
   bool GetStyleConstant( const std::string& key, Property::Value& valueOut );
 
   /**
+   * @copydoc Toolkit::StyleManager::GetConfigurations
+   */
+  const Property::Map GetConfigurations();
+
+  /**
    * @brief Apply the theme style to a control.
    *
    * @param[in] control The control to apply style.
index 04a1af3..91b6a40 100644 (file)
@@ -464,24 +464,21 @@ CharacterIndex GetClosestCursorIndex( VisualModelPtr visualModel,
 }
 
 
-void GetCursorPosition( VisualModelPtr visualModel,
-                        LogicalModelPtr logicalModel,
-                        MetricsPtr metrics,
-                        CharacterIndex logical,
+void GetCursorPosition( GetCursorPositionParameters& parameters,
                         CursorInfo& cursorInfo )
 {
   // Whether the logical cursor position is at the end of the whole text.
-  const bool isLastPosition = logicalModel->mText.Count() == logical;
+  const bool isLastPosition = parameters.logicalModel->mText.Count() == parameters.logical;
 
   // Get the line where the character is laid-out.
-  const CharacterIndex characterOfLine = isLastPosition ? ( logical - 1u ) : logical;
+  const CharacterIndex characterOfLine = isLastPosition ? ( parameters.logical - 1u ) : parameters.logical;
 
   // Whether the cursor is in the last position and the last position is a new paragraph character.
-  const bool isLastNewParagraph = isLastPosition && TextAbstraction::IsNewParagraph( *( logicalModel->mText.Begin() + characterOfLine ) );
+  const bool isLastNewParagraph = parameters.isMultiline && isLastPosition && TextAbstraction::IsNewParagraph( *( parameters.logicalModel->mText.Begin() + characterOfLine ) );
 
-  const LineRun* const modelLines = visualModel->mLines.Begin();
+  const LineRun* const modelLines = parameters.visualModel->mLines.Begin();
 
-  const LineIndex lineIndex = visualModel->GetLineOfCharacter( characterOfLine );
+  const LineIndex lineIndex = parameters.visualModel->GetLineOfCharacter( characterOfLine );
   const LineRun& line = *( modelLines + lineIndex );
 
   if( isLastNewParagraph )
@@ -493,7 +490,7 @@ void GetCursorPosition( VisualModelPtr visualModel,
     cursorInfo.isSecondaryCursor = false;
 
     // Set the line offset and height.
-    cursorInfo.lineOffset = CalculateLineOffset( visualModel->mLines,
+    cursorInfo.lineOffset = CalculateLineOffset( parameters.visualModel->mLines,
                                                  newLineIndex );
 
     // The line height is the addition of the line ascender and the line descender.
@@ -508,24 +505,24 @@ void GetCursorPosition( VisualModelPtr visualModel,
     cursorInfo.primaryPosition.y = cursorInfo.lineOffset;
 
     // Transform the cursor info from line's coords to text's coords.
-    cursorInfo.primaryPosition.x += ( LTR == line.direction ) ? 0.f : visualModel->mControlSize.width;
+    cursorInfo.primaryPosition.x += ( LTR == line.direction ) ? 0.f : parameters.visualModel->mControlSize.width;
   }
   else
   {
     // Whether this line is a bidirectional line.
-    const bool bidiLineFetched = logicalModel->FetchBidirectionalLineInfo( characterOfLine );
+    const bool bidiLineFetched = parameters.logicalModel->FetchBidirectionalLineInfo( characterOfLine );
 
     // Check if the logical position is the first or the last one of the line.
-    const bool isFirstPositionOfLine = line.characterRun.characterIndex == logical;
-    const bool isLastPositionOfLine = line.characterRun.characterIndex + line.characterRun.numberOfCharacters == logical;
+    const bool isFirstPositionOfLine = line.characterRun.characterIndex == parameters.logical;
+    const bool isLastPositionOfLine = line.characterRun.characterIndex + line.characterRun.numberOfCharacters == parameters.logical;
 
     // 'logical' is the logical 'cursor' index.
     // Get the next and current logical 'character' index.
-    const CharacterIndex characterIndex = isFirstPositionOfLine ? logical : logical - 1u;
-    const CharacterIndex nextCharacterIndex = isLastPositionOfLine ? characterIndex : logical;
+    const CharacterIndex characterIndex = isFirstPositionOfLine ? parameters.logical : parameters.logical - 1u;
+    const CharacterIndex nextCharacterIndex = isLastPositionOfLine ? characterIndex : parameters.logical;
 
     // The character's direction buffer.
-    const CharacterDirection* const directionsBuffer = bidiLineFetched ? logicalModel->mCharacterDirections.Begin() : NULL;
+    const CharacterDirection* const directionsBuffer = bidiLineFetched ? parameters.logicalModel->mCharacterDirections.Begin() : NULL;
 
     CharacterDirection isCurrentRightToLeft = false;
     CharacterDirection isNextRightToLeft = false;
@@ -544,7 +541,7 @@ void GetCursorPosition( VisualModelPtr visualModel,
                                      ( isFirstPositionOfLine && ( isRightToLeftParagraph != isCurrentRightToLeft ) ) );
 
     // Set the line offset and height.
-    cursorInfo.lineOffset = CalculateLineOffset( visualModel->mLines,
+    cursorInfo.lineOffset = CalculateLineOffset( parameters.visualModel->mLines,
                                                  lineIndex );
 
     // The line height is the addition of the line ascender and the line descender.
@@ -569,7 +566,7 @@ void GetCursorPosition( VisualModelPtr visualModel,
         index = isRightToLeftParagraph ? line.characterRun.characterIndex : line.characterRun.characterIndex + line.characterRun.numberOfCharacters - 1u;
         if( bidiLineFetched )
         {
-          index = logicalModel->GetLogicalCharacterIndex( index );
+          index = parameters.logicalModel->GetLogicalCharacterIndex( index );
         }
       }
       else if( isFirstPositionOfLine )
@@ -577,7 +574,7 @@ void GetCursorPosition( VisualModelPtr visualModel,
         index = isRightToLeftParagraph ? line.characterRun.characterIndex + line.characterRun.numberOfCharacters - 1u : line.characterRun.characterIndex;
         if( bidiLineFetched )
         {
-          index = logicalModel->GetLogicalCharacterIndex( index );
+          index = parameters.logicalModel->GetLogicalCharacterIndex( index );
         }
       }
       else
@@ -586,12 +583,12 @@ void GetCursorPosition( VisualModelPtr visualModel,
       }
     }
 
-    const GlyphIndex* const charactersToGlyphBuffer = visualModel->mCharactersToGlyph.Begin();
-    const Length* const glyphsPerCharacterBuffer = visualModel->mGlyphsPerCharacter.Begin();
-    const Length* const charactersPerGlyphBuffer = visualModel->mCharactersPerGlyph.Begin();
-    const CharacterIndex* const glyphsToCharactersBuffer = visualModel->mGlyphsToCharacters.Begin();
-    const Vector2* const glyphPositionsBuffer = visualModel->mGlyphPositions.Begin();
-    const GlyphInfo* const glyphInfoBuffer = visualModel->mGlyphs.Begin();
+    const GlyphIndex* const charactersToGlyphBuffer = parameters.visualModel->mCharactersToGlyph.Begin();
+    const Length* const glyphsPerCharacterBuffer = parameters.visualModel->mGlyphsPerCharacter.Begin();
+    const Length* const charactersPerGlyphBuffer = parameters.visualModel->mCharactersPerGlyph.Begin();
+    const CharacterIndex* const glyphsToCharactersBuffer = parameters.visualModel->mGlyphsToCharacters.Begin();
+    const Vector2* const glyphPositionsBuffer = parameters.visualModel->mGlyphPositions.Begin();
+    const GlyphInfo* const glyphInfoBuffer = parameters.visualModel->mGlyphs.Begin();
 
     // Convert the cursor position into the glyph position.
     const GlyphIndex primaryGlyphIndex = *( charactersToGlyphBuffer + index );
@@ -604,7 +601,7 @@ void GetCursorPosition( VisualModelPtr visualModel,
                       primaryNumberOfGlyphs,
                       glyphMetrics,
                       glyphInfoBuffer,
-                      metrics );
+                      parameters.metrics );
 
     // Whether to add the glyph's advance to the cursor position.
     // i.e if the paragraph is left to right and the logical cursor is zero, the position is the position of the first glyph and the advance is not added,
@@ -698,7 +695,7 @@ void GetCursorPosition( VisualModelPtr visualModel,
                         secondaryNumberOfGlyphs,
                         glyphMetrics,
                         glyphInfoBuffer,
-                        metrics );
+                        parameters.metrics );
 
       // Set the secondary cursor's position.
 
index 34a5f7b..ad17b31 100644 (file)
@@ -71,6 +71,18 @@ struct CursorInfo
 };
 
 /**
+ * @brief Parameters passed to the GetCursorPosition() function.
+ */
+struct GetCursorPositionParameters
+{
+  VisualModelPtr visualModel;    ///< The visual model.
+  LogicalModelPtr logicalModel;  ///< The logical model.
+  MetricsPtr metrics;            ///< A wrapper around FontClient used to get metrics.
+  CharacterIndex logical;        ///< The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
+  bool isMultiline;              ///< Whether the text control is multi-line.
+};
+
+/**
  * @brief Retrieves the closest line for a given touch point.
  *
  * It returns the first line if the touch point is above the text and the last line if the touch point is below.
@@ -130,16 +142,10 @@ CharacterIndex GetClosestCursorIndex( VisualModelPtr visualModel,
  * It retrieves as well the line's height and the cursor's height and
  * if there is a valid alternative cursor, its position and height.
  *
- * @param[in] visualModel The visual model.
- * @param[in] logicalModel The logical model.
- * @param[in] metrics A wrapper around FontClient used to get metrics.
- * @param[in] logical The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
+ * @param[in] parameters Parameters used to calculate the cursor's position.
  * @param[out] cursorInfo The line's height, the cursor's height, the cursor's position and whether there is an alternative cursor.
  */
-void GetCursorPosition( VisualModelPtr visualModel,
-                        LogicalModelPtr logicalModel,
-                        MetricsPtr metrics,
-                        CharacterIndex logical,
+void GetCursorPosition( GetCursorPositionParameters& parameters,
                         CursorInfo& cursorInfo );
 
 /**
index 58893d4..532afed 100644 (file)
@@ -70,6 +70,7 @@ namespace Text
 EventData::EventData( DecoratorPtr decorator )
 : mDecorator( decorator ),
   mImfManager(),
+  mPlaceholderFont( NULL ),
   mPlaceholderText(),
   mPlaceholderTextActive(),
   mPlaceholderTextInactive(),
@@ -105,7 +106,8 @@ EventData::EventData( DecoratorPtr decorator )
   mScrollAfterDelete( false ),
   mAllTextSelected( false ),
   mUpdateInputStyle( false ),
-  mPasswordInput( false )
+  mPasswordInput( false ),
+  mIsPlaceholderPixelSize( false )
 {
   mImfManager = ImfManager::Get();
 }
@@ -884,8 +886,19 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
       // Get the default font's description.
       TextAbstraction::FontDescription defaultFontDescription;
       TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE;
-      if( NULL != mFontDefaults )
+
+      if( IsShowingPlaceholderText() && ( NULL != mEventData->mPlaceholderFont ) )
+      {
+        // If the placeholder font is set specifically, only placeholder font is changed.
+        defaultFontDescription = mEventData->mPlaceholderFont->mFontDescription;
+        if( mEventData->mPlaceholderFont->sizeDefined )
+        {
+          defaultPointSize = mEventData->mPlaceholderFont->mDefaultPointSize * 64u;
+        }
+      }
+      else if( NULL != mFontDefaults )
       {
+        // Set the normal font and the placeholder font.
         defaultFontDescription = mFontDefaults->mFontDescription;
         defaultPointSize = mFontDefaults->mDefaultPointSize * 64u;
       }
@@ -1776,8 +1789,18 @@ void Controller::Impl::RetrieveSelection( std::string& selectedText, bool delete
       mModel->mLogicalModel->UpdateTextStyleRuns( startOfSelectedText, -static_cast<int>( lengthOfSelectedText ) );
 
       // Mark the paragraphs to be updated.
-      mTextUpdateInfo.mCharacterIndex = startOfSelectedText;
-      mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText;
+      if( Layout::Engine::SINGLE_LINE_BOX == mLayoutEngine.GetLayout() )
+      {
+        mTextUpdateInfo.mCharacterIndex = 0;
+        mTextUpdateInfo.mNumberOfCharactersToRemove = mTextUpdateInfo.mPreviousNumberOfCharacters;
+        mTextUpdateInfo.mNumberOfCharactersToAdd = mTextUpdateInfo.mPreviousNumberOfCharacters - lengthOfSelectedText;
+        mTextUpdateInfo.mClearAll = true;
+      }
+      else
+      {
+        mTextUpdateInfo.mCharacterIndex = startOfSelectedText;
+        mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText;
+      }
 
       // Delete text between handles
       Vector<Character>::Iterator first = utf32Characters.Begin() + startOfSelectedText;
@@ -2608,13 +2631,18 @@ void Controller::Impl::GetCursorPosition( CharacterIndex logical,
     return;
   }
 
-  Text::GetCursorPosition( mModel->mVisualModel,
-                           mModel->mLogicalModel,
-                           mMetrics,
-                           logical,
+  const bool isMultiLine = ( Layout::Engine::MULTI_LINE_BOX == mLayoutEngine.GetLayout() );
+  GetCursorPositionParameters parameters;
+  parameters.visualModel = mModel->mVisualModel;
+  parameters.logicalModel = mModel->mLogicalModel;
+  parameters.metrics = mMetrics;
+  parameters.logical = logical;
+  parameters.isMultiline = isMultiLine;
+
+  Text::GetCursorPosition( parameters,
                            cursorInfo );
 
-  if( Layout::Engine::MULTI_LINE_BOX == mLayoutEngine.GetLayout() )
+  if( isMultiLine )
   {
     // If the text is editable and multi-line, the cursor position after a white space shouldn't exceed the boundaries of the text control.
 
@@ -2832,13 +2860,16 @@ void Controller::Impl::ScrollToMakePositionVisible( const Vector2& position, flo
     mModel->mScrollPosition.x = mModel->mVisualModel->mControlSize.width - positionEndX;
   }
 
-  if( decoratorPositionBeginY < 0.f )
-  {
-    mModel->mScrollPosition.y = -position.y;
-  }
-  else if( decoratorPositionEndY > mModel->mVisualModel->mControlSize.height )
+  if( Layout::Engine::MULTI_LINE_BOX == mLayoutEngine.GetLayout() )
   {
-    mModel->mScrollPosition.y = mModel->mVisualModel->mControlSize.height - positionEndY;
+    if( decoratorPositionBeginY < 0.f )
+    {
+      mModel->mScrollPosition.y = -position.y;
+    }
+    else if( decoratorPositionEndY > mModel->mVisualModel->mControlSize.height )
+    {
+      mModel->mScrollPosition.y = mModel->mVisualModel->mControlSize.height - positionEndY;
+    }
   }
 }
 
index e9d99f1..f48ce13 100644 (file)
@@ -39,6 +39,7 @@ namespace Text
 
 //Forward declarations
 struct CursorInfo;
+struct FontDefaults;
 
 struct Event
 {
@@ -104,6 +105,7 @@ struct EventData
 
   DecoratorPtr       mDecorator;               ///< Pointer to the decorator.
   ImfManager         mImfManager;              ///< The Input Method Framework Manager.
+  FontDefaults*      mPlaceholderFont;         ///< The placeholder default font.
   std::string        mPlaceholderText;         ///< The text to display when the TextField is empty.
   std::string        mPlaceholderTextActive;   ///< The text to display when the TextField is empty with key-input focus.
   std::string        mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
@@ -155,6 +157,7 @@ struct EventData
   bool mUpdateInputStyle                : 1;   ///< Whether to update the input style after moving the cursor.
   bool mPasswordInput                   : 1;   ///< True if password input is enabled.
   bool mCheckScrollAmount               : 1;   ///< Whether to check scrolled amount after updating the position
+  bool mIsPlaceholderPixelSize          : 1;   ///< True if the placeholder font size is set as pixel size.
 };
 
 struct ModifyEvent
index 53cd489..a0daf14 100644 (file)
 #include <dali-toolkit/internal/text/character-set-conversion.h>
 #include <dali-toolkit/internal/text/layouts/layout-parameters.h>
 #include <dali-toolkit/internal/text/markup-processor.h>
+#include <dali-toolkit/internal/text/multi-language-support.h>
 #include <dali-toolkit/internal/text/text-controller-impl.h>
 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
+#include <dali-toolkit/internal/text/text-font-style.h>
 
 namespace
 {
@@ -45,6 +47,13 @@ const float MAX_FLOAT = std::numeric_limits<float>::max();
 
 const std::string EMPTY_STRING("");
 
+const char * const PLACEHOLDER_TEXT = "placeholderText";
+const char * const PLACEHOLDER_COLOR = "placeholderColor";
+const char * const PLACEHOLDER_FONT_FAMILY = "placeholderFontFamily";
+const char * const PLACEHOLDER_FONT_STYLE = "placeholderFontStyle";
+const char * const PLACEHOLDER_POINT_SIZE = "placeholderPointSize";
+const char * const PLACEHOLDER_PIXEL_SIZE = "placeholderPixelSize";
+
 float ConvertToEven( float value )
 {
   int intValue(static_cast<int>( value ));
@@ -392,6 +401,16 @@ bool Controller::IsTextElideEnabled() const
   return mImpl->mModel->mElideEnabled;
 }
 
+void Controller::SetSelectionEnabled( bool enabled )
+{
+  mImpl->mEventData->mSelectionEnabled = enabled;
+}
+
+bool Controller::IsSelectionEnabled() const
+{
+  return mImpl->mEventData->mSelectionEnabled;
+}
+
 // public : Update
 
 void Controller::SetText( const std::string& text )
@@ -618,6 +637,33 @@ const std::string& Controller::GetDefaultFontFamily() const
   return EMPTY_STRING;
 }
 
+void Controller::SetPlaceholderFontFamily( const std::string& placeholderTextFontFamily )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.family = placeholderTextFontFamily;
+    DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetPlaceholderFontFamily %s\n", placeholderTextFontFamily.c_str());
+    mImpl->mEventData->mPlaceholderFont->familyDefined = !placeholderTextFontFamily.empty();
+
+    mImpl->RequestRelayout();
+  }
+}
+
+const std::string& Controller::GetPlaceholderFontFamily() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.family;
+  }
+
+  return EMPTY_STRING;
+}
+
 void Controller::SetDefaultFontWeight( FontWeight weight )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -649,6 +695,41 @@ FontWeight Controller::GetDefaultFontWeight() const
   return TextAbstraction::FontWeight::NORMAL;
 }
 
+void Controller::SetPlaceholderTextFontWeight( FontWeight weight )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.weight = weight;
+    mImpl->mEventData->mPlaceholderFont->weightDefined = true;
+
+    mImpl->RequestRelayout();
+  }
+}
+
+bool Controller::IsPlaceholderTextFontWeightDefined() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->weightDefined;
+  }
+  return false;
+}
+
+FontWeight Controller::GetPlaceholderTextFontWeight() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.weight;
+  }
+
+  return TextAbstraction::FontWeight::NORMAL;
+}
+
 void Controller::SetDefaultFontWidth( FontWidth width )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -680,6 +761,41 @@ FontWidth Controller::GetDefaultFontWidth() const
   return TextAbstraction::FontWidth::NORMAL;
 }
 
+void Controller::SetPlaceholderTextFontWidth( FontWidth width )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.width = width;
+    mImpl->mEventData->mPlaceholderFont->widthDefined = true;
+
+    mImpl->RequestRelayout();
+  }
+}
+
+bool Controller::IsPlaceholderTextFontWidthDefined() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->widthDefined;
+  }
+  return false;
+}
+
+FontWidth Controller::GetPlaceholderTextFontWidth() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.width;
+  }
+
+  return TextAbstraction::FontWidth::NORMAL;
+}
+
 void Controller::SetDefaultFontSlant( FontSlant slant )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -711,6 +827,41 @@ FontSlant Controller::GetDefaultFontSlant() const
   return TextAbstraction::FontSlant::NORMAL;
 }
 
+void Controller::SetPlaceholderTextFontSlant( FontSlant slant )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    mImpl->mEventData->mPlaceholderFont->mFontDescription.slant = slant;
+    mImpl->mEventData->mPlaceholderFont->slantDefined = true;
+
+    mImpl->RequestRelayout();
+  }
+}
+
+bool Controller::IsPlaceholderTextFontSlantDefined() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->slantDefined;
+  }
+  return false;
+}
+
+FontSlant Controller::GetPlaceholderTextFontSlant() const
+{
+  if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+  {
+    return mImpl->mEventData->mPlaceholderFont->mFontDescription.slant;
+  }
+
+  return TextAbstraction::FontSlant::NORMAL;
+}
+
 void Controller::SetDefaultFontSize( float fontSize, FontSizeType type )
 {
   if( NULL == mImpl->mFontDefaults )
@@ -728,20 +879,16 @@ void Controller::SetDefaultFontSize( float fontSize, FontSizeType type )
     }
     case PIXEL_SIZE:
     {
-      // Point size = Pixel size * 72 / DPI
+      // Point size = Pixel size * 72.f / DPI
       unsigned int horizontalDpi = 0u;
       unsigned int verticalDpi = 0u;
       TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
       fontClient.GetDpi( horizontalDpi, verticalDpi );
 
-      mImpl->mFontDefaults->mDefaultPointSize = ( fontSize * 72 ) / horizontalDpi;
+      mImpl->mFontDefaults->mDefaultPointSize = ( fontSize * 72.f ) / static_cast< float >( horizontalDpi );
       mImpl->mFontDefaults->sizeDefined = true;
       break;
     }
-    default:
-    {
-      DALI_ASSERT_ALWAYS( false );
-    }
   }
 
   // Clear the font-specific data
@@ -764,18 +911,97 @@ float Controller::GetDefaultFontSize( FontSizeType type ) const
       }
       case PIXEL_SIZE:
       {
-        // Pixel size = Point size * DPI / 72
+        // Pixel size = Point size * DPI / 72.f
+        unsigned int horizontalDpi = 0u;
+        unsigned int verticalDpi = 0u;
+        TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+        fontClient.GetDpi( horizontalDpi, verticalDpi );
+
+        value = mImpl->mFontDefaults->mDefaultPointSize * static_cast< float >( horizontalDpi ) / 72.f;
+        break;
+      }
+    }
+    return value;
+  }
+
+  return value;
+}
+
+void Controller::SetPlaceholderTextFontSize( float fontSize, FontSizeType type )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    if( NULL == mImpl->mEventData->mPlaceholderFont )
+    {
+      mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+    }
+
+    switch( type )
+    {
+      case POINT_SIZE:
+      {
+        mImpl->mEventData->mPlaceholderFont->mDefaultPointSize = fontSize;
+        mImpl->mEventData->mPlaceholderFont->sizeDefined = true;
+        mImpl->mEventData->mIsPlaceholderPixelSize = false; // Font size flag
+        break;
+      }
+      case PIXEL_SIZE:
+      {
+        // Point size = Pixel size * 72.f / DPI
         unsigned int horizontalDpi = 0u;
         unsigned int verticalDpi = 0u;
         TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
         fontClient.GetDpi( horizontalDpi, verticalDpi );
 
-        value = mImpl->mFontDefaults->mDefaultPointSize * horizontalDpi / 72;
+        mImpl->mEventData->mPlaceholderFont->mDefaultPointSize = ( fontSize * 72.f ) / static_cast< float >( horizontalDpi );
+        mImpl->mEventData->mPlaceholderFont->sizeDefined = true;
+        mImpl->mEventData->mIsPlaceholderPixelSize = true; // Font size flag
         break;
       }
-      default:
+    }
+
+    mImpl->RequestRelayout();
+  }
+}
+
+float Controller::GetPlaceholderTextFontSize( FontSizeType type ) const
+{
+  float value = 0.0f;
+  if( NULL != mImpl->mEventData )
+  {
+    switch( type )
+    {
+      case POINT_SIZE:
       {
-        DALI_ASSERT_ALWAYS( false );
+        if( NULL != mImpl->mEventData->mPlaceholderFont )
+        {
+          value = mImpl->mEventData->mPlaceholderFont->mDefaultPointSize;
+        }
+        else
+        {
+          // If the placeholder text font size is not set, then return the default font size.
+          value = GetDefaultFontSize( POINT_SIZE );
+        }
+        break;
+      }
+      case PIXEL_SIZE:
+      {
+        if( NULL != mImpl->mEventData->mPlaceholderFont )
+        {
+          // Pixel size = Point size * DPI / 72.f
+          unsigned int horizontalDpi = 0u;
+          unsigned int verticalDpi = 0u;
+          TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+          fontClient.GetDpi( horizontalDpi, verticalDpi );
+
+          value = mImpl->mEventData->mPlaceholderFont->mDefaultPointSize * static_cast< float >( horizontalDpi ) / 72.f;
+        }
+        else
+        {
+          // If the placeholder text font size is not set, then return the default font size.
+          value = GetDefaultFontSize( PIXEL_SIZE );
+        }
+        break;
       }
     }
     return value;
@@ -1678,6 +1904,86 @@ void Controller::GetHiddenInputOption(Property::Map& options )
   }
 }
 
+void Controller::SetPlaceholderProperty( const Property::Map& map )
+{
+  const Property::Map::SizeType count = map.Count();
+
+  for( Property::Map::SizeType position = 0; position < count; ++position )
+  {
+    KeyValuePair keyValue = map.GetKeyValue( position );
+    Property::Key& key = keyValue.first;
+    Property::Value& value = keyValue.second;
+
+    if( key == PLACEHOLDER_TEXT )
+    {
+      std::string text = "";
+      value.Get( text );
+      SetPlaceholderText( text );
+    }
+    else if( key == PLACEHOLDER_COLOR )
+    {
+      Vector4 textColor;
+      value.Get( textColor );
+      if( GetPlaceholderTextColor() != textColor )
+      {
+        SetPlaceholderTextColor( textColor );
+      }
+    }
+    else if( key == PLACEHOLDER_FONT_FAMILY )
+    {
+      std::string fontFamily = "";
+      value.Get( fontFamily );
+      SetPlaceholderFontFamily( fontFamily );
+    }
+    else if( key == PLACEHOLDER_FONT_STYLE )
+    {
+      SetFontStyleProperty( this, value, Text::FontStyle::PLACEHOLDER );
+    }
+    else if( key == PLACEHOLDER_POINT_SIZE )
+    {
+      float pointSize;
+      value.Get( pointSize );
+      if( !Equals( GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE ), pointSize ) )
+      {
+        SetPlaceholderTextFontSize( pointSize, Text::Controller::POINT_SIZE );
+      }
+    }
+    else if( key == PLACEHOLDER_PIXEL_SIZE )
+    {
+      float pixelSize;
+      value.Get( pixelSize );
+      if( !Equals( GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE ), pixelSize ) )
+      {
+        SetPlaceholderTextFontSize( pixelSize, Text::Controller::PIXEL_SIZE );
+      }
+    }
+  }
+}
+
+void Controller::GetPlaceholderProperty( Property::Map& map )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    map[ PLACEHOLDER_TEXT ] = mImpl->mEventData->mPlaceholderText;
+    map[ PLACEHOLDER_COLOR ] = mImpl->mEventData->mPlaceholderTextColor;
+    map[ PLACEHOLDER_FONT_FAMILY ] = GetPlaceholderFontFamily();
+
+    Property::Value fontStyleMapGet;
+    GetFontStyleProperty( this, fontStyleMapGet, Text::FontStyle::PLACEHOLDER );
+    map[ PLACEHOLDER_FONT_STYLE ] = fontStyleMapGet;
+
+    // Choose font size : POINT_SIZE or PIXEL_SIZE
+    if( !mImpl->mEventData->mIsPlaceholderPixelSize )
+    {
+      map[ PLACEHOLDER_POINT_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE );
+    }
+    else
+    {
+      map[ PLACEHOLDER_PIXEL_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE );
+    }
+  }
+}
+
 // public : Relayout.
 
 Controller::UpdateTextType Controller::Relayout( const Size& size )
@@ -2642,8 +2948,18 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
     }
 
     // Mark the first paragraph to be updated.
-    mImpl->mTextUpdateInfo.mCharacterIndex = std::min( cursorIndex, mImpl->mTextUpdateInfo.mCharacterIndex );
-    mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd += maxSizeOfNewText;
+    if( Layout::Engine::SINGLE_LINE_BOX == mImpl->mLayoutEngine.GetLayout() )
+    {
+      mImpl->mTextUpdateInfo.mCharacterIndex = 0;
+      mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters;
+      mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = numberOfCharactersInModel + maxSizeOfNewText;
+      mImpl->mTextUpdateInfo.mClearAll = true;
+    }
+    else
+    {
+      mImpl->mTextUpdateInfo.mCharacterIndex = std::min( cursorIndex, mImpl->mTextUpdateInfo.mCharacterIndex );
+      mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd += maxSizeOfNewText;
+    }
 
     // Update the cursor index.
     cursorIndex += maxSizeOfNewText;
@@ -2741,8 +3057,18 @@ bool Controller::RemoveText( int cursorOffset,
         ( ( cursorIndex + numberOfCharacters ) <= mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters ) )
     {
       // Mark the paragraphs to be updated.
-      mImpl->mTextUpdateInfo.mCharacterIndex = std::min( cursorIndex, mImpl->mTextUpdateInfo.mCharacterIndex );
-      mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove += numberOfCharacters;
+      if( Layout::Engine::SINGLE_LINE_BOX == mImpl->mLayoutEngine.GetLayout() )
+      {
+        mImpl->mTextUpdateInfo.mCharacterIndex = 0;
+        mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters;
+        mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters - numberOfCharacters;
+        mImpl->mTextUpdateInfo.mClearAll = true;
+      }
+      else
+      {
+        mImpl->mTextUpdateInfo.mCharacterIndex = std::min( cursorIndex, mImpl->mTextUpdateInfo.mCharacterIndex );
+        mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove += numberOfCharacters;
+      }
 
       // Update the input style and remove the text's style before removing the text.
 
index c6b01a4..9c80fc7 100644 (file)
@@ -355,6 +355,18 @@ public: // Configure the text controller.
   bool IsTextElideEnabled() const;
 
   /**
+   * @brief Enable or disable the text selection.
+   * @param[in] enabled Whether to enable the text selection.
+   */
+  void SetSelectionEnabled( bool enabled );
+
+  /**
+   * @brief Whether the text selection is enabled or not.
+   * @return True if the text selection is enabled
+   */
+  bool IsSelectionEnabled() const;
+
+  /**
    * @brief Sets input type to password
    *
    * @note The string is displayed hidden character
@@ -504,6 +516,19 @@ public: // Default style & Input style
   const std::string& GetDefaultFontFamily() const;
 
   /**
+   * @brief Sets the placeholder text font family.
+   * @param[in] placeholderTextFontFamily The placeholder text font family.
+   */
+  void SetPlaceholderFontFamily( const std::string& placeholderTextFontFamily );
+
+  /**
+   * @brief Retrieves the placeholder text font family.
+   *
+   * @return The placeholder text font family
+   */
+  const std::string& GetPlaceholderFontFamily() const;
+
+  /**
    * @brief Sets the default font weight.
    *
    * @param[in] weight The font weight.
@@ -523,6 +548,27 @@ public: // Default style & Input style
   FontWeight GetDefaultFontWeight() const;
 
   /**
+   * @brief Sets the placeholder text font weight.
+   *
+   * @param[in] weight The font weight
+   */
+  void SetPlaceholderTextFontWeight( FontWeight weight );
+
+  /**
+   * @brief Whether the font's weight has been defined.
+   *
+   * @return True if the placeholder text font weight is defined
+   */
+  bool IsPlaceholderTextFontWeightDefined() const;
+
+  /**
+   * @brief Retrieves the placeholder text font weight.
+   *
+   * @return The placeholder text font weight
+   */
+  FontWeight GetPlaceholderTextFontWeight() const;
+
+  /**
    * @brief Sets the default font width.
    *
    * @param[in] width The font width.
@@ -542,6 +588,27 @@ public: // Default style & Input style
   FontWidth GetDefaultFontWidth() const;
 
   /**
+   * @brief Sets the placeholder text font width.
+   *
+   * @param[in] width The font width
+   */
+  void SetPlaceholderTextFontWidth( FontWidth width );
+
+  /**
+   * @brief Whether the font's width has been defined.
+   *
+   * @return True if the placeholder text font width is defined
+   */
+  bool IsPlaceholderTextFontWidthDefined() const;
+
+  /**
+   * @brief Retrieves the placeholder text font width.
+   *
+   * @return The placeholder text font width
+   */
+  FontWidth GetPlaceholderTextFontWidth() const;
+
+  /**
    * @brief Sets the default font slant.
    *
    * @param[in] slant The font slant.
@@ -561,9 +628,30 @@ public: // Default style & Input style
   FontSlant GetDefaultFontSlant() const;
 
   /**
+   * @brief Sets the placeholder text font slant.
+   *
+   * @param[in] slant The font slant
+   */
+  void SetPlaceholderTextFontSlant( FontSlant slant );
+
+  /**
+   * @brief Whether the font's slant has been defined.
+   *
+   * @return True if the placeholder text font slant is defined
+   */
+  bool IsPlaceholderTextFontSlantDefined() const;
+
+  /**
+   * @brief Retrieves the placeholder text font slant.
+   *
+   * @return The placeholder text font slant
+   */
+  FontSlant GetPlaceholderTextFontSlant() const;
+
+  /**
    * @brief Set the default font size.
    *
-   * @param[in] size The default font size.
+   * @param[in] fontSize The default font size
    * @param[in] type The font size type is point size or pixel size
    */
   void SetDefaultFontSize( float fontSize, FontSizeType type );
@@ -577,6 +665,20 @@ public: // Default style & Input style
   float GetDefaultFontSize( FontSizeType type ) const;
 
   /**
+   * @brief Sets the Placeholder text font size.
+   * @param[in] fontSize The placeholder text font size
+   * @param[in] type The font size type is point size or pixel size
+   */
+  void SetPlaceholderTextFontSize( float fontSize, FontSizeType type );
+
+  /**
+   * @brief Retrieves the Placeholder text font size.
+   * @param[in] type The font size type
+   * @return The placeholder font size
+   */
+  float GetPlaceholderTextFontSize( FontSizeType type ) const;
+
+  /**
    * @brief Sets the text's default color.
    *
    * @param color The default color.
@@ -966,6 +1068,20 @@ public: // Queries & retrieves.
    */
   void GetHiddenInputOption( Property::Map& options );
 
+  /**
+   * @brief Sets the Placeholder Properties.
+   *
+   * @param[in] map The placeholder property map
+   */
+  void SetPlaceholderProperty( const Property::Map& map );
+
+  /**
+   * @brief Retrieves the Placeholder Property map.
+   *
+   * @param[out] map The property map
+   */
+  void GetPlaceholderProperty( Property::Map& map );
+
 public: // Relayout.
 
   /**
index 249157e..8978beb 100644 (file)
@@ -216,6 +216,28 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu
           }
           break;
         }
+        case FontStyle::PLACEHOLDER:
+        {
+          // Sets the placeholder text font's style values.
+          if( !weightDefined ||
+              ( weightDefined && ( controller->GetPlaceholderTextFontWeight() != weight ) ) )
+          {
+            controller->SetPlaceholderTextFontWeight( weight );
+          }
+
+          if( !widthDefined ||
+              ( widthDefined && ( controller->GetPlaceholderTextFontWidth() != width ) ) )
+          {
+            controller->SetPlaceholderTextFontWidth( width );
+          }
+
+          if( !slantDefined ||
+              ( slantDefined && ( controller->GetPlaceholderTextFontSlant() != slant ) ) )
+          {
+            controller->SetPlaceholderTextFontSlant( slant );
+          }
+          break;
+        }
       } // switch
     } // map not empty
     else
@@ -236,6 +258,13 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu
           controller->SetInputFontSlant( TextAbstraction::FontSlant::NONE );
           break;
         }
+        case FontStyle::PLACEHOLDER:
+        {
+          controller->SetPlaceholderTextFontWeight( TextAbstraction::FontWeight::NONE );
+          controller->SetPlaceholderTextFontWidth( TextAbstraction::FontWidth::NONE );
+          controller->SetPlaceholderTextFontSlant( TextAbstraction::FontSlant::NONE );
+          break;
+        }
       } // switch
     } // map.Empty()
   } // controller
@@ -245,7 +274,6 @@ void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, Fon
 {
   if( controller )
   {
-    const bool isDefaultStyle = FontStyle::DEFAULT == type;
     const bool isSetbyString = controller->IsFontStyleSetByString();
 
     bool weightDefined = false;
@@ -255,46 +283,74 @@ void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, Fon
     FontWidth width = TextAbstraction::FontWidth::NONE;
     FontSlant slant = TextAbstraction::FontSlant::NONE;
 
-    if( isDefaultStyle )
+    switch( type )
     {
-      weightDefined = controller->IsDefaultFontWeightDefined();
-      widthDefined = controller->IsDefaultFontWidthDefined();
-      slantDefined = controller->IsDefaultFontSlantDefined();
-
-      if( weightDefined )
+      case FontStyle::DEFAULT:
       {
-        weight = controller->GetDefaultFontWeight();
-      }
+        weightDefined = controller->IsDefaultFontWeightDefined();
+        widthDefined = controller->IsDefaultFontWidthDefined();
+        slantDefined = controller->IsDefaultFontSlantDefined();
 
-      if( widthDefined )
-      {
-        width = controller->GetDefaultFontWidth();
-      }
+        if( weightDefined )
+        {
+          weight = controller->GetDefaultFontWeight();
+        }
 
-      if( slantDefined )
-      {
-        slant = controller->GetDefaultFontSlant();
-      }
-    }
-    else
-    {
-      weightDefined = controller->IsInputFontWeightDefined();
-      widthDefined = controller->IsInputFontWidthDefined();
-      slantDefined = controller->IsInputFontSlantDefined();
+        if( widthDefined )
+        {
+          width = controller->GetDefaultFontWidth();
+        }
 
-      if( weightDefined )
-      {
-        weight = controller->GetInputFontWeight();
+        if( slantDefined )
+        {
+          slant = controller->GetDefaultFontSlant();
+        }
+        break;
       }
-
-      if( widthDefined )
+      case FontStyle::INPUT:
       {
-        width = controller->GetInputFontWidth();
-      }
+        weightDefined = controller->IsInputFontWeightDefined();
+        widthDefined = controller->IsInputFontWidthDefined();
+        slantDefined = controller->IsInputFontSlantDefined();
 
-      if( slantDefined )
+        if( weightDefined )
+        {
+          weight = controller->GetInputFontWeight();
+        }
+
+        if( widthDefined )
+        {
+          width = controller->GetInputFontWidth();
+        }
+
+        if( slantDefined )
+        {
+          slant = controller->GetInputFontSlant();
+        }
+        break;
+      }
+      case FontStyle::PLACEHOLDER:
       {
-        slant = controller->GetInputFontSlant();
+        // The type is FontStyle::PLACEHOLDER
+        weightDefined = controller->IsPlaceholderTextFontWeightDefined();
+        widthDefined = controller->IsPlaceholderTextFontWidthDefined();
+        slantDefined = controller->IsPlaceholderTextFontSlantDefined();
+
+        if( weightDefined )
+        {
+          weight = controller->GetPlaceholderTextFontWeight();
+        }
+
+        if( widthDefined )
+        {
+          width = controller->GetPlaceholderTextFontWidth();
+        }
+
+        if( slantDefined )
+        {
+          slant = controller->GetPlaceholderTextFontSlant();
+        }
+        break;
       }
     }
 
index e74bcfb..4a01d32 100644 (file)
@@ -83,8 +83,9 @@ namespace FontStyle
 {
   enum Type
   {
-    DEFAULT, ///< The default font's style.
-    INPUT    ///< The input font's style.
+    DEFAULT,      ///< The default font's style.
+    INPUT,        ///< The input font's style.
+    PLACEHOLDER   ///< The placeholder text font's style.
   };
 };
 
@@ -101,7 +102,7 @@ void SetFontFamilyProperty( ControllerPtr controller, const Property::Value& val
  *
  * @param[in] controller The text's controller.
  * @param[in] value The value of the font's style.
- * @param[in] type Whether the property is for the default font's style or the input font's style.
+ * @param[in] type Whether the property is for the default font's style, the input font's style or the placeholder font's style.
  *
  */
 void SetFontStyleProperty( ControllerPtr controller, const Property::Value& value, FontStyle::Type type );
@@ -111,7 +112,7 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu
  *
  * @param[in] controller The text's controller.
  * @param[out] value The value of the font's style.
- * @param[in] type Whether the property is for the default font's style or the input font's style.
+ * @param[in] type Whether the property is for the default font's style, the input font's style or the placeholder font's style.
  */
 void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, FontStyle::Type type );
 
index e50edca..d050442 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/images/native-image.h>
 #include <dali/devel-api/images/texture-set-image.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
@@ -471,6 +470,7 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v
     {
       bool atlasing = false;
       mAttemptAtlasing = value.Get( atlasing );
+      break;
     }
 
     case Toolkit::DevelImageVisual::Property::ALPHA_MASK_URL:
@@ -480,6 +480,7 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v
       {
         mAlphaMaskUrl = VisualUrl( alphaUrl );
       }
+      break;
     }
   }
 }
@@ -632,9 +633,12 @@ void ImageVisual::LoadResourceSynchronously()
 {
   if( mImageUrl.IsValid() )
   {
-    BitmapLoader loader = BitmapLoader::New( mImageUrl.GetUrl(), mDesiredSize, mFittingMode, mSamplingMode );
-    loader.Load();
-    mPixels = loader.GetPixelData();
+    Devel::PixelBuffer pixelBuffer = LoadImageFromFile( mImageUrl.GetUrl(), mDesiredSize, mFittingMode, mSamplingMode );
+
+    if( pixelBuffer )
+    {
+      mPixels = Devel::PixelBuffer::Convert(pixelBuffer); // takes ownership of buffer
+    }
     mTextureLoading = false;
   }
 }
index 76e8558..e6a7bf4 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/stage.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/devel-api/adaptor-framework/file-loader.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
@@ -46,12 +46,12 @@ namespace
   Texture LoadTexture( const char* imageUrl, bool generateMipmaps )
   {
     Texture texture;
-    Dali::BitmapLoader loader = Dali::BitmapLoader::New( imageUrl );
-    loader.Load();
-    PixelData pixelData = loader.GetPixelData();
-    if( pixelData )
+
+    Devel::PixelBuffer pixelBuffer = LoadImageFromFile( imageUrl );
+    if( pixelBuffer )
     {
-      texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+      texture = Texture::New( TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
+      PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
       texture.Upload( pixelData );
 
       if( generateMipmaps )
old mode 100644 (file)
new mode 100755 (executable)
index 1df32a6..9235545
@@ -111,7 +111,6 @@ const char* VERTEX_SHADER_3X3 = DALI_COMPOSE_SHADER(
       vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
       vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
 
-      mediump vec2 scale        = vec2( length( uModelMatrix[ 0 ].xyz ), length( uModelMatrix[ 1 ].xyz ) );\n
       mediump vec2 size         = visualSize.xy;\n
       \n
       mediump vec2 fixedFactor  = vec2( uFixed[ int( ( aPosition.x + 1.0 ) * 0.5 ) ].x, uFixed[ int( ( aPosition.y  + 1.0 ) * 0.5 ) ].y );\n
@@ -444,10 +443,17 @@ Shader NPatchVisual::CreateShader()
     }
     hints = mImpl->mCustomShader->mHints;
 
+    /* Apply Custom Vertex Shader only if image is 9-patch */
     if( ( xStretchCount == 1 && yStretchCount == 1 ) ||
         ( xStretchCount == 0 && yStretchCount == 0 ) )
     {
-      shader = Shader::New( VERTEX_SHADER_3X3, fragmentShader, hints );
+      const char* vertexShader = VERTEX_SHADER_3X3;
+
+      if( !mImpl->mCustomShader->mVertexShader.empty() )
+      {
+        vertexShader = mImpl->mCustomShader->mVertexShader.c_str();
+      }
+      shader = Shader::New( vertexShader, fragmentShader, hints );
     }
     else if( xStretchCount > 0 || yStretchCount > 0)
     {
index a1da87f..1e95223 100644 (file)
@@ -110,6 +110,9 @@ void SvgVisual::DoSetOnStage( Actor& actor )
 
   // Hold the weak handle of the placement actor and delay the adding of renderer until the svg rasterization is finished.
   mPlacementActor = actor;
+
+  // SVG visual needs it's size set before it can be rasterized hence set ResourceReady once on stage
+  ResourceReady();
 }
 
 void SvgVisual::DoSetOffStage( Actor& actor )
index 3ff4ce8..2b5215a 100644 (file)
@@ -457,6 +457,7 @@ void TextVisual::UpdateRenderer( bool initializeRendererAndTexture )
     }
 
     // Nothing else to do if the relayout size is zero.
+    ResourceReady();
     return;
   }
 
index 2283f22..7334b48 100644 (file)
 
 // EXTERNAL HEADERS
 #include <dali/devel-api/common/hash.h>
-#include <dali/devel-api/images/pixel-data-mask.h>
 #include <dali/devel-api/images/texture-set-image.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL HEADERS
 #include <dali/integration-api/debug.h>
-#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
+#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
 #include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
+#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
 #include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
 
 
@@ -61,8 +62,8 @@ TextureManager::TextureManager()
   mAsyncRemoteLoader( Toolkit::AsyncImageLoader::New() ),
   mCurrentTextureId( 0 )
 {
-  mAsyncLocalLoader.ImageLoadedSignal().Connect( this, &TextureManager::AsyncLocalLoadComplete );
-  mAsyncRemoteLoader.ImageLoadedSignal().Connect( this, &TextureManager::AsyncRemoteLoadComplete );
+  DevelAsyncImageLoader::PixelBufferLoadedSignal(mAsyncLocalLoader).Connect( this, &TextureManager::AsyncLocalLoadComplete );
+  DevelAsyncImageLoader::PixelBufferLoadedSignal(mAsyncRemoteLoader).Connect( this, &TextureManager::AsyncRemoteLoadComplete );
 }
 
 TextureManager::TextureId TextureManager::RequestLoad(
@@ -73,7 +74,7 @@ TextureManager::TextureId TextureManager::RequestLoad(
   const UseAtlas           useAtlas,
   TextureUploadObserver*   observer )
 {
-  return RequestInternalLoad( url, INVALID_TEXTURE_ID, desiredSize, fittingMode, samplingMode, useAtlas, GPU_UPLOAD, observer );
+  return RequestLoadInternal( url, INVALID_TEXTURE_ID, desiredSize, fittingMode, samplingMode, useAtlas, UPLOAD_TO_TEXTURE, observer );
 }
 
 TextureManager::TextureId TextureManager::RequestLoad(
@@ -85,17 +86,17 @@ TextureManager::TextureId TextureManager::RequestLoad(
   const UseAtlas           useAtlas,
   TextureUploadObserver*   observer )
 {
-  return RequestInternalLoad( url, maskTextureId, desiredSize, fittingMode, samplingMode, useAtlas, GPU_UPLOAD, observer );
+  return RequestLoadInternal( url, maskTextureId, desiredSize, fittingMode, samplingMode, useAtlas, UPLOAD_TO_TEXTURE, observer );
 }
 
 TextureManager::TextureId TextureManager::RequestMaskLoad( const VisualUrl& maskUrl )
 {
   // Use the normal load procedure to get the alpha mask.
-  return RequestInternalLoad( maskUrl, INVALID_TEXTURE_ID, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, CPU, NULL );
+  return RequestLoadInternal( maskUrl, INVALID_TEXTURE_ID, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, KEEP_PIXEL_BUFFER, NULL );
 }
 
 
-TextureManager::TextureId TextureManager::RequestInternalLoad(
+TextureManager::TextureId TextureManager::RequestLoadInternal(
   const VisualUrl&         url,
   TextureId                maskTextureId,
   const ImageDimensions    desiredSize,
@@ -246,6 +247,15 @@ void TextureManager::Remove( const TextureManager::TextureId textureId )
   }
 }
 
+const VisualUrl& TextureManager::GetVisualUrl( TextureId textureId )
+{
+  int cacheIndex = GetCacheIndexFromId( textureId );
+  DALI_ASSERT_DEBUG( cacheIndex != INVALID_CACHE_INDEX && "TextureId out of range");
+
+  TextureInfo& cachedTextureInfo( mTextureInfoContainer[ cacheIndex ] );
+  return cachedTextureInfo.url;
+}
+
 TextureManager::LoadState TextureManager::GetTextureState( TextureId textureId )
 {
   LoadState loadState = TextureManager::NOT_STARTED;
@@ -314,17 +324,17 @@ void TextureManager::ObserveTexture( TextureInfo& textureInfo,
   }
 }
 
-void TextureManager::AsyncLocalLoadComplete( uint32_t id, PixelData pixelData )
+void TextureManager::AsyncLocalLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer )
 {
-  AsyncLoadComplete( mAsyncLocalLoadingInfoContainer, id, pixelData );
+  AsyncLoadComplete( mAsyncLocalLoadingInfoContainer, id, pixelBuffer );
 }
 
-void TextureManager::AsyncRemoteLoadComplete( uint32_t id, PixelData pixelData )
+void TextureManager::AsyncRemoteLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer )
 {
-  AsyncLoadComplete( mAsyncRemoteLoadingInfoContainer, id, pixelData );
+  AsyncLoadComplete( mAsyncRemoteLoadingInfoContainer, id, pixelBuffer );
 }
 
-void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id, PixelData pixelData )
+void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id, Devel::PixelBuffer pixelBuffer )
 {
   DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::AsyncLoadComplete( id:%d )\n", id );
 
@@ -344,7 +354,7 @@ void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingCo
         if( textureInfo.loadState != CANCELLED )
         {
           // textureInfo can be invalidated after this call (as the mTextureInfoContainer may be modified)
-          PostLoad( textureInfo, pixelData );
+          PostLoad( textureInfo, pixelBuffer );
         }
         else
         {
@@ -357,15 +367,15 @@ void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingCo
   }
 }
 
-void TextureManager::PostLoad( TextureInfo& textureInfo, PixelData pixelData )
+void TextureManager::PostLoad( TextureInfo& textureInfo, Devel::PixelBuffer& pixelBuffer )
 {
   // Was the load successful?
-  if( pixelData && ( pixelData.GetWidth() != 0 ) && ( pixelData.GetHeight() != 0 ) )
+  if( pixelBuffer && ( pixelBuffer.GetWidth() != 0 ) && ( pixelBuffer.GetHeight() != 0 ) )
   {
     // No atlas support for now
     textureInfo.useAtlas = NO_ATLAS;
 
-    if( textureInfo.storageType == GPU_UPLOAD )
+    if( textureInfo.storageType == UPLOAD_TO_TEXTURE )
     {
       // If there is a mask texture ID associated with this texture, then apply the mask
       // if it's already loaded. If it hasn't, and the mask is still loading,
@@ -375,25 +385,25 @@ void TextureManager::PostLoad( TextureInfo& textureInfo, PixelData pixelData )
         LoadState maskLoadState = GetTextureState( textureInfo.maskTextureId );
         if( maskLoadState == LOADING )
         {
-          textureInfo.pixelData = pixelData; // Store the pixel data temporarily
+          textureInfo.pixelBuffer = pixelBuffer; // Store the pixel buffer temporarily
           textureInfo.loadState = WAITING_FOR_MASK;
         }
         else if( maskLoadState == LOAD_FINISHED )
         {
-          ApplyMask( pixelData, textureInfo.maskTextureId );
-          UploadTexture( pixelData, textureInfo );
+          ApplyMask( pixelBuffer, textureInfo.maskTextureId );
+          UploadTexture( pixelBuffer, textureInfo );
           NotifyObservers( textureInfo, true );
         }
       }
       else
       {
-        UploadTexture( pixelData, textureInfo );
+        UploadTexture( pixelBuffer, textureInfo );
         NotifyObservers( textureInfo, true );
       }
     }
-    else // currently, CPU textures are local to texture manager
+    else
     {
-      textureInfo.pixelData = pixelData; // Store the pixel data
+      textureInfo.pixelBuffer = pixelBuffer; // Store the pixel data
       textureInfo.loadState = LOAD_FINISHED;
 
       // Check if there was another texture waiting for this load to complete
@@ -423,13 +433,13 @@ void TextureManager::CheckForWaitingTexture( TextureInfo& maskTextureInfo )
         mTextureInfoContainer[cacheIndex].loadState == WAITING_FOR_MASK )
     {
       TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
-      PixelData pixelData = textureInfo.pixelData;
-      textureInfo.pixelData.Reset();
+      Devel::PixelBuffer pixelBuffer = textureInfo.pixelBuffer;
+      textureInfo.pixelBuffer.Reset();
 
       if( maskTextureInfo.loadState == LOAD_FINISHED )
       {
-        ApplyMask( pixelData, maskTextureInfo.textureId );
-        UploadTexture( pixelData, textureInfo );
+        ApplyMask( pixelBuffer, maskTextureInfo.textureId );
+        UploadTexture( pixelBuffer, textureInfo );
         NotifyObservers( textureInfo, true );
       }
       else
@@ -442,20 +452,21 @@ void TextureManager::CheckForWaitingTexture( TextureInfo& maskTextureInfo )
   }
 }
 
-void TextureManager::ApplyMask( PixelData pixelData, TextureId maskTextureId )
+void TextureManager::ApplyMask( Devel::PixelBuffer& pixelBuffer, TextureId maskTextureId )
 {
   int maskCacheIndex = GetCacheIndexFromId( maskTextureId );
-  PixelData maskPixelData = mTextureInfoContainer[maskCacheIndex].pixelData;
-  Dali::ApplyMask( pixelData, maskPixelData );
+  Devel::PixelBuffer maskPixelBuffer = mTextureInfoContainer[maskCacheIndex].pixelBuffer;
+  pixelBuffer.ApplyMask( maskPixelBuffer );
 }
 
-void TextureManager::UploadTexture( PixelData pixelData, TextureInfo& textureInfo )
+void TextureManager::UploadTexture( Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo )
 {
   if( textureInfo.useAtlas != USE_ATLAS )
   {
     DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "  TextureManager::UploadTexture() New Texture for textureId:%d\n", textureInfo.textureId );
 
-    Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+    Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
+    PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
     texture.Upload( pixelData );
     textureInfo.textureSet = TextureSet::New();
     textureInfo.textureSet.SetTexture( 0u, texture );
@@ -643,12 +654,15 @@ void TextureManager::ObserverDestroyed( TextureUploadObserver* observer )
   for( unsigned int i = 0; i < count; ++i )
   {
     TextureInfo& textureInfo( mTextureInfoContainer[i] );
-    for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin(); j != textureInfo.observerList.End(); ++j )
+    for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin(); j != textureInfo.observerList.End(); )
     {
       if( *j == observer )
       {
-        textureInfo.observerList.Erase( j );
-        break;
+        j = textureInfo.observerList.Erase( j );
+      }
+      else
+      {
+        ++j;
       }
     }
   }
index a650384..04faf46 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/rendering/texture-set.h>
 #include <dali/devel-api/common/owner-container.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <deque>
 
 // INTERNAL INCLUDES
@@ -67,12 +68,12 @@ public:
   };
 
   /**
-   * Whether the texture should be stored in CPU memory, or uploaded to a GPU texture
+   * Whether the pixel data should be kept in TextureManager, or uploaded for rendering
    */
   enum StorageType
   {
-    CPU,
-    GPU_UPLOAD
+    KEEP_PIXEL_BUFFER,
+    UPLOAD_TO_TEXTURE
   };
 
   /**
@@ -140,8 +141,8 @@ public:
 
   /**
    * @brief Requests an image load of the given URL, when the texture has
-   * have loaded, it will perform a CPU blend with the image mask, and upload
-   * the blend texture.
+   * have loaded, it will perform a blend with the image mask, and upload
+   * the blended texture.
    *
    * The parameters are used to specify how the image is loaded.
    * The observer has the UploadComplete method called when the load is ready.
@@ -183,6 +184,11 @@ public:
   void Remove( const TextureManager::TextureId textureId );
 
   /**
+   * Get the visualUrl associated with the texture id
+   */
+  const VisualUrl& GetVisualUrl( TextureId textureId );
+
+  /**
    * @brief Get the current state of a texture
    * @param[in] textureId The texture id to query
    * @return The loading state if the texture is valid, or NOT_STARTED if the textureId
@@ -221,7 +227,7 @@ private:
    *                              This is called when an image load completes (or fails).
    * @return                      A TextureId to use as a handle to reference this Texture
    */
-  TextureId RequestInternalLoad(
+  TextureId RequestLoadInternal(
     const VisualUrl&         url,
     TextureId                maskTextureId,
     const ImageDimensions    desiredSize,
@@ -259,7 +265,7 @@ private:
       loadState( NOT_STARTED ),
       fittingMode( fittingMode ),
       samplingMode( samplingMode ),
-      storageType( GPU_UPLOAD ),
+      storageType( UPLOAD_TO_TEXTURE ),
       loadSynchronously( loadSynchronously ),
       useAtlas( useAtlas )
     {
@@ -272,7 +278,7 @@ private:
 
     ObserverListType observerList; ///< Container used to store all observer clients of this Texture
     Toolkit::ImageAtlas atlas;     ///< The atlas this Texture lays within (if any)
-    PixelData pixelData;           ///< The PixelData holding the image data (this is used if atlasing is deferred or CPU storage is required)
+    Devel::PixelBuffer pixelBuffer;///< The PixelBuffer holding the image data (May be empty after upload)
     TextureSet textureSet;         ///< The TextureSet holding the Texture
     VisualUrl url;                 ///< The URL of the image
     ImageDimensions desiredSize;   ///< The size requested
@@ -346,32 +352,32 @@ private:
   /**
    * @brief This signal handler is called when the async local loader finishes loading.
    * @param[in] id        This is the async image loaders Id
-   * @param[in] pixelData The loaded image data
+   * @param[in] pixelBuffer The loaded image data
    */
-  void AsyncLocalLoadComplete( uint32_t id, PixelData pixelData );
+  void AsyncLocalLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer );
 
   /**
    * @brief This signal handler is called when the async local loader finishes loading.
    * @param[in] id        This is the async image loaders Id
-   * @param[in] pixelData The loaded image data
+   * @param[in] pixelBuffer The loaded image data
    */
-  void AsyncRemoteLoadComplete( uint32_t id, PixelData pixelData );
+  void AsyncRemoteLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer );
 
   /**
    * Common method to handle loading completion
    * @param[in] container The Async loading container
    * @param[in] id        This is the async image loaders Id
-   * @param[in] pixelData The loaded image data
+   * @param[in] pixelBuffer The loaded image data
    */
-  void AsyncLoadComplete( AsyncLoadingInfoContainerType& container, uint32_t id, PixelData pixelData );
+  void AsyncLoadComplete( AsyncLoadingInfoContainerType& container, uint32_t id, Devel::PixelBuffer pixelBuffer );
 
   /**
    * @brief Performs Post-Load steps including atlasing.
    * @param[in] textureInfo The struct associated with this Texture
-   * @param[in] pixelData   The image pixelData
+   * @param[in] pixelBuffer The image pixelBuffer
    * @return    True if successful
    */
-  void PostLoad( TextureManager::TextureInfo& textureInfo, PixelData pixelData );
+  void PostLoad( TextureManager::TextureInfo& textureInfo, Devel::PixelBuffer& pixelBuffer );
 
   /**
    * Check if there is a texture waiting to be masked. If there
@@ -381,19 +387,19 @@ private:
   void CheckForWaitingTexture( TextureInfo& maskTextureInfo );
 
   /**
-   * Apply the mask texture to the image texture.
-   * @param[in] pixelData The image pixelData to apply the mask to
+   * Apply the mask to the pixelBuffer.
+   * @param[in] pixelBuffer The pixelBuffer to apply the mask to
    * @param[in] maskTextureId The texture id of the mask.
    */
-  void ApplyMask( PixelData pixelData, TextureId maskTextureId );
+  void ApplyMask( Devel::PixelBuffer& pixelBuffer, TextureId maskTextureId );
 
   /**
-   * Upload the texture specified in pixelData to the appropriate location
-   * @param[in] pixelData The image data to upload
+   * Upload the texture specified in pixelBuffer to the appropriate location
+   * @param[in] pixelBuffer The image data to upload
    * @param[in] textureInfo The texture info containing the location to
    * store the data to.
    */
-  void UploadTexture( PixelData pixelData, TextureInfo& textureInfo );
+  void UploadTexture( Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo );
 
   /**
    * Mark the texture as complete, and inform observers
index 2dd17c3..52ebd8f 100644 (file)
@@ -97,7 +97,7 @@ void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
 
 float Button::GetInitialAutoRepeatingDelay() const
 {
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetPositionInheritanceMode() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetInitialAutoRepeatingDelay() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
 
   return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
 }
index 59e0a18..05f7ab3 100644 (file)
@@ -517,16 +517,7 @@ void Control::OnStageConnection( int depth )
 
 void Control::OnStageDisconnection()
 {
-  for(RegisteredVisualContainer::Iterator iter = mImpl->mVisuals.Begin(); iter!= mImpl->mVisuals.End(); iter++)
-  {
-    // Check whether the visual is empty
-    if( (*iter)->visual )
-    {
-      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::OnStageDisconnection Setting visual(%d) off stage\n", (*iter)->index );
-      Actor self( Self() );
-      Toolkit::GetImplementation((*iter)->visual).SetOffStage( self );
-    }
-  }
+  mImpl->OnStageDisconnection();
 }
 
 void Control::OnKeyInputFocusGained()
index 19b58d6..a52b13e 100644 (file)
@@ -77,7 +77,7 @@ public:
       TEXT_COLOR,                               ///< name "textColor",                           The text color,                                                                  type VECTOR4 @SINCE_1_1.37
       FONT_FAMILY,                              ///< name "fontFamily",                          The requested font family,                                                       type STRING @SINCE_1_1.37
       FONT_STYLE,                               ///< name "fontStyle",                           The requested font style,                                                        type STRING or MAP @SINCE_1_2.13
-      POINT_SIZE,                               ///< name "pointSize",                           The size of font in points,                                                      type FLOAT @SINCE_1_1.37
+      POINT_SIZE,                               ///< name "pointSize",                           The size of font in points (Conversion from Pixel size to Point size : Point size = Pixel size * 72 / DPI),       type FLOAT @SINCE_1_1.37
       HORIZONTAL_ALIGNMENT,                     ///< name "horizontalAlignment",                 The text horizontal alignment,                                                   type STRING,  values "BEGIN", "CENTER", "END" @SINCE_1_1.37
       SCROLL_THRESHOLD,                         ///< name "scrollThreshold"                      Vertical scrolling will occur if the cursor is this close to the control border, type FLOAT @SINCE_1_1.37
       SCROLL_SPEED,                             ///< name "scrollSpeed"                          The scroll speed in pixels per second,                                           type FLOAT @SINCE_1_1.37
index 1dd97cf..c951a2d 100644 (file)
@@ -78,7 +78,7 @@ public:
       PLACEHOLDER_TEXT_FOCUSED,                 ///< name "placeholderTextFocused",              The text to display when the TextField is empty with key-input focus,              type STRING @SINCE_1_0.0
       FONT_FAMILY,                              ///< name "fontFamily",                          The requested font family,                                                         type STRING @SINCE_1_0.0
       FONT_STYLE,                               ///< name "fontStyle",                           The requested font style,                                                          type STRING or MAP @SINCE_1_2.13
-      POINT_SIZE,                               ///< name "pointSize",                           The size of font in points,                                                        type FLOAT @SINCE_1_0.0
+      POINT_SIZE,                               ///< name "pointSize",                           The size of font in points (Conversion from Pixel size to Point size : Point size = Pixel size * 72 / DPI),       type FLOAT @SINCE_1_0.0
       MAX_LENGTH,                               ///< name "maxLength"                            The maximum number of characters that can be inserted,                             type INTEGER @SINCE_1_0.0
       EXCEED_POLICY,                            ///< name "exceedPolicy"                         Specifies how the text is truncated when it does not fit,                          type INTEGER @SINCE_1_0.0
       HORIZONTAL_ALIGNMENT,                     ///< name "horizontalAlignment",                 The line horizontal alignment,                                                     type STRING,  values "BEGIN", "CENTER", "END" @SINCE_1_0.0
index bd28fce..7b331a6 100644 (file)
@@ -119,6 +119,9 @@ public:
 
       /**
        * @brief The size of font in points.
+       *
+       * Conversion from Pixel size to Point size :
+       *  Point size = Pixel size * 72 / DPI
        * @details name "pointSize", type FLOAT.
        * @SINCE_1_0.0
        */
index b31fe8b..3bb9f35 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 45;
+const unsigned int TOOLKIT_MICRO_VERSION = 47;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 7a8ab3c..e8f8ad7 100644 (file)
@@ -46,7 +46,12 @@ PixelData Load( const std::string& url,
                 bool orientationCorrection )
 {
   // Load the image synchronously (block the thread here).
-  return Dali::LoadImageFromFile( url, dimensions, fittingMode, samplingMode, orientationCorrection );
+  Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromFile( url, dimensions, fittingMode, samplingMode, orientationCorrection );
+  if( pixelBuffer )
+  {
+    return Devel::PixelBuffer::Convert( pixelBuffer );
+  }
+  return Dali::PixelData(); // return empty handle
 }
 
 
index 8179db5..dd06d35 100644 (file)
 //******************************************************************************
 
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "styles":
   {
     "Tooltip":
@@ -93,7 +97,8 @@
       "selectionHighlightColor":[0.75,0.96,1.0,1.0],
       "grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
       "selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
-      "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" }
+      "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
+      "enableSelection":false
     },
 
     "TextFieldFontSize0":
       "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
       "enableScrollBar":true,
       "scrollBarShowDuration":0.8,
-      "scrollBarFadeDuration":0.5
+      "scrollBarFadeDuration":0.5,
+      "enableSelection":false
     },
     "ProgressBar":
     {
index 95d2d01..8612b3c 100644 (file)
 //******************************************************************************
 
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "styles":
   {
     "Tooltip":
@@ -92,7 +96,8 @@
       "selectionHighlightColor":[0.75,0.96,1.0,1.0],
       "grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
       "selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
-      "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" }
+      "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
+      "enableSelection":true
     },
 
     "TextFieldFontSize0":
       "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
       "enableScrollBar":true,
       "scrollBarShowDuration":0.8,
-      "scrollBarFadeDuration":0.5
+      "scrollBarFadeDuration":0.5,
+      "enableSelection":true
     },
     "Popup":
     {
index fdd8182..0c48655 100644 (file)
 //******************************************************************************
 
 {
+  "config":
+  {
+    "alwaysShowFocus":false
+  },
   "styles":
   {
     "TextLabel":
@@ -66,7 +70,8 @@
       "selectionHighlightColor":[0.75,0.96,1.0,1.0],
       "grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
       "selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
-      "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" }
+      "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
+      "enableSelection":true
     },
 
     "TextFieldFontSize0":
       "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
       "enableScrollBar":true,
       "scrollBarShowDuration":0.8,
-      "scrollBarFadeDuration":0.5
+      "scrollBarFadeDuration":0.5,
+      "enableSelection":true
     },
     "Popup":
     {
index b5dc3dd..e512fe7 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.45
+Version:    1.2.47
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT