X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fecore%2Fwayland%2Fwindow-impl-ecore-wl.cpp;h=8437a6b31b1b8e261eb164f782f7dcdd9f0335bf;hb=refs%2Fchanges%2F69%2F183769%2F9;hp=12ec48cfe99d3841708451ee31c385730baa74ac;hpb=0777b3dfbec301e980c84940559759a632968f10;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp old mode 100644 new mode 100755 index 12ec48c..8437a6b --- a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp @@ -41,9 +41,13 @@ namespace { + const float INDICATOR_ANIMATION_DURATION( 0.18f ); // 180 milli seconds const float INDICATOR_SHOW_Y_POSITION( 0.0f ); const float INDICATOR_HIDE_Y_POSITION( -52.0f ); + +const uint32_t MAX_TIZEN_CLIENT_VERSION = 7; + } namespace Dali @@ -155,13 +159,21 @@ struct Window::EventHandler { if( iconifyChangedEvent->iconified == EINA_TRUE ) { - observer->OnWindowHidden(); - DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Iconfied\n", handler->mEcoreWindow ); + handler->mWindow->mIconified = true; + if( handler->mWindow->mVisible ) + { + observer->OnWindowHidden(); + } + DALI_LOG_RELEASE_INFO( "EcoreEventWindowIconifyStateChanged: Iconified, mVisible [%d]\n", handler->mWindow->mVisible ); } else { - observer->OnWindowShown(); - DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Shown\n", handler->mEcoreWindow ); + handler->mWindow->mIconified = false; + if( handler->mWindow->mVisible ) + { + observer->OnWindowShown(); + } + DALI_LOG_RELEASE_INFO( "EcoreEventWindowIconifyStateChanged: Deiconified, mVisible [%d]\n", handler->mWindow->mVisible ); } handled = ECORE_CALLBACK_DONE; } @@ -210,15 +222,15 @@ struct Window::EventHandler if ( handler && handler->mWindow && transformEvent->output == ecore_wl_window_output_find( handler->mEcoreWindow ) ) { - DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventOutputTransform\n", handler->mEcoreWindow ); + DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", handler->mEcoreWindow ); ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) ); if( wlSurface ) { - wlSurface->OutputTransformed(); + int orientation = wlSurface->OutputTransformed(); PositionSize positionSize = wlSurface->GetPositionSize(); - handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); + handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation ); handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); } } @@ -234,15 +246,15 @@ struct Window::EventHandler if ( handler && handler->mWindow && ignoreTransformEvent->win == handler->mEcoreWindow ) { - DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventIgnoreOutputTransform\n", handler->mEcoreWindow ); + DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", handler->mEcoreWindow ); ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) ); if( wlSurface ) { - wlSurface->OutputTransformed(); + int orientation = wlSurface->OutputTransformed(); PositionSize positionSize = wlSurface->GetPositionSize(); - handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); + handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation ); handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); } } @@ -256,7 +268,9 @@ struct Window::EventHandler if( strcmp( interface, tizen_policy_interface.name ) == 0 ) { - eventHandler->mTizenPolicy = static_cast< tizen_policy* >( wl_registry_bind( registry, name, &tizen_policy_interface, version ) ); + uint32_t clientVersion = std::min( version, MAX_TIZEN_CLIENT_VERSION ); + + eventHandler->mTizenPolicy = static_cast< tizen_policy* >( wl_registry_bind( registry, name, &tizen_policy_interface, clientVersion ) ); if( !eventHandler->mTizenPolicy ) { DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: wl_registry_bind(tizen_policy_interface) is failed.\n" ); @@ -289,6 +303,14 @@ struct Window::EventHandler eventHandler->mTizenDisplayPolicy = NULL; } + static void TizenPolicyConformant( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t isConformant ) + { + } + + static void TizenPolicyConformantArea( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h ) + { + } + static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state ) { Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data ); @@ -300,7 +322,11 @@ struct Window::EventHandler DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::TizenPolicyNotificationChangeDone: level = %d, state = %d\n", level, state ); } - static void TizenPolicyScreenModeChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state ) + static void TizenPolicyTransientForDone( void* data, struct tizen_policy* tizenPolicy, uint32_t childId ) + { + } + + static void TizenPolicyScreenModeChangeDone( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state ) { Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data ); @@ -311,7 +337,27 @@ struct Window::EventHandler DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state ); } - static void DisplayPolicyBrightnessChangeDone(void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state ) + static void TizenPolicyIconifyStateChanged( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t iconified, uint32_t force ) + { + } + + static void TizenPolicySupportedAuxiliaryHints( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, struct wl_array* hints, uint32_t numNints ) + { + } + + static void TizenPolicyAllowedAuxiliaryHint( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int id ) + { + } + + static void TizenPolicyAuxiliaryMessage( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, const char* key, const char* val, struct wl_array* options ) + { + } + + static void TizenPolicyConformantRegion( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial ) + { + } + + static void DisplayPolicyBrightnessChangeDone( void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state ) { Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data ); @@ -330,15 +376,16 @@ struct Window::EventHandler const struct tizen_policy_listener mTizenPolicyListener = { - NULL, - NULL, + TizenPolicyConformant, + TizenPolicyConformantArea, TizenPolicyNotificationChangeDone, - NULL, + TizenPolicyTransientForDone, TizenPolicyScreenModeChangeDone, - NULL, - NULL, - NULL, - NULL + TizenPolicyIconifyStateChanged, + TizenPolicySupportedAuxiliaryHints, + TizenPolicyAllowedAuxiliaryHint, + TizenPolicyAuxiliaryMessage, + TizenPolicyConformantRegion }; const struct tizen_display_policy_listener mTizenDisplayPolicyListener = @@ -497,6 +544,7 @@ Window::Window() mEcoreEventHander( true ), mIsFocusAcceptable( true ), mVisible( true ), + mIconified( false ), mOpaqueState( false ), mResizeEnabled( false ), mIndicator( NULL ), @@ -732,16 +780,22 @@ void Window::Raise() { // Use ecore_wl_window_activate to prevent the window shown without rendering ecore_wl_window_activate( mEventHandler->mEcoreWindow ); + + DALI_LOG_RELEASE_INFO( "Window::Raise is called.\n" ); } void Window::Lower() { ecore_wl_window_lower( mEventHandler->mEcoreWindow ); + + DALI_LOG_RELEASE_INFO( "Window::Lower is called.\n" ); } void Window::Activate() { ecore_wl_window_activate( mEventHandler->mEcoreWindow ); + + DALI_LOG_RELEASE_INFO( "Window::Activate is called.\n" ); } Dali::DragAndDropDetector Window::GetDragAndDropDetector() const @@ -801,19 +855,22 @@ void Window::AddAvailableOrientation(Dali::Window::WindowOrientation orientation { bool found = false; - for( std::size_t i=0; i& orientations) { - int rotations[4]; + int rotations[4] = { 0 }; for( std::size_t i = 0; i < mAvailableOrientations.size(); ++i ) { rotations[i] = static_cast< int >( mAvailableOrientations[i] ); @@ -875,10 +932,15 @@ void Window::Show() mVisible = true; ecore_wl_window_show( mEventHandler->mEcoreWindow ); - // Need an update request - if( mAdaptor ) + DALI_LOG_RELEASE_INFO( "Window::Show is called : mIconified [%d]\n", mIconified ); + + if( !mIconified ) { - mAdaptor->RequestUpdateOnce(); + if( mAdaptor ) + { + WindowVisibilityObserver* observer( mAdaptor ); + observer->OnWindowShown(); + } } } @@ -886,6 +948,17 @@ void Window::Hide() { mVisible = false; ecore_wl_window_hide( mEventHandler->mEcoreWindow ); + + DALI_LOG_RELEASE_INFO( "Window::Hide is called : mIconified [%d]\n", mIconified ); + + if( !mIconified ) + { + if( mAdaptor ) + { + WindowVisibilityObserver* observer( mAdaptor ); + observer->OnWindowHidden(); + } + } } bool Window::IsVisible() const