From 61375e873e17c7a305d0c3558a59cb3482c7bbc2 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 15 Nov 2016 09:24:29 +0900 Subject: [PATCH] Revert "[3.0] Indicator synchronization patch" This reverts commit 809dfdfd303d69661bea8c4e4b1a391aded50ec7. Change-Id: I807afe468016069681cccc9a33d2e1c42af8e550 --- adaptors/ecore/common/ecore-indicator-impl.cpp | 185 +++++-------------------- adaptors/ecore/common/ecore-indicator-impl.h | 15 -- 2 files changed, 36 insertions(+), 164 deletions(-) diff --git a/adaptors/ecore/common/ecore-indicator-impl.cpp b/adaptors/ecore/common/ecore-indicator-impl.cpp index fb60098..a57aaa6 100644 --- a/adaptors/ecore/common/ecore-indicator-impl.cpp +++ b/adaptors/ecore/common/ecore-indicator-impl.cpp @@ -21,9 +21,6 @@ // EXTERNAL INCLUDES #include #include -#ifndef WAYLAND -#include -#endif #include #include @@ -151,8 +148,6 @@ const char* INDICATOR_SERVICE_NAME("elm_indicator"); // Copied from ecore_evas_extn_engine.h -#define NBUF 2 - enum // opcodes { OP_RESIZE, @@ -180,8 +175,7 @@ enum // opcodes OP_EV_KEY_DOWN, OP_EV_HOLD, OP_MSG_PARENT, - OP_MSG, - OP_PIXMAP_REF, + OP_MSG }; // Copied from elm_conform.c @@ -291,72 +285,6 @@ namespace Adaptor Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_INDICATOR"); #endif -#ifndef WAYLAND -// Impl to hide EFL implementation. -struct Indicator::Impl -{ - // Construction & Destruction - - /** - * Constructor - */ - Impl(Indicator* indicator) - : mIndicator(indicator), - mEcoreEventHandler(NULL) - { - // Register Client message events for quick panel state. - mEcoreEventHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, EcoreEventClientMessage, this); - } - - /** - * Destructor - */ - ~Impl() - { - 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 ) - { - 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) - { - return ECORE_CALLBACK_PASS_ON; - } - -#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 && - !indicatorImpl->mIndicator->mIsShowing ) - { - indicatorImpl->mIndicator->ShowIndicator( AUTO_INDICATOR_STAY_DURATION ); - } - } - else if( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE ) - { - if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO && - indicatorImpl->mIndicator->mIsShowing ) - { - indicatorImpl->mIndicator->ShowIndicator( HIDE_NOW ); - } - } -#endif - - return ECORE_CALLBACK_PASS_ON; - } - - // Data - Indicator* mIndicator; - Ecore_Event_Handler* mEcoreEventHandler; -}; -#endif Indicator::LockFile::LockFile(const std::string filename) : mFilename(filename), @@ -464,8 +392,6 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat mIsShowing( true ), mIsAnimationPlaying( false ), mCurrentSharedFile( 0 ), - mSharedBufferType( BUFFER_TYPE_SHM ), - mImpl( NULL ), mBackgroundVisible( false ) { mIndicatorContentActor = Dali::Actor::New(); @@ -503,23 +429,10 @@ 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) { mEventActor.TouchedSignal().Disconnect( this, &Indicator::OnTouched ); @@ -628,22 +541,9 @@ void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool { UpdateImageData( mCurrentSharedFile ); } - - if ( visibleMode == Dali::Window::INVISIBLE ) - { - if (mServerConnection) - { - mServerConnection->SendEvent( OP_HIDE, NULL, 0 ); - } - } - else + if ( visibleMode != Dali::Window::INVISIBLE ) { mIndicatorActor.SetVisible( true ); - - if( mServerConnection ) - { - mServerConnection->SendEvent( OP_SHOW, NULL, 0 ); - } } mVisible = visibleMode; @@ -914,11 +814,6 @@ void Indicator::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 ) @@ -963,7 +858,7 @@ void Indicator::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ) OnIndicatorTypeChanged( INDICATOR_TYPE_2 ); } - SetVisible(mVisible); + SetVisible(mVisible, true); } } } @@ -972,33 +867,37 @@ 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 + // epcEvent->ref == w + // epcEvent->ref_to == h + // epcEvent->response == alpha + // epcEvent->data = pixmap id - if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) ) + if( ( epcEvent->data ) && + (epcEvent->size >= (int)sizeof(PixmapId)) ) { - mSharedBufferType = (BufferType)(epcEvent->ref_to); - ClearSharedFileInfo(); - mPixmap = static_cast(epcEvent->ref); - DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "mPixmap [%x]", mPixmap); + if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) ) + { + mImageWidth = epcEvent->ref; + mImageHeight = epcEvent->ref_to; - CreateNewPixmapImage(); + mPixmap = *(static_cast(epcEvent->data)); + CreateNewPixmapImage(); - if( CheckVisibleState() ) - { - // set default indicator type (enable the quick panel) - OnIndicatorTypeChanged( INDICATOR_TYPE_1 ); - } - else - { - // set default indicator type (disable the quick panel) - OnIndicatorTypeChanged( INDICATOR_TYPE_2 ); - } + if( CheckVisibleState() ) + { + // set default indicator type (enable the quick panel) + OnIndicatorTypeChanged( INDICATOR_TYPE_1 ); + } + else + { + // set default indicator type (disable the quick panel) + OnIndicatorTypeChanged( INDICATOR_TYPE_2 ); + } - SetVisible(mVisible); + SetVisible(mVisible, true); + } } } @@ -1275,7 +1174,7 @@ void Indicator::DataReceived( void* event ) DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE\n" ); if( mIsShowing ) { - //mAdaptor->RequestUpdateOnce(); + mAdaptor->RequestUpdateOnce(); } break; } @@ -1283,7 +1182,7 @@ void Indicator::DataReceived( void* event ) { DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE_DONE [%d]\n", epcEvent->response ); // epcEvent->response == display buffer # - //UpdateImageData( epcEvent->response ); + UpdateImageData( epcEvent->response ); break; } case OP_SHM_REF0: @@ -1304,12 +1203,6 @@ void Indicator::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" ); @@ -1388,8 +1281,7 @@ bool Indicator::CheckVisibleState() { if( mOrientation == Dali::Window::LANDSCAPE || mOrientation == Dali::Window::LANDSCAPE_INVERSE - || (mVisible == Dali::Window::INVISIBLE) - || (mVisible == Dali::Window::AUTO && !mIsShowing) ) + || (mVisible != Dali::Window::VISIBLE) ) { return false; } @@ -1440,8 +1332,6 @@ void Indicator::ShowIndicator(float duration) } else { - mIndicatorAnimation.Clear(); - if( EqualsZero(duration) ) { mIndicatorAnimation.AnimateTo( Property( mIndicatorContentActor, Dali::Actor::Property::POSITION ), Vector3(0, -mImageHeight, 0), Dali::AlphaFunction::EASE_OUT ); @@ -1506,16 +1396,17 @@ void Indicator::OnAnimationFinished(Dali::Animation& animation) { mIsAnimationPlaying = false; // once animation is finished and indicator is hidden, take it off stage - if( mObserver != NULL ) + if( !mIsShowing ) { - mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing? + if( mObserver != NULL ) + { + mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing? + } } } void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture ) { - return ; - if( mServerConnection ) { switch( gesture.state ) @@ -1579,11 +1470,7 @@ void Indicator::OnStageTouched(const Dali::TouchEvent& touchEvent) { case Dali::PointState::DOWN: { - // if touch point is inside the indicator, indicator is not hidden - if( mImageHeight < int(touchPoint.screen.y) ) - { - ShowIndicator( HIDE_NOW ); - } + ShowIndicator( HIDE_NOW ); break; } diff --git a/adaptors/ecore/common/ecore-indicator-impl.h b/adaptors/ecore/common/ecore-indicator-impl.h index 4493113..801c12e 100644 --- a/adaptors/ecore/common/ecore-indicator-impl.h +++ b/adaptors/ecore/common/ecore-indicator-impl.h @@ -62,16 +62,6 @@ 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: /** @@ -434,11 +424,6 @@ 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 }; -- 2.7.4