Merge branch 'devel/master(1.2.18)' into tizen
[platform/core/uifw/dali-adaptor.git] / adaptors / ecore / common / ecore-indicator-impl.h
index fafe5fc..1f0e693 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ECORE_INDICATOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/events/pan-gesture-detector.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
 #include <base/interfaces/indicator-interface.h>
@@ -62,6 +61,16 @@ public:
     CONNECTED
   };
 
+  /**
+   * copied from ecore_evas_extn_engine.h
+   */
+  enum BufferType
+  {
+    BUFFER_TYPE_SHM = 0,        ///< shared memory-based buffer backend
+    BUFFER_TYPE_DRI2_PIXMAP,    ///< dri2 pixmap-based buffer backend
+    BUFFER_TYPE_EVASGL_PIXMAP,  ///< pixmap backend for Evas GL only (DEPRECATED)
+    BUFFER_TYPE_GL_PIXMAP,      ///< double buffered GL pixmap backend
+  };
 
 protected:
   /**
@@ -196,6 +205,12 @@ private:
   Dali::Geometry CreateBackgroundGeometry();
 
   /**
+   * Set the texture to be rendered as indicator foreground
+   * @param[in] texture The foreground texture.
+   */
+  void SetForegroundImage( Dali::Texture texture );
+
+  /**
    * Touch event callback.
    * It should pass the valid touch event to indicator server
    *
@@ -274,6 +289,16 @@ private:
   void LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent );
 
   /**
+   * Update top margin of the stage as much as indicator height
+   */
+  void UpdateTopMargin();
+
+  /**
+   * Update the visibility and position of the actors
+   */
+  void UpdateVisibility();
+
+  /**
    * Inform dali that the indicator data has been updated.
    * @param[in] bufferNumber The shared file number
    */
@@ -384,11 +409,10 @@ private:
 
   IndicatorBufferPtr               mIndicatorBuffer;     ///< class which handles indicator rendering
   PixmapId                         mPixmap;              ///< Pixmap including indicator content
-  Dali::Image                      mImage;               ///< Image created from mIndicatorBuffer
-  Dali::ImageActor                 mIndicatorImageActor; ///< Actor created from mImage
+  Dali::Renderer                   mForegroundRenderer;  ///< Renderer renders the indicator foreground
+  Dali::Renderer                   mBackgroundRenderer;  ///< Renderer renders the indicator background
 
-  Dali::Actor                      mIndicatorImageContainerActor; ///< Actor container for image and background
-  Dali::Actor                      mBackgroundActor;     ///< Actor for background
+  Dali::Actor                      mIndicatorContentActor; ///< Actor container for image and background
   Dali::Actor                      mIndicatorActor;      ///< Handle to topmost indicator actor
   Dali::Actor                      mEventActor;          ///< Handle to event
   Dali::PanGestureDetector         mPanDetector;         ///< Pan detector to find flick gesture for hidden indicator
@@ -418,6 +442,14 @@ private:
 
   int                              mCurrentSharedFile;   ///< Current shared file number
   SharedFileInfo                   mSharedFileInfo[SHARED_FILE_NUMBER];    ///< Table to store shared file info
+
+  BufferType                       mSharedBufferType;    ///< Shared buffer type which is used to render indicator
+
+  struct Impl; ///< Contains Ecore specific information
+  Impl* mImpl; ///< Created on construction and destroyed on destruction.
+
+  bool                             mBackgroundVisible;   ///< Indicate whether background is visible
+  int                              mTopMargin;   ///< Top margin of the stage for indicator
 };
 
 } // Adaptor