Geometries.h 885 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Geometries.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. struct SDL_MouseMotionEvent;
  12. struct SDL_Rect;
  13. #include "../../lib/Point.h"
  14. #include "../../lib/Rect.h"
  15. VCMI_LIB_NAMESPACE_BEGIN
  16. class int3;
  17. VCMI_LIB_NAMESPACE_END
  18. #ifdef VCMI_LIB_NAMESPACE
  19. using VCMI_LIB_WRAP_NAMESPACE(Rect);
  20. using VCMI_LIB_WRAP_NAMESPACE(Point);
  21. #endif
  22. enum class ETextAlignment {TOPLEFT, CENTER, BOTTOMRIGHT};
  23. namespace Geometry
  24. {
  25. /// creates Point using provided event
  26. Point fromSDL(const SDL_MouseMotionEvent & motion);
  27. /// creates Rect using provided rect
  28. Rect fromSDL(const SDL_Rect & rect);
  29. /// creates SDL_Rect using provided rect
  30. SDL_Rect toSDL(const Rect & rect);
  31. }