Merge "Added PixelBuffer for image loading and operations." into devel/master
[platform/core/uifw/dali-adaptor.git] / adaptors / emscripten / sdl-application.cpp
index 132cddf..8cca15d 100644 (file)
 namespace
 {
 
-int _kbhit()
-{
-  static const int STDIN = 0;
-  static bool initialized = false;
-
-  if (! initialized)
-  {
-    // Use termios to turn off line buffering
-    termios term;
-    tcgetattr(STDIN, &term);
-    term.c_lflag &= ~ICANON;
-    tcsetattr(STDIN, TCSANOW, &term);
-    setbuf(stdin, NULL);
-    initialized = true;
-  }
-
-  int bytesWaiting;
-  ioctl(STDIN, FIONREAD, &bytesWaiting);
-  return bytesWaiting;
-}
-
-
 void LogFunction(Dali::Integration::Log::DebugPriority priority, std::string& message)
 {
   printf("%s", message.c_str());
@@ -235,25 +213,25 @@ void SdlApplication::DoRender()
 
 void SdlApplication::SendTouchEvent(double x, double y, int mouseState)
 {
-  TouchPoint::State state = TouchPoint::Up;
+  PointState::Type state = PointState::UP;
   if( 0 == mouseState )
   {
-    state = TouchPoint::Down;
+    state = PointState::DOWN;
   }
   else if( 1 == mouseState )
   {
-    state = TouchPoint::Up;
+    state = PointState::UP;
   }
   else if( 2 == mouseState )
   {
-    state = TouchPoint::Motion;
+    state = PointState::MOTION;
   }
 
   Dali::Integration::TouchEvent e;
-  e.AddPoint( TouchPoint( 0,
-                          state,
-                          static_cast<float>(x),
-                          static_cast<float>(y) ) );
+  Dali::Integration::Point point;
+  point.SetState( state );
+  point.SetScreenPosition( Vector2( static_cast<float>(x), static_cast<float>(y) ) );
+  e.AddPoint( point );
 
   mCore->QueueEvent(e);
 }