CmPlatform.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. namespace CamelotFramework
  4. {
  5. enum class CursorType
  6. {
  7. Arrow,
  8. Wait,
  9. IBeam,
  10. Help,
  11. Hand,
  12. SizeAll,
  13. SizeNESW,
  14. SizeNS,
  15. SizeNWSE,
  16. SizeWE
  17. };
  18. enum class NonClientAreaBorderType
  19. {
  20. TopLeft,
  21. Top,
  22. TopRight,
  23. Left,
  24. Right,
  25. BottomLeft,
  26. Bottom,
  27. BottomRight
  28. };
  29. enum class OSMouseButton
  30. {
  31. Left, Middle, Right, Count
  32. };
  33. struct CM_EXPORT OSPositionalInputButtonStates
  34. {
  35. OSPositionalInputButtonStates()
  36. {
  37. mouseButtons[0] = false;
  38. mouseButtons[1] = false;
  39. mouseButtons[2] = false;
  40. shift = false;
  41. ctrl = false;
  42. }
  43. bool mouseButtons[OSMouseButton::Count];
  44. bool shift, ctrl;
  45. };
  46. enum class OSDropType
  47. {
  48. FileList,
  49. None
  50. };
  51. class CM_EXPORT OSDropTarget
  52. {
  53. public:
  54. boost::signal<void(INT32 x, INT32 y)> onDragOver;
  55. boost::signal<void(INT32 x, INT32 y)> onDrop;
  56. boost::signal<void(INT32 x, INT32 y)> onEnter;
  57. boost::signal<void()> onLeave;
  58. void setArea(INT32 x, INT32 y, UINT32 width, UINT32 height);
  59. OSDropType getDropType() const { return mDropType; }
  60. const Vector<WString>::type& getFileList() const { return *mFileList; }
  61. void _clear();
  62. void _setFileList(const Vector<WString>::type& fileList);
  63. void _setActive(bool active) { mActive = active; }
  64. bool _isInside(const Vector2I& pos) const;
  65. bool _isActive() const { return mActive; }
  66. private:
  67. friend class Platform;
  68. OSDropTarget(const RenderWindow* ownerWindow, INT32 x, INT32 y, UINT32 width, UINT32 height);
  69. ~OSDropTarget();
  70. const RenderWindow* getOwnerWindow() const { return mOwnerWindow; }
  71. private:
  72. INT32 mX, mY;
  73. UINT32 mWidth, mHeight;
  74. bool mActive;
  75. const RenderWindow* mOwnerWindow;
  76. OSDropType mDropType;
  77. union
  78. {
  79. Vector<WString>::type* mFileList;
  80. };
  81. };
  82. }
  83. //Bring in the specific platform's header file
  84. #if CM_PLATFORM == CM_PLATFORM_WIN32
  85. # include "Win32/CmPlatformImpl.h"
  86. #elif (CM_PLATFORM == CM_PLATFORM_LINUX)
  87. # include "GLX/CmPlatformImpl.h"
  88. #elif CM_PLATFORM == CM_PLATFORM_APPLE
  89. # include "OSX/CmPlatformImpl.h"
  90. #endif