[dali_2.2.38] Merge branch 'devel/master' 40/296840/1
authorDavid Steele <david.steele@samsung.com>
Fri, 4 Aug 2023 12:43:52 +0000 (13:43 +0100)
committerDavid Steele <david.steele@samsung.com>
Fri, 4 Aug 2023 12:43:52 +0000 (13:43 +0100)
Change-Id: Ifa44fef7cc9f9c70078bb00f9828553296cb7ffc

36 files changed:
automated-tests/src/dali-scene3d/utc-Dali-MotionData.cpp
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp
automated-tests/src/dali-toolkit-styling/CMakeLists.txt
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/dali-toolkit-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp [deleted file]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.h [deleted file]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.h
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
build/tizen/dali-physics/CMakeLists.txt
dali-physics/third-party/bullet3/CMakeLists.txt
dali-physics/third-party/chipmunk2d/src/CMakeLists.txt
dali-toolkit/devel-api/visuals/image-visual-properties-devel.h
dali-toolkit/internal/controls/image-view/image-view-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/text/controller/text-controller-event-handler.cpp
dali-toolkit/internal/text/controller/text-controller-event-handler.h
dali-toolkit/internal/text/controller/text-controller-impl.cpp
dali-toolkit/internal/text/controller/text-controller-impl.h
dali-toolkit/internal/text/controller/text-controller.cpp
dali-toolkit/internal/text/controller/text-controller.h
dali-toolkit/internal/texture-manager/texture-manager-impl.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 54fc168..daa558f 100644 (file)
@@ -393,8 +393,14 @@ int UtcDaliMotionDataLoadAsyncMultiple(void)
   // Check MotionData load successfully.
   DALI_TEST_GREATER(motionData.GetMotionCount(), 0u, TEST_LOCATION);
 
+  gLoadCompleted = false;
+
   // Check if completed request comes only 1 time.
-  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, 1), false, TEST_LOCATION);
+  Test::WaitForEventThreadTrigger(1, 1);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gLoadCompleted, false, TEST_LOCATION);
 
   END_TEST;
 }
