DSTouch: add touchDown/Up/Move APIs 32/241832/1
authorSung-Jin Park <sj76.park@samsung.com>
Fri, 14 Aug 2020 10:55:53 +0000 (19:55 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:11:52 +0000 (19:11 +0900)
Change-Id: I72c4413e76f2d9b99a7236cfffec4bc21b416b77
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSSeat/DSTouch.cpp
src/DSSeat/DSTouch.h

index 3483d6e..00f8abc 100644 (file)
@@ -58,6 +58,49 @@ void DSTouch::processEvent(DSInputTouchEvent *ev, void *data)
                DSLOG_ERR("DSTouch", "No touchFocus available.");
                return;
        }
+
+       if (ev->getType() == DSInputEvent::TouchDownEvent)
+       {
+               DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
+                                       ev->getDevice()->getName().c_str(), ev->getTimestamp());
+               touchDown(ev->getIndex(), ev->getX(), ev->getY());
+       }
+       else if (ev->getType() == DSInputEvent::TouchUpEvent)
+       {
+               DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
+                                       ev->getDevice()->getName().c_str(), ev->getTimestamp());
+               touchUp(ev->getIndex());
+       }
+       else//DSInputEvent::TouchMoveEvent
+       {
+               DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
+                                       ev->getDevice()->getName().c_str(), ev->getTimestamp());
+               touchMove(ev->getIndex(), ev->getX(), ev->getY());
+       }
+}
+
+void DSTouch::touchDown(int32_t id, int x, int y)
+{
+       if (__dswlTouch)
+       {
+               __dswlTouch->sendDown(id, x, y);
+       }
+}
+
+void DSTouch::touchUp(int32_t id)
+{
+       if (__dswlTouch)
+       {
+               __dswlTouch->sendUp(id);
+       }
+}
+
+void DSTouch::touchMove(int32_t id, int x, int y)
+{
+       if (__dswlTouch)
+       {
+               __dswlTouch->sendMotion(id, x, y);
+       }
 }
 
 void DSTouch::setFocus(std::shared_ptr<DSWindow> window)
index c210b21..99c8d7a 100644 (file)
@@ -45,6 +45,9 @@ public:
        virtual ~DSTouch();
 
        void processEvent(DSInputTouchEvent *ev, void *data);
+       void touchDown(int32_t id, int x, int y);
+       void touchUp(int32_t id);
+       void touchMove(int32_t id, int x, int y);
        void setFocus(std::shared_ptr<DSWindow> window);
        std::shared_ptr<DSWindow> getFocus();