From a85c49cf9f7be4935972412d67bf2883f50aa555 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Fri, 28 Aug 2020 10:44:18 +0900 Subject: [PATCH] DSInput: add winX, winY and get/set APIs for DSInputTouchEvent/DSInputMouseEvent Change-Id: I9a937576f75580a1f13ab7308203bba51df5c5ca Signed-off-by: Sung-Jin Park --- src/DSInput/DSInput.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++---- src/DSInput/DSInputEvent.h | 15 +++++++++++++ 2 files changed, 67 insertions(+), 4 deletions(-) diff --git a/src/DSInput/DSInput.cpp b/src/DSInput/DSInput.cpp index 7a34779..f86c9cf 100644 --- a/src/DSInput/DSInput.cpp +++ b/src/DSInput/DSInput.cpp @@ -505,13 +505,13 @@ void DSInputKeyboardEvent::setKeyname(std::string name) DSInputMouseEvent::DSInputMouseEvent() : DSInputEvent(nullptr, NoneEvent, 0), - __button(0), __x(0), __y(0), __z(0) + __button(0), __x(0), __y(0), __z(0), __winX(0), __winY(0), __winZ(0) { } DSInputMouseEvent::DSInputMouseEvent(std::shared_ptr device, Type type, uint32_t timestamp, int button, int x, int y, int z) : DSInputEvent(device, type, timestamp), - __button(button), __x(x), __y(y), __z(z) + __button(button), __x(x), __y(y), __z(z), __winX(0), __winY(0), __winZ(0) { } @@ -540,16 +540,45 @@ const int DSInputMouseEvent::getZ() return __z; } +const int DSInputMouseEvent::getWinX() +{ + return __winX; +} + +const int DSInputMouseEvent::getWinY() +{ + return __winY; +} + +const int DSInputMouseEvent::getWinZ() +{ + return __winZ; +} + +void DSInputMouseEvent::setWinX(int winX) +{ + __winX = winX; +} + +void DSInputMouseEvent::setWinY(int winY) +{ + __winY = winY; +} + +void DSInputMouseEvent::setWinZ(int winZ) +{ + __winZ = winZ; +} DSInputTouchEvent::DSInputTouchEvent() : DSInputEvent(nullptr, NoneEvent, 0), - __index(0), __x(0), __y(0) + __index(0), __x(0), __y(0), __winX(0), __winY(0) { } DSInputTouchEvent::DSInputTouchEvent(std::shared_ptr device, Type type, uint32_t timestamp, int index, int x, int y) : DSInputEvent(device, type, timestamp), - __index(index), __x(x), __y(y) + __index(index), __x(x), __y(y), __winX(0), __winY(0) { } @@ -572,5 +601,24 @@ const int DSInputTouchEvent::getY() return __y; } +const int DSInputTouchEvent::getWinX() +{ + return __winX; +} + +const int DSInputTouchEvent::getWinY() +{ + return __winY; +} + +void DSInputTouchEvent::setWinX(int winX) +{ + __winX = winX; +} + +void DSInputTouchEvent::setWinY(int winY) +{ + __winY = winY; +} } // namespace display_server diff --git a/src/DSInput/DSInputEvent.h b/src/DSInput/DSInputEvent.h index aa12dc2..1df1f03 100644 --- a/src/DSInput/DSInputEvent.h +++ b/src/DSInput/DSInputEvent.h @@ -96,12 +96,21 @@ public: const int getX(); const int getY(); const int getZ(); + const int getWinX(); + const int getWinY(); + const int getWinZ(); + void setWinX(int winX); + void setWinY(int winY); + void setWinZ(int winZ); protected: int __button; int __x; int __y; int __z; + int __winX; + int __winY; + int __winZ; }; class DSInputTouchEvent : public DSInputEvent @@ -114,11 +123,17 @@ public: const int getIndex(); const int getX(); const int getY(); + const int getWinX(); + const int getWinY(); + void setWinX(int winX); + void setWinY(int winY); protected: int __index; int __x; int __y; + int __winX; + int __winY; }; } -- 2.7.4