Add GlWindow
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / event-handler.cpp
index cf8720a..911a3bd 100755 (executable)
@@ -22,7 +22,7 @@
 #include <cstring>
 #include <sys/time.h>
 
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/events/wheel-event.h>
 #include <dali/integration-api/debug.h>
@@ -95,7 +95,7 @@ static uint32_t GetCurrentMilliSeconds(void)
 } // unnamed namespace
 #endif
 
-EventHandler::EventHandler( WindowRenderSurface* surface, DamageObserver& damageObserver )
+EventHandler::EventHandler( WindowBase* windowBase, DamageObserver& damageObserver )
 : mStyleMonitor( StyleMonitor::Get() ),
   mDamageObserver( damageObserver ),
   mAccessibilityAdaptor( AccessibilityAdaptor::Get() ),
@@ -103,11 +103,9 @@ EventHandler::EventHandler( WindowRenderSurface* surface, DamageObserver& damage
   mClipboard( Clipboard::Get() ),
   mPaused( false )
 {
-  if( surface )
+  // Connect signals
+  if( windowBase )
   {
-    WindowBase* windowBase = surface->GetWindowBase();
-
-    // Connect signals
     windowBase->WindowDamagedSignal().Connect( this, &EventHandler::OnWindowDamaged );
     windowBase->FocusChangedSignal().Connect( this, &EventHandler::OnFocusChanged );
     windowBase->RotationSignal().Connect( this, &EventHandler::OnRotation );
@@ -119,6 +117,10 @@ EventHandler::EventHandler( WindowRenderSurface* surface, DamageObserver& damage
     windowBase->StyleChangedSignal().Connect( this, &EventHandler::OnStyleChanged );
     windowBase->AccessibilitySignal().Connect( this, &EventHandler::OnAccessibilityNotification );
   }
+  else
+  {
+    DALI_LOG_ERROR("WindowBase is invalid!!!\n");
+  }
 }
 
 EventHandler::~EventHandler()
@@ -266,22 +268,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.