\ No newline at end of file
index f903fbe..ee58ab6 100755 (executable)
@@ -61,7 +61,6 @@ SET(TEST_HARNESS_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-feedback-player.cpp
index 7c4636d..6a3a84a 100644 (file)
@@ -44,12 +44,6 @@ const char* const OPTION_CLIPBOARD("optionClipboard");    // "Clipboard" popup o
 
 const Size CONTROL_SIZE(300.f, 60.f);
 
-std::string gClipboardText;
-void        ContentSelectedCallback(TextClipboardEventNotifier& notifier)
-{
-  gClipboardText = notifier.GetContent();
-}
-
 // Generate a KeyEvent to send to Core.
 Dali::KeyEvent GenerateKey(const std::string&           keyName,
                            const std::string&           keyString,
@@ -547,9 +541,6 @@ int UtcDaliTextControllerTextPopupButtonTouched(void)
   controller->GetText(text);
   DALI_TEST_CHECK(text.empty());
 
-  TextClipboardEventNotifier clipboardEventNotifier = TextClipboardEventNotifier::Get();
-  clipboardEventNotifier.ContentSelectedSignal().Connect(&ContentSelectedCallback);
-
   // Paste the text.
   button = PushButton::DownCast(textPopup.FindChildByName(OPTION_PASTE));
   DALI_TEST_CHECK(button);
@@ -558,8 +549,9 @@ int UtcDaliTextControllerTextPopupButtonTouched(void)
 
   // Call relayout to process the input events.
   controller->Relayout(CONTROL_SIZE);
+  controller->GetText(text);
 
-  DALI_TEST_EQUALS("Hello world", gClipboardText, TEST_LOCATION);
+  DALI_TEST_EQUALS("Hello world", text.c_str(), TEST_LOCATION);
 
   // Show the clipboard.
   button = PushButton::DownCast(textPopup.FindChildByName(OPTION_CLIPBOARD));
index 4c211d1..814a4de 100644 (file)
@@ -31,7 +31,6 @@ SET(TEST_HARNESS_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-virtual-keyboard.cpp
index aa881bc..994ec67 100644 (file)
@@ -14,7 +14,6 @@ SET(TC_SOURCES
 SET(TEST_HARNESS_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
index 85a1439..1ddb118 100755 (executable)
@@ -103,7 +103,6 @@ SET(TEST_HARNESS_SOURCES
   dali-toolkit-test-utils/toolkit-application.cpp
   dali-toolkit-test-utils/toolkit-canvas-renderer.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
   dali-toolkit-test-utils/toolkit-environment-variable.cpp
   dali-toolkit-test-utils/toolkit-input-method-context.cpp
index da96fac..96f0acd 100644 (file)
@@ -31,6 +31,5 @@ std::ostream& operator<<( std::ostream& ostream, Dali::Toolkit::Visual::Resource
 #include "toolkit-test-application.h"
 #include "toolkit-application.h"
 #include "toolkit-input-method-context.h"
-#include "toolkit-clipboard-event-notifier.h"
 
 #endif // DALI_TOOLKIT_TEST_SUITE_UTILS_H
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
deleted file mode 100644 (file)
index cfc2a96..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2018 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 "toolkit-clipboard-event-notifier.h"
-
-#include <dali-toolkit/public-api/dali-toolkit-common.h>
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/signals/dali-signal.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class TextClipboardEventNotifier : public Dali::BaseObject
-{
-public:
-
-  typedef Dali::TextClipboardEventNotifier::TextClipboardEventSignalType TextClipboardEventSignalType;
-
-  // Creation
-  static Dali::TextClipboardEventNotifier New();
-  static Dali::TextClipboardEventNotifier Get();
-
-  // Public API
-  const std::string& GetContent() const;
-  void SetContent( const std::string& content );
-  void ClearContent();
-  void EmitContentSelectedSignal();
-
-  // Signals
-  TextClipboardEventSignalType& ContentSelectedSignal()
-  {
-    return mContentSelectedSignal;
-  }
-
-private:
-  // Construction & Destruction
-  TextClipboardEventNotifier();
-  virtual ~TextClipboardEventNotifier();
-
-  // Undefined
-  TextClipboardEventNotifier( const TextClipboardEventNotifier& );
-  TextClipboardEventNotifier& operator=( TextClipboardEventNotifier& );
-
-private:
-
-  std::string mContent;    ///< The current selected content.
-  TextClipboardEventSignalType mContentSelectedSignal;
-
-  static Dali::TextClipboardEventNotifier mToolkitClipboardEventNotifier;
-
-public:
-
-  // Helpers for public-api forwarding methods
-
-  inline static Internal::Adaptor::TextClipboardEventNotifier& GetImplementation(Dali::TextClipboardEventNotifier& detector)
-  {
-    DALI_ASSERT_ALWAYS( detector && "TextClipboardEventNotifier handle is empty" );
-
-    BaseObject& handle = detector.GetBaseObject();
-
-    return static_cast<Internal::Adaptor::TextClipboardEventNotifier&>(handle);
-  }
-
-  inline static const Internal::Adaptor::TextClipboardEventNotifier& GetImplementation(const Dali::TextClipboardEventNotifier& detector)
-  {
-    DALI_ASSERT_ALWAYS( detector && "TextClipboardEventNotifier handle is empty" );
-
-    const BaseObject& handle = detector.GetBaseObject();
-
-    return static_cast<const Internal::Adaptor::TextClipboardEventNotifier&>(handle);
-  }
-
-};
-
-Dali::TextClipboardEventNotifier TextClipboardEventNotifier::mToolkitClipboardEventNotifier;
-
-Dali::TextClipboardEventNotifier TextClipboardEventNotifier::New()
-{
-  return Get();
-}
-
-Dali::TextClipboardEventNotifier TextClipboardEventNotifier::Get()
-{
-  if ( !mToolkitClipboardEventNotifier )
-  {
-    mToolkitClipboardEventNotifier = Dali::TextClipboardEventNotifier( new TextClipboardEventNotifier );
-  }
-  return mToolkitClipboardEventNotifier;
-}
-
-const std::string& TextClipboardEventNotifier::GetContent() const
-{
-  return mContent;
-}
-
-void TextClipboardEventNotifier::SetContent( const std::string& content )
-{
-  mContent = content;
-}
-
-void TextClipboardEventNotifier::ClearContent()
-{
-  mContent.clear();
-}
-
-void TextClipboardEventNotifier::EmitContentSelectedSignal()
-{
-  if ( !mContentSelectedSignal.Empty() )
-  {
-    Dali::TextClipboardEventNotifier handle( this );
-    mContentSelectedSignal.Emit( handle );
-  }
-}
-
-TextClipboardEventNotifier::TextClipboardEventNotifier()
-: mContent()
-{
-}
-
-TextClipboardEventNotifier::~TextClipboardEventNotifier()
-{
-}
-
-} // namespace Adaptor
-} // namespace Internal
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TextClipboardEventNotifier::TextClipboardEventNotifier()
-{
-}
-
-TextClipboardEventNotifier TextClipboardEventNotifier::Get()
-{
-  return Internal::Adaptor::TextClipboardEventNotifier::Get();
-}
-
-TextClipboardEventNotifier::~TextClipboardEventNotifier()
-{
-}
-
-const std::string& TextClipboardEventNotifier::GetContent() const
-{
-  return Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).GetContent();
-}
-
-void TextClipboardEventNotifier::SetContent( const std::string& content )
-{
-  Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).SetContent(content);
-}
-
-void TextClipboardEventNotifier::ClearContent()
-{
-  Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).ClearContent();
-}
-
-void TextClipboardEventNotifier::EmitContentSelectedSignal()
-{
-  Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).EmitContentSelectedSignal();
-}
-
-TextClipboardEventNotifier::TextClipboardEventSignalType& TextClipboardEventNotifier::ContentSelectedSignal()
-{
-  return Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).ContentSelectedSignal();
-}
-
-TextClipboardEventNotifier::TextClipboardEventNotifier( Internal::Adaptor::TextClipboardEventNotifier* notifier )
-: BaseHandle( notifier )
-{
-}
-
-} // namespace Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.h
deleted file mode 100644 (file)
index b2aabe4..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef DALI_TOOLKIT_CLIPBOARD_EVENT_NOTIFIER_H
-#define DALI_TOOLKIT_CLIPBOARD_EVENT_NOTIFIER_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// PUBLIC INCLUDES
-#define DALI_TEXT_CLIPBOARD_EVENT_NOTIFIER_H
-#include <dali/public-api/object/base-handle.h>
-#include <dali/public-api/signals/dali-signal.h>
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-namespace Adaptor
-{
-class TextClipboardEventNotifier;
-}
-}
-
-class TextClipboardEventNotifier : public BaseHandle
-{
-public:
-  typedef Signal< void ( TextClipboardEventNotifier& ) > TextClipboardEventSignalType;
-
-  TextClipboardEventNotifier();
-  static TextClipboardEventNotifier Get();
-  ~TextClipboardEventNotifier();
-
-  const std::string& GetContent() const;
-  void SetContent( const std::string& content );
-  void ClearContent();
-
-  void EmitContentSelectedSignal();
-  TextClipboardEventSignalType& ContentSelectedSignal();
-
-  TextClipboardEventNotifier( Internal::Adaptor::TextClipboardEventNotifier* notifier );
-};
-
-} // namespace Dali
-
-#endif // DALI_TOOLKIT_TOOLKIT_CLIPBOARD_EVENT_NOTIFIER_H
index 177dc95..39d04e3 100644 (file)
@@ -19,7 +19,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/base-object.h>
-#include <dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h>
 
 namespace Dali
 {
@@ -31,94 +30,110 @@ namespace Adaptor
 {
 
 /**
- * Implementation of the Clip Board
+ * Implementation of the Clipboard
  */
 
-class TextClipboard :  public Dali::BaseObject
+class Clipboard :  public Dali::BaseObject
 {
 public:
 
   /**
-   * @copydoc Dali::TextClipboardEventNotifier::Get()
+   * @copydoc Dali::ClipboardEventNotifier::Get()
    */
-  static Dali::TextClipboard Get();
+  static Dali::Clipboard Get();
 
   /**
    * Constructor
    * @param[in] ecoreXwin, The window is created by application.
    */
-  TextClipboard(/*Ecore_X_Window ecoreXwin*/);
-  virtual ~TextClipboard();
+  Clipboard(/*Ecore_X_Window ecoreXwin*/);
+  virtual ~Clipboard();
 
   /**
-   * @copydoc Dali::TextClipboard::IsAvailable()
+   * @copydoc Dali::Clipboard::IsAvailable()
    */
   static bool IsAvailable();
 
   /**
-   * @copydoc Dali::TextClipboard::SetItem()
+   * @copydoc Dali::Clipboard::DataSentSignal()
    */
-  bool SetItem(const std::string &itemData);
+  Dali::Clipboard::DataSentSignalType& DataSentSignal();
 
   /**
-   * @copydoc Dali::TextClipboard::RequestItem()
+   * @copydoc Dali::Clipboard::DataReceivedSignal()
    */
-  void RequestItem();
+  Dali::Clipboard::DataReceivedSignalType& DataReceivedSignal();
 
   /**
-   * @copydoc Dali::TextClipboard::NumberOfClipboardItems()
+   * @copydoc Dali::Clipboard::SetData()
    */
-  unsigned int NumberOfItems();
+  bool SetData(const Dali::Clipboard::ClipData& clipData);
 
   /**
-   * @copydoc Dali::TextClipboard::ShowClipboard()
+   * @copydoc Dali::Clipboard::GetData()
+   */
+  uint32_t GetData(const std::string &mimeType);
+
+  /**
+   * @copydoc Dali::Clipboard::NumberOfClipboardItems()
+   */
+  size_t NumberOfItems();
+
+  /**
+   * @copydoc Dali::Clipboard::ShowClipboard()
    */
   void ShowClipboard();
 
   /**
-   * @copydoc Dali::TextClipboard::HideClipboard()
+   * @copydoc Dali::Clipboard::HideClipboard()
    */
   void HideClipboard();
 
   /**
-  * @copydoc Dali::TextClipboard::IsVisible()
+  * @copydoc Dali::Clipboard::IsVisible()
   */
   bool IsVisible() const;
 
 private:
-  TextClipboard( const TextClipboard& );
-  TextClipboard& operator=( TextClipboard& );
+  Clipboard( const Clipboard& );
+  Clipboard& operator=( Clipboard& );
 
-  static Dali::TextClipboard mToolkitClipboard;
-  bool mVisible;
-  std::string mItem;
-  int mCount;
-}; // class TextClipboard
+  static Dali::Clipboard mToolkitClipboard;
 
+  bool        mVisible;
+  std::string mMimeType;
+  std::string mData;
+  uint32_t    mDataId{0};
+  size_t      mCount;
 
-Dali::TextClipboard Dali::Internal::Adaptor::TextClipboard::mToolkitClipboard;
+  Dali::Clipboard::DataSentSignalType     mDataSentSignal;
+  Dali::Clipboard::DataReceivedSignalType mDataReceivedSignal;
+}; // class clipboard
 
 
-TextClipboard::TextClipboard()
+Dali::Clipboard Dali::Internal::Adaptor::Clipboard::mToolkitClipboard;
+
+
+Clipboard::Clipboard()
 {
   mVisible = false;
-  mCount = 0;
+  mCount = 0u;
 }
 
-TextClipboard::~TextClipboard()
+Clipboard::~Clipboard()
 {
 }
 
-Dali::TextClipboard TextClipboard::Get()
+Dali::Clipboard Clipboard::Get()
 {
-  if( ! mToolkitClipboard )
+  if(!mToolkitClipboard)
   {
-    mToolkitClipboard = Dali::TextClipboard( new Dali::Internal::Adaptor::TextClipboard() );
+    mToolkitClipboard = Dali::Clipboard(new Dali::Internal::Adaptor::Clipboard());
   }
   return mToolkitClipboard;
 }
 
-bool TextClipboard::IsAvailable()
+bool Clipboard::IsAvailable()
 {
   if(mToolkitClipboard)
   {
@@ -127,39 +142,59 @@ bool TextClipboard::IsAvailable()
   return false;
 }
 
-bool TextClipboard::SetItem(const std::string &itemData )
+Dali::Clipboard::DataSentSignalType& Clipboard::DataSentSignal()
+{
+  return mDataSentSignal;
+}
+
+Dali::Clipboard::DataReceivedSignalType& Clipboard::DataReceivedSignal()
+{
+  return mDataReceivedSignal;
+}
+
+bool Clipboard::SetData(const Dali::Clipboard::ClipData& clipData)
 {
-  mItem = itemData;
-  mCount = 1;
+  mMimeType = clipData.GetMimeType();
+  mData     = clipData.GetData();
+  mCount    = 1u;
+
+  if(mData.empty())
+  {
+    return false;
+  }
+
+  mDataSentSignal.Emit(mMimeType.c_str(), mData.c_str());
+
   return true;
 }
 
-void TextClipboard::RequestItem()
+uint32_t Clipboard::GetData(const std::string &mimeType)
 {
-  Dali::TextClipboardEventNotifier clipboardEventNotifier(Dali::TextClipboardEventNotifier::Get());
-  if ( clipboardEventNotifier )
+  if(!mMimeType.compare(mimeType.c_str()))
   {
-    clipboardEventNotifier.SetContent( mItem );
-    clipboardEventNotifier.EmitContentSelectedSignal();
+    mDataId++;
+    mDataReceivedSignal.Emit(mDataId, mMimeType.c_str(), mData.c_str());
+    return mDataId;
   }
+  return 0u;
 }
 
-unsigned int TextClipboard::NumberOfItems()
+size_t Clipboard::NumberOfItems()
 {
   return mCount;
 }
 
-void TextClipboard::ShowClipboard()
+void Clipboard::ShowClipboard()
 {
   mVisible = true;
 }
 
-void TextClipboard::HideClipboard()
+void Clipboard::HideClipboard()
 {
   mVisible = false;
 }
 
-bool TextClipboard::IsVisible() const
+bool Clipboard::IsVisible() const
 {
   return mVisible;
 }
@@ -169,64 +204,55 @@ bool TextClipboard::IsVisible() const
 } // namespace Internal
 
 
-inline static Internal::Adaptor::TextClipboard& GetImplementation(Dali::TextClipboard& clipboard)
+inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
 {
   // Bypass any passed in clipboard handle - it probably won't be initialized
-  Dali::TextClipboard theClipboard = Dali::TextClipboard::Get();
+  Dali::Clipboard theClipboard = Dali::Clipboard::Get();
   BaseObject& object = theClipboard.GetBaseObject();
-  return static_cast<Internal::Adaptor::TextClipboard&>(object);
+  return static_cast<Internal::Adaptor::Clipboard&>(object);
 }
 
-inline static const  Internal::Adaptor::TextClipboard& GetImplementation(const Dali::TextClipboard& clipboard)
+inline static const  Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
 {
   // Bypass any passed in clipboard handle - it probably won't be initialized
-  Dali::TextClipboard theClipboard = Dali::TextClipboard::Get();
+  Dali::Clipboard theClipboard = Dali::Clipboard::Get();
   const BaseObject& object = theClipboard.GetBaseObject();
-  return static_cast<const Internal::Adaptor::TextClipboard&>(object);
+  return static_cast<const Internal::Adaptor::Clipboard&>(object);
 }
 
 
-TextClipboard::TextClipboard()
+Clipboard::Clipboard()
 {
 }
-TextClipboard::~TextClipboard()
+Clipboard::~Clipboard()
 {
 }
-TextClipboard::TextClipboard(Internal::Adaptor::TextClipboard *impl)
+Clipboard::Clipboard(Internal::Adaptor::Clipboard *impl)
   : BaseHandle(impl)
 {
 }
 
-TextClipboard TextClipboard::Get()
-{
-  return Internal::Adaptor::TextClipboard::Get();
-}
-bool TextClipboard::SetItem( const std::string &itemData)
-{
-  return GetImplementation(*this).SetItem( itemData );
-}
-
-void TextClipboard::RequestItem()
+Clipboard Clipboard::Get()
 {
-  GetImplementation(*this).RequestItem();
+  return Internal::Adaptor::Clipboard::Get();
 }
 
-unsigned int TextClipboard::NumberOfItems()
+size_t Clipboard::NumberOfItems()
 {
   return GetImplementation(*this).NumberOfItems();
 }
 
-void TextClipboard::ShowClipboard()
+void Clipboard::ShowClipboard()
 {
   GetImplementation(*this).ShowClipboard();
 }
 
-void TextClipboard::HideClipboard()
+void Clipboard::HideClipboard()
 {
   GetImplementation(*this).HideClipboard();
 }
 
-bool TextClipboard::IsVisible() const
+bool Clipboard::IsVisible() const
 {
   return GetImplementation(*this).IsVisible();
 }
index 5757cff..7ad3187 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef  TOOLKIT_TEXT_CLIPBOARD_H
-#define  TOOLKIT_TEXT_CLIPBOARD_H
+#ifndef  TOOLKIT_CLIPBOARD_H
+#define  TOOLKIT_CLIPBOARD_H
 
 /*
  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  */
 
-#define DALI_TEXT_CLIPBOARD_H
+#define DALI_CLIPBOARD_H
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/signals/dali-signal.h>
 
 namespace Dali DALI_IMPORT_API
 {
@@ -32,7 +33,7 @@ namespace Internal DALI_INTERNAL
 
 namespace Adaptor
 {
-class TextClipboard;
+class Clipboard;
 }
 }
 
@@ -40,56 +41,114 @@ class TextClipboard;
  * The Clipboard can operate using various funtion.
  * Clipboard can manage it's item and set show / hide status.
  */
-class TextClipboard : public BaseHandle
+class Clipboard : public BaseHandle
 {
 public:
   /**
+   * @brief Structure that contains information about the clipboard data information.
+   */
+  struct ClipData
+  {
+    ClipData(const char* mimeType = nullptr, const char* data = nullptr)
+    {
+      this->mimeType = mimeType;
+      this->data     = data;
+    }
+    void SetMimeType(const char* mimeType)
+    {
+      this->mimeType = mimeType;
+    }
+    const char* GetMimeType() const
+    {
+      return mimeType;
+    }
+    void SetData(const char* data)
+    {
+      this->data = data;
+    }
+    const char* GetData() const
+    {
+      return data;
+    }
+
+  private:
+    const char* mimeType {nullptr}; ///< The mime type of clip data.
+    const char* data {nullptr};     ///< The clip data.
+  };
+
+  /// @brief Data send completed signal.
+  typedef Signal<void(const char*, const char*)> DataSentSignalType;
+
+  /// @brief Data receive completed signal.
+  typedef Signal<void(uint32_t, const char*, const char*)> DataReceivedSignalType;
+
+
+  /**
    * Create an uninitialized Clipboard;
    *  this can be initialized with one of the derived Clipboard' New() methods
    */
-  TextClipboard();
+  Clipboard();
 
   /**
    * Non virtual destructor.
    */
-  ~TextClipboard();
+  ~Clipboard();
 
   /**
    * This constructor is used by Adaptor::GetClipboard().
    * @param[in] clipboard A pointer to the clipboard.
    */
-  TextClipboard( Internal::Adaptor::TextClipboard* clipboard );
+  Clipboard(Internal::Adaptor::Clipboard* clipboard);
 
   /**
-   * Retrieve a handle to the TextClipboardEventNotifier instance
-   * @return A handle to the TextClipboard
+   * Retrieve a handle to the ClipboardEventNotifier instance
+   * @return A handle to the Clipboard
    */
-  static TextClipboard Get();
+  static Clipboard Get();
 
   /**
    * @brief Checks whether the clipboard is available.
-   *
    * @return true, if it is available, false otherwise.
    */
   static bool IsAvailable();
 
   /**
-   * Send the given string to the clipboard
-   * @param[in] itemData string to send to clip board
-   * @return bool true if the internal clip board sending was successful.
+   * @brief This signal is emitted when the data send complete.
+   * @note
+   * SetData() opertion does not follow a synchronous call.
+   * It follows the sequence below.
+   * SetData() -> EcoreEventDataSend() -> SendData() -> DataSentSignal() Emit
+   */
+  DataSentSignalType& DataSentSignal();
+
+  /**
+   * @brief This signal is emitted when the data receive complete.
+   * @note
+   * GetData() opertion does not follow a synchronous call.
+   * It follows the sequence below.
+   * GetData() -> EcoreEventOfferDataReady() -> ReceiveData() -> DataReceivedSignal() Emit
+   */
+  DataReceivedSignalType& DataReceivedSignal();
+
+  /**
+   * @brief Send the given data to the clipboard.
+   * @param[in] clipData data to send to the clipboard
+   * @return bool true if the internal clipboard sending was successful.
    */
-  bool SetItem( const std::string& itemData );
+  bool SetData(const ClipData& clipData);
 
   /**
-   * Request clipboard service to retrieve an item
+   * @brief Request data from the clipboard.
+   * @param[in] mimeType mime type of data to request.
+   * @return uint32_t Returns the data request id.
    */
-  void RequestItem();
+  uint32_t GetData(const std::string& mimeType);
 
   /**
-   * Returns the number of item currently in the clipboard
-   * @return unsigned int number of clipboard items
+   * @brief Returns the number of item currently in the clipboard.
+   * @return size_t number of clipboard items.
    */
-  unsigned int NumberOfItems();
+  size_t NumberOfItems();
 
   /**
    * Show the clipboard window
@@ -110,4 +169,4 @@ public:
 };
 } // namespace Dali
 
-#endif // TOOLKIT_TextCLIPBOARD_H
+#endif // TOOLKIT_CLIPBOARD_H
index c6a8711..9583e09 100644 (file)
@@ -1961,6 +1961,80 @@ int UtcDaliImageVisualSetInvalidRemoteImage(void)
   END_TEST;
 }
 
+int UtcDaliImageVisualSetInvalidImageWithDisabledBroken(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("Request image visual with invalid images - should draw broken.png");
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK(factory);
+
+  // Load invalid file
+  Property::Map propertyMap;
+  propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+  propertyMap.Insert(ImageVisual::Property::URL, "InvalidImage.png");
+
+  Visual::Base visual = factory.CreateVisual(propertyMap);
+  DALI_TEST_CHECK(visual);
+
+  TestGlAbstraction& gl           = application.GetGlAbstraction();
+  TraceCallStack&    textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
+  DummyControl      actor     = DummyControl::New();
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+
+  actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+  DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+
+  application.GetScene().Add(actor);
+
+  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("BindTexture"), true, TEST_LOCATION);
+
+  application.GetScene().Remove(actor);
+  DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
+  textureTrace.Reset();
+
+  // Load invalid file with disabled broken
+  propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+  propertyMap.Insert(ImageVisual::Property::URL, "InvalidImage.png");
+  propertyMap.Insert(Toolkit::DevelImageVisual::Property::ENABLE_BROKEN_IMAGE, false);
+
+  visual = factory.CreateVisual(propertyMap);
+  DALI_TEST_CHECK(visual);
+
+  actor                        = DummyControl::New();
+  DummyControlImpl& dummyImpl2 = static_cast<DummyControlImpl&>(actor.GetImplementation());
+  dummyImpl2.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+
+  actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+  DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), false, TEST_LOCATION);
+
+  application.GetScene().Remove(actor);
+  DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
+
+  END_TEST;
+}
+
 int UtcDaliImageVisualAlphaMask01(void)
 {
   ToolkitTestApplication application;
index 81f69a7..557be57 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
 
 #include <dali/devel-api/actors/actor-devel.h>
-#include <dali/devel-api/adaptor-framework/text-clipboard.h>
+#include <dali/devel-api/adaptor-framework/clipboard.h>
 #include <dali/devel-api/adaptor-framework/key-devel.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/devel-api/events/pan-gesture-devel.h>
@@ -2166,7 +2166,7 @@ int utcDaliTextEditorEvent03(void)
   application.Render();
 
   // Send some taps and check text controller with clipboard window
-  Dali::TextClipboard clipboard = TextClipboard::Get();
+  Dali::Clipboard clipboard = Clipboard::Get();
   clipboard.ShowClipboard();
   TestGenerateTap(application, 3.0f, 25.0f, 100);
   clipboard.HideClipboard();
index 5375a59..5f33099 100644 (file)
@@ -2981,8 +2981,9 @@ int utcDaliTextFieldEvent08(void)
   ToolkitTestApplication application;
   tet_infoline(" utcDaliTextFieldEvent08");
 
-  Dali::TextClipboard clipboard = TextClipboard::Get();
-  clipboard.SetItem("testTextFieldEvent");
+  Dali::Clipboard clipboard = Clipboard::Get();
+  Dali::Clipboard::ClipData data("text/plain;charset=utf-8", "testTextFieldEvent");
+  clipboard.SetData(data);
 
   // Checks Longpress when only place holder text
 
index f835962..d6dbad2 100644 (file)
@@ -8,7 +8,7 @@ set(${name}_VERSION_MINOR 0)
 set(${name}_VERSION_PATCH 0)
 set(${name}_VERSION ${${name}_VERSION_MAJOR}.${${name}_VERSION_MINOR}.${${name}_VERSION_PATCH} )
 
-SET(DALI_SCENE3D_VERSION ${${name}_VERSION} )
+SET(DALI_PHYSICS_VERSION ${${name}_VERSION} )
 
 if(CMAKE_BUILD_TYPE MATCHES Debug)
     add_definitions("-DDEBUG_ENABLED")
@@ -76,8 +76,19 @@ if (ENABLE_PKG_CONFIGURE)
     )
 endif()
 
+if( INSTALL_CMAKE_MODULES )
 
+  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}-2d-config.cmake "
+    include(CMakeFindDependencyMacro)
+    include(\${CMAKE_CURRENT_LIST_DIR}/${name}-2d-targets.cmake)
+  ")
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-2d-config.cmake DESTINATION share/${name}-2d)
 
-
+  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}-3d-config.cmake "
+    include(CMakeFindDependencyMacro)
+    include(\${CMAKE_CURRENT_LIST_DIR}/${name}-3d-targets.cmake)
+  ")
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-3d-config.cmake DESTINATION share/${name}-3d)
+endif()
 
 
index 1f331c9..b504089 100644 (file)
@@ -96,6 +96,8 @@ else()
     target_compile_options(bullet3 PRIVATE -w)
 endif()
 
+target_compile_options(bullet3 PRIVATE -fvisibility=default)
+
 target_link_libraries(bullet3 ${COVERAGE})
 
 if(ENABLE_PKG_CONFIGURE)
@@ -121,9 +123,18 @@ endif(ENABLE_PKG_CONFIGURE)
 install(
     TARGETS bullet3
     DESTINATION ${LIB_DIR}
-    EXPORT Bullet3Targets
+    EXPORT bullet3-targets
 )
 
+if(INSTALL_CMAKE_MODULES)
+  install(
+      EXPORT bullet3-targets
+      NAMESPACE bullet3::
+      FILE bullet3-targets.cmake
+      DESTINATION share/bullet3
+  )
+endif()
+
 if(BULLET3_BUILD_SHARED AND MSVC)
     install(FILES $<TARGET_PDB_FILE:bullet3> DESTINATION lib)
 endif()
@@ -140,3 +151,11 @@ foreach(SUB ${BULLET_SUBMODULES})
         FILES_MATCHING PATTERN "*.h"
     )
 endforeach()
+
+if(INSTALL_CMAKE_MODULES)
+  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bullet3-config.cmake "
+    include(CMakeFindDependencyMacro)
+    include(\${CMAKE_CURRENT_LIST_DIR}/bullet3-targets.cmake)
+  ")
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bullet3-config.cmake DESTINATION share/bullet3)
+endif()
\ No newline at end of file
index 1c45355..34b30eb 100644 (file)
@@ -55,6 +55,7 @@ if(BUILD_SHARED)
       SOVERSION ${CHIPMUNK_VERSION_MAJOR}
       VERSION ${CHIPMUNK_VERSION})
   endif(NOT ANDROID)
+  target_compile_options(chipmunk PRIVATE -fvisibility=default)
   if(ANDROID OR UNIX)
     # need to explicitly link to the math library because the CMake/Android toolchains may not do it automatically
     target_link_libraries(chipmunk m ${COVERAGE})
@@ -62,9 +63,11 @@ if(BUILD_SHARED)
   if(ANDROID)
     target_link_libraries(chipmunk ${LOGLIB})
   endif(ANDROID)
-  install(TARGETS chipmunk RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+  install(TARGETS chipmunk EXPORT chipmunk-targets
+                           RUNTIME DESTINATION ${BIN_INSTALL_DIR}
                            LIBRARY DESTINATION ${LIB_INSTALL_DIR}
-                           ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
+                           ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+                           )
 endif(BUILD_SHARED)
 
 if(BUILD_STATIC)
@@ -78,12 +81,13 @@ if(BUILD_STATIC)
   endif(MSVC)
   # Sets chipmunk_static to output "libchipmunk.a" not "libchipmunk_static.a"
   set_target_properties(chipmunk_static PROPERTIES OUTPUT_NAME chipmunk)
+  target_compile_options(chipmunk PRIVATE -fvisibility=default)
   target_link_libraries(chipmunk m ${COVERAGE})
   if(ANDROID)
     target_link_libraries(chipmunk ${LOGLIB})
   endif(ANDROID)
   if(INSTALL_STATIC)
-    install(TARGETS chipmunk_static ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
+    install(TARGETS chipmunk_static EXPORT chipmunk-targets ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
   endif(INSTALL_STATIC)
 endif(BUILD_STATIC)
 
@@ -91,6 +95,21 @@ if(BUILD_SHARED OR INSTALL_STATIC)
   # FIXME: change to PUBLIC_HEADER to allow building frameworks
   install(FILES ${chipmunk_public_header} DESTINATION include/chipmunk)
   install(FILES ${chipmunk_constraint_header} DESTINATION include/chipmunk/constraints)
+
+  if(INSTALL_CMAKE_MODULES)
+    install(
+      EXPORT chipmunk-targets
+      NAMESPACE chipmunk::
+      FILE chipmunk-targets.cmake
+      DESTINATION share/chipmunk
+    )
+
+    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/chipmunk-config.cmake "
+      include(CMakeFindDependencyMacro)
+      include(\${CMAKE_CURRENT_LIST_DIR}/chipmunk-targets.cmake)
+    ")
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/chipmunk-config.cmake DESTINATION share/chipmunk)
+  endif()
 endif(BUILD_SHARED OR INSTALL_STATIC)
 
 if (ENABLE_PKG_CONFIGURE)
index 9e6d199..3c0e7d6 100644 (file)
@@ -155,7 +155,15 @@ enum Type
    * So we change its value to MASKING_ON_RENDERING even if the visual sets the MASKING_TYPE as MASKING_ON_LOADING when it uses external texture.
    * @note It is used in the ImageVisual and AnimatedImageVisual. The default is MASKING_ON_LOADING.
    */
-  MASKING_TYPE = ORIENTATION_CORRECTION + 12
+  MASKING_TYPE = ORIENTATION_CORRECTION + 12,
+
+  /**
+   * @brief Whether to enable broken image in image visual.
+   * Some of visual don't need to show broken image(ex. placeholder)
+   * Disable broken image for these visuals.
+   * default is true.
+   */
+  ENABLE_BROKEN_IMAGE = ORIENTATION_CORRECTION + 14
 };
 
 } //namespace Property
