X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fubuntu-x11%2Fwindow-base-ecore-x.cpp;h=f7058dcbee065ca0547379d814ede10b1ebab1ac;hb=e7069e6600d290fb68810872d2077e0a90cf8657;hp=5f92464ef3d15f684c8e05a7f8d372da2786b001;hpb=116fbd0c8799b78ecfe44724bd0ee24b3d8d9340;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index 5f92464..f7058dc 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -15,55 +15,49 @@ * */ -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" - // CLASS HEADER #include // INTERNAL HEADERS #include #include +#include #include // EXTERNAL_HEADERS -#include #include -#include +#include +#include +#include namespace Dali { - namespace Internal { - namespace Adaptor { - namespace { - -const std::string DEFAULT_DEVICE_NAME = ""; -const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE; +const std::string DEFAULT_DEVICE_NAME = ""; +const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE; const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE; -const unsigned int PRIMARY_TOUCH_BUTTON_ID( 1 ); +const unsigned int PRIMARY_TOUCH_BUTTON_ID(1); #if defined(DEBUG_ENABLED) -Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW_BASE" ); +Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW_BASE"); #endif ///////////////////////////////////////////////////////////////////////////////////////////////// // Window Callbacks ///////////////////////////////////////////////////////////////////////////////////////////////// -static Eina_Bool EcoreEventWindowPropertyChanged( void* data, int type, void* event ) +static Eina_Bool EcoreEventWindowPropertyChanged(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - return windowBase->OnWindowPropertyChanged( data, type, event ); + return windowBase->OnWindowPropertyChanged(data, type, event); } return ECORE_CALLBACK_PASS_ON; @@ -72,10 +66,10 @@ static Eina_Bool EcoreEventWindowPropertyChanged( void* data, int type, void* ev /** * Called when the window receives a delete request */ -static Eina_Bool EcoreEventWindowDeleteRequest( void* data, int type, void* event ) +static Eina_Bool EcoreEventWindowDeleteRequest(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { windowBase->OnDeleteRequest(); } @@ -85,12 +79,12 @@ static Eina_Bool EcoreEventWindowDeleteRequest( void* data, int type, void* even /** * Called when the window gains focus. */ -static Eina_Bool EcoreEventWindowFocusIn( void* data, int type, void* event ) +static Eina_Bool EcoreEventWindowFocusIn(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnFocusIn( data, type, event ); + windowBase->OnFocusIn(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -98,12 +92,12 @@ static Eina_Bool EcoreEventWindowFocusIn( void* data, int type, void* event ) /** * Called when the window loses focus. */ -static Eina_Bool EcoreEventWindowFocusOut( void* data, int type, void* event ) +static Eina_Bool EcoreEventWindowFocusOut(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnFocusOut( data, type, event ); + windowBase->OnFocusOut(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -111,12 +105,12 @@ static Eina_Bool EcoreEventWindowFocusOut( void* data, int type, void* event ) /** * Called when the window is damaged. */ -static Eina_Bool EcoreEventWindowDamaged( void* data, int type, void* event ) +static Eina_Bool EcoreEventWindowDamaged(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnWindowDamaged( data, type, event ); + windowBase->OnWindowDamaged(data, type, event); } return ECORE_CALLBACK_PASS_ON; @@ -129,12 +123,12 @@ static Eina_Bool EcoreEventWindowDamaged( void* data, int type, void* event ) /** * Called when the source window notifies us the content in clipboard is selected. */ -static Eina_Bool EcoreEventSelectionClear( void* data, int type, void* event ) +static Eina_Bool EcoreEventSelectionClear(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnSelectionClear( data, type, event ); + windowBase->OnSelectionClear(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -143,12 +137,12 @@ static Eina_Bool EcoreEventSelectionClear( void* data, int type, void* event ) * Called when the source window sends us about the selected content. * For example, when dragged items are dragged INTO our window or when items are selected in the clipboard. */ -static Eina_Bool EcoreEventSelectionNotify( void* data, int type, void* event ) +static Eina_Bool EcoreEventSelectionNotify(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnSelectionNotify( data, type, event ); + windowBase->OnSelectionNotify(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -160,12 +154,12 @@ static Eina_Bool EcoreEventSelectionNotify( void* data, int type, void* event ) /** * Called when a touch down is received. */ -static Eina_Bool EcoreEventMouseButtonDown( void* data, int type, void* event ) +static Eina_Bool EcoreEventMouseButtonDown(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnMouseButtonDown( data, type, event ); + windowBase->OnMouseButtonDown(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -173,12 +167,12 @@ static Eina_Bool EcoreEventMouseButtonDown( void* data, int type, void* event ) /** * Called when a touch up is received. */ -static Eina_Bool EcoreEventMouseButtonUp( void* data, int type, void* event ) +static Eina_Bool EcoreEventMouseButtonUp(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnMouseButtonUp( data, type, event ); + windowBase->OnMouseButtonUp(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -186,12 +180,12 @@ static Eina_Bool EcoreEventMouseButtonUp( void* data, int type, void* event ) /** * Called when a touch motion is received. */ -static Eina_Bool EcoreEventMouseButtonMove( void* data, int type, void* event ) +static Eina_Bool EcoreEventMouseButtonMove(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnMouseButtonMove( data, type, event ); + windowBase->OnMouseButtonMove(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -203,12 +197,12 @@ static Eina_Bool EcoreEventMouseButtonMove( void* data, int type, void* event ) /** * Called when a mouse wheel is received. */ -static Eina_Bool EcoreEventMouseWheel( void* data, int type, void* event ) +static Eina_Bool EcoreEventMouseWheel(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnMouseWheel( data, type, event ); + windowBase->OnMouseWheel(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -220,12 +214,12 @@ static Eina_Bool EcoreEventMouseWheel( void* data, int type, void* event ) /** * Called when a key down is received. */ -static Eina_Bool EcoreEventKeyDown( void* data, int type, void* event ) +static Eina_Bool EcoreEventKeyDown(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnKeyDown( data, type, event ); + windowBase->OnKeyDown(data, type, event); } return ECORE_CALLBACK_PASS_ON; } @@ -233,143 +227,149 @@ static Eina_Bool EcoreEventKeyDown( void* data, int type, void* event ) /** * Called when a key up is received. */ -static Eina_Bool EcoreEventKeyUp( void* data, int type, void* event ) +static Eina_Bool EcoreEventKeyUp(void* data, int type, void* event) { - WindowBaseEcoreX* windowBase = static_cast< WindowBaseEcoreX* >( data ); - if( windowBase ) + WindowBaseEcoreX* windowBase = static_cast(data); + if(windowBase) { - windowBase->OnKeyUp( data, type, event ); + windowBase->OnKeyUp(data, type, event); } return ECORE_CALLBACK_PASS_ON; } } // unnamed namespace -WindowBaseEcoreX::WindowBaseEcoreX( Dali::PositionSize positionSize, Any surface, bool isTransparent ) +WindowBaseEcoreX::WindowBaseEcoreX(Dali::PositionSize positionSize, Any surface, bool isTransparent) : mEcoreEventHandler(), - mEcoreWindow( 0 ), - mOwnSurface( false ), - mRotationAppSet( false ) + mEcoreWindow(0), + mOwnSurface(false), + mIsTransparent(false), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is. + mRotationAppSet(false), + mWindowRotationAngle(0) { - Initialize( positionSize, surface, isTransparent ); + Initialize(positionSize, surface, isTransparent); } WindowBaseEcoreX::~WindowBaseEcoreX() { - for( Dali::Vector< Ecore_Event_Handler* >::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter ) + for(Dali::Vector::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter) { - ecore_event_handler_del( *iter ); + ecore_event_handler_del(*iter); } mEcoreEventHandler.Clear(); - if( mOwnSurface ) + if(mOwnSurface) { - ecore_x_window_free( mEcoreWindow ); + ecore_x_window_free(mEcoreWindow); + + WindowSystem::Shutdown(); } } -void WindowBaseEcoreX::Initialize( PositionSize positionSize, Any surface, bool isTransparent ) +void WindowBaseEcoreX::Initialize(PositionSize positionSize, Any surface, bool isTransparent) { // see if there is a surface in Any surface - unsigned int surfaceId = GetSurfaceId( surface ); + unsigned int surfaceId = GetSurfaceId(surface); // if the surface is empty, create a new one. - if( surfaceId == 0 ) + if(surfaceId == 0) { + WindowSystem::Initialize(); + // we own the surface about to created mOwnSurface = true; - CreateWindow( positionSize, isTransparent ); + CreateWindow(positionSize, isTransparent); } else { // XLib should already be initialized so no point in calling XInitThreads - mEcoreWindow = static_cast< Ecore_X_Window >( surfaceId ); + mEcoreWindow = static_cast(surfaceId); } // set up etc properties to match with ecore-evas - char *id = NULL; - if( ( id = getenv("DESKTOP_STARTUP_ID") ) ) + char* id = NULL; + if((id = getenv("DESKTOP_STARTUP_ID"))) { - ecore_x_netwm_startup_id_set( mEcoreWindow, id ); + ecore_x_netwm_startup_id_set(mEcoreWindow, id); } - ecore_x_icccm_hints_set( mEcoreWindow, - 1, // accepts_focus - ECORE_X_WINDOW_STATE_HINT_NORMAL, // initial_state - 0, // icon_pixmap - 0, // icon_mask - 0, // icon_window - 0, // window_group - 0 ); // is_urgent + ecore_x_icccm_hints_set(mEcoreWindow, + 1, // accepts_focus + ECORE_X_WINDOW_STATE_HINT_NORMAL, // initial_state + 0, // icon_pixmap + 0, // icon_mask + 0, // icon_window + 0, // window_group + 0); // is_urgent // we SHOULD guarantee the x11 window was created in x server. ecore_x_sync(); - ecore_x_input_multi_select( mEcoreWindow ); + ecore_x_input_multi_select(mEcoreWindow); // This ensures that we catch the window close (or delete) request - ecore_x_icccm_protocol_set( mEcoreWindow, ECORE_X_WM_PROTOCOL_DELETE_REQUEST, EINA_TRUE ); + ecore_x_icccm_protocol_set(mEcoreWindow, ECORE_X_WM_PROTOCOL_DELETE_REQUEST, EINA_TRUE); // Enable Drag & Drop - ecore_x_dnd_aware_set( mEcoreWindow, EINA_TRUE ); + ecore_x_dnd_aware_set(mEcoreWindow, EINA_TRUE); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_X_EVENT_WINDOW_PROPERTY, EcoreEventWindowPropertyChanged, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_X_EVENT_WINDOW_DELETE_REQUEST, EcoreEventWindowDeleteRequest, this ) ); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, EcoreEventWindowPropertyChanged, this)); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DELETE_REQUEST, EcoreEventWindowDeleteRequest, this)); // Register window focus events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_X_EVENT_WINDOW_FOCUS_IN, EcoreEventWindowFocusIn, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_X_EVENT_WINDOW_FOCUS_OUT, EcoreEventWindowFocusOut, this ) ); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, EcoreEventWindowFocusIn, this)); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, EcoreEventWindowFocusOut, this)); // Register Window damage events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_X_EVENT_WINDOW_DAMAGE, EcoreEventWindowDamaged, this ) ); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, EcoreEventWindowDamaged, this)); // Register Touch events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_OUT, EcoreEventMouseButtonUp, this ) ); // process mouse out event like up event + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, this)); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this)); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this)); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_OUT, EcoreEventMouseButtonUp, this)); // process mouse out event like up event // Register Mouse wheel events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this ) ); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this)); // Register Key events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this ) ); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this)); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this)); // Register Selection event - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_X_EVENT_SELECTION_CLEAR, EcoreEventSelectionClear, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_X_EVENT_SELECTION_NOTIFY, EcoreEventSelectionNotify, this ) ); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, EcoreEventSelectionClear, this)); + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, EcoreEventSelectionNotify, this)); } -Eina_Bool WindowBaseEcoreX::OnWindowPropertyChanged( void* data, int type, void* event ) +Eina_Bool WindowBaseEcoreX::OnWindowPropertyChanged(void* data, int type, void* event) { - Ecore_X_Event_Window_Property* propertyChangedEvent = static_cast< Ecore_X_Event_Window_Property* >( event ); - Eina_Bool handled( ECORE_CALLBACK_PASS_ON ); + Ecore_X_Event_Window_Property* propertyChangedEvent = static_cast(event); + Eina_Bool handled(ECORE_CALLBACK_PASS_ON); - if( propertyChangedEvent->win == mEcoreWindow ) + if(propertyChangedEvent->win == mEcoreWindow) { - Ecore_X_Window_State_Hint state( ecore_x_icccm_state_get( propertyChangedEvent->win ) ); + Ecore_X_Window_State_Hint state(ecore_x_icccm_state_get(propertyChangedEvent->win)); - switch( state ) + switch(state) { case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN: { // Window was hidden. - mIconifyChangedSignal.Emit( true ); + mIconifyChangedSignal.Emit(true); handled = ECORE_CALLBACK_DONE; break; } case ECORE_X_WINDOW_STATE_HINT_ICONIC: { // Window was iconified (minimised). - mIconifyChangedSignal.Emit( true ); + mIconifyChangedSignal.Emit(true); handled = ECORE_CALLBACK_DONE; break; } case ECORE_X_WINDOW_STATE_HINT_NORMAL: { // Window was shown. - mIconifyChangedSignal.Emit( false ); + mIconifyChangedSignal.Emit(false); handled = ECORE_CALLBACK_DONE; break; } @@ -389,222 +389,236 @@ void WindowBaseEcoreX::OnDeleteRequest() mDeleteRequestSignal.Emit(); } -void WindowBaseEcoreX::OnFocusIn( void* data, int type, void* event ) +void WindowBaseEcoreX::OnFocusIn(void* data, int type, void* event) { - Ecore_X_Event_Window_Focus_In* focusInEvent = static_cast< Ecore_X_Event_Window_Focus_In* >( event ); + Ecore_X_Event_Window_Focus_In* focusInEvent = static_cast(event); - if( focusInEvent->win == mEcoreWindow ) + if(focusInEvent->win == mEcoreWindow) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n" ); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n"); - mFocusChangedSignal.Emit( true ); + mFocusChangedSignal.Emit(true); } } -void WindowBaseEcoreX::OnFocusOut( void* data, int type, void* event ) +void WindowBaseEcoreX::OnFocusOut(void* data, int type, void* event) { - Ecore_X_Event_Window_Focus_Out* focusOutEvent = static_cast< Ecore_X_Event_Window_Focus_Out* >( event ); + Ecore_X_Event_Window_Focus_Out* focusOutEvent = static_cast(event); // If the window loses focus then hide the keyboard. - if( focusOutEvent->win == mEcoreWindow ) + if(focusOutEvent->win == mEcoreWindow) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n" ); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n"); - mFocusChangedSignal.Emit( false ); + mFocusChangedSignal.Emit(false); } } -void WindowBaseEcoreX::OnWindowDamaged( void* data, int type, void* event ) +void WindowBaseEcoreX::OnWindowDamaged(void* data, int type, void* event) { - Ecore_X_Event_Window_Damage* windowDamagedEvent = static_cast< Ecore_X_Event_Window_Damage* >( event ); + Ecore_X_Event_Window_Damage* windowDamagedEvent = static_cast(event); - if( windowDamagedEvent->win == mEcoreWindow ) + if(windowDamagedEvent->win == mEcoreWindow) { DamageArea area; - area.x = windowDamagedEvent->x; - area.y = windowDamagedEvent->y; - area.width = windowDamagedEvent->w; + area.x = windowDamagedEvent->x; + area.y = windowDamagedEvent->y; + area.width = windowDamagedEvent->w; area.height = windowDamagedEvent->h; - mWindowDamagedSignal.Emit( area ); + mWindowDamagedSignal.Emit(area); } } -void WindowBaseEcoreX::OnMouseButtonDown( void* data, int type, void* event ) +void WindowBaseEcoreX::OnMouseButtonDown(void* data, int type, void* event) { - Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( event ); + Ecore_Event_Mouse_Button* touchEvent = static_cast(event); - if( touchEvent->window == mEcoreWindow ) + if(touchEvent->window == mEcoreWindow) { - PointState::Type state ( PointState::DOWN ); + PointState::Type state(PointState::DOWN); - // Check if the buttons field is set and ensure it's the primary touch button. - // If this event was triggered by buttons other than the primary button (used for touch), then - // just send an interrupted event to Core. - if( touchEvent->buttons && ( touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) ) + Integration::Point point; + point.SetDeviceId(touchEvent->multi.device); + point.SetState(state); + point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y)); + point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radius_x, touchEvent->multi.radius_y)); + point.SetPressure(touchEvent->multi.pressure); + point.SetAngle(Degree(touchEvent->multi.angle)); + if(touchEvent->buttons) { - state = PointState::INTERRUPTED; + point.SetMouseButton(static_cast(touchEvent->buttons)); } - Integration::Point point; - point.SetDeviceId( touchEvent->multi.device ); - point.SetState( state ); - point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) ); - point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) ); - point.SetPressure( touchEvent->multi.pressure ); - point.SetAngle( Degree( touchEvent->multi.angle ) ); - - mTouchEventSignal.Emit( point, touchEvent->timestamp ); + mTouchEventSignal.Emit(point, touchEvent->timestamp); } } -void WindowBaseEcoreX::OnMouseButtonUp( void* data, int type, void* event ) +void WindowBaseEcoreX::OnMouseButtonUp(void* data, int type, void* event) { - Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( event ); + Ecore_Event_Mouse_Button* touchEvent = static_cast(event); - if( touchEvent->window == mEcoreWindow ) + if(touchEvent->window == mEcoreWindow) { Integration::Point point; - point.SetDeviceId( touchEvent->multi.device ); - point.SetState( PointState::UP ); - point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) ); - point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) ); - point.SetPressure( touchEvent->multi.pressure ); - point.SetAngle( Degree( touchEvent->multi.angle ) ); + point.SetDeviceId(touchEvent->multi.device); + point.SetState(PointState::UP); + point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y)); + point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radius_x, touchEvent->multi.radius_y)); + point.SetPressure(touchEvent->multi.pressure); + point.SetAngle(Degree(static_cast(touchEvent->multi.angle))); + if(touchEvent->buttons) + { + point.SetMouseButton(static_cast(touchEvent->buttons)); + } - mTouchEventSignal.Emit( point, touchEvent->timestamp ); + mTouchEventSignal.Emit(point, touchEvent->timestamp); } } -void WindowBaseEcoreX::OnMouseButtonMove( void* data, int type, void* event ) +void WindowBaseEcoreX::OnMouseButtonMove(void* data, int type, void* event) { - Ecore_Event_Mouse_Move* touchEvent = static_cast< Ecore_Event_Mouse_Move* >( event ); + Ecore_Event_Mouse_Move* touchEvent = static_cast(event); - if( touchEvent->window == mEcoreWindow ) + if(touchEvent->window == mEcoreWindow) { Integration::Point point; - point.SetDeviceId( touchEvent->multi.device ); - point.SetState( PointState::MOTION ); - point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) ); - point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) ); - point.SetPressure( touchEvent->multi.pressure ); - point.SetAngle( Degree( touchEvent->multi.angle ) ); + point.SetDeviceId(touchEvent->multi.device); + point.SetState(PointState::MOTION); + point.SetScreenPosition(Vector2(static_cast(touchEvent->x), static_cast(touchEvent->y))); + point.SetRadius(static_cast(touchEvent->multi.radius), Vector2(static_cast(touchEvent->multi.radius_x), static_cast(touchEvent->multi.radius_y))); + point.SetPressure(static_cast(touchEvent->multi.pressure)); + point.SetAngle(Degree(static_cast(touchEvent->multi.angle))); - mTouchEventSignal.Emit( point, touchEvent->timestamp ); + mTouchEventSignal.Emit(point, touchEvent->timestamp); } } -void WindowBaseEcoreX::OnMouseWheel( void* data, int type, void* event ) +void WindowBaseEcoreX::OnMouseWheel(void* data, int type, void* event) { - Ecore_Event_Mouse_Wheel* mouseWheelEvent = static_cast< Ecore_Event_Mouse_Wheel* >( event ); + Ecore_Event_Mouse_Wheel* mouseWheelEvent = static_cast(event); - if( mouseWheelEvent->window == mEcoreWindow ) + if(mouseWheelEvent->window == mEcoreWindow) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreX::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreX::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z); - WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); + Integration::WheelEvent wheelEvent(Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2(static_cast(mouseWheelEvent->x), static_cast(mouseWheelEvent->y)), mouseWheelEvent->z, mouseWheelEvent->timestamp); - mWheelEventSignal.Emit( wheelEvent ); + mWheelEventSignal.Emit(wheelEvent); } } -void WindowBaseEcoreX::OnKeyDown( void* data, int type, void* event ) +void WindowBaseEcoreX::OnKeyDown(void* data, int type, void* event) { - Ecore_Event_Key* keyEvent = static_cast< Ecore_Event_Key* >( event ); + Ecore_Event_Key* keyEvent = static_cast(event); - if( keyEvent->window == mEcoreWindow ) + if(keyEvent->window == mEcoreWindow) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreX::OnKeyDown\n" ); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreX::OnKeyDown\n"); - std::string keyName( keyEvent->keyname ); - std::string keyString( "" ); - std::string compose( "" ); + std::string keyName(keyEvent->keyname); + std::string logicalKey(""); + std::string keyString(""); + std::string compose(""); // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string. - if( keyEvent->compose ) + if(keyEvent->compose) { compose = keyEvent->compose; } - int keyCode = ecore_x_keysym_keycode_get( keyEvent->keyname ); - int modifier( keyEvent->modifiers ); + // Ensure key symbol is not NULL as keys like SHIFT have a null string. + if(keyEvent->key) + { + logicalKey = keyEvent->key; + } + + int keyCode = ecore_x_keysym_keycode_get(keyEvent->keyname); + int modifier(keyEvent->modifiers); unsigned long time = keyEvent->timestamp; // Ensure key event string is not NULL as keys like SHIFT have a null string. - if( keyEvent->string ) + if(keyEvent->string) { keyString = keyEvent->string; } - Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS ); + Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS); - mKeyEventSignal.Emit( keyEvent ); + mKeyEventSignal.Emit(keyEvent); } } -void WindowBaseEcoreX::OnKeyUp( void* data, int type, void* event ) +void WindowBaseEcoreX::OnKeyUp(void* data, int type, void* event) { - Ecore_Event_Key* keyEvent = static_cast< Ecore_Event_Key* >( event ); + Ecore_Event_Key* keyEvent = static_cast(event); - if ( keyEvent->window == mEcoreWindow ) + if(keyEvent->window == mEcoreWindow) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, " WindowBaseEcoreX::OnKeyUp\n" ); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, " WindowBaseEcoreX::OnKeyUp\n"); - std::string keyName( keyEvent->keyname ); - std::string keyString( "" ); - std::string compose( "" ); + std::string keyName(keyEvent->keyname); + std::string logicalKey(""); + std::string keyString(""); + std::string compose(""); // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string. - if( keyEvent->compose ) + if(keyEvent->compose) { compose = keyEvent->compose; } - int keyCode = ecore_x_keysym_keycode_get( keyEvent->keyname ); - int modifier( keyEvent->modifiers ); - unsigned long time( keyEvent->timestamp ); + // Ensure key symbol is not NULL as keys like SHIFT have a null string. + if(keyEvent->key) + { + logicalKey = keyEvent->key; + } + + int keyCode = ecore_x_keysym_keycode_get(keyEvent->keyname); + int modifier(keyEvent->modifiers); + unsigned long time(keyEvent->timestamp); // Ensure key event string is not NULL as keys like SHIFT have a null string. - if( keyEvent->string ) + if(keyEvent->string) { keyString = keyEvent->string; } - Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS ); + Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::UP, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS); - mKeyEventSignal.Emit( keyEvent ); + mKeyEventSignal.Emit(keyEvent); } } -void WindowBaseEcoreX::OnSelectionClear( void* data, int type, void* event ) +void WindowBaseEcoreX::OnSelectionClear(void* data, int type, void* event) { - Ecore_X_Event_Selection_Clear* selectionClearEvent = static_cast< Ecore_X_Event_Selection_Clear* >( event ); + Ecore_X_Event_Selection_Clear* selectionClearEvent = static_cast(event); - if( selectionClearEvent->win == mEcoreWindow ) + if(selectionClearEvent->win == mEcoreWindow) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseEcoreX::OnSelectionClear\n" ); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, " WindowBaseEcoreX::OnSelectionClear\n"); - if( selectionClearEvent->selection == ECORE_X_SELECTION_SECONDARY ) + if(selectionClearEvent->selection == ECORE_X_SELECTION_SECONDARY) { // Request to get the content from Ecore. - ecore_x_selection_secondary_request( selectionClearEvent->win, ECORE_X_SELECTION_TARGET_TEXT ); + ecore_x_selection_secondary_request(selectionClearEvent->win, ECORE_X_SELECTION_TARGET_TEXT); } } } -void WindowBaseEcoreX::OnSelectionNotify( void* data, int type, void* event ) +void WindowBaseEcoreX::OnSelectionNotify(void* data, int type, void* event) { - Ecore_X_Event_Selection_Notify* selectionNotifyEvent = static_cast< Ecore_X_Event_Selection_Notify* >( event ); + Ecore_X_Event_Selection_Notify* selectionNotifyEvent = static_cast(event); - if( selectionNotifyEvent->win == mEcoreWindow ) + if(selectionNotifyEvent->win == mEcoreWindow) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseEcoreX::OnSelectionNotify\n" ); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, " WindowBaseEcoreX::OnSelectionNotify\n"); - Ecore_X_Selection_Data* selectionData = static_cast< Ecore_X_Selection_Data* >( selectionNotifyEvent->data ); - if( selectionData->data ) + Ecore_X_Selection_Data* selectionData = static_cast(selectionNotifyEvent->data); + if(selectionData->data) { - if( selectionNotifyEvent->selection == ECORE_X_SELECTION_SECONDARY ) + if(selectionNotifyEvent->selection == ECORE_X_SELECTION_SECONDARY) { - mSelectionDataReceivedSignal.Emit( event ); + mSelectionDataReceivedSignal.Emit(event); } } } @@ -620,30 +634,30 @@ int WindowBaseEcoreX::GetNativeWindowId() return mEcoreWindow; } -EGLNativeWindowType WindowBaseEcoreX::CreateEglWindow( int width, int height ) +EGLNativeWindowType WindowBaseEcoreX::CreateEglWindow(int width, int height) { // need to create X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit - XWindow window( mEcoreWindow ); - return reinterpret_cast< EGLNativeWindowType >( window ); + XWindow window(mEcoreWindow); + return reinterpret_cast(window); } void WindowBaseEcoreX::DestroyEglWindow() { } -void WindowBaseEcoreX::SetEglWindowRotation( int angle ) +void WindowBaseEcoreX::SetEglWindowRotation(int angle) { } -void WindowBaseEcoreX::SetEglWindowBufferTransform( int angle ) +void WindowBaseEcoreX::SetEglWindowBufferTransform(int angle) { } -void WindowBaseEcoreX::SetEglWindowTransform( int angle ) +void WindowBaseEcoreX::SetEglWindowTransform(int angle) { } -void WindowBaseEcoreX::ResizeEglWindow( PositionSize positionSize ) +void WindowBaseEcoreX::ResizeEglWindow(PositionSize positionSize) { } @@ -652,106 +666,63 @@ bool WindowBaseEcoreX::IsEglWindowRotationSupported() return false; } -void WindowBaseEcoreX::Move( PositionSize positionSize ) +void WindowBaseEcoreX::Move(PositionSize positionSize) { - ecore_x_window_move( mEcoreWindow, positionSize.x, positionSize.y ); + ecore_x_window_move(mEcoreWindow, positionSize.x, positionSize.y); } -void WindowBaseEcoreX::Resize( PositionSize positionSize ) +void WindowBaseEcoreX::Resize(PositionSize positionSize) { - ecore_x_window_resize( mEcoreWindow, positionSize.width, positionSize.height ); + ecore_x_window_resize(mEcoreWindow, positionSize.width, positionSize.height); } -void WindowBaseEcoreX::MoveResize( PositionSize positionSize ) +void WindowBaseEcoreX::MoveResize(PositionSize positionSize) { - ecore_x_window_move_resize( mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height ); + ecore_x_window_move_resize(mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height); } -void WindowBaseEcoreX::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) -{ - DALI_LOG_TRACE_METHOD_FMT( gWindowBaseLogFilter, "visible : %d\n", visibleMode ); - - if( visibleMode == Dali::Window::VISIBLE ) - { - // when the indicator is visible, set proper mode for indicator server according to bg mode - if( opacityMode == Dali::Window::OPAQUE ) - { - ecore_x_e_illume_indicator_opacity_set( mEcoreWindow, ECORE_X_ILLUME_INDICATOR_OPAQUE ); - } - else if( opacityMode == Dali::Window::TRANSLUCENT ) - { - ecore_x_e_illume_indicator_opacity_set( mEcoreWindow, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT ); - } - } - else - { - // when the indicator is not visible, set TRANSPARENT mode for indicator server - ecore_x_e_illume_indicator_opacity_set( mEcoreWindow, ECORE_X_ILLUME_INDICATOR_TRANSPARENT ); // it means hidden indicator - } -} - -void WindowBaseEcoreX::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) -{ - int show_state = static_cast< int >( isShow ); - ecore_x_window_prop_property_set( mEcoreWindow, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE, - ECORE_X_ATOM_CARDINAL, 32, &show_state, 1 ); - - if( isShow ) - { - ecore_x_e_illume_indicator_state_set( mEcoreWindow, ECORE_X_ILLUME_INDICATOR_STATE_ON ); - } - else - { - ecore_x_e_illume_indicator_state_set( mEcoreWindow, ECORE_X_ILLUME_INDICATOR_STATE_OFF ); - } -} - -void WindowBaseEcoreX::IndicatorTypeChanged( IndicatorInterface::Type type ) +void WindowBaseEcoreX::SetClass(const std::string& name, const std::string& className) { -} - -void WindowBaseEcoreX::SetClass( const std::string& name, const std::string& className ) -{ - ecore_x_icccm_title_set( mEcoreWindow, name.c_str() ); - ecore_x_netwm_name_set( mEcoreWindow, name.c_str() ); - ecore_x_icccm_name_class_set( mEcoreWindow, name.c_str(), className.c_str() ); + ecore_x_icccm_title_set(mEcoreWindow, name.c_str()); + ecore_x_netwm_name_set(mEcoreWindow, name.c_str()); + ecore_x_icccm_name_class_set(mEcoreWindow, name.c_str(), className.c_str()); } void WindowBaseEcoreX::Raise() { - ecore_x_window_raise( mEcoreWindow ); + ecore_x_window_raise(mEcoreWindow); } void WindowBaseEcoreX::Lower() { - ecore_x_window_lower( mEcoreWindow ); + ecore_x_window_lower(mEcoreWindow); } void WindowBaseEcoreX::Activate() { - ecore_x_netwm_client_active_request( ecore_x_window_root_get( mEcoreWindow ), mEcoreWindow, 1 /* request type, 1:application, 2:pager */, 0 ); + ecore_x_netwm_client_active_request(ecore_x_window_root_get(mEcoreWindow), mEcoreWindow, 1 /* request type, 1:application, 2:pager */, 0); } -void WindowBaseEcoreX::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations ) +void WindowBaseEcoreX::SetAvailableAnlges(const std::vector& angles) { } -void WindowBaseEcoreX::SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) +void WindowBaseEcoreX::SetPreferredAngle(int angle) { } -void WindowBaseEcoreX::SetAcceptFocus( bool accept ) +void WindowBaseEcoreX::SetAcceptFocus(bool accept) { } void WindowBaseEcoreX::Show() { - ecore_x_window_show( mEcoreWindow ); + ecore_x_window_show(mEcoreWindow); } void WindowBaseEcoreX::Hide() { - ecore_x_window_hide( mEcoreWindow ); + ecore_x_window_hide(mEcoreWindow); } unsigned int WindowBaseEcoreX::GetSupportedAuxiliaryHintCount() const @@ -759,71 +730,76 @@ unsigned int WindowBaseEcoreX::GetSupportedAuxiliaryHintCount() const return 0; } -std::string WindowBaseEcoreX::GetSupportedAuxiliaryHint( unsigned int index ) const +std::string WindowBaseEcoreX::GetSupportedAuxiliaryHint(unsigned int index) const { return std::string(); } -unsigned int WindowBaseEcoreX::AddAuxiliaryHint( const std::string& hint, const std::string& value ) +unsigned int WindowBaseEcoreX::AddAuxiliaryHint(const std::string& hint, const std::string& value) { return 0; } -bool WindowBaseEcoreX::RemoveAuxiliaryHint( unsigned int id ) +bool WindowBaseEcoreX::RemoveAuxiliaryHint(unsigned int id) { return false; } -bool WindowBaseEcoreX::SetAuxiliaryHintValue( unsigned int id, const std::string& value ) +bool WindowBaseEcoreX::SetAuxiliaryHintValue(unsigned int id, const std::string& value) { return false; } -std::string WindowBaseEcoreX::GetAuxiliaryHintValue( unsigned int id ) const +std::string WindowBaseEcoreX::GetAuxiliaryHintValue(unsigned int id) const { return std::string(); } -unsigned int WindowBaseEcoreX::GetAuxiliaryHintId( const std::string& hint ) const +unsigned int WindowBaseEcoreX::GetAuxiliaryHintId(const std::string& hint) const { return 0; } -void WindowBaseEcoreX::SetInputRegion( const Rect< int >& inputRegion ) +void WindowBaseEcoreX::SetInputRegion(const Rect& inputRegion) { } -void WindowBaseEcoreX::SetType( Dali::Window::Type type ) +void WindowBaseEcoreX::SetType(Dali::WindowType type) { } -bool WindowBaseEcoreX::SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) +Dali::WindowType WindowBaseEcoreX::GetType() const { - return false; + return Dali::WindowType::NORMAL; } -Dali::Window::NotificationLevel::Type WindowBaseEcoreX::GetNotificationLevel() const +Dali::WindowOperationResult WindowBaseEcoreX::SetNotificationLevel(Dali::WindowNotificationLevel level) { - return Dali::Window::NotificationLevel::NONE; + return Dali::WindowOperationResult::NOT_SUPPORTED; } -void WindowBaseEcoreX::SetOpaqueState( bool opaque ) +Dali::WindowNotificationLevel WindowBaseEcoreX::GetNotificationLevel() const { + return Dali::WindowNotificationLevel::NONE; } -bool WindowBaseEcoreX::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) +void WindowBaseEcoreX::SetOpaqueState(bool opaque) { - return false; } -Dali::Window::ScreenOffMode::Type WindowBaseEcoreX::GetScreenOffMode() const +Dali::WindowOperationResult WindowBaseEcoreX::SetScreenOffMode(WindowScreenOffMode screenOffMode) { - return Dali::Window::ScreenOffMode::TIMEOUT; + return Dali::WindowOperationResult::NOT_SUPPORTED; } -bool WindowBaseEcoreX::SetBrightness( int brightness ) +WindowScreenOffMode WindowBaseEcoreX::GetScreenOffMode() const { - return false; + return WindowScreenOffMode::TIMEOUT; +} + +Dali::WindowOperationResult WindowBaseEcoreX::SetBrightness(int brightness) +{ + return Dali::WindowOperationResult::NOT_SUPPORTED; } int WindowBaseEcoreX::GetBrightness() const @@ -831,48 +807,38 @@ int WindowBaseEcoreX::GetBrightness() const return 0; } -bool WindowBaseEcoreX::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) +bool WindowBaseEcoreX::GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode) { return false; } -bool WindowBaseEcoreX::UngrabKey( Dali::KEY key ) +bool WindowBaseEcoreX::UngrabKey(Dali::KEY key) { return false; } -bool WindowBaseEcoreX::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) +bool WindowBaseEcoreX::GrabKeyList(const Dali::Vector& key, const Dali::Vector& grabMode, Dali::Vector& result) { return false; } -bool WindowBaseEcoreX::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) +bool WindowBaseEcoreX::UngrabKeyList(const Dali::Vector& key, Dali::Vector& result) { return false; } -void WindowBaseEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) +void WindowBaseEcoreX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) { - // calculate DPI - float xres, yres; - // 1 inch = 25.4 millimeters - xres = ecore_x_dpi_get(); - yres = ecore_x_dpi_get(); + // ecore does not account for differing DPI in the x and y axes, so only get for x is available - dpiHorizontal = int( xres + 0.5f ); // rounding - dpiVertical = int( yres + 0.5f ); + dpiHorizontal = ecore_x_dpi_get(); + dpiVertical = ecore_x_dpi_get(); } -void WindowBaseEcoreX::SetViewMode( ViewMode viewMode ) +int WindowBaseEcoreX::GetOrientation() const { - Ecore_X_Atom viewModeAtom( ecore_x_atom_get( "_E_COMP_3D_APP_WIN" ) ); - - if( viewModeAtom != None ) - { - unsigned int value( static_cast< unsigned int >( viewMode ) ); - ecore_x_window_prop_card32_set( mEcoreWindow, viewModeAtom, &value, 1 ); - } + return 0; } int WindowBaseEcoreX::GetScreenRotationAngle() @@ -880,57 +846,121 @@ int WindowBaseEcoreX::GetScreenRotationAngle() return 0; } -void WindowBaseEcoreX::SetWindowRotationAngle( int degree ) +void WindowBaseEcoreX::SetWindowRotationAngle(int degree) { + mWindowRotationAngle = degree; } -void WindowBaseEcoreX::WindowRotationCompleted( int degree, int width, int height ) +void WindowBaseEcoreX::WindowRotationCompleted(int degree, int width, int height) { } -void WindowBaseEcoreX::SetTransparency( bool transparent ) +void WindowBaseEcoreX::SetTransparency(bool transparent) { } -unsigned int WindowBaseEcoreX::GetSurfaceId( Any surface ) const +unsigned int WindowBaseEcoreX::GetSurfaceId(Any surface) const { unsigned int surfaceId = 0; - if ( surface.Empty() == false ) + if(surface.Empty() == false) { // check we have a valid type - DALI_ASSERT_ALWAYS( ( (surface.GetType() == typeid (XWindow) ) || (surface.GetType() == typeid (Ecore_X_Window) ) ) - && "Surface type is invalid" ); + DALI_ASSERT_ALWAYS(((surface.GetType() == typeid(XWindow)) || (surface.GetType() == typeid(Ecore_X_Window))) && "Surface type is invalid"); - if ( surface.GetType() == typeid (Ecore_X_Window) ) + if(surface.GetType() == typeid(Ecore_X_Window)) { - surfaceId = AnyCast< Ecore_X_Window >( surface ); + surfaceId = AnyCast(surface); } else { - surfaceId = AnyCast< XWindow >( surface ); + surfaceId = static_cast(AnyCast(surface)); } } return surfaceId; } -void WindowBaseEcoreX::CreateWindow( PositionSize positionSize, bool isTransparent ) +void WindowBaseEcoreX::CreateWindow(PositionSize positionSize, bool isTransparent) { - if( isTransparent ) - { - // create 32 bit window - mEcoreWindow = ecore_x_window_argb_new( 0, positionSize.x, positionSize.y, positionSize.width, positionSize.height ); - } - else - { - // create 24 bit window - mEcoreWindow = ecore_x_window_new( 0, positionSize.x, positionSize.y, positionSize.width, positionSize.height ); - } + if(isTransparent) + { + // create 32 bit window + mEcoreWindow = ecore_x_window_argb_new(0, positionSize.x, positionSize.y, positionSize.width, positionSize.height); + mIsTransparent = true; + } + else + { + // create 24 bit window + mEcoreWindow = ecore_x_window_new(0, positionSize.x, positionSize.y, positionSize.width, positionSize.height); + } - if ( mEcoreWindow == 0 ) - { - DALI_ASSERT_ALWAYS( 0 && "Failed to create X window" ); - } + if(mEcoreWindow == 0) + { + DALI_ASSERT_ALWAYS(0 && "Failed to create X window"); + } +} + +void WindowBaseEcoreX::SetParent(WindowBase* parentWinBase, bool belowParent) +{ + Ecore_X_Window ecoreParent = 0; + if(parentWinBase) + { + WindowBaseEcoreX* winBaseEcoreX = static_cast(parentWinBase); + ecoreParent = winBaseEcoreX->mEcoreWindow; + ecore_x_icccm_transient_for_set(mEcoreWindow, ecoreParent); + } + else + { + ecoreParent = 0; + ecore_x_icccm_transient_for_unset(mEcoreWindow); + } +} + +int WindowBaseEcoreX::CreateFrameRenderedSyncFence() +{ + return -1; +} + +int WindowBaseEcoreX::CreateFramePresentedSyncFence() +{ + return -1; +} + +void WindowBaseEcoreX::SetPositionSizeWithAngle(PositionSize positionSize, int angle) +{ +} + +void WindowBaseEcoreX::InitializeIme() +{ +} + +void WindowBaseEcoreX::ImeWindowReadyToRender() +{ +} + +void WindowBaseEcoreX::RequestMoveToServer() +{ +} + +void WindowBaseEcoreX::RequestResizeToServer(WindowResizeDirection direction) +{ +} + +void WindowBaseEcoreX::EnableFloatingMode(bool enable) +{ +} + +bool WindowBaseEcoreX::IsFloatingModeEnabled() const +{ + return false; +} + +void WindowBaseEcoreX::IncludeInputRegion(const Rect& inputRegion) +{ +} + +void WindowBaseEcoreX::ExcludeInputRegion(const Rect& inputRegion) +{ } } // namespace Adaptor @@ -938,5 +968,3 @@ void WindowBaseEcoreX::CreateWindow( PositionSize positionSize, bool isTranspare } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop