Basic support of keyboard focus for multiple windows 52/207352/4
authorRichard Huang <r.huang@samsung.com>
Mon, 3 Jun 2019 16:14:56 +0000 (17:14 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 7 Jun 2019 10:15:21 +0000 (11:15 +0100)
Change-Id: I5ff7a43ed9ea9c9b9437aa5973d9632b64245eff

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 bbdac10d7c4af616a1041f56d0ff3f121ee10d29..3da549eea7f61dbaa24433791a5a45252f4496da 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 25b5a6bf380ef6f47f2bf4635519b27e35c5e72d..570ff199c9fcbd0f993355dcea008e0865a33b3b 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 6bce4d5f159b0b6b33eb73dc6b468308ce17558f..28417ee956e49d017ac314ecc30632d84033712e 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 29bb7d5524e0ef10455a5be6439a7dd2f766ba8c..d36f8a651f37edda919e55aef9a3e227e9c707fb 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 a18335093a5671ed154d95afd982809c495c2cf6..17b080588b1bb142dd29bfe8b6bfa259b6d15446 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 )
 {