index 5f58fe3..87ab126 100644 (file)
@@ -611,6 +611,7 @@ void ImageView::CreatePlaceholderImage()
   propertyMap.Insert(Toolkit::ImageVisual::Property::URL, mPlaceholderUrl);
   //propertyMap.Insert(Toolkit::ImageVisual::Property::LOAD_POLICY, Toolkit::ImageVisual::LoadPolicy::IMMEDIATE); // TODO: need to enable this property
   propertyMap.Insert(Toolkit::ImageVisual::Property::RELEASE_POLICY, Toolkit::ImageVisual::ReleasePolicy::DESTROYED);
+  propertyMap.Insert(Toolkit::DevelImageVisual::Property::ENABLE_BROKEN_IMAGE, false);
   mPlaceholderVisual = Toolkit::VisualFactory::Get().CreateVisual(propertyMap);
   if(mPlaceholderVisual)
   {
index 6ae5aa0..3fc19f2 100644 (file)
@@ -858,12 +858,6 @@ void TextEditor::OnKeyInputFocusGained()
     // When window gain lost focus, the InputMethodContext is deactivated. Thus when window gain focus again, the InputMethodContext must be activated.
     mInputMethodContext.SetRestoreAfterFocusLost(true);
   }
-  TextClipboardEventNotifier notifier(TextClipboardEventNotifier::Get());
-
-  if(notifier)
-  {
-    notifier.ContentSelectedSignal().Connect(this, &TextEditor::OnClipboardTextSelected);
-  }
 
   if(IsEditable() && mController->IsUserInteractionEnabled())
   {
@@ -888,12 +882,6 @@ void TextEditor::OnKeyInputFocusLost()
 
     mInputMethodContext.EventReceivedSignal().Disconnect(this, &TextEditor::OnInputMethodContextEvent);
   }
