// 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
../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
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,
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);
// 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));
../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
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
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
#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
+++ /dev/null
-/*
- * 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
+++ /dev/null
-#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
// EXTERNAL INCLUDES
#include <dali/public-api/object/base-object.h>
-#include <dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h>
namespace Dali
{
{
/**
- * 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)
{
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;
}
} // 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();
}
-#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
{
namespace Adaptor
{
-class TextClipboard;
+class Clipboard;
}
}
* 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
};
} // namespace Dali
-#endif // TOOLKIT_TextCLIPBOARD_H
+#endif // TOOLKIT_CLIPBOARD_H
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;
#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>
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();
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
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")
)
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()
target_compile_options(bullet3 PRIVATE -w)
endif()
+target_compile_options(bullet3 PRIVATE -fvisibility=default)
+
target_link_libraries(bullet3 ${COVERAGE})
if(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()
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
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})
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)
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)
# 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)
* 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
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)
{
// 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())
{
mInputMethodContext.EventReceivedSignal().Disconnect(this, &TextEditor::OnInputMethodContextEvent);
}
- TextClipboardEventNotifier notifier(TextClipboardEventNotifier::Get());
-
- if(notifier)
- {
- notifier.ContentSelectedSignal().Disconnect(this, &TextEditor::OnClipboardTextSelected);
- }
mController->KeyboardFocusLostEvent();
}
}
-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);
// 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>
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
// 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())
{
mInputMethodContext.EventReceivedSignal().Disconnect(this, &TextField::OnInputMethodContextEvent);
}
- TextClipboardEventNotifier notifier(TextClipboardEventNotifier::Get());
-
- if(notifier)
- {
- notifier.ContentSelectedSignal().Disconnect(this, &TextField::OnClipboardTextSelected);
- }
mController->KeyboardFocusLostEvent();
}
}
-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);
*/
// 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>
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
#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>
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();
controller.mImpl->SetClipboardHideEnable(false);
// Paste
- TextUpdater::PasteText(controller, stringToPaste);
+ TextUpdater::PasteText(controller, text);
controller.mImpl->SetClipboardHideEnable(true);
}
*/
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);
};
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
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)
ChangeState(EventData::EDITING);
}
-void Controller::Impl::RequestGetTextFromClipboard()
-{
- if(EnsureClipboardCreated())
- {
- mClipboard.RequestItem();
- }
-}
-
void Controller::Impl::RepositionSelectionHandles()
{
SelectionHandleController::Reposition(*this);
*/
// 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>
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);
{
if(!mClipboard)
{
- mClipboard = TextClipboard::Get();
+ mClipboard = Clipboard::Get();
}
return mClipboard != nullptr ? true : false;
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;
}
void SendSelectionToClipboard(bool deleteAfterSending);
- void RequestGetTextFromClipboard();
-
void RepositionSelectionHandles();
void RepositionSelectionHandles(float visualX, float visualY, Controller::NoTextTap::Action action);
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.
#endif
const char* EMPTY_STRING = "";
+const char* MIME_TYPE_TEXT_PLAIN = "text/plain;charset=utf-8";
template<typename Type>
void EnsureCreated(Type*& object)
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)
// 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>
*
* 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.
/**
/**
* @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.
}
else
{
- RequestRemove(textureInfo.textureId, nullptr);
+ Remove(textureInfo.textureId);
}
}
}
mAtlasRectSize(0, 0),
mLoadState(TextureManager::LoadState::NOT_STARTED),
mAttemptAtlasing(false),
- mOrientationCorrection(true)
+ mOrientationCorrection(true),
+ mEnableBrokenImage(true)
{
EnablePreMultipliedAlpha(mFactoryCache.GetPreMultiplyOnLoad());
}
{
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);
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;
}
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);
}
}
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();
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
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();
+ }
}
}
}
}
+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
*/
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;
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
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");
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;
{
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
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