inputconvertnormal.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef INPUTCONVERT_H
  2. #define INPUTCONVERT_H
  3. //#include "inputconvertbase.h"
  4. #include "common.h"
  5. #include "controlmsg.h"
  6. //#include "mirrordbus.h"
  7. struct TouchEvent
  8. {
  9. enum TouchPointState {
  10. TouchPointPressed = 0x01,
  11. TouchPointMoved = 0x02,
  12. TouchPointStationary = 0x04,
  13. TouchPointReleased = 0x08,
  14. };
  15. TouchEvent(){}
  16. TouchEvent(TouchEvent::TouchPointState state, int x, int y)
  17. : state(state)
  18. , y(y)
  19. , x(x) {}
  20. ~TouchEvent() {}
  21. int x;
  22. int y;
  23. TouchEvent::TouchPointState state;
  24. };
  25. struct TouchEvent;
  26. class Controller;
  27. class InputConvertNormal
  28. {
  29. public:
  30. InputConvertNormal(Controller* controller);
  31. virtual ~InputConvertNormal();
  32. virtual void mouseEvent(const TouchEvent* from, const Size& frameSize, const Size& showSize);
  33. virtual void PhoneScreen(int& VideoWidth, int& VideoHeight, int ScreenWidth, int ScreenHeight);
  34. virtual void ValidRect(int VideoWidth, int VideoHeight, int ScreenWidth, int ScreenHeight);
  35. void FixPos(int x, int y, int* phone_x, int *phone_y, double zoom, Rect rc);
  36. private:
  37. Controller *m_controller;
  38. int m_VideoWidth;
  39. int m_VideoHeight;
  40. double mRatio;
  41. Rect mRect;
  42. };
  43. #endif // INPUTCONVERT_H