-  TextClipboardEventNotifier notifier(TextClipboardEventNotifier::Get());
-
-  if(notifier)
-  {
-    notifier.ContentSelectedSignal().Disconnect(this, &TextEditor::OnClipboardTextSelected);
-  }
 
   mController->KeyboardFocusLostEvent();
 
@@ -1286,11 +1274,6 @@ void TextEditor::GetHandleImagePropertyValue(Property::Value& value, Text::Handl
   }
 }
 
-void TextEditor::OnClipboardTextSelected(TextClipboardEventNotifier& clipboard)
-{
-  mController->PasteClipboardItemEvent();
-}
-
 void TextEditor::KeyboardStatusChanged(bool keyboardShown)
 {
   DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor::KeyboardStatusChanged %p keyboardShown %d\n", mController.Get(), keyboardShown);
index a4491e1..7b30c17 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h>
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 #include <dali/devel-api/atspi-interfaces/editable-text.h>
 #include <dali/devel-api/atspi-interfaces/hypertext.h>
@@ -448,12 +447,6 @@ private: // Implementation
   InputMethodContext::CallbackData OnInputMethodContextEvent(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent);
 
   /**
-   * @brief Callback when Clipboard signals an item should be pasted
-   * @param[in] clipboard handle to TextClipboard Event Notifier
-   */
-  void OnClipboardTextSelected(TextClipboardEventNotifier& clipboard);
-
-  /**
    * @brief Get a Property Map for the image used for the required Handle Image
    * @param[out] value the returned image property
    * @param[in] handleType the type of handle
index 658bb9a..93c436e 100644 (file)
@@ -765,12 +765,6 @@ void TextField::OnKeyInputFocusGained()
     // When window gain lost focus, the inputMethodContext is deactivated. Thus when window gain focus again, the inputMethodContext must be activated.
     mInputMethodContext.SetRestoreAfterFocusLost(true);
   }
-  TextClipboardEventNotifier notifier(TextClipboardEventNotifier::Get());
-
-  if(notifier)
-  {
-    notifier.ContentSelectedSignal().Connect(this, &TextField::OnClipboardTextSelected);
-  }
 
   if(IsEditable() && mController->IsUserInteractionEnabled())
   {
@@ -794,12 +788,6 @@ void TextField::OnKeyInputFocusLost()
 
     mInputMethodContext.EventReceivedSignal().Disconnect(this, &TextField::OnInputMethodContextEvent);
   }
-  TextClipboardEventNotifier notifier(TextClipboardEventNotifier::Get());
-
-  if(notifier)
-  {
-    notifier.ContentSelectedSignal().Disconnect(this, &TextField::OnClipboardTextSelected);
-  }
 
   mController->KeyboardFocusLostEvent();
 
@@ -1118,11 +1106,6 @@ void TextField::EnableClipping()
   }
 }
 
-void TextField::OnClipboardTextSelected(TextClipboardEventNotifier& clipboard)
-{
-  mController->PasteClipboardItemEvent();
-}
-
 void TextField::KeyboardStatusChanged(bool keyboardShown)
 {
   DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::KeyboardStatusChanged %p keyboardShown %d\n", mController.Get(), keyboardShown);
index 36fe57f..afaed24 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h>
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 #include <dali/devel-api/atspi-interfaces/editable-text.h>
 #include <dali/devel-api/atspi-interfaces/hypertext.h>
@@ -420,12 +419,6 @@ private: // Implementation
   InputMethodContext::CallbackData OnInputMethodContextEvent(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent);
 
   /**
-   * @brief Callback when Clipboard signals an item should be pasted
-   * @param[in] clipboard handle to TextClipboard Event Notifier
-   */
-  void OnClipboardTextSelected(TextClipboardEventNotifier& clipboard);
-
-  /**
    * @brief Get a Property Map for the image used for the required Handle Image
    * @param[out] value the returned image property
    * @param[in] handleType the type of handle
index 4cff878..12fcd69 100644 (file)
@@ -19,7 +19,6 @@
 #include <dali-toolkit/internal/text/controller/text-controller-event-handler.h>
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h>
 #include <dali/devel-api/adaptor-framework/key-devel.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/trace.h>
@@ -892,12 +891,8 @@ InputMethodContext::CallbackData Controller::EventHandler::OnInputMethodContextE
   return callbackData;
 }
 
-void Controller::EventHandler::PasteClipboardItemEvent(Controller& controller)
+void Controller::EventHandler::PasteClipboardItemEvent(Controller& controller, const std::string& text)
 {
-  // Retrieve the clipboard contents first
-  TextClipboardEventNotifier notifier(TextClipboardEventNotifier::Get());
-  std::string            stringToPaste(notifier.GetContent());
-
   // Commit the current pre-edit text; the contents of the clipboard should be appended
   controller.mImpl->ResetInputMethodContext();
 
@@ -905,7 +900,7 @@ void Controller::EventHandler::PasteClipboardItemEvent(Controller& controller)
   controller.mImpl->SetClipboardHideEnable(false);
 
   // Paste
-  TextUpdater::PasteText(controller, stringToPaste);
+  TextUpdater::PasteText(controller, text);
 
   controller.mImpl->SetClipboardHideEnable(true);
 }
index 3be57c2..48ab1d5 100644 (file)
@@ -115,12 +115,26 @@ struct Controller::EventHandler
    */
   static bool DeleteEvent(Controller& controller, int keyCode);
 
+  /// @copydoc Text::Controller::OnInputMethodContextEvent
+  /// @param[in] controller A reference to the controller class
   static InputMethodContext::CallbackData OnInputMethodContextEvent(Controller&                          controller,
                                                                     InputMethodContext&                  inputMethodContext,
                                                                     const InputMethodContext::EventData& inputMethodContextEvent);
 
-  static void PasteClipboardItemEvent(Controller& controller);
+  /**
+   * @brief This function executes the actual text update when a clipboard paste event occurs.
+   *
+   * @param[in] controller A reference to the controller class.
+   * @param[in] text The text data to be pasted into the text controller.
+   */
+  static void PasteClipboardItemEvent(Controller& controller, const std::string& text);
+
+  /// @copydoc Text::Controller::DecorationEvent
+  /// @param[in] controller A reference to the controller class
   static void DecorationEvent(Controller& controller, HandleType handleType, HandleState state, float x, float y);
+
+  /// @copydoc Text::Controller::TextPopupButtonTouched
+  /// @param[in] controller A reference to the controller class
   static void TextPopupButtonTouched(Controller& controller, Dali::Toolkit::TextSelectionPopup::Buttons button);
 };
 
