CmCursorImpl.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmInt2.h"
  4. #include "CmRect.h"
  5. namespace CamelotFramework
  6. {
  7. // Encapsulate native cursor type so we can avoid including windows.h as it pollutes the global namespace
  8. struct CM_EXPORT NativeCursorData
  9. {
  10. struct Pimpl;
  11. NativeCursorData();
  12. ~NativeCursorData();
  13. Pimpl* data;
  14. };
  15. /**
  16. * @brief Provides controls for Windows operating system cursor.
  17. */
  18. class CM_EXPORT Cursor
  19. {
  20. public:
  21. Cursor();
  22. ~Cursor();
  23. /**
  24. * @brief Moves the cursor to the specified screen position.
  25. */
  26. static void setPosition(const Int2& screenPos);
  27. static void clipToWindow(const RenderWindow& window);
  28. static void clipToRect(const Rect& screenRect);
  29. static void clipDisable();
  30. static void hide();
  31. static void show();
  32. static bool isHidden() { return mIsHidden; }
  33. static void setCursor(CursorType type);
  34. static void setCustomCursor(PixelData& pixelData, const Int2& hotSpot);
  35. static void _win32ShowCursor();
  36. static void _win32HideCursor();
  37. private:
  38. static bool mIsHidden;
  39. static NativeCursorData mCursor;
  40. static bool mUsingCustom;
  41. };
  42. }