X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fecore-indicator-impl.cpp;fp=dali%2Finternal%2Fwindow-system%2Ftizen-wayland%2Findicator-impl-ecore-wl.cpp;h=3c9a6b1fe2b19433900f31db548e17f9b0b9ff29;hb=refs%2Fchanges%2F22%2F179422%2F1;hp=8d6d04fe1b07ba5aac68ff14f3db38826223b199;hpb=44ac6b074a4d7d2f9474331a364e4629c0bce11a;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp b/dali/internal/window-system/common/ecore-indicator-impl.cpp similarity index 85% rename from dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp rename to dali/internal/window-system/common/ecore-indicator-impl.cpp index 8d6d04f..3c9a6b1 100644 --- a/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp +++ b/dali/internal/window-system/common/ecore-indicator-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -16,7 +16,7 @@ */ // CLASS HEADER -#include +#include // EXTERNAL INCLUDES // Ecore is littered with C style cast @@ -24,21 +24,25 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #include #include - -#ifdef ECORE_WAYLAND2 -#include -#else +#ifdef WAYLAND #include +#else +#include #endif #include #include #include #include +#include +#include +#include #include +#include #include #include +#include #include #include @@ -48,6 +52,8 @@ #include #include +using Dali::Vector4; + #if defined(DEBUG_ENABLED) #define STATE_DEBUG_STRING(state) (state==DISCONNECTED?"DISCONNECTED":state==CONNECTED?"CONNECTED":"UNKNOWN") #endif @@ -56,7 +62,8 @@ namespace { const float SLIDING_ANIMATION_DURATION( 0.2f ); // 200 milli seconds -const float AUTO_INDICATOR_STAY_DURATION( 3.0f ); // 3 seconds +const float AUTO_INDICATOR_STAY_DURATION(3.0f); // 3 seconds +const float SHOWING_DISTANCE_HEIGHT_RATE(0.34f); // 20 pixels enum { @@ -142,11 +149,16 @@ Dali::Geometry CreateQuadGeometry() return quad; } +const float OPAQUE_THRESHOLD(0.99f); +const float TRANSPARENT_THRESHOLD(0.05f); + // indicator service name const char* INDICATOR_SERVICE_NAME("elm_indicator"); // Copied from ecore_evas_extn_engine.h +#define NBUF 2 + enum // opcodes { OP_RESIZE, @@ -175,6 +187,7 @@ enum // opcodes OP_EV_HOLD, OP_MSG_PARENT, OP_MSG, + OP_PIXMAP_REF, }; // Copied from elm_conform.c @@ -186,6 +199,11 @@ const int MSG_ID_INDICATOR_OPACITY( 0X1004 ); const int MSG_ID_INDICATOR_TYPE( 0X1005 ); const int MSG_ID_INDICATOR_START_ANIMATION( 0X10006 ); +struct IpcDataUpdate +{ + int x, w, y, h; +}; + struct IpcDataResize { int w, h; @@ -334,7 +352,7 @@ Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, " // Impl to hide EFL implementation. -struct IndicatorEcoreWl::Impl +struct Indicator::Impl { enum // operation mode { @@ -345,17 +363,17 @@ struct IndicatorEcoreWl::Impl /** * Constructor */ - Impl(IndicatorEcoreWl* indicator) + Impl(Indicator* indicator) : mIndicator(indicator), mEcoreEventHandler(NULL) { #if defined(DALI_PROFILE_MOBILE) -#ifdef ECORE_WAYLAND2 - mEcoreEventHandler = ecore_event_handler_add(ECORE_WL2_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this); -#else +#if defined(WAYLAND) mEcoreEventHandler = ecore_event_handler_add(ECORE_WL_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this); +#else + mEcoreEventHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, EcoreEventClientMessage, this); #endif -#endif // DALI_PROFILE_MOBILE +#endif // WAYLAND && DALI_PROFILE_MOBILE } /** @@ -371,7 +389,7 @@ struct IndicatorEcoreWl::Impl static void SetIndicatorVisibility( void* data, int operation ) { - IndicatorEcoreWl::Impl* indicatorImpl((IndicatorEcoreWl::Impl*)data); + Indicator::Impl* indicatorImpl((Indicator::Impl*)data); if ( indicatorImpl == NULL || indicatorImpl->mIndicator == NULL) { @@ -395,8 +413,8 @@ struct IndicatorEcoreWl::Impl } } } - #if defined(DALI_PROFILE_MOBILE) +#if defined(WAYLAND) /** * Called when the Ecore indicator event is received. */ @@ -405,14 +423,36 @@ struct IndicatorEcoreWl::Impl SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION ); return ECORE_CALLBACK_PASS_ON; } -#endif // DALI_PROFILE_MOBILE +#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); + + 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 - IndicatorEcoreWl* mIndicator; + Indicator* mIndicator; Ecore_Event_Handler* mEcoreEventHandler; }; -IndicatorEcoreWl::LockFile::LockFile(const std::string filename) +Indicator::LockFile::LockFile(const std::string filename) : mFilename(filename), mErrorThrown(false) { @@ -425,7 +465,7 @@ IndicatorEcoreWl::LockFile::LockFile(const std::string filename) } } -IndicatorEcoreWl::LockFile::~LockFile() +Indicator::LockFile::~LockFile() { // Closing file descriptor also unlocks file. if( mFileDescriptor > 0 ) @@ -434,7 +474,7 @@ IndicatorEcoreWl::LockFile::~LockFile() } } -bool IndicatorEcoreWl::LockFile::Lock() +bool Indicator::LockFile::Lock() { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -466,7 +506,7 @@ bool IndicatorEcoreWl::LockFile::Lock() return locked; } -void IndicatorEcoreWl::LockFile::Unlock() +void Indicator::LockFile::Unlock() { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -486,14 +526,14 @@ void IndicatorEcoreWl::LockFile::Unlock() } } -bool IndicatorEcoreWl::LockFile::RetrieveAndClearErrorStatus() +bool Indicator::LockFile::RetrieveAndClearErrorStatus() { bool error = mErrorThrown; mErrorThrown = false; return error; } -IndicatorEcoreWl::ScopedLock::ScopedLock(LockFile* lockFile) +Indicator::ScopedLock::ScopedLock(LockFile* lockFile) : mLockFile(lockFile), mLocked(false) { @@ -503,7 +543,7 @@ IndicatorEcoreWl::ScopedLock::ScopedLock(LockFile* lockFile) } } -IndicatorEcoreWl::ScopedLock::~ScopedLock() +Indicator::ScopedLock::~ScopedLock() { if( mLockFile ) { @@ -511,13 +551,16 @@ IndicatorEcoreWl::ScopedLock::~ScopedLock() } } -bool IndicatorEcoreWl::ScopedLock::IsLocked() +bool Indicator::ScopedLock::IsLocked() { return mLocked; } -IndicatorEcoreWl::IndicatorEcoreWl( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, IndicatorInterface::Observer* observer ) -: mConnection( this ), +Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, IndicatorInterface::Observer* observer ) +: mPixmap( 0 ), + mGestureDeltaY( 0.0f ), + mGestureDetected( false ), + mConnection( this ), mOpacityMode( Dali::Window::OPAQUE ), mState( DISCONNECTED ), mAdaptor(adaptor), @@ -530,6 +573,7 @@ IndicatorEcoreWl::IndicatorEcoreWl( Adaptor* adaptor, Dali::Window::WindowOrient mIsShowing( true ), mIsAnimationPlaying( false ), mCurrentSharedFile( 0 ), + mSharedBufferType( BUFFER_TYPE_SHM ), mImpl( NULL ), mBackgroundVisible( false ), mTopMargin( 0 ) @@ -540,7 +584,7 @@ IndicatorEcoreWl::IndicatorEcoreWl( Adaptor* adaptor, Dali::Window::WindowOrient // Indicator image handles the touch event including "leave" mIndicatorContentActor.SetLeaveRequired( true ); - mIndicatorContentActor.TouchSignal().Connect( this, &IndicatorEcoreWl::OnTouch ); + mIndicatorContentActor.TouchSignal().Connect( this, &Indicator::OnTouch ); mIndicatorContentActor.SetColor( Color::BLACK ); mIndicatorActor = Dali::Actor::New(); @@ -556,7 +600,7 @@ IndicatorEcoreWl::IndicatorEcoreWl( Adaptor* adaptor, Dali::Window::WindowOrient // It can prevent the problem that scrollview gets pan gesture even indicator area is touched, // since it consumes the pan gesture in advance. mPanDetector = Dali::PanGestureDetector::New(); - mPanDetector.DetectedSignal().Connect( this, &IndicatorEcoreWl::OnPan ); + mPanDetector.DetectedSignal().Connect( this, &Indicator::OnPan ); mPanDetector.Attach( mEventActor ); Open( orientation ); @@ -574,7 +618,7 @@ IndicatorEcoreWl::IndicatorEcoreWl( Adaptor* adaptor, Dali::Window::WindowOrient mImpl = new Impl(this); } -IndicatorEcoreWl::~IndicatorEcoreWl() +Indicator::~Indicator() { if(mImpl) { @@ -584,23 +628,23 @@ IndicatorEcoreWl::~IndicatorEcoreWl() if(mEventActor) { - mEventActor.TouchSignal().Disconnect( this, &IndicatorEcoreWl::OnTouch ); + mEventActor.TouchSignal().Disconnect( this, &Indicator::OnTouch ); } Disconnect(); } -void IndicatorEcoreWl::SetAdaptor(Adaptor* adaptor) +void Indicator::SetAdaptor(Adaptor* adaptor) { mAdaptor = adaptor; mIndicatorBuffer->SetAdaptor( adaptor ); } -Dali::Actor IndicatorEcoreWl::GetActor() +Dali::Actor Indicator::GetActor() { return mIndicatorActor; } -void IndicatorEcoreWl::Open( Dali::Window::WindowOrientation orientation ) +void Indicator::Open( Dali::Window::WindowOrientation orientation ) { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -627,7 +671,7 @@ void IndicatorEcoreWl::Open( Dali::Window::WindowOrientation orientation ) } } -void IndicatorEcoreWl::Close() +void Indicator::Close() { DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "State: %s", STATE_DEBUG_STRING(mState) ); @@ -644,7 +688,7 @@ void IndicatorEcoreWl::Close() SetForegroundImage( emptyTexture ); } -void IndicatorEcoreWl::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode ) +void Indicator::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode ) { mOpacityMode = mode; @@ -682,7 +726,7 @@ void IndicatorEcoreWl::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode ) UpdateTopMargin(); } -void IndicatorEcoreWl::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate ) +void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate ) { if ( visibleMode != mVisible || forceUpdate ) { @@ -737,12 +781,12 @@ void IndicatorEcoreWl::SetVisible( Dali::Window::IndicatorVisibleMode visibleMod } } -bool IndicatorEcoreWl::IsConnected() +bool Indicator::IsConnected() { return ( mState == CONNECTED ); } -bool IndicatorEcoreWl::SendMessage( int messageDomain, int messageId, const void *data, int size ) +bool Indicator::SendMessage( int messageDomain, int messageId, const void *data, int size ) { if(IsConnected()) { @@ -754,7 +798,7 @@ bool IndicatorEcoreWl::SendMessage( int messageDomain, int messageId, const void } } -bool IndicatorEcoreWl::OnTouch(Dali::Actor indicator, const Dali::TouchData& touchData) +bool Indicator::OnTouch(Dali::Actor indicator, const Dali::TouchData& touchData) { if( mServerConnection ) { @@ -819,7 +863,7 @@ bool IndicatorEcoreWl::OnTouch(Dali::Actor indicator, const Dali::TouchData& tou return false; } -bool IndicatorEcoreWl::Connect() +bool Indicator::Connect() { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -850,18 +894,18 @@ bool IndicatorEcoreWl::Connect() return connected; } -void IndicatorEcoreWl::StartReconnectionTimer() +void Indicator::StartReconnectionTimer() { if( ! mReconnectTimer ) { mReconnectTimer = Dali::Timer::New(1000); mConnection.DisconnectAll(); - mReconnectTimer.TickSignal().Connect( mConnection, &IndicatorEcoreWl::OnReconnectTimer ); + mReconnectTimer.TickSignal().Connect( mConnection, &Indicator::OnReconnectTimer ); } mReconnectTimer.Start(); } -bool IndicatorEcoreWl::OnReconnectTimer() +bool Indicator::OnReconnectTimer() { bool retry = false; @@ -876,7 +920,7 @@ bool IndicatorEcoreWl::OnReconnectTimer() return retry; } -void IndicatorEcoreWl::Disconnect() +void Indicator::Disconnect() { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -888,7 +932,7 @@ void IndicatorEcoreWl::Disconnect() ClearSharedFileInfo(); } -void IndicatorEcoreWl::Resize( int width, int height ) +void Indicator::Resize( int width, int height ) { if( width < 1 ) { @@ -911,7 +955,7 @@ void IndicatorEcoreWl::Resize( int width, int height ) } } -void IndicatorEcoreWl::SetLockFileInfo( Ecore_Ipc_Event_Server_Data *epcEvent ) +void Indicator::SetLockFileInfo( Ecore_Ipc_Event_Server_Data *epcEvent ) { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -942,7 +986,7 @@ void IndicatorEcoreWl::SetLockFileInfo( Ecore_Ipc_Event_Server_Data *epcEvent ) } } -void IndicatorEcoreWl::SetSharedImageInfo( Ecore_Ipc_Event_Server_Data *epcEvent ) +void Indicator::SetSharedImageInfo( Ecore_Ipc_Event_Server_Data *epcEvent ) { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -974,7 +1018,7 @@ void IndicatorEcoreWl::SetSharedImageInfo( Ecore_Ipc_Event_Server_Data *epcEvent } } -void IndicatorEcoreWl::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ) +void Indicator::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ) { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -982,6 +1026,11 @@ void IndicatorEcoreWl::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ) // epcEvent->ref_to == sys // epcEvent->response == buffer num + if ( mSharedBufferType != BUFFER_TYPE_SHM ) + { + return ; + } + int n = epcEvent->response; if( n >= 0 && n < SHARED_FILE_NUMBER ) @@ -1007,7 +1056,7 @@ void IndicatorEcoreWl::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ) mSharedFileInfo[n].mSharedFile = SharedFile::New( sharedFilename.c_str(), mSharedFileInfo[n].mImageWidth * mSharedFileInfo[n].mImageWidth * 4, true ); if( mSharedFileInfo[n].mSharedFile != NULL ) { - mSharedFileInfo[n].mLock = new IndicatorEcoreWl::LockFile( mSharedFileInfo[n].mLockFileName ); + mSharedFileInfo[n].mLock = new Indicator::LockFile( mSharedFileInfo[n].mLockFileName ); if( mSharedFileInfo[n].mLock->RetrieveAndClearErrorStatus() ) { DALI_LOG_ERROR( "### Indicator error: Cannot open lock file %s ###\n", mSharedFileInfo[n].mLockFileName.c_str() ); @@ -1021,7 +1070,29 @@ void IndicatorEcoreWl::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ) } } -void IndicatorEcoreWl::UpdateTopMargin() +void Indicator::LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent ) +{ + DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); + + // epcEvent->ref == pixmap id + // epcEvent->ref_to == type + // epcEvent->response == buffer num + + if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) ) + { + mSharedBufferType = (BufferType)(epcEvent->ref_to); + + ClearSharedFileInfo(); + + mPixmap = static_cast(epcEvent->ref); + DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "mPixmap [%x]", mPixmap); + + CreateNewPixmapImage(); + UpdateVisibility(); + } +} + +void Indicator::UpdateTopMargin() { int newMargin = (mVisible == Dali::Window::VISIBLE && mOpacityMode == Dali::Window::OPAQUE) ? mImageHeight : 0; if (mTopMargin != newMargin) @@ -1031,7 +1102,7 @@ void IndicatorEcoreWl::UpdateTopMargin() } } -void IndicatorEcoreWl::UpdateVisibility() +void Indicator::UpdateVisibility() { if( CheckVisibleState() ) { @@ -1052,24 +1123,34 @@ void IndicatorEcoreWl::UpdateVisibility() SetVisible(mVisible, true); } -void IndicatorEcoreWl::UpdateImageData( int bufferNumber ) +void Indicator::UpdateImageData( int bufferNumber ) { DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "State: %s mVisible: %s", STATE_DEBUG_STRING(mState), mVisible?"T":"F" ); if( mState == CONNECTED && mVisible ) { - // not sure we can skip it when mIsShowing is false - CopyToBuffer( bufferNumber ); + if(mPixmap == 0) + { + // in case of shm indicator (not pixmap), not sure we can skip it when mIsShowing is false + CopyToBuffer( bufferNumber ); + } + else + { + if(mIsShowing) + { + mAdaptor->RequestUpdateOnce(); + } + } } } -bool IndicatorEcoreWl::CopyToBuffer( int bufferNumber ) +bool Indicator::CopyToBuffer( int bufferNumber ) { bool success = false; if( mSharedFileInfo[bufferNumber].mLock ) { - IndicatorEcoreWl::ScopedLock scopedLock(mSharedFileInfo[bufferNumber].mLock); + Indicator::ScopedLock scopedLock(mSharedFileInfo[bufferNumber].mLock); if( mSharedFileInfo[bufferNumber].mLock->RetrieveAndClearErrorStatus() ) { // Do nothing here. @@ -1090,7 +1171,38 @@ bool IndicatorEcoreWl::CopyToBuffer( int bufferNumber ) return success; } -void IndicatorEcoreWl::CreateNewImage( int bufferNumber ) +void Indicator::CreateNewPixmapImage() +{ + DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "W:%d H:%d", mImageWidth, mImageHeight ); + Dali::NativeImageSourcePtr nativeImageSource = Dali::NativeImageSource::New( mPixmap ); + +#ifdef ENABLE_INDICATOR_IMAGE_SAVING + SaveIndicatorImage( nativeImageSource ); +#endif + + if( nativeImageSource ) + { + Dali::Texture texture = Dali::Texture::New( *nativeImageSource ); + SetForegroundImage( texture ); + mIndicatorContentActor.SetSize( mImageWidth, mImageHeight ); + mIndicatorActor.SetSize( mImageWidth, mImageHeight ); + mEventActor.SetSize( mImageWidth, mImageHeight ); + UpdateTopMargin(); + } + else + { + DALI_LOG_WARNING("### Cannot create indicator image - disconnecting ###\n"); + Disconnect(); + if( mObserver != NULL ) + { + mObserver->IndicatorClosed( this ); + } + // Don't do connection in this callback - strange things happen! + StartReconnectionTimer(); + } +} + +void Indicator::CreateNewImage( int bufferNumber ) { DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "W:%d H:%d", mSharedFileInfo[bufferNumber].mImageWidth, mSharedFileInfo[bufferNumber].mImageHeight ); mIndicatorBuffer = new IndicatorBuffer( mAdaptor, mSharedFileInfo[bufferNumber].mImageWidth, mSharedFileInfo[bufferNumber].mImageHeight, Pixel::BGRA8888 ); @@ -1112,7 +1224,7 @@ void IndicatorEcoreWl::CreateNewImage( int bufferNumber ) } } -Dali::Geometry IndicatorEcoreWl::CreateBackgroundGeometry() +Dali::Geometry Indicator::CreateBackgroundGeometry() { switch( mOpacityMode ) { @@ -1223,7 +1335,7 @@ Dali::Geometry IndicatorEcoreWl::CreateBackgroundGeometry() return Dali::Geometry(); } -void IndicatorEcoreWl::SetForegroundImage( Dali::Texture texture ) +void Indicator::SetForegroundImage( Dali::Texture texture ) { if( !mForegroundRenderer && texture ) { @@ -1262,7 +1374,7 @@ void IndicatorEcoreWl::SetForegroundImage( Dali::Texture texture ) } } -void IndicatorEcoreWl::OnIndicatorTypeChanged( Type indicatorType ) +void Indicator::OnIndicatorTypeChanged( Type indicatorType ) { if( mObserver != NULL ) { @@ -1270,7 +1382,7 @@ void IndicatorEcoreWl::OnIndicatorTypeChanged( Type indicatorType ) } } -void IndicatorEcoreWl::DataReceived( void* event ) +void Indicator::DataReceived( void* event ) { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); Ecore_Ipc_Event_Server_Data *epcEvent = static_cast( event ); @@ -1311,6 +1423,12 @@ void IndicatorEcoreWl::DataReceived( void* event ) LoadSharedImage( epcEvent ); break; } + case OP_PIXMAP_REF: + { + DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_PIXMAP_REF\n" ); + LoadPixmapImage( epcEvent ); + break; + } case OP_RESIZE: { DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_RESIZE\n" ); @@ -1371,7 +1489,7 @@ void IndicatorEcoreWl::DataReceived( void* event ) } } -void IndicatorEcoreWl::ConnectionClosed() +void Indicator::ConnectionClosed() { DALI_LOG_TRACE_METHOD( gIndicatorLogFilter ); @@ -1384,7 +1502,7 @@ void IndicatorEcoreWl::ConnectionClosed() Connect(); } -bool IndicatorEcoreWl::CheckVisibleState() +bool Indicator::CheckVisibleState() { if( mOrientation == Dali::Window::LANDSCAPE || mOrientation == Dali::Window::LANDSCAPE_INVERSE @@ -1397,7 +1515,7 @@ bool IndicatorEcoreWl::CheckVisibleState() return true; } -void IndicatorEcoreWl::ClearSharedFileInfo() +void Indicator::ClearSharedFileInfo() { for( int i = 0; i < SHARED_FILE_NUMBER; i++ ) { @@ -1421,12 +1539,12 @@ void IndicatorEcoreWl::ClearSharedFileInfo() * HIDE_NOW = 0 * }; */ -void IndicatorEcoreWl::ShowIndicator(float duration) +void Indicator::ShowIndicator(float duration) { if( !mIndicatorAnimation ) { mIndicatorAnimation = Dali::Animation::New(SLIDING_ANIMATION_DURATION); - mIndicatorAnimation.FinishedSignal().Connect(this, &IndicatorEcoreWl::OnAnimationFinished); + mIndicatorAnimation.FinishedSignal().Connect(this, &Indicator::OnAnimationFinished); } if(mIsShowing && !EqualsZero(duration)) @@ -1468,7 +1586,7 @@ void IndicatorEcoreWl::ShowIndicator(float duration) if(!mShowTimer) { mShowTimer = Dali::Timer::New(1000 * duration); - mShowTimer.TickSignal().Connect(this, &IndicatorEcoreWl::OnShowTimer); + mShowTimer.TickSignal().Connect(this, &Indicator::OnShowTimer); } mShowTimer.SetInterval(1000* duration); mShowTimer.Start(); @@ -1476,7 +1594,7 @@ void IndicatorEcoreWl::ShowIndicator(float duration) if( mVisible == Dali::Window::AUTO ) { // check the stage touch - Dali::Stage::GetCurrent().TouchSignal().Connect( this, &IndicatorEcoreWl::OnStageTouch ); + Dali::Stage::GetCurrent().TouchSignal().Connect( this, &Indicator::OnStageTouch ); } } else @@ -1489,12 +1607,12 @@ void IndicatorEcoreWl::ShowIndicator(float duration) if( mVisible == Dali::Window::AUTO ) { // check the stage touch - Dali::Stage::GetCurrent().TouchSignal().Disconnect( this, &IndicatorEcoreWl::OnStageTouch ); + Dali::Stage::GetCurrent().TouchSignal().Disconnect( this, &Indicator::OnStageTouch ); } } } -bool IndicatorEcoreWl::OnShowTimer() +bool Indicator::OnShowTimer() { // after time up, hide indicator ShowIndicator( HIDE_NOW ); @@ -1502,7 +1620,7 @@ bool IndicatorEcoreWl::OnShowTimer() return false; } -void IndicatorEcoreWl::OnAnimationFinished(Dali::Animation& animation) +void Indicator::OnAnimationFinished(Dali::Animation& animation) { mIsAnimationPlaying = false; // once animation is finished and indicator is hidden, take it off stage @@ -1512,12 +1630,12 @@ void IndicatorEcoreWl::OnAnimationFinished(Dali::Animation& animation) } } -void IndicatorEcoreWl::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture ) +void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture ) { // Nothing to do, but we still want to consume pan } -void IndicatorEcoreWl::OnStageTouch(const Dali::TouchData& touchData) +void Indicator::OnStageTouch(const Dali::TouchData& touchData) { // when stage is touched while indicator is showing temporary, hide it if( mIsShowing && ( CheckVisibleState() == false || mVisible == Dali::Window::AUTO ) )