[dali_1.4.34] Merge branch 'devel/master' 20/212620/1
authorgreynaga <g.reynaga@samsung.com>
Fri, 23 Aug 2019 10:02:57 +0000 (11:02 +0100)
committergreynaga <g.reynaga@samsung.com>
Fri, 23 Aug 2019 10:02:57 +0000 (11:02 +0100)
Change-Id: I92fa30e83593d6f03c15c2daa0b14fafb35fddd5

29 files changed:
.gitignore
build/tizen/adaptor/Makefile.am
build/tizen/adaptor/configure.ac
build/tizen/adaptor/system-cache-path.in [new file with mode: 0644]
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/file.list
dali/internal/graphics/gles/gl-implementation.h
dali/internal/imaging/common/image-loader.cpp
dali/internal/imaging/common/image-loader.h
dali/internal/system/common/environment-variables.h
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/common/window-render-surface.cpp
dali/internal/window-system/common/window-render-surface.h
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 8384ac8..3480ca9 100644 (file)
@@ -38,3 +38,4 @@ tags
 /debugfiles.list
 /debuglinks.list
 /debugsources.list
+/dali/internal/adaptor/common/system-cache-path.cpp
index e5cbc8e..017e16d 100644 (file)
@@ -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
index a2a542b..ae20dd2 100644 (file)
@@ -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 (file)
index 0000000..816be33
--- /dev/null
@@ -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 <string>
+#include <cstdlib>
+
+std::string GetSystemCachePath()
+{
+  return std::string( "@cachePath@/.cache/dali_common_caches/" );
+}
\ No newline at end of file
index dd28579..04e2902 100644 (file)
@@ -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
index e61381e..53e06d6 100644 (file)
@@ -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
index 7273b94..1a30951 100644 (file)
@@ -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() )
index 6256e04..d42eff5 100755 (executable)
@@ -34,6 +34,8 @@
 #include <dali/integration-api/events/wheel-event-integ.h>
 #include <dali/integration-api/processor-interface.h>
 
+#include <fstream>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
 #include <dali/internal/system/common/thread-controller.h>
 #include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
 #include <dali/internal/imaging/common/image-loader.h>
 
+#include <dali/devel-api/adaptor-framework/file-stream.h>
 
 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<std::fstream&>( 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<EglGraphics *>( 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<std::fstream&>( 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
index aae3340..94693d2 100644 (file)
@@ -493,6 +493,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     }
   }
 
+  eglGraphics->GetGlesInterface().ContextCreated();
+
   // Tell core it has a context
   mCore.ContextCreated();
 
index 803b95b..b10b5b8 100644 (file)
@@ -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=\
index 8c279f4..9ccc015 100644 (file)
@@ -23,6 +23,7 @@
 #include <cstdlib>
 #include <GLES2/gl2.h>
 #include <dali/integration-api/gl-abstraction.h>
+#include <dali/devel-api/threading/conditional-wait.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/gles/gles-abstraction.h>
@@ -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<GlesAbstraction> mImpl;
 };
 
index b83878e..5980796 100755 (executable)
@@ -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
index 55f1680..a7c42a0 100644 (file)
@@ -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
index 0947bdb..3d63c00 100644 (file)
@@ -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
index 165a69a..5f29f56 100644 (file)
@@ -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
 
   /**
index 9483164..4ecda0d 100644 (file)
@@ -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
index 4dc14e4..5e8ea5b 100644 (file)
@@ -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<Dali::Window::WindowOrientation> mAvailableOrientations;
index 3a316f8..8bb94c5 100644 (file)
@@ -32,6 +32,7 @@
 #include <dali/internal/window-system/common/window-factory.h>
 #include <dali/internal/window-system/common/window-system.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/system/common/environment-variables.h>
 
 
 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()
index 55bc955..8749342 100644 (file)
@@ -251,6 +251,9 @@ private: // Data
   bool                            mScreenRotationFinished;
   bool                            mResizeFinished;
 
+  uint32_t                        mDpiHorizontal;
+  uint32_t                        mDpiVertical;
+
 }; // class WindowRenderSurface
 
 } // namespace Adaptor
index 06490d2..5b67e26 100644 (file)
@@ -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
index 48ab90c..922e278 100644 (file)
@@ -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
index 5d1a51a..2f5cf34 100755 (executable)
@@ -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
index 6a4694c..2b45ae0 100644 (file)
@@ -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:
 
   /**
index e2f650b..0c36b1d 100755 (executable)
@@ -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
index c30eba6..6c99f46 100644 (file)
@@ -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:
 
   /**
index b1d6f1c..87af139 100755 (executable)
@@ -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 );\r
-\r
-  if( windowDamagedEvent->window == mWin32Window )\r
-  {\r
-    DamageArea area;\r
-    area.x = 0;\r
-    area.y = 0;\r
-    WindowSystem::GetScreenSize( area.width, area.height );\r
-\r
-    mWindowDamagedSignal.Emit( area );\r
-  }\r
+  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 );\r
-  touchEvent.y = HIWORD( event->lParam );\r
+  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 );\r
-  touchEvent.y = HIWORD( event->lParam );\r
+  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 );\r
-  touchEvent.y = HIWORD( event->lParam );\r
+  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 );\r
-\r
-  WindowsPlatformImplementation::ShowWindow( hWnd );\r
-\r
-  mWin32Window = (WinWindowHandle)hWnd;\r
+  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 )\r
-  {\r
-  case WM_SETFOCUS:\r
-  {\r
-    OnFocusIn( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_KILLFOCUS:\r
-  {\r
-    OnFocusOut( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_PAINT:\r
-  {\r
-    OnWindowDamaged( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_LBUTTONDOWN:\r
-  {\r
-    OnMouseButtonDown( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_LBUTTONUP:\r
-  {\r
-    OnMouseButtonUp( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_MOUSEMOVE:\r
-  {\r
-    OnMouseButtonMove( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_MOUSEWHEEL:\r
-  {\r
-    OnMouseWheel( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_KEYDOWN:\r
-  {\r
-    OnKeyDown( uMsg, event );\r
-    break;\r
-  }\r
-\r
-  case WM_KEYUP:\r
-  {\r
-    OnKeyUp( uMsg, event );\r
-    break;\r
-  }\r
-\r
+  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;\r
+    break;
   }
 }
 
+void WindowBaseWin::SetParent( Any parent )
+{
+
+}
+
+bool WindowBaseWin::IsMatchedWindow( Any window )
+{
+  return false;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index b0e48c6..f19fdfc 100755 (executable)
@@ -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:
 
   /**
index 928603f..59a9867 100644 (file)
@@ -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
index 4039a05..c7c1d1f 100644 (file)
@@ -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