X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fevent-handler.cpp;h=7a1d02b883db5a31d0fc0dca7e7a610b07aef104;hb=a90b09ccda956cbe4a076aeed1c305f3b49c9e17;hp=33927978a4966fafa25c61cdc7a46db99fdd508e;hpb=75de2834aa2172e402c34279e450403e93b8788c;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/event-handler.cpp b/dali/internal/window-system/common/event-handler.cpp index 3392797..7a1d02b 100755 --- a/dali/internal/window-system/common/event-handler.cpp +++ b/dali/internal/window-system/common/event-handler.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -95,7 +95,7 @@ static uint32_t GetCurrentMilliSeconds(void) } // unnamed namespace #endif -EventHandler::EventHandler( WindowBase* windowBase, DamageObserver& damageObserver ) +EventHandler::EventHandler( WindowRenderSurface* surface, DamageObserver& damageObserver ) : mStyleMonitor( StyleMonitor::Get() ), mDamageObserver( damageObserver ), mAccessibilityAdaptor( AccessibilityAdaptor::Get() ), @@ -103,17 +103,22 @@ EventHandler::EventHandler( WindowBase* windowBase, DamageObserver& damageObserv mClipboard( Clipboard::Get() ), mPaused( false ) { - // Connect signals - windowBase->WindowDamagedSignal().Connect( this, &EventHandler::OnWindowDamaged ); - windowBase->FocusChangedSignal().Connect( this, &EventHandler::OnFocusChanged ); - windowBase->RotationSignal().Connect( this, &EventHandler::OnRotation ); - windowBase->TouchEventSignal().Connect( this, &EventHandler::OnTouchEvent ); - windowBase->WheelEventSignal().Connect( this, &EventHandler::OnWheelEvent ); - windowBase->KeyEventSignal().Connect( this, &EventHandler::OnKeyEvent ); - windowBase->SelectionDataSendSignal().Connect( this, &EventHandler::OnSelectionDataSend ); - windowBase->SelectionDataReceivedSignal().Connect( this, &EventHandler::OnSelectionDataReceived ); - windowBase->StyleChangedSignal().Connect( this, &EventHandler::OnStyleChanged ); - windowBase->AccessibilitySignal().Connect( this, &EventHandler::OnAccessibilityNotification ); + if( surface ) + { + WindowBase* windowBase = surface->GetWindowBase(); + + // Connect signals + windowBase->WindowDamagedSignal().Connect( this, &EventHandler::OnWindowDamaged ); + windowBase->FocusChangedSignal().Connect( this, &EventHandler::OnFocusChanged ); + windowBase->RotationSignal().Connect( this, &EventHandler::OnRotation ); + windowBase->TouchEventSignal().Connect( this, &EventHandler::OnTouchEvent ); + windowBase->WheelEventSignal().Connect( this, &EventHandler::OnWheelEvent ); + windowBase->KeyEventSignal().Connect( this, &EventHandler::OnKeyEvent ); + windowBase->SelectionDataSendSignal().Connect( this, &EventHandler::OnSelectionDataSend ); + windowBase->SelectionDataReceivedSignal().Connect( this, &EventHandler::OnSelectionDataReceived ); + windowBase->StyleChangedSignal().Connect( this, &EventHandler::OnStyleChanged ); + windowBase->AccessibilitySignal().Connect( this, &EventHandler::OnAccessibilityNotification ); + } } EventHandler::~EventHandler() @@ -261,22 +266,22 @@ void EventHandler::OnAccessibilityNotification( const WindowBase::AccessibilityI } // Create a touch point object. - TouchPoint::State touchPointState( TouchPoint::Down ); + PointState::Type touchPointState( PointState::DOWN ); if( info.state == 0 ) { - touchPointState = TouchPoint::Down; // Mouse down. + touchPointState = PointState::DOWN; // Mouse down. } else if( info.state == 1 ) { - touchPointState = TouchPoint::Motion; // Mouse move. + touchPointState = PointState::MOTION; // Mouse move. } else if( info.state == 2 ) { - touchPointState = TouchPoint::Up; // Mouse up. + touchPointState = PointState::UP; // Mouse up. } else { - touchPointState = TouchPoint::Interrupted; // Error. + touchPointState = PointState::INTERRUPTED; // Error. } // Send touch event to accessibility adaptor.