index 0385fd9..a84509f 100644 (file)
@@ -52,6 +52,7 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT
 constexpr float MAX_FLOAT = std::numeric_limits<float>::max();
 
 const char* EMPTY_STRING = "";
+const char* MIME_TYPE_TEXT_PLAIN = "text/plain;charset=utf-8";
 
 } // namespace
 
@@ -1072,8 +1073,13 @@ void Controller::Impl::SetClipboardHideEnable(bool enable)
 
 bool Controller::Impl::CopyStringToClipboard(const std::string& source)
 {
-  //Send string to clipboard
-  return (EnsureClipboardCreated() && mClipboard.SetItem(source));
+  if(EnsureClipboardCreated())
+  {
+    Dali::Clipboard::ClipData data(MIME_TYPE_TEXT_PLAIN, source.c_str());
+    return mClipboard.SetData(data); // Send clipboard data to clipboard.
+  }
+
+  return false;
 }
 
 void Controller::Impl::SendSelectionToClipboard(bool deleteAfterSending)
@@ -1084,14 +1090,6 @@ void Controller::Impl::SendSelectionToClipboard(bool deleteAfterSending)
   ChangeState(EventData::EDITING);
 }
 
-void Controller::Impl::RequestGetTextFromClipboard()
-{
-  if(EnsureClipboardCreated())
-  {
-    mClipboard.RequestItem();
-  }
-}
-
 void Controller::Impl::RepositionSelectionHandles()
 {
   SelectionHandleController::Reposition(*this);
index f4dc169..97010cc 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/text-clipboard.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/public-api/rendering/shader.h>
 
@@ -371,9 +370,9 @@ struct Controller::Impl
     mModel = Model::New();
 
     mFontClient = TextAbstraction::FontClient::Get();
-    if(mEditableControlInterface != nullptr && TextClipboard::IsAvailable())
+    if(mEditableControlInterface != nullptr && Clipboard::IsAvailable())
     {
-      mClipboard = TextClipboard::Get();
+      mClipboard = Clipboard::Get();
     }
 
     mView.SetVisualModel(mModel->mVisualModel);
@@ -567,7 +566,7 @@ struct Controller::Impl
   {
     if(!mClipboard)
     {
-      mClipboard = TextClipboard::Get();
+      mClipboard = Clipboard::Get();
     }
 
     return mClipboard != nullptr ? true : false;
@@ -575,13 +574,13 @@ struct Controller::Impl
 
   bool IsClipboardEmpty()
   {
-    bool result(TextClipboard::IsAvailable() && EnsureClipboardCreated() && mClipboard.NumberOfItems());
+    bool result(Clipboard::IsAvailable() && EnsureClipboardCreated() && mClipboard.NumberOfItems());
     return !result; // If NumberOfItems greater than 0, return false
   }
 
   bool IsClipboardVisible()
   {
-    bool result(TextClipboard::IsAvailable() && EnsureClipboardCreated() && mClipboard.IsVisible());
+    bool result(Clipboard::IsAvailable() && EnsureClipboardCreated() && mClipboard.IsVisible());
     return result;
   }
 
@@ -733,8 +732,6 @@ struct Controller::Impl
 
   void SendSelectionToClipboard(bool deleteAfterSending);
 
-  void RequestGetTextFromClipboard();
-
   void RepositionSelectionHandles();
   void RepositionSelectionHandles(float visualX, float visualY, Controller::NoTextTap::Action action);
 
@@ -1015,7 +1012,7 @@ public:
   OutlineDefaults*             mOutlineDefaults;            ///< Avoid allocating this when the user does not specify outline parameters.
   EventData*                   mEventData;                  ///< Avoid allocating everything for text input until EnableTextInput().
   TextAbstraction::FontClient  mFontClient;                 ///< Handle to the font client.
-  TextClipboard                mClipboard;                  ///< Handle to the system clipboard
+  Clipboard                    mClipboard;                  ///< Handle to the system clipboard
   View                         mView;                       ///< The view interface to the rendering back-end.
   MetricsPtr                   mMetrics;                    ///< A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics.
   Layout::Engine               mLayoutEngine;               ///< The layout engine.
index f376551..f61a037 100644 (file)
@@ -46,6 +46,7 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT
 #endif
 
 const char* EMPTY_STRING = "";
+const char* MIME_TYPE_TEXT_PLAIN = "text/plain;charset=utf-8";
 
 template<typename Type>
 void EnsureCreated(Type*& object)
@@ -1613,19 +1614,40 @@ string Controller::CutText()
   return mImpl->CutText();
 }
 
-void Controller::PasteText()
+void Controller::PasteClipboardItemEvent(uint32_t id, const char* mimeType, const char* data)
 {
-  mImpl->RequestGetTextFromClipboard(); // Request clipboard service to retrieve an item
+  // Upon receiving the data, it is important to disconnect the signal
+  // to avoid potential unintended pasting caused by subsequent requests.
+  mImpl->mClipboard.DataReceivedSignal().Disconnect(this, &Controller::PasteClipboardItemEvent);
+
+  // If the id is 0u, it is an invalid response.
+  // text-controller allows only plain text type.
+  if(id != 0u && !strncmp(mimeType, MIME_TYPE_TEXT_PLAIN, strlen(MIME_TYPE_TEXT_PLAIN)))
+  {
+    EventHandler::PasteClipboardItemEvent(*this, data);
+  }
 }
 
-InputMethodContext::CallbackData Controller::OnInputMethodContextEvent(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent)
+void Controller::PasteText()
 {
-  return EventHandler::OnInputMethodContextEvent(*this, inputMethodContext, inputMethodContextEvent);
+  if(mImpl->EnsureClipboardCreated())
+  {
+    // Connect the signal before calling GetData() of the clipboard.
+    mImpl->mClipboard.DataReceivedSignal().Connect(this, &Controller::PasteClipboardItemEvent);
+
+    // Request clipboard service to retrieve an item.
+    uint id = mImpl->mClipboard.GetData(MIME_TYPE_TEXT_PLAIN);
+    if(id == 0u)
+    {
+      // If the return id is 0u, the signal is not emitted, we must disconnect signal here.
+      mImpl->mClipboard.DataReceivedSignal().Disconnect(this, &Controller::PasteClipboardItemEvent);
+    }
+  }
 }
 
-void Controller::PasteClipboardItemEvent()
+InputMethodContext::CallbackData Controller::OnInputMethodContextEvent(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent)
 {
-  EventHandler::PasteClipboardItemEvent(*this);
+  return EventHandler::OnInputMethodContextEvent(*this, inputMethodContext, inputMethodContextEvent);
 }
 
 void Controller::GetTargetSize(Vector2& targetSize)
index db9d6cf..4932cec 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/devel-api/text/spanned.h>
+#include <dali/devel-api/adaptor-framework/clipboard.h>
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 #include <dali/public-api/events/gesture.h>
 
@@ -69,7 +70,7 @@ typedef IntrusivePtr<Controller> ControllerPtr;
  *
  * The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
  */
-class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface, public HiddenText::Observer
+class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface, public HiddenText::Observer, public ConnectionTracker
 {
 public: // Enumerated types.
   /**
@@ -2000,8 +2001,14 @@ public: // Text-input Event Queuing.
 
   /**
    * @brief Event from Clipboard notifying an Item has been selected for pasting
+   *
+   * @param[in] id The id of the data request.
+   * @param[in] mimeType The mime type of data received.
+   * @param[in] data The data received.
+   * @note
+   * This event is executed by receiving the Clipboard's DataReceivedSignal.
    */
-  void PasteClipboardItemEvent();
+  void PasteClipboardItemEvent(uint32_t id, const char* mimeType, const char* data);
 
   /**
    * @brief Return true when text control should clear key input focus when escape key is pressed.
index b548e6c..11c9105 100644 (file)
@@ -1047,7 +1047,7 @@ void TextureManager::AsyncLoadComplete(const TextureManager::TextureId& textureI
     }
     else
     {
-      RequestRemove(textureInfo.textureId, nullptr);
+      Remove(textureInfo.textureId);
     }
   }
 }
index 8adcb32..18cf2b4 100644 (file)
@@ -168,7 +168,8 @@ ImageVisual::ImageVisual(VisualFactoryCache&       factoryCache,
   mAtlasRectSize(0, 0),
   mLoadState(TextureManager::LoadState::NOT_STARTED),
   mAttemptAtlasing(false),
-  mOrientationCorrection(true)
+  mOrientationCorrection(true),
+  mEnableBrokenImage(true)
 {
   EnablePreMultipliedAlpha(mFactoryCache.GetPreMultiplyOnLoad());
 }
@@ -266,6 +267,10 @@ void ImageVisual::DoSetProperties(const Property::Map& propertyMap)
       {
         DoSetProperty(Toolkit::DevelImageVisual::Property::MASKING_TYPE, keyValue.second);
       }
+      else if(keyValue.first == ENABLE_BROKEN_IMAGE)
+      {
+        DoSetProperty(Toolkit::DevelImageVisual::Property::ENABLE_BROKEN_IMAGE, keyValue.second);
+      }
       else if(keyValue.first == LOAD_POLICY_NAME)
       {
         DoSetProperty(Toolkit::ImageVisual::Property::LOAD_POLICY, keyValue.second);
@@ -438,6 +443,16 @@ void ImageVisual::DoSetProperty(Property::Index index, const Property::Value& va
       break;
     }
 
+    case Toolkit::DevelImageVisual::Property::ENABLE_BROKEN_IMAGE:
+    {
+      bool enableBrokenImage(mEnableBrokenImage);
+      if(value.Get(enableBrokenImage))
+      {
+        mEnableBrokenImage = enableBrokenImage;
+      }
+      break;
+    }
+
     case Toolkit::ImageVisual::Property::RELEASE_POLICY:
     {
       int releasePolicy = 0;
@@ -762,17 +777,7 @@ void ImageVisual::DoSetOnScene(Actor& actor)
   }
   else if(mLoadState == TextureManager::LoadState::LOAD_FAILED)
   {
-    Vector2 imageSize = Vector2::ZERO;
-    if(actor)
-    {
-      imageSize           = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
-      mPlacementActorSize = imageSize;
-    }
-
-    mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
-    actor.AddRenderer(mImpl->mRenderer);
-    mPlacementActor.Reset();
-
+    ShowBrokenImage();
     ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
   }
 }
@@ -785,14 +790,7 @@ void ImageVisual::DoSetOffScene(Actor& actor)
   actor.RemoveRenderer(mImpl->mRenderer);
   if(mReleasePolicy == Toolkit::ImageVisual::ReleasePolicy::DETACHED)
   {
-    RemoveTexture(); // If INVALID_TEXTURE_ID then removal will be attempted on atlas
-    mImpl->mResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
-
-    TextureSet textureSet = TextureSet::New();
-    mImpl->mRenderer.SetTextures(textureSet);
-    ComputeTextureSize();
-
-    mLoadState = TextureManager::LoadState::NOT_STARTED;
+    ResetRenderer();
   }
 
   mPlacementActor.Reset();
@@ -912,18 +910,7 @@ void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureIn
     Actor actor = mPlacementActor.GetHandle();
     if(!loadingSuccess)
     {
-      Vector2 imageSize = Vector2::ZERO;
-      if(actor)
-      {
-        imageSize           = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
-        mPlacementActorSize = imageSize;
-      }
-      else
-      {
-        imageSize = mPlacementActorSize;
-      }
-
-      mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
+      ShowBrokenImage();
       textureInformation.textureSet = mImpl->mRenderer.GetTextures();
     }
     else
@@ -947,13 +934,13 @@ void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureIn
           UpdateShader();
         }
       }
-    }
 
-    if(actor)
-    {
-      actor.AddRenderer(mImpl->mRenderer);
-      // reset the weak handle so that the renderer only get added to actor once
-      mPlacementActor.Reset();
+      if(actor)
+      {
+        actor.AddRenderer(mImpl->mRenderer);
+        // reset the weak handle so that the renderer only get added to actor once
+        mPlacementActor.Reset();
+      }
     }
   }
 
@@ -1190,6 +1177,44 @@ void ImageVisual::CheckMaskTexture()
   }
 }
 
+void ImageVisual::ResetRenderer()
+{
+  RemoveTexture(); // If INVALID_TEXTURE_ID then removal will be attempted on atlas
+  mImpl->mResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
+
+  TextureSet textureSet = TextureSet::New();
+  mImpl->mRenderer.SetTextures(textureSet);
+  ComputeTextureSize();
+
+  mLoadState = TextureManager::LoadState::NOT_STARTED;
+}
+
+void ImageVisual::ShowBrokenImage()
+{
+  if(mEnableBrokenImage)
+  {
+    Actor actor = mPlacementActor.GetHandle();
+
+    Vector2 imageSize = Vector2::ZERO;
+    if(actor)
+    {
+      imageSize           = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+      mPlacementActorSize = imageSize;
+    }
+
+    mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
+    if(actor)
+    {
+      actor.AddRenderer(mImpl->mRenderer);
+      mPlacementActor.Reset();
+    }
+  }
+  else
+  {
+    ResetRenderer();
+  }
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index f5bf6fe..1bd414b 100644 (file)
@@ -322,6 +322,17 @@ private:
    */
   void CheckMaskTexture();
 
+  /**
+   * @brief Reset Renderer using empty texture
+   * For drawing empty visual, reset the renderer.
+   */
+  void ResetRenderer();
+
+  /**
+   * @brief Show broken image when image loading is failed.
+   */
+  void ShowBrokenImage();
+
 private:
   Vector4                            mPixelArea;
   WeakHandle<Actor>                  mPlacementActor;
@@ -348,6 +359,7 @@ private:
   bool                                            mAttemptAtlasing;       ///< If true will attempt atlasing, otherwise create unique texture
   bool                                            mOrientationCorrection; ///< true if the image will have it's orientation corrected.
   bool                                            mNeedYuvToRgb{false};   ///< true if we need to convert yuv to rgb.
+  bool                                            mEnableBrokenImage;
 };
 
 } // namespace Internal
index ac898d7..ec888ce 100644 (file)
@@ -123,6 +123,7 @@ const char* const ALPHA_MASK_URL("alphaMaskUrl");
 const char* const REDRAW_IN_SCALING_DOWN_NAME("redrawInScalingDown");
 const char* const MASKING_TYPE_NAME("maskingType");
 const char* const MASK_TEXTURE_RATIO_NAME("maskTextureRatio");
+const char* const ENABLE_BROKEN_IMAGE("enableBrokenImage");
 
 // Text visual
 const char* const TEXT_PROPERTY("text");
index 0bb5840..29d75a9 100644 (file)
@@ -107,6 +107,7 @@ extern const char* const ALPHA_MASK_URL;
 extern const char* const REDRAW_IN_SCALING_DOWN_NAME;
 extern const char* const MASKING_TYPE_NAME;
 extern const char* const MASK_TEXTURE_RATIO_NAME;
+extern const char* const ENABLE_BROKEN_IMAGE;
 
 // Text visual
 extern const char* const TEXT_PROPERTY;
index e942030..97d5585 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 37;
+const unsigned int TOOLKIT_MICRO_VERSION = 38;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 26f467c..971a603 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.2.37
+Version:    2.2.38
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT