Revert "[Tizen]Revert "Basic support of keyboard focus for multiple windows""
authorJiyun Yang <ji.yang@samsung.com>
Mon, 17 Jun 2019 05:59:35 +0000 (14:59 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Mon, 17 Jun 2019 05:59:35 +0000 (14:59 +0900)
This reverts commit 88b460eab34ce84f7e15c12ff3751356126041c1.

dali/devel-api/adaptor-framework/window-devel.h
dali/integration-api/adaptor.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor.cpp

index bbdac10..3da549e 100644 (file)
@@ -53,7 +53,7 @@ DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize
  * @param[in] window The window instance
  * @return A valid handle to a RenderTaskList
  */
-Dali::RenderTaskList GetRenderTaskList( Window window );
+DALI_ADAPTOR_API Dali::RenderTaskList GetRenderTaskList( Window window );
 
 /**
  * @brief Retrieve the window that the given actor is added to.
index 25b5a6b..570ff19 100755 (executable)
@@ -44,6 +44,8 @@ namespace Dali
 
 class RenderSurfaceInterface;
 
+using WindowContainer = std::vector<Window>;
+
 namespace Integration
 {
 class SceneHolder;
@@ -122,6 +124,7 @@ class DALI_ADAPTOR_API Adaptor
 public:
 
   typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
+  typedef Signal< void (Window&) > WindowCreatedSignalType;  ///< Window created signal type
 
 public:
   /**
@@ -427,6 +430,12 @@ public:
    */
   void UnregisterProcessor( Integration::Processor& processor );
 
+  /**
+   * @brief Get the list of windows created.
+   * @return The list of windows
+   */
+  Dali::WindowContainer GetWindows() const;
+
 public:  // Signals
 
   /**
@@ -444,6 +453,13 @@ public:  // Signals
    */
   AdaptorSignalType& LanguageChangedSignal();
 
+  /**
+   * @brief This signal is emitted when a new window is created
+   *
+   * @return The signal to connect to
+   */
+  WindowCreatedSignalType& WindowCreatedSignal();
+
 private:
 
   // Undefined
index 6bce4d5..28417ee 100755 (executable)
@@ -182,6 +182,12 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
 
   defaultWindow->SetAdaptor( Get() );
 
+  Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( ( &defaultWindow )->Get() ) );
+  if ( window )
+  {
+    mWindowCreatedSignal.Emit( window );
+  }
+
   const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
   if( 0u < timeInterval )
   {
@@ -572,6 +578,13 @@ bool Adaptor::AddWindow( Dali::Integration::SceneHolder* childWindow, const std:
 
   // Add the new Window to the container - the order is not important
   mWindows.push_back( SceneHolderPtr( &windowImpl ) );
+
+  Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( &windowImpl ) );
+  if ( window )
+  {
+    mWindowCreatedSignal.Emit( window );
+  }
+
   return true;
 }
 
@@ -1008,9 +1021,27 @@ Dali::Internal::Adaptor::SceneHolder* Adaptor::GetWindow( Dali::Actor& actor )
   return nullptr;
 }
 
+Dali::WindowContainer Adaptor::GetWindows() const
+{
+  Dali::WindowContainer windows;
+
+  for ( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter )
+  {
+    // Downcast to Dali::Window
+    Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( iter->Get() ) );
+    if ( window )
+    {
+      windows.push_back( window );
+    }
+  }
+
+  return windows;
+}
+
 Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions)
 : mResizedSignal(),
   mLanguageChangedSignal(),
+  mWindowCreatedSignal(),
   mAdaptor( adaptor ),
   mState( READY ),
   mCore( nullptr ),
index 29bb7d5..d36f8a6 100755 (executable)
@@ -97,9 +97,10 @@ class Adaptor : public Integration::RenderController,
 {
 public:
 
-  typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType;
+  using AdaptorSignalType =  Dali::Adaptor::AdaptorSignalType;
+  using WindowCreatedSignalType = Dali::Adaptor::WindowCreatedSignalType;
 
-  typedef Uint16Pair SurfaceSize;          ///< Surface size type
+  using SurfaceSize = Uint16Pair;          ///< Surface size type
 
   /**
    * Creates a New Adaptor
@@ -302,6 +303,11 @@ public: // AdaptorInternalServices implementation
    */
   Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor );
 
+  /**
+   * @copydoc Dali::Adaptor::GetWindows()
+   */
+  Dali::WindowContainer GetWindows() const;
+
 public:
 
   /**
@@ -503,6 +509,14 @@ public: // Signals
     return mLanguageChangedSignal;
   }
 
+  /**
+   * @copydoc Dali::Adaptor::WindowCreatedSignal
+   */
+  WindowCreatedSignalType& WindowCreatedSignal()
+  {
+    return mWindowCreatedSignal;
+  }
+
 public: // From Dali::Internal::Adaptor::CoreEventInterface
 
   /**
@@ -632,6 +646,7 @@ private: // Data
 
   AdaptorSignalType                     mResizedSignal;               ///< Resized signal.
   AdaptorSignalType                     mLanguageChangedSignal;       ///< Language changed signal.
+  WindowCreatedSignalType               mWindowCreatedSignal;         ///< Window created signal.
 
   Dali::Adaptor&                        mAdaptor;                     ///< Reference to public adaptor instance.
   State                                 mState;                       ///< Current state of the adaptor
index a183350..17b0805 100755 (executable)
@@ -141,6 +141,11 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
   return mImpl->LanguageChangedSignal();
 }
 
+Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+{
+  return mImpl->WindowCreatedSignal();
+}
+
 Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
   return mImpl->GetSurface();
@@ -236,6 +241,11 @@ void Adaptor::UnregisterProcessor( Integration::Processor& processor )
   mImpl->UnregisterProcessor( processor );
 }
 
+Dali::WindowContainer Adaptor::GetWindows() const
+{
+  return mImpl->GetWindows();
+}
+
 Adaptor::Adaptor()
 : mImpl( NULL )
 {