From: greynaga Date: Fri, 23 Aug 2019 10:02:57 +0000 (+0100) Subject: [dali_1.4.34] Merge branch 'devel/master' X-Git-Tag: dali_1.9.21~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dece1a6413b51816d7c20bca1cc26f77fe4ba630;hp=99b3803562d803ffdbbc7181806d5778d1e7398b;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [dali_1.4.34] Merge branch 'devel/master' Change-Id: I92fa30e83593d6f03c15c2daa0b14fafb35fddd5 --- diff --git a/.gitignore b/.gitignore index 8384ac8..3480ca9 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ tags /debugfiles.list /debuglinks.list /debugsources.list +/dali/internal/adaptor/common/system-cache-path.cpp diff --git a/build/tizen/adaptor/Makefile.am b/build/tizen/adaptor/Makefile.am index e5cbc8e..017e16d 100644 --- a/build/tizen/adaptor/Makefile.am +++ b/build/tizen/adaptor/Makefile.am @@ -68,7 +68,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_window_system_ubuntu_x11_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) + $(static_libraries_libunibreak_src_files) \ + $(adaptor_dali_src_file) if ENABLE_NETWORK_LOGGING LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -125,7 +126,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) + $(static_libraries_libunibreak_src_files) \ + $(adaptor_dali_src_file) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -191,7 +193,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) + $(static_libraries_libunibreak_src_files) \ + $(adaptor_dali_src_file) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -256,7 +259,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) + $(static_libraries_libunibreak_src_files) \ + $(adaptor_dali_src_file) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -320,7 +324,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) + $(static_libraries_libunibreak_src_files) \ + $(adaptor_dali_src_file) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -387,7 +392,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) + $(static_libraries_libunibreak_src_files) \ + $(adaptor_dali_src_file) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -409,7 +415,6 @@ endif endif - # Package doc package_doxy_dir = ../../../doc include ../../../doc/file.list diff --git a/build/tizen/adaptor/configure.ac b/build/tizen/adaptor/configure.ac index a2a542b..ae20dd2 100644 --- a/build/tizen/adaptor/configure.ac +++ b/build/tizen/adaptor/configure.ac @@ -312,6 +312,13 @@ if test x$FONT_CONFIGURATION_FILE != x; then fontConfigurationFile=$FONT_CONFIGURATION_FILE fi +if test "x$enable_profile" = "xUBUNTU"; then + cachePath=$HOME +else + cachePath="/home/owner" +fi # ubuntu profile test + +AC_SUBST(cachePath) AC_SUBST(dataReadWriteDir) AC_SUBST(dataReadOnlyDir) AC_SUBST(DALI_ADAPTOR_CFLAGS) @@ -328,6 +335,7 @@ AC_CONFIG_FILES([ Makefile dali-adaptor.pc dali-adaptor-integration.pc + ../../../dali/internal/adaptor/common/system-cache-path.cpp:./system-cache-path.in ]) if test "x$freetype_bitmap_support" = "xyes"; then diff --git a/build/tizen/adaptor/system-cache-path.in b/build/tizen/adaptor/system-cache-path.in new file mode 100644 index 0000000..816be33 --- /dev/null +++ b/build/tizen/adaptor/system-cache-path.in @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// EXTERNAL INCLUDES +#include +#include + +std::string GetSystemCachePath() +{ + return std::string( "@cachePath@/.cache/dali_common_caches/" ); +} \ No newline at end of file diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index dd28579..04e2902 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -70,6 +70,21 @@ WheelEventSignalType& WheelEventSignal( Window window ) return GetImplementation( window ).WheelEventSignal(); } +void SetParent( Window window, Window parent ) +{ + GetImplementation( window ).SetParent( parent ); +} + +void Unparent( Window window ) +{ + GetImplementation( window ).Unparent(); +} + +Window GetParent( Window window ) +{ + return GetImplementation( window ).GetParent(); +} + } // namespace DevelWindow } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index e61381e..53e06d6 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -127,6 +127,33 @@ DALI_ADAPTOR_API TouchSignalType& TouchSignal( Window window ); */ DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window ); +/** + * @brief Sets parent window of the window. + * + * After setting that, these windows do together when raise-up, lower and iconified/deiconified. + * + * @param[in] window The window instance + * @param[in] parent The parent window instance + */ +DALI_ADAPTOR_API void SetParent( Window window, Window parent ); + +/** + * @brief Unsets parent window of the window. + * + * After unsetting, the window is disconnected his parent window. + * + * @param[in] window The window instance + */ +DALI_ADAPTOR_API void Unparent( Window window ); + +/** + * @brief Gets parent window of the window. + * + * @param[in] window The window instance + * @return The parent window of the window + */ +DALI_ADAPTOR_API Window GetParent( Window window ); + } // namespace DevelWindow } // namespace Dali diff --git a/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp b/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp index 7273b94..1a30951 100644 --- a/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp +++ b/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp @@ -106,19 +106,19 @@ std::iostream& FileStream::Impl::GetStream() return mBufferStream; } - std::ios_base::openmode openMode = std::ios::ate; - if( mMode & Dali::FileStream::BINARY ) - { - openMode |= std::ios::binary; - } - + std::ios_base::openmode openMode; if( mMode & Dali::FileStream::WRITE ) { - openMode |= std::ios::out; + openMode = ( std::ios::out | std::ios::ate ); } else { - openMode |= std::ios::in; + openMode = std::ios::in; + } + + if( mMode & Dali::FileStream::BINARY ) + { + openMode |= std::ios::binary; } if( !mFileName.empty() ) diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 6256e04..d42eff5 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -34,6 +34,8 @@ #include #include +#include + // INTERNAL INCLUDES #include #include @@ -65,9 +67,12 @@ #include #include +#include using Dali::TextAbstraction::FontClient; +extern std::string GetSystemCachePath(); + namespace Dali { @@ -284,6 +289,40 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: { Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() ); } + + std::string systemCachePath = GetSystemCachePath(); + if ( systemCachePath.c_str() != NULL ) + { + Dali::FileStream fileStream( systemCachePath + "gpu-environment.conf", Dali::FileStream::READ | Dali::FileStream::TEXT ); + std::fstream& stream = dynamic_cast( fileStream.GetStream() ); + if( stream.is_open() ) + { + std::string line; + while( std::getline( stream, line ) ) + { + line.erase( line.find_last_not_of( " \t\r\n" ) + 1 ); + line.erase( 0, line.find_first_not_of( " \t\r\n" ) ); + if( '#' == *( line.cbegin() ) || line == "" ) + { + continue; + } + + std::istringstream stream( line ); + std::string environmentVariableName, environmentVariableValue; + std::getline(stream, environmentVariableName, ' '); + if( environmentVariableName == "DALI_ENV_MAX_TEXTURE_SIZE" && mEnvironmentOptions->GetMaxTextureSize() == 0 ) + { + std::getline(stream, environmentVariableValue); + setenv( environmentVariableName.c_str() , environmentVariableValue.c_str(), 1 ); + Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( std::atoi( environmentVariableValue.c_str() ) ); + } + } + } + else + { + DALI_LOG_ERROR( "Fail to open file : %s\n", ( systemCachePath + "gpu-environment.conf" ).c_str() ); + } + } } Adaptor::~Adaptor() @@ -353,6 +392,31 @@ void Adaptor::Start() // Initialize the thread controller mThreadController->Initialize(); + if( !Dali::TizenPlatform::ImageLoader::MaxTextureSizeUpdated() ) + { + auto eglGraphics = static_cast( mGraphics ); + GlImplementation& mGLES = eglGraphics->GetGlesInterface(); + Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mGLES.GetMaxTextureSize() ); + + std::string systemCachePath = GetSystemCachePath(); + if( systemCachePath.c_str() != NULL ) + { + const int dir_err = system( std::string( "mkdir " + systemCachePath ).c_str() ); + if (-1 == dir_err) + { + printf("Error creating directory!n"); + exit(1); + } + + Dali::FileStream fileStream( systemCachePath + "gpu-environment.conf", Dali::FileStream::WRITE | Dali::FileStream::TEXT ); + std::fstream& configFile = dynamic_cast( fileStream.GetStream() ); + if( configFile.is_open() ) + { + configFile << "DALI_ENV_MAX_TEXTURE_SIZE " << mGLES.GetMaxTextureSize() << std::endl; + } + } + } + ProcessCoreEvents(); // Ensure any startup messages are processed. // Initialize the image loader plugin diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index aae3340..94693d2 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -493,6 +493,8 @@ void CombinedUpdateRenderController::UpdateRenderThread() } } + eglGraphics->GetGlesInterface().ContextCreated(); + // Tell core it has a context mCore.ContextCreated(); diff --git a/dali/internal/adaptor/file.list b/dali/internal/adaptor/file.list index 803b95b..b10b5b8 100644 --- a/dali/internal/adaptor/file.list +++ b/dali/internal/adaptor/file.list @@ -7,7 +7,8 @@ adaptor_adaptor_common_src_files=\ ${adaptor_adaptor_dir}/common/adaptor.cpp \ ${adaptor_adaptor_dir}/common/adaptor-builder-impl.cpp \ ${adaptor_adaptor_dir}/common/application-impl.cpp \ - ${adaptor_adaptor_dir}/common/combined-update-render-controller.cpp + ${adaptor_adaptor_dir}/common/combined-update-render-controller.cpp \ + ${adaptor_adaptor_dir}/common/system-cache-path.cpp # module: adaptor, backend: tizen-wayland adaptor_adaptor_tizen_wayland_src_files=\ diff --git a/dali/internal/graphics/gles/gl-implementation.h b/dali/internal/graphics/gles/gl-implementation.h index 8c279f4..9ccc015 100644 --- a/dali/internal/graphics/gles/gl-implementation.h +++ b/dali/internal/graphics/gles/gl-implementation.h @@ -23,6 +23,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -49,7 +50,10 @@ class GlImplementation : public Dali::Integration::GlAbstraction public: GlImplementation() : mGlesVersion( 30 ), - mIsSurfacelessContextSupported( false ) + mIsSurfacelessContextSupported( false ), + mIsContextCreated( false ), + mContextCreatedWaitCondition(), + mMaxTextureSize( 0 ) { mImpl.reset( new Gles3Implementation() ); } @@ -66,6 +70,17 @@ public: /* Do nothing in main implementation */ } + void ContextCreated() + { + glGetIntegerv( GL_MAX_TEXTURE_SIZE, &mMaxTextureSize ); + + if( !mIsContextCreated ) + { + mContextCreatedWaitCondition.Notify(); + } + mIsContextCreated = true; + } + void SetGlesVersion( const int32_t glesVersion ) { if( mGlesVersion != glesVersion ) @@ -103,6 +118,15 @@ public: return convert; } + int GetMaxTextureSize() + { + if( !mIsContextCreated ) + { + mContextCreatedWaitCondition.Wait(); + } + return mMaxTextureSize; + } + /* OpenGL ES 2.0 */ void ActiveTexture( GLenum texture ) @@ -1340,6 +1364,9 @@ public: private: int32_t mGlesVersion; bool mIsSurfacelessContextSupported; + bool mIsContextCreated; + ConditionalWait mContextCreatedWaitCondition; + GLint mMaxTextureSize; std::unique_ptr mImpl; }; diff --git a/dali/internal/imaging/common/image-loader.cpp b/dali/internal/imaging/common/image-loader.cpp index b83878e..5980796 100755 --- a/dali/internal/imaging/common/image-loader.cpp +++ b/dali/internal/imaging/common/image-loader.cpp @@ -47,6 +47,8 @@ Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false static unsigned int gMaxTextureSize = 4096; +static bool gMaxTextureSizeUpdated = false; + /** * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE */ @@ -418,6 +420,7 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer void SetMaxTextureSize( unsigned int size ) { gMaxTextureSize = size; + gMaxTextureSizeUpdated = true; } unsigned int GetMaxTextureSize() @@ -425,6 +428,11 @@ unsigned int GetMaxTextureSize() return gMaxTextureSize; } +bool MaxTextureSizeUpdated() +{ + return gMaxTextureSizeUpdated; +} + } // ImageLoader } // TizenPlatform } // Dali diff --git a/dali/internal/imaging/common/image-loader.h b/dali/internal/imaging/common/image-loader.h index 55f1680..a7c42a0 100644 --- a/dali/internal/imaging/common/image-loader.h +++ b/dali/internal/imaging/common/image-loader.h @@ -95,6 +95,13 @@ void SetMaxTextureSize( unsigned int size ); */ unsigned int GetMaxTextureSize(); +/** + * @brief Check the gMaxTextureSize is updated or not. + * + * @return Whether the gMaxTextureSize is updated or not. + */ +bool MaxTextureSizeUpdated(); + } // ImageLoader } // TizenPlatform } // Dali diff --git a/dali/internal/system/common/environment-variables.h b/dali/internal/system/common/environment-variables.h index 0947bdb..3d63c00 100644 --- a/dali/internal/system/common/environment-variables.h +++ b/dali/internal/system/common/environment-variables.h @@ -118,6 +118,10 @@ namespace Adaptor #define DALI_ENV_WEB_ENGINE_NAME "DALI_WEB_ENGINE_NAME" +#define DALI_ENV_DPI_HORIZONTAL "DALI_DPI_HORIZONTAL" + +#define DALI_ENV_DPI_VERTICAL "DALI_DPI_VERTICAL" + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 165a69a..5f29f56 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -328,6 +328,17 @@ public: */ virtual void SetTransparency( bool transparent ) = 0; + /** + * @copydoc Dali::Window::SetParent() + */ + virtual void SetParent( Any parent ) = 0; + + /** + * @brief Check whether the window is matched or not. + * @return The result of matched. + */ + virtual bool IsMatchedWindow( Any window ) = 0; + // Signals /** diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 9483164..4ecda0d 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -77,6 +77,7 @@ Window::Window() mOpaqueState( false ), mResizeEnabled( false ), mType( Dali::Window::NORMAL ), + mParentWindow( NULL ), mPreferredOrientation( Dali::Window::PORTRAIT ), mRotationAngle( 0 ), mWindowWidth( 0 ), @@ -693,6 +694,33 @@ Dali::Window Window::Get( Dali::Actor actor ) return Dali::Window( windowImpl ); } + +void Window::SetParent( Dali::Window& parent ) +{ + if ( DALI_UNLIKELY( parent ) ) + { + mParentWindow = parent; + Dali::Window grandParent = Dali::DevelWindow::GetParent( parent ); + // check circular parent window setting + if ( DALI_UNLIKELY( grandParent ) && mWindowBase->IsMatchedWindow( grandParent.GetNativeHandle() ) ) + { + Dali::DevelWindow::Unparent( parent ); + } + mWindowBase->SetParent( parent.GetNativeHandle() ); + } +} + +void Window::Unparent() +{ + Any parent; + mWindowBase->SetParent( parent ); +} + +Dali::Window Window::GetParent() +{ + return mParentWindow; +} + } // Adaptor } // Internal diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index 4dc14e4..5e8ea5b 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -333,6 +333,21 @@ public: */ static Dali::Window Get( Dali::Actor actor ); + /** + * @copydoc Dali::DevelWindow::SetParent() + */ + void SetParent( Dali::Window& parent ); + + /** + * @copydoc Dali::DevelWindow::Unparent() + */ + void Unparent(); + + /** + * @copydoc Dali::DevelWindow::GetParent() + */ + Dali::Window GetParent(); + public: // Dali::Internal::Adaptor::SceneHolder /** @@ -491,6 +506,7 @@ private: bool mOpaqueState:1; bool mResizeEnabled:1; Dali::Window::Type mType; + Dali::Window mParentWindow; OrientationPtr mOrientation; std::vector mAvailableOrientations; diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 3a316f8..8bb94c5 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -32,6 +32,7 @@ #include #include #include +#include namespace Dali @@ -71,7 +72,9 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, Any s mRotationSupported( false ), mRotationFinished( true ), mScreenRotationFinished( true ), - mResizeFinished( true ) + mResizeFinished( true ), + mDpiHorizontal( 0 ), + mDpiVertical( 0 ) { DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" ); Initialize( surface ); @@ -184,7 +187,22 @@ PositionSize WindowRenderSurface::GetPositionSize() const void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { - mWindowBase->GetDpi( dpiHorizontal, dpiVertical ); + if( mDpiHorizontal == 0 || mDpiVertical == 0 ) + { + const char* environmentDpiHorizontal = std::getenv( DALI_ENV_DPI_HORIZONTAL ); + mDpiHorizontal = environmentDpiHorizontal ? std::atoi( environmentDpiHorizontal ) : 0; + + const char* environmentDpiVertical = std::getenv( DALI_ENV_DPI_VERTICAL ); + mDpiVertical = environmentDpiVertical ? std::atoi( environmentDpiVertical ) : 0; + + if( mDpiHorizontal == 0 || mDpiVertical == 0 ) + { + mWindowBase->GetDpi( mDpiHorizontal, mDpiVertical ); + } + } + + dpiHorizontal = mDpiHorizontal; + dpiVertical = mDpiVertical; } void WindowRenderSurface::InitializeGraphics() diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index 55bc955..8749342 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -251,6 +251,9 @@ private: // Data bool mScreenRotationFinished; bool mResizeFinished; + uint32_t mDpiHorizontal; + uint32_t mDpiVertical; + }; // class WindowRenderSurface } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 06490d2..5b67e26 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -2132,6 +2132,37 @@ void WindowBaseEcoreWl::CreateWindow( PositionSize positionSize ) } } +void WindowBaseEcoreWl::SetParent( Any parent ) +{ + Ecore_Wl_Window* mEcoreParent; + if( parent.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( parent.GetType() == typeid (Ecore_Wl_Window *) ) && "Parent's surface type is invalid" ); + mEcoreParent = AnyCast< Ecore_Wl_Window* >( parent ); + } + else + { + mEcoreParent = NULL; + } + ecore_wl_window_parent_set( mEcoreWindow, mEcoreParent ); +} + +bool WindowBaseEcoreWl::IsMatchedWindow( Any window ) +{ + bool ret = false; + if ( window.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( window.GetType() == typeid (Ecore_Wl_Window *) ) && "Window's surface type is invalid" ); + if ( AnyCast< Ecore_Wl_Window* >( window ) == mEcoreWindow ) + { + ret = true; + } + } + return ret; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 48ab90c..922e278 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -414,6 +414,16 @@ public: */ virtual void SetTransparency( bool transparent ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() + */ + virtual void SetParent( Any parent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow() + */ + virtual bool IsMatchedWindow( Any window ) override; + private: /** @@ -473,6 +483,7 @@ private: #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE + }; } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 5d1a51a..2f5cf34 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -2187,6 +2187,37 @@ void WindowBaseEcoreWl2::CreateWindow( PositionSize positionSize ) ecore_wl2_window_type_set( mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL ); } +void WindowBaseEcoreWl2::SetParent( Any parent ) +{ + Ecore_Wl2_Window* mEcoreParent; + if( parent.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( parent.GetType() == typeid (Ecore_Wl2_Window *) ) && "Parent's surface type is invalid" ); + mEcoreParent = AnyCast< Ecore_Wl2_Window* >( parent ); + } + else + { + mEcoreParent = NULL; + } + ecore_wl2_window_parent_set( mEcoreWindow, mEcoreParent ); +} + +bool WindowBaseEcoreWl2::IsMatchedWindow( Any window ) +{ + bool ret = false; + if ( window.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( window.GetType() == typeid (Ecore_Wl2_Window *) ) && "Window's surface type is invalid" ); + if ( AnyCast< Ecore_Wl2_Window*>( window ) == mEcoreWindow ) + { + ret = true; + } + } + return ret; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index 6a4694c..2b45ae0 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -419,6 +419,16 @@ public: */ virtual void SetTransparency( bool transparent ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() + */ + virtual void SetParent( Any parent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow() + */ + virtual bool IsMatchedWindow( Any window ) override; + private: /** diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index e2f650b..0c36b1d 100755 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -888,6 +888,48 @@ void WindowBaseEcoreX::CreateWindow( PositionSize positionSize, bool isTranspare } } +void WindowBaseEcoreX::SetParent( Any parent ) +{ + Ecore_X_Window mEcoreParent; + if ( parent.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( (parent.GetType() == typeid (Ecore_X_Window) ) ) + && "Surface type is invalid" ); + + if ( parent.GetType() == typeid (Ecore_X_Window) ) + { + mEcoreParent = AnyCast< Ecore_X_Window >( parent ); + ecore_x_icccm_transient_for_set( mEcoreWindow, mEcoreParent ); + } + else + { + mEcoreParent = 0; + ecore_x_icccm_transient_for_unset( mEcoreWindow ); + } + } + else + { + mEcoreParent = 0; + ecore_x_icccm_transient_for_unset( mEcoreWindow ); + } +} + +bool WindowBaseEcoreX::IsMatchedWindow( Any window ) +{ + bool ret = false; + if ( window.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( (window.GetType() == typeid (Ecore_X_Window) ) ) && "Surface type is invalid" ); + if ( AnyCast< Ecore_X_Window >( window ) == mEcoreWindow ) + { + ret = true; + } + } + return ret; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index c30eba6..6c99f46 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -348,6 +348,16 @@ public: */ virtual void SetTransparency( bool transparent ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() + */ + virtual void SetParent( Any parent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow() + */ + virtual bool IsMatchedWindow( Any window ) override; + private: /** diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index b1d6f1c..87af139 100755 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -100,25 +100,25 @@ void WindowBaseWin::OnFocusOut( int type, TWinEventInfo *event ) void WindowBaseWin::OnWindowDamaged( int type, TWinEventInfo *event ) { - Event_Mouse_Button* windowDamagedEvent( (Event_Mouse_Button*)event ); - - if( windowDamagedEvent->window == mWin32Window ) - { - DamageArea area; - area.x = 0; - area.y = 0; - WindowSystem::GetScreenSize( area.width, area.height ); - - mWindowDamagedSignal.Emit( area ); - } + Event_Mouse_Button* windowDamagedEvent( (Event_Mouse_Button*)event ); + + if( windowDamagedEvent->window == mWin32Window ) + { + DamageArea area; + area.x = 0; + area.y = 0; + WindowSystem::GetScreenSize( area.width, area.height ); + + mWindowDamagedSignal.Emit( area ); + } } void WindowBaseWin::OnMouseButtonDown( int type, TWinEventInfo *event ) { Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event); touchEvent.timestamp = GetTickCount(); - touchEvent.x = LOWORD( event->lParam ); - touchEvent.y = HIWORD( event->lParam ); + touchEvent.x = LOWORD( event->lParam ); + touchEvent.y = HIWORD( event->lParam ); touchEvent.multi.device = DEVICE_MOUSE; if( touchEvent.window == mWin32Window ) @@ -141,8 +141,8 @@ void WindowBaseWin::OnMouseButtonUp( int type, TWinEventInfo *event ) { Event_Mouse_Button touchEvent = *( (Event_Mouse_Button*)event ); touchEvent.timestamp = GetTickCount(); - touchEvent.x = LOWORD( event->lParam ); - touchEvent.y = HIWORD( event->lParam ); + touchEvent.x = LOWORD( event->lParam ); + touchEvent.y = HIWORD( event->lParam ); touchEvent.multi.device = DEVICE_MOUSE; if( touchEvent.window == mWin32Window ) @@ -165,8 +165,8 @@ void WindowBaseWin::OnMouseButtonMove( int type, TWinEventInfo *event ) { Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event); touchEvent.timestamp = GetTickCount(); - touchEvent.x = LOWORD( event->lParam ); - touchEvent.y = HIWORD( event->lParam ); + touchEvent.x = LOWORD( event->lParam ); + touchEvent.y = HIWORD( event->lParam ); touchEvent.multi.device = DEVICE_MOUSE; if( touchEvent.window == mWin32Window ) @@ -479,11 +479,11 @@ unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent ) { - long hWnd = WindowsPlatformImplementation::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL ); - - WindowsPlatformImplementation::ShowWindow( hWnd ); - - mWin32Window = (WinWindowHandle)hWnd; + long hWnd = WindowsPlatformImplementation::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL ); + + WindowsPlatformImplementation::ShowWindow( hWnd ); + + mWin32Window = (WinWindowHandle)hWnd; DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" ); } @@ -491,67 +491,77 @@ void WindowBaseWin::EventEntry( TWinEventInfo *event ) { unsigned int uMsg = event->uMsg; - switch( uMsg ) - { - case WM_SETFOCUS: - { - OnFocusIn( uMsg, event ); - break; - } - - case WM_KILLFOCUS: - { - OnFocusOut( uMsg, event ); - break; - } - - case WM_PAINT: - { - OnWindowDamaged( uMsg, event ); - break; - } - - case WM_LBUTTONDOWN: - { - OnMouseButtonDown( uMsg, event ); - break; - } - - case WM_LBUTTONUP: - { - OnMouseButtonUp( uMsg, event ); - break; - } - - case WM_MOUSEMOVE: - { - OnMouseButtonMove( uMsg, event ); - break; - } - - case WM_MOUSEWHEEL: - { - OnMouseWheel( uMsg, event ); - break; - } - - case WM_KEYDOWN: - { - OnKeyDown( uMsg, event ); - break; - } - - case WM_KEYUP: - { - OnKeyUp( uMsg, event ); - break; - } - + switch( uMsg ) + { + case WM_SETFOCUS: + { + OnFocusIn( uMsg, event ); + break; + } + + case WM_KILLFOCUS: + { + OnFocusOut( uMsg, event ); + break; + } + + case WM_PAINT: + { + OnWindowDamaged( uMsg, event ); + break; + } + + case WM_LBUTTONDOWN: + { + OnMouseButtonDown( uMsg, event ); + break; + } + + case WM_LBUTTONUP: + { + OnMouseButtonUp( uMsg, event ); + break; + } + + case WM_MOUSEMOVE: + { + OnMouseButtonMove( uMsg, event ); + break; + } + + case WM_MOUSEWHEEL: + { + OnMouseWheel( uMsg, event ); + break; + } + + case WM_KEYDOWN: + { + OnKeyDown( uMsg, event ); + break; + } + + case WM_KEYUP: + { + OnKeyUp( uMsg, event ); + break; + } + default: - break; + break; } } +void WindowBaseWin::SetParent( Any parent ) +{ + +} + +bool WindowBaseWin::IsMatchedWindow( Any window ) +{ + return false; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index b0e48c6..f19fdfc 100755 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -336,6 +336,16 @@ public: */ virtual void SetTransparency( bool transparent ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() + */ + virtual void SetParent( Any parent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow() + */ + virtual bool IsMatchedWindow( Any window ) override; + private: /** diff --git a/dali/public-api/dali-adaptor-version.cpp b/dali/public-api/dali-adaptor-version.cpp index 928603f..59a9867 100644 --- a/dali/public-api/dali-adaptor-version.cpp +++ b/dali/public-api/dali-adaptor-version.cpp @@ -28,7 +28,7 @@ namespace Dali const unsigned int ADAPTOR_MAJOR_VERSION = 1; const unsigned int ADAPTOR_MINOR_VERSION = 4; -const unsigned int ADAPTOR_MICRO_VERSION = 33; +const unsigned int ADAPTOR_MICRO_VERSION = 34; const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 4039a05..c7c1d1f 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -17,7 +17,7 @@ Name: dali-adaptor Summary: The DALi Tizen Adaptor -Version: 1.4.33 +Version: 1.4.34 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT