// EXTERNAL INCLUDES
#include <Ecore.h>
#include <Evas.h>
-#ifndef WAYLAND
+#ifdef WAYLAND
+#include <Ecore_Wayland.h>
+#else
#include <Ecore_X.h>
#endif
Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_INDICATOR");
#endif
-#ifndef WAYLAND
// Impl to hide EFL implementation.
+
struct Indicator::Impl
{
- // Construction & Destruction
+ enum // operation mode
+ {
+ INDICATOR_HIDE,
+ INDICATOR_STAY_WITH_DURATION
+ };
/**
* Constructor
: mIndicator(indicator),
mEcoreEventHandler(NULL)
{
- // Register Client message events for quick panel state.
+#ifdef WAYLAND
+ mEcoreEventHandler = ecore_event_handler_add(ECORE_WL_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this);
+#elif !defined(DALI_PROFILE_UBUNTU)
mEcoreEventHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, EcoreEventClientMessage, this);
+#endif
}
/**
*/
~Impl()
{
- ecore_event_handler_del(mEcoreEventHandler);
+ if ( mEcoreEventHandler )
+ {
+ ecore_event_handler_del(mEcoreEventHandler);
+ }
}
- /**
- * Called when the client messages (i.e. quick panel state) are received.
- */
- static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
+ static void SetIndicatorVisibility( void* data, int operation )
{
- Ecore_X_Event_Client_Message* clientMessageEvent((Ecore_X_Event_Client_Message*)event);
Indicator::Impl* indicatorImpl((Indicator::Impl*)data);
- if (clientMessageEvent == NULL || indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
+ if ( indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
{
- return ECORE_CALLBACK_PASS_ON;
+ return;
}
-
-#ifndef DALI_PROFILE_UBUNTU
- if (clientMessageEvent->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE)
+ if ( operation == INDICATOR_STAY_WITH_DURATION )
{
// if indicator is not showing, INDICATOR_FLICK_DONE is given
if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
indicatorImpl->mIndicator->ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
}
}
- else if( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE )
+ else if( operation == INDICATOR_HIDE )
{
if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
indicatorImpl->mIndicator->mIsShowing )
indicatorImpl->mIndicator->ShowIndicator( HIDE_NOW );
}
}
-#endif
+ }
+#ifdef 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;
}
+#elif !defined(DALI_PROFILE_UBUNTU)
+ /**
+ * 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);
+
+ 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 // WAYLAND
// Data
Indicator* mIndicator;
Ecore_Event_Handler* mEcoreEventHandler;
};
-#endif
Indicator::LockFile::LockFile(const std::string filename)
: mFilename(filename),
// 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)
{
break;
case Dali::PointState::UP:
+ case Dali::PointState::INTERRUPTED:
{
IpcDataEvMouseUp ipcUp( touchEvent.time );
mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) );
void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
{
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+ if( wlSurface )
+ {
+ Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+ if ( isShow )
+ {
+ ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_ON);
+ }
+ else
+ {
+ ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_OFF);
+ }
+ }
}
void Window::IndicatorTypeChanged(Indicator::Type type)
{
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+ if( wlSurface )
+ {
+ Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+ switch(type)
+ {
+ case Indicator::INDICATOR_TYPE_1:
+ ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
+ break;
+
+ case Indicator::INDICATOR_TYPE_2:
+ ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN);
+ break;
+
+ case Indicator::INDICATOR_TYPE_UNKNOWN:
+ default:
+ break;
+ }
+ }
}
void Window::IndicatorClosed( IndicatorInterface* indicator )