Revert "[3.0] Implement wayland clipboard"
[platform/core/uifw/dali-adaptor.git] / adaptors / ecore / common / ecore-indicator-impl.cpp
index b954b69..b33cd12 100644 (file)
@@ -21,9 +21,7 @@
 // EXTERNAL INCLUDES
 #include <Ecore.h>
 #include <Evas.h>
-#ifdef WAYLAND
-#include <Ecore_Wayland.h>
-#else
+#ifndef WAYLAND
 #include <Ecore_X.h>
 #endif
 
@@ -293,15 +291,11 @@ namespace Adaptor
 Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_INDICATOR");
 #endif
 
+#ifndef WAYLAND
 // Impl to hide EFL implementation.
-
 struct Indicator::Impl
 {
-  enum // operation mode
-  {
-    INDICATOR_HIDE,
-    INDICATOR_STAY_WITH_DURATION
-  };
+  // Construction & Destruction
 
   /**
    * Constructor
@@ -310,13 +304,8 @@ struct Indicator::Impl
   : mIndicator(indicator),
     mEcoreEventHandler(NULL)
   {
-#if defined(DALI_PROFILE_MOBILE)
-#if defined(WAYLAND)
-    mEcoreEventHandler = ecore_event_handler_add(ECORE_WL_EVENT_INDICATOR_FLICK,  EcoreEventIndicator, this);
-#else
+    // Register Client message events for quick panel state.
     mEcoreEventHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,  EcoreEventClientMessage, this);
-#endif
-#endif // WAYLAND && DALI_PROFILE_MOBILE
   }
 
   /**
@@ -324,21 +313,24 @@ struct Indicator::Impl
    */
   ~Impl()
   {
-    if ( mEcoreEventHandler )
-    {
-      ecore_event_handler_del(mEcoreEventHandler);
-    }
+    ecore_event_handler_del(mEcoreEventHandler);
   }
 
-  static void SetIndicatorVisibility( void* data, int operation )
+  /**
+   * Called when the client messages (i.e. quick panel state) are received.
+   */
+  static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
   {
+    Ecore_X_Event_Client_Message* clientMessageEvent((Ecore_X_Event_Client_Message*)event);
     Indicator::Impl* indicatorImpl((Indicator::Impl*)data);
 
-    if ( indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
+    if (clientMessageEvent == NULL || indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
     {
-      return;
+      return ECORE_CALLBACK_PASS_ON;
     }
-    if ( operation == INDICATOR_STAY_WITH_DURATION )
+
+#ifndef DALI_PROFILE_UBUNTU
+    if (clientMessageEvent->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE)
     {
       // if indicator is not showing, INDICATOR_FLICK_DONE is given
       if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
@@ -347,7 +339,7 @@ struct Indicator::Impl
         indicatorImpl->mIndicator->ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
       }
     }
-    else if( operation == INDICATOR_HIDE )
+    else if( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE )
     {
       if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
           indicatorImpl->mIndicator->mIsShowing )
@@ -355,45 +347,16 @@ struct Indicator::Impl
         indicatorImpl->mIndicator->ShowIndicator( HIDE_NOW );
       }
     }
-  }
-#if defined(DALI_PROFILE_MOBILE)
-#if defined(WAYLAND)
-  /**
-   * Called when the Ecore indicator event is received.
-   */
-  static Eina_Bool EcoreEventIndicator( void* data, int type, void* event )
-  {
-    SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
-    return ECORE_CALLBACK_PASS_ON;
-  }
-#else
-  /**
-   * Called when the client messages (i.e. quick panel state) are received.
-   */
-  static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
-  {
-    Ecore_X_Event_Client_Message* clientMessageEvent((Ecore_X_Event_Client_Message*)event);
+#endif
 
-    if ( clientMessageEvent != NULL )
-    {
-      if (clientMessageEvent->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE)
-      {
-        SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
-      }
-      else if ( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE )
-      {
-        SetIndicatorVisibility( data, INDICATOR_HIDE );
-      }
-    }
     return ECORE_CALLBACK_PASS_ON;
   }
-#endif
-#endif // WAYLAND && DALI_PROFILE_MOBILE
 
   // Data
   Indicator*           mIndicator;
   Ecore_Event_Handler* mEcoreEventHandler;
 };
+#endif
 
 Indicator::LockFile::LockFile(const std::string filename)
 : mFilename(filename),
@@ -541,17 +504,21 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat
   // hide the indicator by default
   mIndicatorActor.SetVisible( false );
 
+#ifndef WAYLAND
   // create impl to handle ecore event
   mImpl = new Impl(this);
+#endif
 }
 
 Indicator::~Indicator()
 {
+#ifndef WAYLAND
   if(mImpl)
   {
     delete mImpl;
     mImpl = NULL;
   }
+#endif
 
   if(mEventActor)
   {
@@ -757,7 +724,6 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv
         break;
 
         case Dali::PointState::UP:
-        case Dali::PointState::INTERRUPTED:
         {
           IpcDataEvMouseUp ipcUp( touchEvent.time );
           mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) );