Merge "Fixed indentation." into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / adaptor-impl.h
index 428680c..9b61083 100755 (executable)
@@ -28,6 +28,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/adaptor.h>
+#include <dali/integration-api/scene.h>
 #include <dali/public-api/adaptor-framework/tts-player.h>
 #include <dali/devel-api/adaptor-framework/clipboard.h>
 
@@ -39,6 +40,7 @@
 #include <dali/internal/system/common/core-event-interface.h>
 #include <dali/internal/input/common/drag-and-drop-detector-impl.h>
 #include <dali/internal/window-system/common/damage-observer.h>
+#include <dali/internal/window-system/common/window-impl.h>
 #include <dali/internal/window-system/common/window-visibility-observer.h>
 #include <dali/internal/system/common/kernel-trace.h>
 #include <dali/internal/system/common/system-trace.h>
@@ -66,7 +68,6 @@ namespace Adaptor
 {
 class DisplayConnection;
 class GraphicsFactory;
-class EventHandler;
 class GestureManager;
 class GlImplementation;
 class GlSyncImplementation;
@@ -75,7 +76,6 @@ class TriggerEvent;
 class CallbackManager;
 class FeedbackPluginProxy;
 class FeedbackController;
-class RotationObserver;
 class VSyncMonitor;
 class PerformanceInterface;
 class LifeCycleObserver;
@@ -98,21 +98,21 @@ public:
 
   /**
    * Creates a New Adaptor
-   * @param[in]  nativeWindow        Native window handle
+   * @param[in]  window              The window handle
    * @param[in]  surface             A render surface can be one of the following
    *                                  - Pixmap, adaptor will use existing Pixmap to draw on to
    *                                  - Window, adaptor will use existing Window to draw on to
    * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
-  static Dali::Adaptor* New( Any nativeWindow,
+  static Dali::Adaptor* New( Dali::Window window,
                              Dali::RenderSurfaceInterface* surface,
                              Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
 
   /**
    * Creates a New Adaptor
-   * @param[in]  nativeWindow        native window handle
+   * @param[in]  window              The window handle
    * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
@@ -123,7 +123,7 @@ public:
   /**
    * Creates a New Adaptor
    * @param[in]  graphicsFactory     A factory that creates the graphics interface
-   * @param[in]  nativeWindow        Native window handle
+   * @param[in]  window              The window handle
    * @param[in]  surface             A render surface can be one of the following
    *                                  - Pixmap, adaptor will use existing Pixmap to draw on to
    *                                  - Window, adaptor will use existing Window to draw on to
@@ -131,7 +131,7 @@ public:
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
   static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
-                             Any nativeWindow,
+                             Dali::Window window,
                              Dali::RenderSurfaceInterface* surface,
                              Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
@@ -139,7 +139,7 @@ public:
   /**
    * Creates a New Adaptor
    * @param[in]  graphicsFactory     A factory that creates the graphics interface
-   * @param[in]  nativeWindow        native window handle
+   * @param[in]  window              The window handle
    * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
@@ -224,7 +224,7 @@ public: // AdaptorInternalServices implementation
   /**
    * @copydoc AdaptorInterface::ReplaceSurface()
    */
-  virtual void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface );
+  virtual void ReplaceSurface( Dali::Window window, Dali::RenderSurfaceInterface& surface );
 
   /**
    * @copydoc Dali::Adaptor::GetSurface()
@@ -319,13 +319,6 @@ public:
   void SetDragAndDropDetector( DragAndDropDetectorPtr detector );
 
   /**
-   * Sets a rotation observer, or set to NULL to remove.
-   * @pre Adaptor::Start() has been called ( to create EventHandler )
-   * @param[in] observer The observer to listen for window rotation events
-   */
-  void SetRotationObserver( RotationObserver* observer );
-
-  /**
    * Destroy the TtsPlayer of specific mode.
    * @param[in] mode The mode of TtsPlayer to destroy
    */
@@ -511,6 +504,15 @@ public: // Signals
     return mLanguageChangedSignal;
   }
 
+  /**
+   * Gets the gesture manager.
+   * @return The GestureManager
+   */
+  GestureManager* GetGestureManager() const
+  {
+    return mGestureManager;
+  }
+
 private: // From Dali::Internal::Adaptor::CoreEventInterface
 
   /**
@@ -609,14 +611,14 @@ private:
 
   /**
    * Constructor
-   * @param[in]  nativeWindow native window handle
+   * @param[in]  window       window handle
    * @param[in]  adaptor      The public adaptor
    * @param[in]  surface      A render surface can be one of the following
    *                          - Pixmap, adaptor will use existing Pixmap to draw on to
    *                          - Window, adaptor will use existing Window to draw on to
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
-  Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions );
+  Adaptor( Dali::Window window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions );
 
 private: // Types
 
@@ -629,21 +631,9 @@ private: // Types
     STOPPED,             ///< Adaptor has been stopped.
   };
 
-  // A structure to encapsulate each Window instance for the Adaptor to track them
-  typedef struct WindowPane
-  {
-    Dali::Window*  instance;     ///< Window object
-    std::string    window_name;  ///< Name (title)_of the window
-    std::string    class_name;   ///< Class name that the window belongs to
-    bool           window_mode;  ///< Display mode of the window
-    Any            nativeWindow; ///< window identifier
-    uint32_t       id;           ///< unique Window ID
-    Dali::RenderSurfaceInterface* surface;      ///< The surface the Window is bound to
-  } WindowPane;
-
-  typedef std::vector<WindowPane> WindowFrames;
-
-  typedef std::vector<LifeCycleObserver*>  ObserverContainer;
+  using WindowPtr = IntrusivePtr< Window >;
+  using WindowContainer = std::vector<WindowPtr>;
+  using ObserverContainer = std::vector<LifeCycleObserver*>;
 
 private: // Data
 
@@ -658,11 +648,10 @@ private: // Data
 
   GraphicsInterface*                    mGraphics;                    ///< Graphics interface
   Dali::DisplayConnection*              mDisplayConnection;           ///< Display connection
-  WindowFrames                          mWindowFrame;                 ///< A container of all the Windows that are currently created
+  WindowContainer                       mWindows;                     ///< A container of all the Windows that are currently created
 
   TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction;      ///< Platform abstraction
 
-  EventHandler*                         mEventHandler;                ///< event handler
   CallbackManager*                      mCallbackManager;             ///< Used to install callbacks
   bool                                  mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event
   TriggerEventInterface*                mNotificationTrigger;         ///< Notification event trigger
@@ -672,7 +661,6 @@ private: // Data
   Dali::TtsPlayer                       mTtsPlayers[Dali::TtsPlayer::MODE_NUM];                   ///< Provides TTS support
   ObserverContainer                     mObservers;                   ///< A list of adaptor observer pointers
   DragAndDropDetectorPtr                mDragAndDropDetector;         ///< The Drag & Drop detector
-  RotationObserver*                     mDeferredRotationObserver;    ///< deferred Rotation observer needs event handler
   EnvironmentOptions*                   mEnvironmentOptions;          ///< environment options
   PerformanceInterface*                 mPerformanceInterface;        ///< Performance interface
   KernelTrace                           mKernelTracer;                ///< Kernel tracer