/docs/generated/*
/build/tizen/doc
/build/tizen/.cov
+build/tizen/CMakeDoxyfile.in
+build/tizen/CMakeDoxygenDefaults.cmake
/build/desktop
/packaging/home*
.vscode/
+# prebuild test addons
IF( DEFINED MODULE )
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}")
ADD_SUBDIRECTORY(${MODULE})
# List of test case sources (Only these get parsed for test cases)
SET(TC_SOURCES
+ utc-Dali-AddOns.cpp
utc-Dali-BidirectionalSupport.cpp
utc-Dali-ColorConversion.cpp
utc-Dali-Control-internal.cpp
../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
dali-toolkit-test-utils/toolkit-text-utils.cpp
dali-toolkit-test-utils/dummy-visual.cpp
+ dali-toolkit-test-utils/test-addon-manager.cpp
)
-
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
dali2-core
dali2-adaptor
dali2-toolkit
)
-ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror -DDEBUG_ENABLED )
+ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror -DDEBUG_ENABLED -fPIC )
ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
ADD_DEFINITIONS(-DTEST_RESOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../resources\" )
+ADD_DEFINITIONS(-DDALI_ADDONS_PATH=\"${CMAKE_CURRENT_BINARY_DIR}\")
FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS})
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${directory}")
ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
TARGET_LINK_LIBRARIES(${EXEC_NAME}
${${CAPI_LIB}_LIBRARIES}
- -lpthread --coverage
+ -lpthread --coverage -ldl
)
INSTALL(PROGRAMS ${EXEC_NAME}
DESTINATION ${BIN_DIR}/${EXEC_NAME}
)
+
+# build addons
+MESSAGE( STATUS "BINDIR: ${CMAKE_CURRENT_BINARY_DIR}")
+
+FILE( GLOB FILES ${CMAKE_CURRENT_SOURCE_DIR}/addons/*.cmake )
+
+FOREACH( INFILE IN ITEMS ${FILES} )
+
+ INCLUDE( ${INFILE} )
+ MESSAGE( STATUS "Building ${INFILE}" )
+
+ ADD_LIBRARY( ${ADDON_NAME} SHARED ${ADDON_SOURCES} )
+
+ TARGET_INCLUDE_DIRECTORIES( ${ADDON_NAME} PUBLIC
+ ../../../
+ ${${CAPI_LIB}_INCLUDE_DIRS}
+ ../dali-toolkit/dali-toolkit-test-utils
+ dali-toolkit-test-utils)
+
+ TARGET_LINK_LIBRARIES(${ADDON_NAME}
+ ${CMAKE_CXX_LINK_FLAGS}
+ ${${CAPI_LIB}_LIBRARIES}
+ -lpthread -ldl --coverage
+ )
+
+ INSTALL( TARGETS ${ADDON_NAME} DESTINATION ${BIN_DIR} )
+
+ SET( ADDON_LIST "lib${ADDON_NAME}.so
+${ADDON_LIST}")
+ENDFOREACH()
+
+# store AddOns list
+FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/addons.txt "${ADDON_LIST}" )
\ No newline at end of file
--- /dev/null
+SET(ADDON_NAME rendering )
+SET(ADDON_SOURCES ./addons/test-rendering-addon.cpp)
--- /dev/null
+SET(ADDON_NAME sample )
+SET(ADDON_SOURCES ./addons/test-sample-addon.cpp)
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2020 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 HEADERS
+#include <dali/devel-api/addons/addon-base.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
+
+// INTERNAL HEADERS
+// Needed to access the private class members
+#define private public
+#include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
+#include <dali-toolkit/internal/visuals/npatch-loader.h>
+#undef private
+
+
+using Dali::Toolkit::Internal::TextureManager;
+
+namespace Dali
+{
+namespace AddOns
+{
+
+struct DummyTiler
+{
+};
+
+void* CreateInstance( TextureManager* textureManager )
+{
+ fprintf(stderr, "AddOn::CreateInstance( %p )\n", textureManager);
+ return new DummyTiler;
+}
+
+namespace GeometryTiler
+{
+std::vector<std::string> gCallStack;
+
+static Geometry GetGeometryInternal(TextureManager::TextureId textureId, uint32_t& o0, uint32_t& o1 )
+{
+ gCallStack.emplace_back( "GetGeometry" );
+ o0 = 10;
+ o1 = 5;
+ fprintf(stderr, "AddOn::GetGeometryInternal()\n");
+ return Dali::Geometry::New();
+}
+
+static Geometry CreateGeometryInternal(TextureManager::TextureId textureId, const Devel::PixelBuffer& pixelBuffer )
+{
+ gCallStack.emplace_back( "CreateGeometry" );
+ fprintf(stderr, "AddOn::CreateGeometryInternal()\n");
+ return Dali::Geometry::New();
+}
+
+static Geometry CreateGeometryMapInternal(const void* opacityMap,
+ const Uint16Pair& gridSize,
+ uint32_t *outElements)
+{
+ gCallStack.emplace_back( "CreateGeometryGrid" );
+ outElements[0] = 2;
+ outElements[1] = 3;
+ return Dali::Geometry::New();
+}
+
+static void* NPatchBuildInternal(const Devel::PixelBuffer& pixelBuffer, Toolkit::Internal::NPatchLoader::Data* data )
+{
+ gCallStack.emplace_back( "BuildNPatch" );
+ fprintf(stderr, "AddOn::NPatchBuild()\n");
+ static char dummyData;
+ return &dummyData;
+}
+
+static void NPatchDestroyInternal(void* object )
+{
+ gCallStack.emplace_back( "DestroyNPatch" );
+ fprintf(stderr, "AddOn::NPatchDestroy()\n");
+}
+
+static void SubmitInternal(Renderer& renderer, const void* object )
+{
+ gCallStack.emplace_back( "SubmitRenderTask" );
+ fprintf(stderr, "AddOn::SubmitInternal()\n");
+}
+
+static std::vector<std::string> GetCallStack( bool clear )
+{
+ auto retval = gCallStack;
+ if(clear)
+ {
+ gCallStack.clear();
+ }
+ return retval;
+}
+
+
+}
+}
+}
+
+/**
+ * OverdrawingAddOn implementation
+ */
+class TestRenderingAddOn : public Dali::AddOns::AddOnBase
+{
+public:
+
+ void GetAddOnInfo( Dali::AddOnInfo& info ) override
+ {
+ info.type = Dali::AddOnType::GENERIC;
+ info.name = "oo-rendering";
+ info.version = Dali::DALI_ADDON_VERSION( 1, 0, 0 );
+ info.next = nullptr;
+ }
+
+ /**
+ * Dispatch table for global functions
+ * @return
+ */
+ Dali::AddOns::DispatchTable* GetGlobalDispatchTable() override
+ {
+ static Dali::AddOns::DispatchTable dispatchTable{};
+ if( dispatchTable.Empty() )
+ {
+ dispatchTable["Initialize"] = Dali::AddOns::CreateInstance;
+ dispatchTable["CreateGeometry"] = Dali::AddOns::GeometryTiler::CreateGeometryInternal;
+ dispatchTable["GetGeometry"] = Dali::AddOns::GeometryTiler::GetGeometryInternal;
+ dispatchTable["CreateGeometryGrid"] = Dali::AddOns::GeometryTiler::CreateGeometryMapInternal;
+ dispatchTable["BuildNPatch"] = Dali::AddOns::GeometryTiler::NPatchBuildInternal;
+ dispatchTable["DestroyNPatch"] = Dali::AddOns::GeometryTiler::NPatchDestroyInternal;
+ dispatchTable["SubmitRenderTask"] = Dali::AddOns::GeometryTiler::SubmitInternal;
+ dispatchTable["GetCallStack"] = Dali::AddOns::GeometryTiler::GetCallStack;
+ }
+ return &dispatchTable;
+ }
+
+ /**
+ * Lifecycle
+ */
+
+ void OnStart() override
+ {
+ }
+
+ void OnStop() override
+ {
+ }
+
+ void OnPause() override
+ {
+ }
+
+ void OnResume() override
+ {
+ }
+
+ /**
+ * Dispatch table for instance functions
+ * @return
+ */
+ Dali::AddOns::DispatchTable* GetInstanceDispatchTable() override
+ {
+ return nullptr;
+ }
+};
+
+REGISTER_ADDON_CLASS( TestRenderingAddOn );
--- /dev/null
+/*
+ * Copyright (c) 2020 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 <cstring>
+#include <dali/devel-api/addons/addon-base.h>
+#include <dali-test-suite-utils.h>
+
+namespace
+{
+bool gIsPaused = false;
+const auto ANSWER_TO_EVERYTHING = 42;
+}
+
+int StringLen( const char* str )
+{
+ return strlen( str );
+}
+
+int DoSum( int a, int b )
+{
+ return a+b;
+}
+
+bool GetLifecycleStatus()
+{
+ return gIsPaused;
+}
+
+struct AddOnDataInstance
+{
+ int GetValue()
+ {
+ return ANSWER_TO_EVERYTHING;
+ }
+
+ static int GetValueWithInstance( AddOnDataInstance* instance )
+ {
+ return instance->GetValue();
+ }
+};
+
+AddOnDataInstance* CreateInstance()
+{
+ return new AddOnDataInstance();
+}
+
+class TestDummyAddOn : public Dali::AddOns::AddOnBase
+{
+public:
+
+ void GetAddOnInfo( Dali::AddOnInfo& info ) override
+ {
+ info.type = Dali::AddOnType::GENERIC;
+ info.name = "SampleAddOn";
+ info.version = Dali::DALI_ADDON_VERSION( 1, 0, 0 );
+ info.next = nullptr;
+ tet_printf( "SampleAddOn: GetAddOnInfo() : name = %s\n", info.name.c_str());
+ }
+
+ /**
+ * Dispatch table for global functions
+ * @return
+ */
+ Dali::AddOns::DispatchTable* GetGlobalDispatchTable() override
+ {
+ static Dali::AddOns::DispatchTable dispatchTable{};
+ if( dispatchTable.Empty() )
+ {
+ dispatchTable["DoSum"] = DoSum;
+ dispatchTable["StringLen"] = StringLen;
+ dispatchTable["GetLifecycleStatus"] = GetLifecycleStatus;
+ dispatchTable["CreateInstance"] = CreateInstance;
+
+ }
+ return &dispatchTable;
+ }
+
+ /**
+ * Lifecycle
+ */
+ void OnStart() override
+ {
+ gIsPaused = false;
+ }
+
+ void OnStop() override
+ {
+ gIsPaused = true;
+ }
+
+ void OnPause() override
+ {
+ gIsPaused = true;
+ }
+
+ void OnResume() override
+ {
+ gIsPaused = false;
+ }
+
+ /**
+ * Dispatch table for instance functions
+ */
+ Dali::AddOns::DispatchTable* GetInstanceDispatchTable() override
+ {
+ static Dali::AddOns::DispatchTable dispatchTable{};
+ if( dispatchTable.Empty() )
+ {
+ dispatchTable["InstanceCall"] = AddOnDataInstance::GetValueWithInstance;
+ }
+ return &dispatchTable;
+ }
+};
+
+REGISTER_ADDON_CLASS( TestDummyAddOn );
--- /dev/null
+/*
+ * Copyright (c) 2020 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 "test-addon-manager.h"
+#include <dali-test-suite-utils.h>
+#include <cstring>
+#include <dlfcn.h>
+
+#ifndef DALI_ADDONS_PATH
+#define DALI_ADDONS_PATH ""
+#endif
+
+namespace Dali
+{
+namespace Test
+{
+
+std::vector<std::string> AddOnManager::EnumerateAddOns()
+{
+ std::string listFileName(DALI_ADDONS_PATH);
+ listFileName += "/addons.txt";
+
+ // Read list of available test addons
+ tet_printf("Enumerating addons, file: %s\n", listFileName.c_str());
+ std::vector<std::string> addons{};
+ auto* fin = fopen( listFileName.c_str(), "r" );
+ char* lineBuf = new char[256];
+ memset( lineBuf, 0, 256 );
+ size_t n = 256;
+ while( getline( &lineBuf, &n, fin ) > 0 )
+ {
+ char* c = lineBuf;
+ while( *c )
+ {
+ if( *c == '\n' || *c == '\r' )
+ {
+ *c = 0;
+ break;
+ }
+ ++c;
+ }
+ tet_printf("Adding %s\n", lineBuf);
+ addons.emplace_back( lineBuf );
+ memset( lineBuf, 0, 256 );
+ }
+ fclose(fin);
+ delete [] lineBuf;
+ std::vector<std::string> retval{};
+ // Open addons
+ for( auto& name : addons )
+ {
+ std::string path(DALI_ADDONS_PATH);
+ path += "/";
+ path += name;
+
+ mAddOnCache.emplace_back();
+ mAddOnCache.back().handle = dlopen( path.c_str(), RTLD_DEEPBIND|RTLD_LAZY );
+ if( !mAddOnCache.back().handle )
+ {
+ mAddOnCache.back().valid = false;
+ tet_printf( "Can't open addon lib: %s, error: '%s'\n", path.c_str(), dlerror());
+ continue;
+ }
+ // Here addon must self register
+ if( !mAddOnCache.back().valid )
+ {
+ puts("Addon invalid!");
+ }
+ else
+ {
+ tet_printf( "Valid AddOn: %s\n", mAddOnCache.back().name.c_str() );
+ retval.emplace_back( mAddOnCache.back().name );
+ }
+ }
+
+ return retval;
+
+ /**
+ * Check for self-registering addons
+ */
+}
+
+void AddOnManager::RegisterAddOnDispatchTable( const AddOnDispatchTable* dispatchTable )
+{
+ // Register the dispatch table
+ auto& entry = mAddOnCache.back();
+ entry.name = dispatchTable->name;
+ tet_printf( "Registering AddOn: %s\n", entry.name.c_str());
+ entry.GetGlobalProc = dispatchTable->GetGlobalProc;
+ entry.GetInstanceProc = dispatchTable->GetInstanceProc;
+ entry.GetAddOnInfo = dispatchTable->GetAddOnInfo;
+ entry.OnStart = dispatchTable->OnStart;
+ entry.OnStop = dispatchTable->OnStop;
+ entry.OnPause = dispatchTable->OnPause;
+ entry.OnResume = dispatchTable->OnResume;
+ entry.valid = true;
+}
+
+bool AddOnManager::GetAddOnInfo(const std::string& name, AddOnInfo& info )
+{
+ auto retval = false;
+ std::find_if( mAddOnCache.begin(), mAddOnCache.end(),
+ [&retval, name, &info]( AddOnCacheEntry& entry )
+ {
+ if(entry.name == name)
+ {
+ entry.GetAddOnInfo( info );
+ retval = true;
+ return true;
+ }
+ return false;
+ });
+ return retval;
+}
+
+std::vector<AddOnLibrary> AddOnManager::LoadAddOns( const std::vector<std::string>& addonNames )
+{
+ if(mAddOnCache.empty())
+ {
+ EnumerateAddOns();
+ }
+
+ std::vector<AddOnLibrary> retval{};
+ for( auto& name : addonNames)
+ {
+ size_t index = 0;
+ auto iter = std::find_if( mAddOnCache.begin(), mAddOnCache.end(),
+ [&retval, name, &index]( AddOnCacheEntry& entry )
+ {
+ index++;
+ if(entry.name == name)
+ {
+ return true;
+ }
+ return false;
+ });
+ if( iter != mAddOnCache.end() )
+ {
+ retval.emplace_back( *reinterpret_cast<void**>( &index ) );
+ }
+ else
+ {
+ retval.emplace_back( nullptr );
+ }
+ }
+
+ return retval;
+}
+
+void* AddOnManager::GetGlobalProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName )
+{
+ auto index = *reinterpret_cast<const size_t*>( &addOnLibrary );
+ return mAddOnCache[index-1].GetGlobalProc( procName );
+}
+
+void* AddOnManager::GetInstanceProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName )
+{
+ auto index = *reinterpret_cast<const size_t*>( &addOnLibrary );
+ return mAddOnCache[index-1].GetInstanceProc( procName );
+}
+
+void AddOnManager::Start()
+{
+ for( auto& entry : mAddOnCache )
+ {
+ if(entry.OnStart)
+ {
+ entry.OnStart();
+ }
+ }
+}
+
+void AddOnManager::Resume()
+{
+ for( auto& entry : mAddOnCache )
+ {
+ if(entry.OnResume)
+ {
+ entry.OnResume();
+ }
+ }
+}
+
+void AddOnManager::Stop()
+{
+ for( auto& entry : mAddOnCache )
+ {
+ if(entry.OnStop)
+ {
+ entry.OnStop();
+ }
+ }
+}
+
+void AddOnManager::Pause()
+{
+ for( auto& entry : mAddOnCache )
+ {
+ if(entry.OnPause)
+ {
+ entry.OnPause();
+ }
+ }
+}
+
+}
+}
+
--- /dev/null
+#ifndef TEST_ADDON_MANAGER_H
+#define TEST_ADDON_MANAGER_H
+
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/integration-api/addon-manager.h>
+#include <dali/public-api/common/vector-wrapper.h>
+#include <string>
+
+namespace Dali
+{
+namespace Test
+{
+class AddOnManager : public Dali::Integration::AddOnManager
+{
+public:
+
+ /**
+ * @brief Constructor, initialised by the Adaptor
+ */
+ AddOnManager() = default;
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~AddOnManager() = default;
+
+ std::vector<std::string> EnumerateAddOns() override;
+
+ bool GetAddOnInfo(const std::string& name, AddOnInfo& info ) override;
+
+ std::vector<AddOnLibrary> LoadAddOns( const std::vector<std::string>& addonNames ) override;
+
+ void* GetGlobalProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName ) override;
+
+ void* GetInstanceProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName ) override;
+
+ void RegisterAddOnDispatchTable( const AddOnDispatchTable* dispatchTable ) override;
+
+ void Start() override;
+
+ void Resume() override;
+
+ void Stop() override;
+
+ void Pause() override;
+
+ struct AddOnCacheEntry
+ {
+ std::string name{};
+ AddOnInfo info{};
+
+ // library handle
+ void* handle {nullptr};
+
+ // main function pointers
+ void(*GetAddOnInfo)(AddOnInfo& ) = nullptr; ///< Returns AddOnInfo structure
+ void*(*GetInstanceProc)( const char* ) = nullptr; ///< Returns pointer of instance function (member funtion)
+ void*(*GetGlobalProc)( const char* ) = nullptr; ///< Returns pointer of global function (non-member function)
+
+ void(*OnStart)() = nullptr;
+ void(*OnResume)() = nullptr;
+ void(*OnPause)() = nullptr;
+ void(*OnStop)() = nullptr;
+
+ bool valid = false;
+ };
+
+ std::vector<AddOnCacheEntry> mAddOnCache;
+};
+} // Namespace Test
+} // namespace Dali
+
+#endif // TEST_ADDON_MANAGER_H
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+#include <stdlib.h>
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include "dali-toolkit-test-utils/test-addon-manager.h"
+#include <toolkit-event-thread-callback.h>
+
+using namespace Dali::Toolkit::Internal;
+
+namespace
+{
+
+const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/application-icon-20.png";
+const char* TEST_IMAGE_FILE_NAME_9 = TEST_RESOURCE_DIR "/heartsframe.9.png";
+
+int CountFunctionCalls( const std::vector<std::string>& callstack, const std::string& function )
+{
+ int counter = 0;
+ std::find_if( callstack.begin(), callstack.end(), [&counter, &function]( const std::string& item )
+ {
+ if( item == function )
+ {
+ counter++;
+ }
+ return false;
+ });
+
+ return counter;
+}
+
+}
+
+int UtcRenderingAddOnTestP(void)
+{
+ Dali::Integration::AddOnManager* addOnManager = new Dali::Test::AddOnManager();
+
+ bool valid = addOnManager->Get() != nullptr;
+ DALI_TEST_EQUALS( valid, true, TEST_LOCATION );
+ auto addon = addOnManager->GetAddOn( "oo-rendering" );
+ auto GetCallStack = addOnManager->GetGlobalProc<std::vector<std::string>(bool)>( addon, "GetCallStack" );
+
+ ToolkitTestApplication application;
+ tet_infoline( "UtcRenderingAddOnTestP" );
+
+ // Load regular image view
+ auto imageView = Dali::Toolkit::ImageView::New( TEST_IMAGE_FILE_NAME );
+ imageView.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+
+ // Load npatch image view
+ auto imageView2 = Dali::Toolkit::ImageView::New( TEST_IMAGE_FILE_NAME_9 );
+ imageView2.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) );
+ imageView2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ imageView2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+
+ application.GetScene().Add( imageView );
+ application.GetScene().Add( imageView2 );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( ::Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ auto callstack = GetCallStack(true);
+
+ DALI_TEST_EQUALS( CountFunctionCalls( callstack, "GetGeometry" ), 2, TEST_LOCATION);
+ DALI_TEST_EQUALS( CountFunctionCalls( callstack, "CreateGeometry" ), 1, TEST_LOCATION);
+ DALI_TEST_EQUALS( CountFunctionCalls( callstack, "CreateGeometryGrid" ), 1, TEST_LOCATION);
+ DALI_TEST_EQUALS( CountFunctionCalls( callstack, "BuildNPatch" ), 1, TEST_LOCATION);
+
+ delete addOnManager;
+
+ END_TEST;
+}
END_TEST;
}
+
+int UtcDaliTextControllerDeleteSurroundings(void)
+{
+ tet_infoline(" UtcDaliTextControllerDeleteSurroundings");
+ ToolkitTestApplication application;
+
+ // Creates a text controller.
+ ControllerPtr controller = Controller::New();
+
+ ConfigureTextField( controller );
+
+ // Get the implementation of the text controller
+ Controller::Impl& mImpl = Controller::Impl::GetImplementation( *controller.Get() );
+
+ DALI_TEST_EQUALS( EventData::INACTIVE, mImpl.mEventData->mState, TEST_LOCATION );
+
+ InputMethodContext inputMethodContext = InputMethodContext::New();
+ // Add some pre-edit text, such as Korean
+ InputMethodContext::EventData imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "ã…‚ã…‚ã…‚", 0, 3 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
+
+ // Perform a relayout
+ const Size size( application.GetScene().GetSize() );
+
+ application.SendNotification();
+ application.Render();
+
+ controller->Relayout( size );
+
+ // Simulate a key event to delete one text
+ controller->KeyEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Dali::KeyEvent::Down ) );
+
+ // Send DELETE_SURROUNDING event (Delete All text)
+ imfEvent = InputMethodContext::EventData( InputMethodContext::DELETE_SURROUNDING, "", -2, 2 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
+
+ application.SendNotification();
+ application.Render();
+
+ controller->Relayout( size );
+
+ // simulate a key event to add text
+ controller->KeyEvent( GenerateKey( "ã…‡", "ã…‡", 238, 0, 0, Dali::KeyEvent::Down ) );
+ controller->KeyEvent( GenerateKey( "ã…‡", "ã…‡", 238, 0, 0, Dali::KeyEvent::Down ) );
+
+ DALI_TEST_EQUALS( EventData::EDITING, mImpl.mEventData->mState, TEST_LOCATION );
+
+ // Force to update the model.
+ controller->GetNaturalSize();
+
+ application.SendNotification();
+ application.Render();
+
+ controller->Relayout( size );
+
+ tet_result(TET_PASS);
+
+ END_TEST;
+}
TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
{
- mExtension = new TestNativeImageExtension();
}
TestNativeImage::~TestNativeImage()
{
}
-
-TestNativeImageNoExtPointer TestNativeImageNoExt::New(uint32_t width, uint32_t height)
-{
- return new TestNativeImageNoExt(width, height);
-}
-
-TestNativeImageNoExt::TestNativeImageNoExt(uint32_t width, uint32_t height)
-: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
-{
-}
-
-TestNativeImageNoExt::~TestNativeImageNoExt()
-{
-}
-
} // namespace dali
// INTERNAL INCLUDES
#include <dali/public-api/images/native-image-interface.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
#include <dali/integration-api/gl-defines.h>
namespace Dali
{
class TestNativeImage;
-class TestNativeImageNoExt;
typedef IntrusivePtr<TestNativeImage> TestNativeImagePointer;
-typedef IntrusivePtr<TestNativeImageNoExt> TestNativeImageNoExtPointer;
-
-class DALI_CORE_API TestNativeImageExtension: public Dali::NativeImageInterface::Extension
-{
-public:
- inline const char* GetCustomFragmentPreFix(){return "#extension GL_OES_EGL_image_external:require\n";}
- inline const char* GetCustomSamplerTypename(){return "samplerExternalOES";}
-
- inline int32_t GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
-
-};
class DALI_CORE_API TestNativeImage : public Dali::NativeImageInterface
{
static TestNativeImagePointer New(uint32_t width, uint32_t height);
inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
- inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
- inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
- inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 0;};
+ inline virtual bool CreateResource() { ++mExtensionCreateCalls; return createResult;};
+ inline virtual void DestroyResource() { ++mExtensionDestroyCalls; };
+ inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return mTargetTextureError;};
inline virtual void PrepareTexture() {};
inline virtual uint32_t GetWidth() const {return mWidth;};
inline virtual uint32_t GetHeight() const {return mHeight;};
inline virtual bool RequiresBlending() const {return true;};
- inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return mExtension;}
+ inline virtual int GetTextureTarget() const {return GL_TEXTURE_EXTERNAL_OES;};
+ inline virtual const char* GetCustomFragmentPrefix() const {return "#extension GL_OES_EGL_image_external:require\n";};
+ inline const char* GetCustomSamplerTypename() const override { return "samplerExternalOES"; };
+
+ inline Any GetNativeImageHandle() const override { return nullptr; };
+ inline bool SourceChanged() const override { return false; };
+
+ inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return nullptr;}
private:
TestNativeImage(uint32_t width, uint32_t height);
int32_t mExtensionCreateCalls;
int32_t mExtensionDestroyCalls;
int32_t mTargetTextureCalls;
-
+ uint32_t mTargetTextureError=0u;
bool createResult;
- TestNativeImageExtension* mExtension;
};
-class DALI_CORE_API TestNativeImageNoExt : public Dali::NativeImageInterface
-{
-public:
- static TestNativeImageNoExtPointer New(uint32_t width, uint32_t height);
-
- inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
- inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
- inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
- inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;};
- inline virtual void PrepareTexture() {};
- inline virtual uint32_t GetWidth() const {return mWidth;};
- inline virtual uint32_t GetHeight() const {return mHeight;};
- inline virtual bool RequiresBlending() const {return true;};
-
-private:
- TestNativeImageNoExt(uint32_t width, uint32_t height);
- virtual ~TestNativeImageNoExt();
-
- uint32_t mWidth;
- uint32_t mHeight;
-public:
- int32_t mExtensionCreateCalls;
- int32_t mExtensionDestroyCalls;
- int32_t mTargetTextureCalls;
- bool createResult;
-};
} // Dali
return false;
}
-bool NativeImageSource::GlExtensionCreate()
+bool NativeImageSource::CreateResource()
{
return false;
}
-void NativeImageSource::GlExtensionDestroy()
+void NativeImageSource::DestroyResource()
{
}
return false;
}
+int NativeImageSource::GetTextureTarget() const
+{
+ return 0;
+}
+
+const char* NativeImageSource::GetCustomFragmentPrefix() const
+{
+ return "";
+}
+
+const char* NativeImageSource::GetCustomSamplerTypename() const
+{
+ return "";
+}
+
+Any NativeImageSource::GetNativeImageHandle() const
+{
+ return nullptr;
+}
+
+bool NativeImageSource::SourceChanged() const
+{
+ return false;
+}
+
NativeImageInterface::Extension* NativeImageSource::GetExtension()
{
return NULL;
*/
#include <dali/devel-api/adaptor-framework/video-player.h>
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/base-object.h>
#include <toolkit-application.h>
return NULL;
}
+ void StartSynchronization()
+ {
+
+ }
+
+ void FinishSynchronization()
+ {
+
+ }
public:
return VideoPlayer( player );
}
+VideoPlayer VideoPlayer::New( Dali::Actor actor, Dali::VideoSyncMode syncMode )
+{
+ Internal::Adaptor::VideoPlayer* player = new Internal::Adaptor::VideoPlayer();
+
+ return VideoPlayer( player );
+}
+
VideoPlayer::VideoPlayer( const VideoPlayer& player )
: BaseHandle( player )
{
return Internal::Adaptor::GetImplementation( *this ).GetMediaPlayer();
}
+void VideoPlayer::StartSynchronization()
+{
+ Internal::Adaptor::GetImplementation( *this ).StartSynchronization();
+}
+
+void VideoPlayer::FinishSynchronization()
+{
+ Internal::Adaptor::GetImplementation( *this ).FinishSynchronization();
+}
+
} // namespace Dali;
return Dali::Window( windowImpl );
}
+void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
+{
+ CallbackBase::Execute( *callback, frameId );
+}
+
+void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
+{
+ CallbackBase::Execute( *callback, frameId );
+}
+
EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
{
return GetImplementation( window ).GetScene().EventProcessingFinishedSignal();
Dali::Window Get( Actor actor );
Dali::Window DownCast( BaseHandle handle );
+void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId );
+void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId );
EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Window window );
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
END_TEST;
}
+int UtcDaliAsyncImageLoaderMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ AsyncImageLoader loader = AsyncImageLoader::New( );
+ DALI_TEST_CHECK( loader );
+ DALI_TEST_EQUALS( 1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ AsyncImageLoader moved = std::move( loader );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !loader );
+
+ END_TEST;
+}
+
int UtcDaliAsyncImageLoaderAssignmentOperator(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliAsyncImageLoaderMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ AsyncImageLoader loader = AsyncImageLoader::New( );
+ DALI_TEST_CHECK( loader );
+ DALI_TEST_EQUALS( 1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ AsyncImageLoader moved;
+ moved = std::move( loader );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !loader );
+
+ END_TEST;
+}
+
int UtcDaliAsyncImageLoaderDownCastP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliButtonMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ Button button = PushButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, true );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+
+ Button moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliButtonAssignmentOperatorP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliButtonMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ Button button = PushButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, true );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+
+ Button moved;
+ moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliButtonDownCastP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliCheckBoxButtonMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ CheckBoxButton button = CheckBoxButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, false );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+
+ CheckBoxButton moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliCheckBoxButtonAssignmentOperatorP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliCheckBoxButtonMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ CheckBoxButton button = CheckBoxButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, false );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+
+ CheckBoxButton moved;
+ moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliCheckBoxButtonNewP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliControlMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ Control control = Control::New();
+ DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ control.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ Control moved = std::move( control );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !control );
+
+ END_TEST;
+}
+
+int UtcDaliControlMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ Control control = Control::New();
+ DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ control.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ Control moved;
+ moved = std::move( control );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !control );
+
+ END_TEST;
+}
+
int UtcDaliControlDownCast(void)
{
ToolkitTestApplication application;
END_TEST;
}
+
+int UtcDaliControlImplOnPinch(void)
+{
+ ToolkitTestApplication application;
+
+ Control control = Control::New();
+ control.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+ control.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ application.GetScene().Add(control);
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::Control& impl = Toolkit::Internal::GetImplementation(control);
+ impl.EnableGestureDetection(Gesture::Pinch);
+
+ // Scale becomes 0.6666666
+ TestStartPinch( application, Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
+ Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
+
+ DALI_TEST_EQUALS(0.666f, control.GetProperty( Actor::Property::SCALE_X).Get<float>(), 0.01f, TEST_LOCATION);
+
+ END_TEST;
+
+}
END_TEST;
}
+int UtcDaliFlexContainerMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ FlexContainer flexContainer = FlexContainer::New();
+ DALI_TEST_EQUALS( 1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE );
+ DALI_TEST_CHECK( flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
+
+ FlexContainer moved = std::move( flexContainer );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
+ DALI_TEST_CHECK( !flexContainer );
+
+ END_TEST;
+}
+
int UtcDaliToolkitFlexContainerAssignmentOperatorP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliFlexContainerMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ FlexContainer flexContainer = FlexContainer::New();
+ DALI_TEST_EQUALS( 1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE );
+ DALI_TEST_CHECK( flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
+
+ FlexContainer moved;
+ moved = std::move( flexContainer );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
+ DALI_TEST_CHECK( !flexContainer );
+
+ END_TEST;
+}
+
// Positive test case for a method
int UtcDaliToolkitFlexContainerGetPropertyP(void)
{
END_TEST;
}
+int UtcDaliImageViewMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ ImageView imageView = ImageView::New();
+ DALI_TEST_EQUALS( 1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ imageView.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == imageView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ImageView moved = std::move( imageView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !imageView );
+
+ END_TEST;
+}
+
int UtcDaliImageViewAssignmentOperatorP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliImageViewMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ ImageView imageView = ImageView::New();
+ DALI_TEST_EQUALS( 1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ imageView.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == imageView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ImageView moved;
+ moved = std::move( imageView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !imageView );
+
+ END_TEST;
+}
+
int UtcDaliImageViewDownCastP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliItemViewCopyConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ TestItemFactory factory;
+ ItemView itemView = ItemView::New( factory );
+ DALI_TEST_CHECK( itemView );
+
+ ItemView copy( itemView );
+ DALI_TEST_CHECK( copy );
+
+ END_TEST;
+}
+
+int UtcDaliItemViewCopyAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ TestItemFactory factory;
+ ItemView itemView = ItemView::New( factory );
+ DALI_TEST_CHECK( itemView );
+
+ ItemView copy;
+ copy = itemView;
+ DALI_TEST_CHECK( copy );
+ DALI_TEST_EQUALS( itemView, copy, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliItemViewMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ TestItemFactory factory;
+ ItemView itemView = ItemView::New( factory );
+ DALI_TEST_EQUALS( 1, itemView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ itemView.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == itemView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ItemView moved = std::move( itemView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !itemView );
+
+ END_TEST;
+}
+
+int UtcDaliItemViewMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ TestItemFactory factory;
+ ItemView itemView = ItemView::New( factory );
+ DALI_TEST_EQUALS( 1, itemView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ itemView.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == itemView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ItemView moved;
+ moved = std::move( itemView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !itemView );
+
+ END_TEST;
+}
+
int UtcDaliItemViewDownCast(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliModelMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ Model3dView view = Toolkit::Model3dView::New();
+ DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ view.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == view.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ Model3dView moved = std::move( view );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !view );
+
+ END_TEST;
+}
+
+int UtcDaliModelMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ Model3dView view = Toolkit::Model3dView::New();
+ DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ view.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == view.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ Model3dView moved;
+ moved = std::move( view );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !view );
+
+ END_TEST;
+}
+
int UtcDaliModelTypeRegistry(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliProgressBarCopyConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_CHECK( progressBar );
+
+ ProgressBar copy( progressBar );
+ DALI_TEST_CHECK( copy );
+
+ END_TEST;
+}
+
+int UtcDaliProgressBarCopyAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_CHECK( progressBar );
+
+ ProgressBar copy;
+ copy = progressBar;
+ DALI_TEST_CHECK( copy );
+ DALI_TEST_EQUALS( progressBar, copy, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliProgressBarMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ progressBar.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ProgressBar moved = std::move( progressBar );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !progressBar );
+
+ END_TEST;
+}
+
+int UtcDaliProgressBarMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ progressBar.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ProgressBar moved;
+ moved = std::move( progressBar );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !progressBar );
+
+ END_TEST;
+}
+
int UtcDaliProgressBarDownCast(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliPushButtonMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ PushButton button = PushButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, true );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+
+ PushButton moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliPushButtonAssignmentOperatorP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliPushButtonMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ PushButton button = PushButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, true );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+
+ PushButton moved;
+ moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliPushButtonNewP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliRadioButtonMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ RadioButton button = RadioButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, false );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+
+ RadioButton moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliRadioButtonAssignmentOperatorP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliRadioButtonMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ RadioButton button = RadioButton::New();
+ DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ button.SetProperty( Button::Property::TOGGLABLE, false );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+
+ RadioButton moved;
+ moved = std::move( button );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_CHECK( !button );
+
+ END_TEST;
+}
+
int UtcDaliRadioButtonNewP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliScrollViewMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ ScrollView scrollView = ScrollView::New();
+ DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+ DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+
+ ScrollView moved = std::move( scrollView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+ DALI_TEST_CHECK( !scrollView );
+
+ END_TEST;
+}
+
int UtcDaliToolkitScrollViewAssignmentOperatorP(void)
{
ToolkitTestApplication application;
ScrollView scrollView = ScrollView::New();
scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
- ScrollView copy = scrollView;
+ ScrollView copy;
+ copy = scrollView;
DALI_TEST_CHECK( copy );
DALI_TEST_CHECK( copy.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) );
END_TEST;
}
+int UtcDaliScrollViewMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ ScrollView scrollView = ScrollView::New();
+ DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+ DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+
+ ScrollView moved;
+ moved = std::move( scrollView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+ DALI_TEST_CHECK( !scrollView );
+
+ END_TEST;
+}
+
int UtcDaliScrollViewDestructorP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliSliderCopyConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ Slider slider = Slider::New();
+ DALI_TEST_CHECK( slider );
+
+ Slider copy( slider );
+ DALI_TEST_CHECK( copy );
+
+ END_TEST;
+}
+
+int UtcDaliSliderCopyAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ Slider slider = Slider::New();
+ DALI_TEST_CHECK( slider );
+
+ Slider copy;
+ copy = slider;
+ DALI_TEST_CHECK( copy );
+ DALI_TEST_EQUALS( slider, copy, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliSliderMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ Slider slider = Slider::New();
+ DALI_TEST_EQUALS( 1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ slider.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == slider.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ Slider moved = std::move( slider );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !slider );
+
+ END_TEST;
+}
+
+int UtcDaliSliderMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ Slider slider = Slider::New();
+ DALI_TEST_EQUALS( 1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ slider.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == slider.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ Slider moved;
+ moved = std::move( slider );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !slider );
+
+ END_TEST;
+}
+
int UtcDaliSliderDestructor(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliTextEditorMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ TextEditor textEditor = TextEditor::New();
+ textEditor.SetProperty( TextEditor::Property::TEXT, "Test" );
+ DALI_TEST_CHECK( textEditor.GetProperty<std::string>( TextEditor::Property::TEXT ) == "Test" );
+
+ TextEditor moved = std::move( textEditor );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<std::string>( TextEditor::Property::TEXT ) == "Test" );
+ DALI_TEST_CHECK( !textEditor );
+
+ END_TEST;
+}
+
int UtcDaliToolkitTextEditorAssignmentOperatorP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliTextEditorMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ TextEditor textEditor = TextEditor::New();
+ textEditor.SetProperty( TextEditor::Property::TEXT, "Test" );
+ DALI_TEST_CHECK( textEditor.GetProperty<std::string>( TextEditor::Property::TEXT ) == "Test" );
+
+ TextEditor moved;
+ moved = std::move( textEditor );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<std::string>( TextEditor::Property::TEXT ) == "Test" );
+ DALI_TEST_CHECK( !textEditor );
+
+ END_TEST;
+}
+
int UtcDaliTextEditorNewP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliTextFieldMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ TextField textField = TextField::New();
+ textField.SetProperty( TextEditor::Property::TEXT, "Test" );
+ DALI_TEST_CHECK( textField.GetProperty<std::string>( TextField::Property::TEXT ) == "Test" );
+
+ TextField moved = std::move( textField );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<std::string>( TextField::Property::TEXT ) == "Test" );
+ DALI_TEST_CHECK( !textField );
+
+ END_TEST;
+}
+
int UtcDaliToolkitTextFieldAssignmentOperatorP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliTextFieldMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ TextField textField = TextField::New();
+ textField.SetProperty( TextEditor::Property::TEXT, "Test" );
+ DALI_TEST_CHECK( textField.GetProperty<std::string>( TextField::Property::TEXT ) == "Test" );
+
+ TextField moved;
+ moved = std::move( textField );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<std::string>( TextField::Property::TEXT ) == "Test" );
+ DALI_TEST_CHECK( !textField );
+
+ END_TEST;
+}
+
int UtcDaliTextFieldNewP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliTextLabelMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ TextLabel textLabel = TextLabel::New();
+ textLabel.SetProperty( TextLabel::Property::TEXT, "Test" );
+ DALI_TEST_CHECK( textLabel.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
+
+ TextLabel moved = std::move( textLabel );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
+ DALI_TEST_CHECK( !textLabel );
+
+ END_TEST;
+}
+
int UtcDaliToolkitTextLabelAssignmentOperatorP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliTextLabelMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ TextLabel textLabel = TextLabel::New();
+ textLabel.SetProperty( TextLabel::Property::TEXT, "Test" );
+ DALI_TEST_CHECK( textLabel.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
+
+ TextLabel moved;
+ moved = std::move( textLabel );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
+ DALI_TEST_CHECK( !textLabel );
+
+ END_TEST;
+}
+
// Positive test case for a method
int UtcDaliToolkitTextLabelGetPropertyP(void)
{
DALI_TEST_EQUALS( indexArray.GetElementAt(0).Get<int>(), 10, TEST_LOCATION );
END_TEST;
-}
\ No newline at end of file
+}
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/public-api/controls/video-view/video-view.h>
#include <dali-toolkit/devel-api/controls/video-view/video-view-devel.h>
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
using namespace Dali;
using namespace Dali::Toolkit;
const char* const VOLUME_LEFT( "volumeLeft" );
const char* const VOLUME_RIGHT( "volumeRight" );
const char* const RENDERING_TYPE( "renderingTarget" );
+const char* const DUMMY_STRING( "dummy string" );
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
Toolkit::VideoView view = Toolkit::VideoView::New();
DALI_TEST_CHECK( view );
- Toolkit::VideoView view2 = Toolkit::VideoView::New( "" );
+ const std::string url( DUMMY_STRING );
+ Toolkit::VideoView view2 = Toolkit::VideoView::New( url );
DALI_TEST_CHECK( view2 );
END_TEST;
}
END_TEST;
}
+int UtcDaliVideoViewMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ VideoView view = Toolkit::VideoView::New();
+ DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ view.SetProperty( VideoView::Property::LOOPING, true );
+ DALI_TEST_CHECK( view.GetProperty<bool>( VideoView::Property::LOOPING ) );
+
+ VideoView moved = std::move( view );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<bool>( VideoView::Property::LOOPING ) );
+ DALI_TEST_CHECK( !view );
+
+ END_TEST;
+}
+
+int UtcDaliVideoViewMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ VideoView view = Toolkit::VideoView::New();
+ DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ view.SetProperty( VideoView::Property::LOOPING, true );
+ DALI_TEST_CHECK( view.GetProperty<bool>( VideoView::Property::LOOPING ) );
+
+ VideoView moved;
+ moved = std::move( view );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetProperty<bool>( VideoView::Property::LOOPING ) );
+ DALI_TEST_CHECK( !view );
+
+ END_TEST;
+}
+
int UtcDaliVideoViewTypeRegistry(void)
{
ToolkitTestApplication application;
ToolkitTestApplication application;
tet_infoline( "VideoView with custom shader" );
- VideoView view = VideoView::New();
+ VideoView view = VideoView::New( false );
DALI_TEST_CHECK( view );
ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
END_TEST;
}
+
+// Functor to test whether a Finish signal is emitted
+struct AnimationFinishCheck
+{
+ AnimationFinishCheck(bool& signalReceived)
+ : mSignalReceived(signalReceived)
+ {
+ }
+
+ void operator()(Animation& animation)
+ {
+ mSignalReceived = true;
+ }
+
+ void Reset()
+ {
+ mSignalReceived = false;
+ }
+
+ void CheckSignalReceived()
+ {
+ if (!mSignalReceived)
+ {
+ tet_printf("Expected Finish signal was not received\n");
+ tet_result(TET_FAIL);
+ }
+ else
+ {
+ tet_result(TET_PASS);
+ }
+ }
+
+ void CheckSignalNotReceived()
+ {
+ if (mSignalReceived)
+ {
+ tet_printf("Unexpected Finish signal was received\n");
+ tet_result(TET_FAIL);
+ }
+ else
+ {
+ tet_result(TET_PASS);
+ }
+ }
+
+ bool& mSignalReceived; // owned by individual tests
+};
+
+int UtcDaliVideoViewSyncAniamtionForCoverage(void)
+{
+ ToolkitTestApplication application;
+
+ VideoView videoView = DevelVideoView::New( Dali::VideoSyncMode::ENABLED );
+ DALI_TEST_CHECK( videoView );
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+
+ // Start the animation
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(videoView, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+ DevelVideoView::PlayAnimation( videoView, animation );
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*1000.0f) - 1u/*just less than the animation duration*/);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(2u/*just beyond the animation duration*/);
+
+ // We did expect the animation to finish
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+ DALI_TEST_EQUALS( targetPosition, videoView.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION );
+
+ // Restart the animation, with a different duration
+ finishCheck.Reset();
+
+ END_TEST;
+}
+
+int UtcDaliVideoViewASyncAniamtionForCoverage(void)
+{
+ ToolkitTestApplication application;
+
+ VideoView videoView = DevelVideoView::New( Dali::VideoSyncMode::DISABLED );
+ DALI_TEST_CHECK( videoView );
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+
+ // Start the animation
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(videoView, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+ DevelVideoView::PlayAnimation( videoView, animation );
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*1000.0f) - 1u/*just less than the animation duration*/);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(2u/*just beyond the animation duration*/);
+
+ // We did expect the animation to finish
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+ DALI_TEST_EQUALS( targetPosition, videoView.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION );
+
+ // Restart the animation, with a different duration
+ finishCheck.Reset();
+
+ END_TEST;
+}
+
+int UtcDaliVideoViewResizeWithSynchronization(void)
+{
+ ToolkitTestApplication application;
+ VideoView videoView = DevelVideoView::New( Dali::VideoSyncMode::ENABLED );
+ DALI_TEST_CHECK( videoView );
+
+ application.GetScene().Add( videoView );
+
+ Vector3 vector(50.0f, 200.0f, 0.0f);
+ videoView.SetProperty( Actor::Property::SIZE, vector );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(vector == videoView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
+
+ END_TEST;
+}
return Dali::Toolkit::GetImpl( videoView ).GetMediaPlayer();\r
}\r
\r
+VideoView New( VideoSyncMode syncMode )\r
+{\r
+ VideoView videoView = Internal::VideoView::New( syncMode );\r
+ return videoView;\r
+}\r
+\r
+void PlayAnimation( VideoView videoView, Animation animation )\r
+{\r
+ Dali::Toolkit::GetImpl( videoView ).PlayAnimation( animation );\r
+}\r
\r
} // namespace DevelVideoView\r
\r
*\r
*/\r
\r
+// EXTERNAL INCLUDES\r
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>\r
+\r
// INTERNAL INCLUDES\r
+#include <dali/public-api/animation/animation.h>\r
#include <dali-toolkit/public-api/controls/video-view/video-view.h>\r
#include <dali/public-api/object/any.h>\r
\r
namespace DevelVideoView\r
{\r
\r
-\r
/**\r
* @brief Returns the internal media player.\r
* @param[in] videoView The current VideoView\r
*/\r
DALI_TOOLKIT_API Any GetMediaPlayer( VideoView videoView );\r
\r
+/**\r
+ * @brief Creates an initialized VideoView with synchronization mode.\r
+ *\r
+ * The syncMode is for synchronization between UI(transparent hole) and underlay video.\r
+ *\r
+ * @param[in] syncMode The synchronization mode between the UI (transparent hole) and VideoPlayer\r
+ * @return A handle to a newly allocated Dali VideoView\r
+ */\r
+DALI_TOOLKIT_API VideoView New( VideoSyncMode syncMode );\r
+\r
+/**\r
+ * @brief Play the resize or move animation with synchronization between UI(transparent hole) and video player\r
+ *\r
+ * The resize and move animation's play() function is called.\r
+ * If the animation is played, UI and video player will work synchronization.\r
+ *\r
+ * @param[in] videoView The current VideoView\r
+ * @param[in] animation The animation for video view's resize or move.\r
+ */\r
+DALI_TOOLKIT_API void PlayAnimation( VideoView videoView, Animation animation );\r
\r
} // namespace DevelVideoView\r
\r
bool Button::OnTouch( Actor actor, const TouchData& touch )
{
-
- // Only events are processed when the button is not disabled
- auto result( false );
-
- if( !IsDisabled() )
+ if( !IsDisabled() && (actor == touch.GetHitActor(0)) )
{
if ( 1 == touch.GetPointCount() )
{
// Sets the button state to the default
mButtonPressedState = UNPRESSED;
}
- result = true;
}
- return result;
+ return false;
}
bool Button::OnKeyboardEnter()
mPopupLayout.SetFitHeight( 0 ); // Set row to fit.
mPopupLayout.SetFitHeight( 1 ); // Set row to fit.
- mPopupLayout.TouchSignal().Connect( this, &Popup::OnDialogTouched );
-
mPopupContainer.Add( mPopupLayout );
// Any content after this point which is added to Self() will be re-parented to mContent.
mAlterAddedChild = true;
SetAsKeyboardFocusGroup( true );
+
+ SetupTouch();
}
Popup::~Popup()
mPopupBackgroundImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mPopupBackgroundImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- // OnDialogTouched only consumes the event. It prevents the touch event to be caught by the backing.
- mPopupBackgroundImage.TouchSignal().Connect( this, &Popup::OnDialogTouched );
-
// Set the popup border to be slightly larger than the layout contents.
UpdateBackgroundPositionAndSize();
// Default to being transparent.
backing.SetProperty( Actor::Property::COLOR_ALPHA, 0.0f );
- backing.TouchSignal().Connect( this, &Popup::OnBackingTouched );
backing.WheelEventSignal().Connect( this, &Popup::OnBackingWheelEvent );
return backing;
}
void Popup::SetTouchTransparent( bool enabled )
{
- mTouchTransparent = enabled;
+ if( mTouchTransparent != enabled )
+ {
+ mTouchTransparent = enabled;
+ SetupTouch();
+ }
}
const bool Popup::IsTouchTransparent() const
bool Popup::OnBackingTouched( Actor actor, const TouchData& touch )
{
- // Allow events to pass through if touch transparency is enabled.
- if( mTouchTransparent )
+ // Allow events to pass through if the backing isn't the hit-actor
+ if( (touch.GetHitActor(0) == actor) &&
+ (touch.GetPointCount() > 0) &&
+ (touch.GetState( 0 ) == PointState::DOWN))
{
- return false;
- }
-
- if( touch.GetPointCount() > 0 )
- {
- if( touch.GetState( 0 ) == PointState::DOWN )
- {
- // Guard against destruction during signal emission.
- Toolkit::Popup handle( GetOwner() );
+ // Guard against destruction during signal emission.
+ Toolkit::Popup handle( GetOwner() );
- mTouchedOutsideSignal.Emit();
- }
+ mTouchedOutsideSignal.Emit();
}
- // Block anything behind backing becoming touched.
- mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
- return true;
+ return false;
}
bool Popup::OnBackingWheelEvent( Actor actor, const WheelEvent& event )
return false;
}
- // Consume wheel event in dimmed backing actor.
- mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
return true;
}
bool Popup::OnDialogTouched( Actor actor, const TouchData& touch )
{
- // Allow events to pass through if touch transparency is enabled.
- if( mTouchTransparent )
- {
- return false;
- }
-
- // Consume event (stops backing actor receiving touch events)
- mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
- return true;
+ // Only connecting this so the backing does not become the default hit-actor and inadvertently closes the popup
+ return false;
}
void Popup::OnStageConnection( int depth )
return nextFocusableActor;
}
+void Popup::SetupTouch()
+{
+ if( ! mTouchTransparent )
+ {
+ // Connect all the signals and set us up to consume all touch events
+ mBacking.TouchSignal().Connect( this, &Popup::OnBackingTouched );
+ mPopupBackgroundImage.TouchSignal().Connect( this, &Popup::OnDialogTouched );
+ mPopupLayout.TouchSignal().Connect( this, &Popup::OnDialogTouched );
+ mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
+ }
+ else
+ {
+ // We are touch transparent so disconnect all signals and ensure our layer does not consumed all touch events
+ mBacking.TouchSignal().Disconnect( this, &Popup::OnBackingTouched );
+ mPopupBackgroundImage.TouchSignal().Disconnect( this, &Popup::OnDialogTouched );
+ mPopupLayout.TouchSignal().Disconnect( this, &Popup::OnDialogTouched );
+ mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, false );
+ }
+}
} // namespace Internal
#define DALI_TOOLKIT_INTERNAL_POPUP_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
void AddFocusableChildrenRecursive( Actor parent, std::vector< Actor >& focusableActors );
+ /**
+ * Sets up the touch signals connections as required.
+ * @note This must be called after all the members have been created.
+ */
+ void SetupTouch();
+
private:
// Undefined.
RemoveAnimation(mScrollAnimation);
}
- return true; // consume since we're potentially scrolling
+ return false; // Do not consume as we're potentially scrolling (detecting pan gestures)
}
void ItemView::OnPan( const PanGesture& gesture )
mScrollInterrupted = false;
}
- return true;
+ return false;
}
bool ScrollView::OnWheelEvent(const WheelEvent& event)
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
}
}
- return true;
+ return false;
}
void Slider::OnPan( Actor actor, const PanGesture& gesture )
bool TextEditor::OnTouched( Actor actor, const TouchData& touch )
{
- return true;
+ return false;
}
void TextEditor::OnIdleSignal()
bool TextField::OnTouched( Actor actor, const TouchData& touch )
{
- return true;
+ return false;
}
void TextField::OnIdleSignal()
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/scripting.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/animation/constraint.h>
} // anonymous namepsace
-VideoView::VideoView()
+VideoView::VideoView( Dali::VideoSyncMode syncMode )
: Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
mCurrentVideoPlayPosition( 0 ),
+ mFrameID( 0 ),
mIsPlay( false ),
- mIsUnderlay( true )
+ mIsUnderlay( true ),
+ mSyncMode( syncMode )
{
- mVideoPlayer = Dali::VideoPlayer::New();
}
VideoView::~VideoView()
{
}
-Toolkit::VideoView VideoView::New()
+Toolkit::VideoView VideoView::New( VideoSyncMode syncMode )
{
- VideoView* impl = new VideoView();
+ VideoView* impl = new VideoView( syncMode );
Toolkit::VideoView handle = Toolkit::VideoView( *impl );
+ impl->mVideoPlayer = Dali::VideoPlayer::New( impl->Self(), syncMode );
impl->Initialize();
-
return handle;
}
Control::OnStageDisconnection();
}
+void VideoView::OnSizeSet( const Vector3& targetSize )
+{
+ if( mIsUnderlay && mSyncMode == Dali::VideoSyncMode::ENABLED )
+ {
+ SetFrameRenderCallback();
+ mVideoPlayer.StartSynchronization();
+ }
+ Control::OnSizeSet( targetSize );
+}
+
Vector3 VideoView::GetNaturalSize()
{
Vector3 size;
void VideoView::UpdateDisplayArea( Dali::PropertyNotification& source )
{
- if( !mIsUnderlay )
+ // If mSyncMode is enabled, Video player's size and poistion is updated in Video player's constraint.
+ // Because video view and player should be work syncronization.
+ if( !mIsUnderlay || mSyncMode == Dali::VideoSyncMode::ENABLED )
{
return;
}
return mVideoPlayer.GetMediaPlayer();
}
+void VideoView::OnAnimationFinished( Animation& animation )
+{
+ // send desync
+ SetFrameRenderCallback();
+}
+
+void VideoView::PlayAnimation( Dali::Animation animation )
+{
+ if( mIsUnderlay && mSyncMode == Dali::VideoSyncMode::ENABLED )
+ {
+ mVideoPlayer.StartSynchronization();
+ animation.FinishedSignal().Connect( this, &VideoView::OnAnimationFinished );
+ }
+ animation.Play();
+}
+
Dali::Shader VideoView::CreateShader()
{
std::string fragmentShader = "#extension GL_OES_EGL_image_external:require\n";
}
}
+void VideoView::FrameRenderCallback( int frameID )
+{
+ // send desync
+ if( frameID == mFrameID )
+ {
+ mVideoPlayer.FinishSynchronization();
+ mFrameID = 0;
+ }
+}
+
+void VideoView::SetFrameRenderCallback()
+{
+ mFrameID++;
+ DevelWindow::AddFrameRenderedCallback( DevelWindow::Get( Self() ),
+ std::unique_ptr< CallbackBase >( MakeCallback( this, &VideoView::FrameRenderCallback ) ), mFrameID );
+}
+
} // namespace Internal
} // namespace toolkit
#include <dali/public-api/rendering/texture.h>
#include <dali/devel-api/adaptor-framework/video-player.h>
#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
{
protected:
- VideoView();
+ VideoView( Dali::VideoSyncMode syncMode );
virtual ~VideoView();
public:
/**
- * @copydoc Toolkit::VideoView::New()
+ * @copydoc Toolkit::DevelVideoView::New()
*/
- static Toolkit::VideoView New();
+ static Toolkit::VideoView New( VideoSyncMode syncMode );
/**
* @brief Sets a video url to play.
*/
Any GetMediaPlayer();
+ /**
+ * @brief Play the resize or move animation with synchronization between UI(transparent hole) and video player
+ *
+ * The resize and move animation's play() function is called.
+ * If the animation is played, UI and video player will work synchronization.
+ *
+ * @param[in] videoView The current VideoView
+ * @param[in] animation The animation for video view's resize or move.
+ */
+ void PlayAnimation( Dali::Animation animation );
+
private: // From Control
/**
virtual void OnStageDisconnection();
/**
+ * @copydoc Toolkit::Control::OnSizeSet()
+ */
+ virtual void OnSizeSet( const Vector3& targetSize );
+
+ /**
* @copydoc Toolkit::Control::GetNaturalSize
*/
virtual Vector3 GetNaturalSize();
*/
void ApplyBackupProperties();
+ /*
+ * @brief FrameRender's callback function
+ *
+ * This function means the resize/move animation is finished,
+ * so Ui and video player's synchronization can be finished.
+ *
+ */
+ void FrameRenderCallback( int frameID );
+
+ /*
+ * @brief Set frameRender Callback function
+ *
+ * This function is added for listenr the resize/move animation is finished,
+ *
+ */
+ void SetFrameRenderCallback();
+
+
+ /*
+ * @brief resize/move animation finished callback function
+ *
+ * This function is called the resize/move animation is finished,
+ *
+ */
+ void OnAnimationFinished( Dali::Animation& animation );
+
private:
Dali::VideoPlayer mVideoPlayer;
Dali::Property::Map mPropertyBackup;
int mCurrentVideoPlayPosition;
+ int mFrameID;
+
bool mIsPlay;
bool mIsUnderlay;
+
+ Dali::VideoSyncMode mSyncMode;
};
} // namespace Internal
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
}
mPointDown = false;
}
- return true;
+ return false;
}
const std::string& DragAndDropDetector::GetContent() const
Join();
delete mTrigger;
+
+ for( auto&& iter : mLoadQueue )
+ {
+ delete iter;
+ }
+ mLoadQueue.Clear();
+
+ for( auto&& iter : mCompleteQueue )
+ {
+ delete iter;
+ }
+ mCompleteQueue.Clear();
}
void ImageLoadThread::Run()
SetHandleImage( GRAB_HANDLE );
}
- // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
- return true;
+ return false;
}
bool OnHandleOneTouched( Actor actor, const TouchData& touch )
SetHandleImage( LEFT_SELECTION_HANDLE );
}
- // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
- return true;
+ return false;
}
bool OnHandleTwoTouched( Actor actor, const TouchData& touch )
SetHandleImage( RIGHT_SELECTION_HANDLE );
}
- // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
- return true;
+ return false;
}
void HandleResetPosition( PropertyNotification& source )
{
mAtlasManager = Dali::Toolkit::AtlasManager::New();
mSampler = Sampler::New();
- mSampler.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
+ mSampler.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR );
}
void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
}
// Move the origin (0,0) of the mesh to the center of the actor
- const Vector2 position = *( positionsBuffer + i ) - halfTextSize - lineOffsetPosition;
+ const Vector2& temp = *( positionsBuffer + i );
+ const Vector2 position = Vector2( roundf( temp.x ), temp.y ) - halfTextSize - lineOffsetPosition; // roundf() avoids pixel alignment issues.
if ( 0u != slot.mImageId ) // invalid slot id, glyph has failed to be added to atlas
{
if( ( currentText.Count() - numberOfCharacters == 0 ) && ( cursorIndex == 0 ) )
{
mImpl->ClearPreEditFlag();
+ mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = 0;
}
// Updates the text style runs by removing characters. Runs with no characters are removed.
#include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
namespace Dali
{
if( !mImpl->mCustomShader )
{
- geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
+ TextureManager& textureManager = mFactoryCache.GetTextureManager();
+
+ uint32_t opaqueElementsCount {0u};
+ uint32_t transparentElementsCount {0u};
+ geometry = textureManager.GetRenderGeometry(mTextureId, opaqueElementsCount, transparentElementsCount);
+ if(!opaqueElementsCount && !transparentElementsCount)
+ {
+ geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
+ }
shader = mImageVisualShaderFactory.GetShader( mFactoryCache,
mImpl->mFlags & Impl::IS_ATLASING_APPLIED,
{
resourceStatus = Toolkit::Visual::ResourceStatus::FAILED;
}
+
+ // use geometry if needed
+ if( loadingSuccess )
+ {
+ uint32_t opaqueElements{0u};
+ uint32_t transparentElements{0u};
+ auto geometry = mFactoryCache.GetTextureManager().GetRenderGeometry(mTextureId, opaqueElements, transparentElements);
+ if (mImpl->mRenderer && geometry)
+ {
+ mImpl->mRenderer.SetGeometry(geometry);
+ Dali::DevelRenderer::DrawCommand drawCommand{};
+ drawCommand.drawType = DevelRenderer::DrawType::INDEXED;
+
+ if (opaqueElements)
+ {
+ drawCommand.firstIndex = 0;
+ drawCommand.elementCount = opaqueElements;
+ drawCommand.queue = 0;
+ DevelRenderer::AddDrawCommand(mImpl->mRenderer, drawCommand);
+ }
+
+ if (transparentElements)
+ {
+ drawCommand.firstIndex = opaqueElements;
+ drawCommand.elementCount = transparentElements;
+ drawCommand.queue = 1;
+ DevelRenderer::AddDrawCommand(mImpl->mRenderer, drawCommand);
+ }
+ }
+ }
+
// Signal to observers ( control ) that resources are ready. Must be all resources.
ResourceReady( resourceStatus );
mLoading = false;
// CLASS HEADER
#include <dali-toolkit/internal/visuals/npatch-loader.h>
-// EXTERNAL INCLUDES
+// INTERNAL HEADERS
+#include <dali-toolkit/internal/visuals/rendering-addon.h>
+
+// EXTERNAL HEADERS
#include <dali/devel-api/common/hash.h>
#include <dali/integration-api/debug.h>
data->croppedWidth = pixelBuffer.GetWidth();
data->croppedHeight = pixelBuffer.GetHeight();
+ // Create opacity map
+ data->renderingMap = RenderingAddOn::Get().IsValid() ? RenderingAddOn::Get().BuildNPatch(pixelBuffer, data ) : nullptr;
+
PixelData pixels = Devel::PixelBuffer::Convert( pixelBuffer ); // takes ownership of buffer
Texture texture = Texture::New( TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight() );
} // namespace NPatchBuffer
+NPatchLoader::Data::~Data()
+{
+ // If there is an opacity map, it has to be destroyed using addon call
+ if( renderingMap )
+ {
+ RenderingAddOn::Get().DestroyNPatch( renderingMap );
+ }
+}
+
NPatchLoader::NPatchLoader()
{
}
croppedWidth( 0 ),
croppedHeight( 0 ),
border( 0, 0, 0, 0 ),
- loadCompleted( false )
+ loadCompleted( false ),
+ renderingMap{ nullptr }
{}
- std::string url; ///< Url of the N-Patch
- TextureSet textureSet; ///< Texture containing the cropped image
- NPatchUtility::StretchRanges stretchPixelsX; ///< X stretch pixels
- NPatchUtility::StretchRanges stretchPixelsY; ///< Y stretch pixels
- std::size_t hash; ///< Hash code for the Url
- uint32_t croppedWidth; ///< Width of the cropped middle part of N-patch
- uint32_t croppedHeight; ///< Height of the cropped middle part of N-patch
- Rect< int > border; ///< The size of the border
- bool loadCompleted; ///< True if the data loading is completed
+ ~Data();
+
+ std::string url; ///< Url of the N-Patch
+ TextureSet textureSet; ///< Texture containing the cropped image
+ NPatchUtility::StretchRanges stretchPixelsX; ///< X stretch pixels
+ NPatchUtility::StretchRanges stretchPixelsY; ///< Y stretch pixels
+ std::size_t hash; ///< Hash code for the Url
+ uint32_t croppedWidth; ///< Width of the cropped middle part of N-patch
+ uint32_t croppedHeight; ///< Height of the cropped middle part of N-patch
+ Rect< int > border; ///< The size of the border
+ bool loadCompleted; ///< True if the data loading is completed
+ void* renderingMap; ///< NPatch rendering data
};
public:
// EXTERNAL INCLUDES
#include <dali/devel-api/object/handle-devel.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/integration-api/debug.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
+#include <dali-toolkit/internal/visuals/rendering-addon.h>
namespace Dali
{
mPlacementActor = actor;
if( data->loadCompleted )
{
+ if( RenderingAddOn::Get().IsValid() )
+ {
+ RenderingAddOn::Get().SubmitRenderTask( mImpl->mRenderer, data->renderingMap );
+ }
+
ApplyTextureAndUniforms();
actor.AddRenderer( mImpl->mRenderer );
mPlacementActor.Reset();
}
else
{
- geometry = GetNinePatchGeometry( VisualFactoryCache::NINE_PATCH_GEOMETRY );
+ if( data->renderingMap )
+ {
+ uint32_t elementCount[2];
+ geometry = RenderingAddOn::Get().CreateGeometryGrid(data->renderingMap, Uint16Pair(3, 3), elementCount );
+ }
+ else
+ {
+ geometry = GetNinePatchGeometry( VisualFactoryCache::NINE_PATCH_GEOMETRY );
+ }
}
}
else if( data->stretchPixelsX.Size() > 0 || data->stretchPixelsY.Size() > 0)
{
Uint16Pair gridSize( 2 * data->stretchPixelsX.Size() + 1, 2 * data->stretchPixelsY.Size() + 1 );
- geometry = !mBorderOnly ? CreateGridGeometry( gridSize ) : CreateBorderGeometry( gridSize );
+ if( !data->renderingMap )
+ {
+ geometry = !mBorderOnly ? CreateGridGeometry( gridSize ) : CreateBorderGeometry( gridSize );
+ }
+ else
+ {
+ uint32_t elementCount[2];
+ geometry = !mBorderOnly ?
+ RenderingAddOn::Get().CreateGeometryGrid(data->renderingMap, gridSize, elementCount ) : CreateBorderGeometry(gridSize );
+ }
}
}
else
--- /dev/null
+#ifndef DALI_CMAKE_RENDERING_ADDON_H
+#define DALI_CMAKE_RENDERING_ADDON_H
+
+/*
+* Copyright (c) 2020 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+#include <dali/devel-api/common/addon-binder.h>
+#include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+
+/**
+ * Interface of Overdrawing AddOn
+ */
+class RenderingAddOn : public Dali::AddOn::AddOnBinder
+{
+ using TextureManager = Dali::Toolkit::Internal::TextureManager;
+public:
+ RenderingAddOn() : Dali::AddOn::AddOnBinder( "oo-rendering", 0u )
+ {}
+
+ // Bind AddOn functions
+ ADDON_BIND_FUNCTION(
+ GetGeometry,
+ Dali::Geometry(TextureManager::TextureId, uint32_t&, uint32_t& ) );
+
+ ADDON_BIND_FUNCTION(
+ CreateGeometry,
+ Dali::Geometry( TextureManager::TextureId, const Dali::Devel::PixelBuffer& pixelBuffer ) );
+
+ ADDON_BIND_FUNCTION(
+ Initialize,
+ void*() );
+
+ ADDON_BIND_FUNCTION(
+ CreateGeometryGrid,
+ Dali::Geometry( const void*, const Uint16Pair&, uint32_t*) );
+
+ ADDON_BIND_FUNCTION(
+ SubmitRenderTask,
+ void( Renderer&, const void* ) );
+
+ ADDON_BIND_FUNCTION(
+ BuildNPatch,
+ void*( const Devel::PixelBuffer&, void*) );
+
+ ADDON_BIND_FUNCTION(
+ DestroyNPatch,
+ void( void* ) );
+
+ /**
+ * Single instance of the addon
+ * @return
+ */
+ static RenderingAddOn& Get()
+ {
+ static RenderingAddOn* addon = nullptr;
+ if( !addon )
+ {
+ addon = new RenderingAddOn();
+ if(addon->IsValid())
+ {
+ addon->Initialize();
+ }
+ }
+ return *addon;
+ }
+};
+
+} // Internal
+} // Toolkit
+} // Dali
+
+#endif //DALI_CMAKE_RENDERING_ADDON_H
#include <dali/devel-api/common/hash.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/geometry.h>
// INTERNAL HEADERS
#include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
#include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
+#include <dali-toolkit/internal/visuals/rendering-addon.h>
namespace
{
mCurrentTextureId( 0 ),
mQueueLoadFlag(false)
{
+ // Initialize the AddOn
+ RenderingAddOn::Get();
}
TextureManager::~TextureManager()
// Check if this pixelBuffer is premultiplied
textureInfo.preMultiplied = pixelBuffer.IsAlphaPreMultiplied();
+ auto& renderingAddOn = RenderingAddOn::Get();
+ if( renderingAddOn.IsValid() )
+ {
+ renderingAddOn.CreateGeometry( textureInfo.textureId, pixelBuffer );
+ }
+
Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(),
pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
mBrokenImageUrl = brokenImageUrl;
}
+Geometry TextureManager::GetRenderGeometry(TextureId textureId, uint32_t& frontElements, uint32_t& backElements )
+{
+ return RenderingAddOn::Get().IsValid() ?
+ RenderingAddOn::Get().GetGeometry( textureId, frontElements, backElements) :
+ Geometry();
+}
+
} // namespace Internal
} // namespace Toolkit
#include <dali/public-api/rendering/texture-set.h>
#include <dali/devel-api/common/owner-container.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/public-api/rendering/geometry.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
*/
void SetBrokenImageUrl(const std::string& brokenImageUrl);
+ /**
+ * @brief Returns the geometry associated with texture.
+ * @param[in] textureId Id of the texture
+ * @param[out] frontElements number of front elements
+ * @param[out] backElements number of back elements
+ * @return Returns valid geometry object
+ */
+ Geometry GetRenderGeometry(TextureId textureId, uint32_t& frontElements, uint32_t& backElements );
+
private:
/**
void UploadTexture( Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo );
/**
+ * Creates tiled geometry of for the texture which separates fully-opaque
+ * tiles from ones which use transparency.
+ * @param pixelBuffer
+ * @param textureInfo
+ */
+ bool CreateTiledGeometry( const Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo );
+
+ /**
* Mark the texture as complete, and inform observers
* @param[in] textureInfo The struct associated with this Texture
*/
Button::Button()
{}
-Button::Button( const Button& button )
-: Control( button )
-{
-}
+Button::Button( const Button& button ) = default;
-Button& Button::operator=( const Button& button )
-{
- if( &button != this )
- {
- Control::operator=( button );
- }
- return *this;
-}
+Button::Button( Button&& rhs ) = default;
+
+Button& Button::operator=( const Button& button ) = default;
+
+Button& Button::operator=( Button&& rhs ) = default;
Button::~Button()
{
#define DALI_TOOLKIT_BUTTON_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Button( const Button& button );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ Button( Button&& rhs );
+
+ /**
* @brief Assignment operator.
* @SINCE_1_0.0
* @param[in] button Handle to an object
Button& operator=( const Button& button );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Button& operator=( Button&& rhs );
+
+ /**
* @brief Downcasts a handle to Button handle.
*
* If handle points to a Button, the downcast produces valid handle.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-CheckBoxButton::CheckBoxButton( const CheckBoxButton& checkBox )
-: Button( checkBox )
-{
-}
+CheckBoxButton::CheckBoxButton( const CheckBoxButton& checkBox ) = default;
-CheckBoxButton& CheckBoxButton::operator=( const CheckBoxButton& checkBox )
-{
- if( &checkBox != this )
- {
- Button::operator=( checkBox );
- }
- return *this;
-}
+CheckBoxButton::CheckBoxButton( CheckBoxButton&& rhs ) = default;
+
+CheckBoxButton& CheckBoxButton::operator=( const CheckBoxButton& checkBox ) = default;
+
+CheckBoxButton& CheckBoxButton::operator=( CheckBoxButton&& rhs ) = default;
CheckBoxButton::~CheckBoxButton()
{
#define DALI_TOOLKIT_CHECK_BOX_BUTTON_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
CheckBoxButton( const CheckBoxButton& checkBox );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ CheckBoxButton( CheckBoxButton&& rhs );
+
+ /**
* @brief Assignment operator.
* @SINCE_1_0.0
* @param[in] checkBox Handle to an object
CheckBoxButton& operator=( const CheckBoxButton& checkBox );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ CheckBoxButton& operator=( CheckBoxButton&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
{
}
-PushButton::PushButton( const PushButton& pushButton )
-: Button( pushButton )
-{
-}
+PushButton::PushButton( const PushButton& pushButton ) = default;
-PushButton& PushButton::operator=( const PushButton& pushButton )
-{
- if( &pushButton != this )
- {
- Button::operator=( pushButton );
- }
- return *this;
-}
+PushButton::PushButton( PushButton&& rhs ) = default;
+
+PushButton& PushButton::operator=( const PushButton& pushButton ) = default;
+
+PushButton& PushButton::operator=( PushButton&& rhs ) = default;
PushButton::PushButton( Dali::Internal::CustomActor* internal )
: Button( internal )
PushButton( const PushButton& pushButton );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ PushButton( PushButton&& rhs );
+
+ /**
* @brief Assignment operator.
* @SINCE_1_0.0
* @param[in] pushButton Handle to an object
PushButton& operator=( const PushButton& pushButton );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ PushButton& operator=( PushButton&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-RadioButton::RadioButton( const RadioButton& radioButton )
- : Button( radioButton )
-{
-}
+RadioButton::RadioButton( const RadioButton& radioButton ) = default;
-RadioButton& RadioButton::operator=( const RadioButton& radioButton )
-{
- if( &radioButton != this )
- {
- Button::operator=( radioButton );
- }
- return *this;
-}
+RadioButton::RadioButton( RadioButton&& rhs ) = default;
+
+RadioButton& RadioButton::operator=( const RadioButton& radioButton ) = default;
+
+RadioButton& RadioButton::operator=( RadioButton&& rhs ) = default;
RadioButton::RadioButton( Dali::Internal::CustomActor* internal )
: Button( internal )
#define DALI_TOOLKIT_RADIO_BUTTON_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2029 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.
RadioButton( const RadioButton& radioButton );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ RadioButton( RadioButton&& rhs );
+
+ /**
* @brief Assignment operator.
* @SINCE_1_0.0
* @param[in] radioButton Handle to an object
RadioButton& operator=( const RadioButton& radioButton );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ RadioButton& operator=( RadioButton&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-Control::Control( const Control& uiControl )
-: CustomActor( uiControl )
-{
-}
+Control::Control( const Control& uiControl ) = default;
+
+Control::Control( Control&& rhs ) = default;
Control::~Control()
{
}
-Control& Control::operator=( const Control& handle )
-{
- if( &handle != this )
- {
- CustomActor::operator=( handle );
- }
- return *this;
-}
+Control& Control::operator=( const Control& handle ) = default;
+
+Control& Control::operator=( Control&& rhs ) = default;
Control Control::DownCast( BaseHandle handle )
{
Control(const Control& uiControl);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.23
+ * @param[in] rhs Handle to move
+ */
+ Control( Control&& rhs );
+
+ /**
* @brief Dali::Control is intended as a base class.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
public: // operators
/**
- * @brief Assignment operator.
+ * @brief Copy assignment operator.
*
* Changes this handle to point to another real object.
* @SINCE_1_0.0
*/
Control& operator=( const Control& handle );
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.23
+ * @param[in] rhs Object to assign this to
+ * @return Reference to this
+ */
+ Control& operator=( Control&& rhs );
+
public:
/**
{
}
-FlexContainer::FlexContainer( const FlexContainer& handle )
-: Control( handle )
-{
-}
+FlexContainer::FlexContainer( const FlexContainer& handle ) = default;
-FlexContainer& FlexContainer::operator=( const FlexContainer& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+FlexContainer::FlexContainer( FlexContainer&& rhs ) = default;
+
+FlexContainer& FlexContainer::operator=( const FlexContainer& handle ) = default;
+
+FlexContainer& FlexContainer::operator=( FlexContainer&& rhs ) = default;
FlexContainer::~FlexContainer()
{
#define DALI_TOOLKIT_FLEX_CONTAINER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
FlexContainer( const FlexContainer& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ FlexContainer( FlexContainer&& rhs );
+
+ /**
* @brief Assignment operator. Changes this handle to point to another real object.
* @SINCE_1_1.35
* @param[in] handle Handle to an object
FlexContainer& operator=( const FlexContainer& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ FlexContainer& operator=( FlexContainer&& rhs );
+
+ /**
* @brief Destructor.
*
* @details This is non-virtual since derived Handle types must not contain data or virtual methods.
{
}
-ImageView::ImageView( const ImageView& imageView )
-: Control( imageView )
-{
-}
+ImageView::ImageView( const ImageView& imageView ) = default;
-ImageView& ImageView::operator=( const ImageView& imageView )
-{
- if( &imageView != this )
- {
- Control::operator=( imageView );
- }
- return *this;
-}
+ImageView::ImageView( ImageView&& rhs ) = default;
+
+ImageView& ImageView::operator=( const ImageView& imageView ) = default;
+
+ImageView& ImageView::operator=( ImageView&& rhs ) = default;
ImageView::~ImageView()
{
ImageView( const ImageView& imageView );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ ImageView( ImageView&& rhs );
+
+ /**
* @brief Assignment operator.
*
* @SINCE_1_0.0
ImageView& operator=( const ImageView& imageView );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ ImageView& operator=( ImageView&& rhs );
+
+ /**
* @brief Downcasts a handle to ImageView handle.
*
* If handle points to a ImageView, the downcast produces valid handle.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Model3dView::Model3dView()
{}
-Model3dView::Model3dView( const Model3dView& model3dView )
-: Control( model3dView )
-{
-}
+Model3dView::Model3dView( const Model3dView& model3dView ) = default;
-Model3dView& Model3dView::operator=( const Model3dView& model3dView )
-{
- if( &model3dView != this )
- {
- Control::operator=( model3dView );
- }
- return *this;
-}
+Model3dView::Model3dView( Model3dView&& rhs ) = default;
+
+Model3dView& Model3dView::operator=( const Model3dView& model3dView ) = default;
+
+Model3dView& Model3dView::operator=( Model3dView&& rhs ) = default;
Model3dView::~Model3dView()
{
#define DALI_TOOLKIT_MODEL3D_VIEW_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Model3dView( const Model3dView& model3dView );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ Model3dView( Model3dView&& rhs );
+
+ /**
* @brief Assignment operator.
* @SINCE_1_1.4
* @param[in] model3dView Handle to an object
Model3dView& operator=( const Model3dView& model3dView );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Model3dView& operator=( Model3dView&& rhs );
+
+ /**
* @brief Downcasts an Object handle to Model3dView.
*
* If handle points to a Model3dView, the downcast produces valid handle.
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-ProgressBar::ProgressBar( const ProgressBar& handle )
-: Control( handle )
-{
-}
+ProgressBar::ProgressBar( const ProgressBar& handle ) = default;
-ProgressBar& ProgressBar::operator=( const ProgressBar& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+ProgressBar::ProgressBar( ProgressBar&& rhs ) = default;
+
+ProgressBar& ProgressBar::operator=( const ProgressBar& handle ) = default;
+
+ProgressBar& ProgressBar::operator=( ProgressBar&& rhs ) = default;
ProgressBar::ProgressBar(Internal::ProgressBar& implementation)
: Control(implementation)
#define DALI_TOOLKIT_PROGRESS_BAR_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
ProgressBar( const ProgressBar& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ ProgressBar( ProgressBar&& rhs );
+
+ /**
* @brief Assignment operator.
*
* Changes this handle to point to another real object.
ProgressBar& operator=( const ProgressBar& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ ProgressBar& operator=( ProgressBar&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
VerifyCustomActorPointer<Internal::ItemView>(internal);
}
-ItemView::ItemView( const ItemView& itemView )
-: Scrollable(itemView)
-{
-}
+ItemView::ItemView( const ItemView& itemView ) = default;
-ItemView& ItemView::operator=( const ItemView& itemView )
-{
- if( &itemView != this )
- {
- Control::operator=( itemView );
- }
- return *this;
-}
+ItemView::ItemView( ItemView&& rhs ) = default;
+
+ItemView& ItemView::operator=( const ItemView& itemView ) = default;
+
+ItemView& ItemView::operator=( ItemView&& rhs ) = default;
ItemView ItemView::New(ItemFactory& factory)
{
#define DALI_TOOLKIT_ITEM_VIEW_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
ItemView( const ItemView& itemView );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ ItemView( ItemView&& rhs );
+
+ /**
* @brief Assignment operator.
* @SINCE_1_0.0
* @param[in] itemView Handle to an object
ItemView& operator=( const ItemView& itemView );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ ItemView& operator=( ItemView&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
VerifyCustomActorPointer<Internal::ScrollView>(internal);
}
-ScrollView::ScrollView( const ScrollView& handle )
-: Scrollable( handle )
-{
-}
+ScrollView::ScrollView( const ScrollView& handle ) = default;
-ScrollView& ScrollView::operator=( const ScrollView& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+ScrollView::ScrollView( ScrollView&& rhs ) = default;
+
+ScrollView& ScrollView::operator=( const ScrollView& handle ) = default;
+
+ScrollView& ScrollView::operator=( ScrollView&& rhs ) = default;
ScrollView ScrollView::New()
{
#define DALI_TOOLKIT_SCROLL_VIEW_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
ScrollView( const ScrollView& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ ScrollView( ScrollView&& rhs );
+
+ /**
* @brief Assignment operator.
*
* Changes this handle to point to another real object.
ScrollView& operator=( const ScrollView& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ ScrollView& operator=( ScrollView&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
VerifyCustomActorPointer<Internal::Scrollable>(internal);
}
-Scrollable::Scrollable( const Scrollable& handle )
-: Control( handle )
-{
-}
+Scrollable::Scrollable( const Scrollable& handle ) = default;
-Scrollable& Scrollable::operator=( const Scrollable& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+Scrollable::Scrollable( Scrollable&& rhs ) = default;
+
+Scrollable& Scrollable::operator=( const Scrollable& handle ) = default;
+
+Scrollable& Scrollable::operator=( Scrollable&& rhs ) = default;
Scrollable::~Scrollable()
{
#define DALI_TOOLKIT_SCROLLABLE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Scrollable( const Scrollable& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ Scrollable( Scrollable&& rhs );
+
+ /**
* @brief Assignment operator.
*
* Changes this handle to point to another real object.
Scrollable& operator=( const Scrollable& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Scrollable& operator=( Scrollable&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-Slider::Slider( const Slider& handle )
-: Control( handle )
-{
-}
+Slider::Slider( const Slider& handle ) = default;
-Slider& Slider::operator=( const Slider& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+Slider::Slider( Slider&& rhs ) = default;
+
+Slider& Slider::operator=( const Slider& handle ) = default;
+
+Slider& Slider::operator=( Slider&& rhs ) = default;
Slider::Slider(Internal::Slider& implementation)
: Control(implementation)
#define DALI_TOOLKIT_SLIDER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Slider( const Slider& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ Slider( Slider&& rhs );
+
+ /**
* @brief Assignment operator.
*
* Changes this handle to point to another real object.
Slider& operator=( const Slider& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Slider& operator=( Slider&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-TextEditor::TextEditor( const TextEditor& handle )
-: Control( handle )
-{
-}
+TextEditor::TextEditor( const TextEditor& handle ) = default;
-TextEditor& TextEditor::operator=( const TextEditor& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+TextEditor::TextEditor( TextEditor&& rhs ) = default;
+
+TextEditor& TextEditor::operator=( const TextEditor& handle ) = default;
+
+TextEditor& TextEditor::operator=( TextEditor&& rhs ) = default;
TextEditor::~TextEditor()
{
TextEditor( const TextEditor &handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ TextEditor( TextEditor&& rhs );
+
+ /**
* @brief Assignment operator.
*
* @SINCE_1_1.37
* @param[in] handle The handle to copy from
* @return A reference to this
*/
- TextEditor&
- operator=( const TextEditor &handle );
+ TextEditor& operator=( const TextEditor &handle );
+
+ /**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ TextEditor& operator=( TextEditor&& rhs );
/**
* @brief Destructor.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-TextField::TextField( const TextField& handle )
-: Control( handle )
-{
-}
+TextField::TextField( const TextField& handle ) = default;
-TextField& TextField::operator=( const TextField& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+TextField::TextField( TextField&& rhs ) = default;
+
+TextField& TextField::operator=( const TextField& handle ) = default;
+
+TextField& TextField::operator=( TextField&& rhs ) = default;
TextField::~TextField()
{
TextField( const TextField& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ TextField( TextField&& rhs );
+
+ /**
* @brief Assignment operator.
*
* @SINCE_1_0.0
TextField& operator=( const TextField& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ TextField& operator=( TextField&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-TextLabel::TextLabel( const TextLabel& handle )
-: Control( handle )
-{
-}
+TextLabel::TextLabel( const TextLabel& handle ) = default;
-TextLabel& TextLabel::operator=( const TextLabel& handle )
-{
- if( &handle != this )
- {
- Control::operator=( handle );
- }
- return *this;
-}
+TextLabel::TextLabel( TextLabel&& rhs ) = default;
+
+TextLabel& TextLabel::operator=( const TextLabel& handle ) = default;
+
+TextLabel& TextLabel::operator=( TextLabel&& rhs ) = default;
TextLabel::~TextLabel()
{
TextLabel( const TextLabel& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ TextLabel( TextLabel&& rhs );
+
+ /**
* @brief Assignment operator.
*
* @SINCE_1_0.0
TextLabel& operator=( const TextLabel& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ TextLabel& operator=( TextLabel&& rhs );
+
+ /**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// EXTERNAL INCLUDES
#include <dali/public-api/object/property-map.h>
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/video-view/video-view-impl.h>
{
}
-VideoView::VideoView( const VideoView& videoView )
-: Control( videoView )
-{
-}
+VideoView::VideoView( const VideoView& videoView ) = default;
-VideoView& VideoView::operator=( const VideoView& videoView )
-{
- if( &videoView != this )
- {
- Control::operator=( videoView );
- }
+VideoView::VideoView( VideoView&& rhs ) = default;
- return *this;
-}
+VideoView& VideoView::operator=( const VideoView& videoView ) = default;
+
+VideoView& VideoView::operator=( VideoView&& rhs ) = default;
VideoView::~VideoView()
{
VideoView VideoView::New()
{
- return Internal::VideoView::New();
+ return Internal::VideoView::New( Dali::VideoSyncMode::DISABLED );
}
VideoView VideoView::New( const std::string& url )
{
- VideoView videoView = Internal::VideoView::New();
+ VideoView videoView = Internal::VideoView::New( Dali::VideoSyncMode::DISABLED );
Dali::Toolkit::GetImpl( videoView ).SetUrl( url );
return videoView;
}
VideoView VideoView::New( bool swCodec )
{
- VideoView videoView = Internal::VideoView::New();
+ VideoView videoView = Internal::VideoView::New( Dali::VideoSyncMode::DISABLED );
Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
return videoView;
}
VideoView VideoView::New( const std::string& url, bool swCodec )
{
- VideoView videoView = Internal::VideoView::New();
+ VideoView videoView = Internal::VideoView::New( Dali::VideoSyncMode::DISABLED );
Dali::Toolkit::GetImpl( videoView ).SetUrl( url );
Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
return videoView;
#define DALI_TOOLKIT_VIDEO_VIEW_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
VideoView( const VideoView& videoView );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ VideoView( VideoView&& rhs );
+
+ /**
* @brief Assignment operator.
*
* @SINCE_1_1.38
VideoView& operator=( const VideoView& videoView );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ VideoView& operator=( VideoView&& rhs );
+
+ /**
* @brief Downcasts a handle to VideoView handle.
*
* If handle points to a VideoView, the downcast produces valid handle.
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 9;
-const unsigned int TOOLKIT_MICRO_VERSION = 22;
+const unsigned int TOOLKIT_MICRO_VERSION = 23;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-AsyncImageLoader::AsyncImageLoader( const AsyncImageLoader& handle )
-: BaseHandle( handle )
-{
-}
+AsyncImageLoader::AsyncImageLoader( const AsyncImageLoader& handle ) = default;
-AsyncImageLoader& AsyncImageLoader::operator=( const AsyncImageLoader& handle )
-{
- BaseHandle::operator=( handle );
- return *this;
-}
+AsyncImageLoader::AsyncImageLoader( AsyncImageLoader&& rhs ) = default;
+
+AsyncImageLoader& AsyncImageLoader::operator=( const AsyncImageLoader& handle ) = default;
+
+AsyncImageLoader& AsyncImageLoader::operator=( AsyncImageLoader&& rhs ) = default;
AsyncImageLoader AsyncImageLoader::DownCast( BaseHandle handle )
{
#define DALI_TOOLKIT_ASYNC_IMAGE_LOADER_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
AsyncImageLoader( const AsyncImageLoader& handle );
/**
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ AsyncImageLoader( AsyncImageLoader&& rhs );
+
+ /**
* @brief This assignment operator is required for (smart) pointer semantics.
* @SINCE_1_2_14
*
AsyncImageLoader& operator=( const AsyncImageLoader& handle );
/**
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ AsyncImageLoader& operator=( AsyncImageLoader&& rhs );
+
+ /**
* @brief Creates a new loader to load the image asynchronously in a worker thread.
* @SINCE_1_2_14
*
valueText << touchedCount;
mTagText.SetProperty( TextLabel::Property::TEXT, valueText.str() );
- return true; // Consumed
+ return true; // Consumed meaning any gestures will be cancelled
}
// C++ EXAMPLE END
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.9.22
+Version: 1.9.23
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT