2
0

CWindowObject.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * CWindowObject.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. #include "../gui/CIntObject.h"
  12. #include "../../lib/filesystem/ResourcePath.h"
  13. class CGStatusBar;
  14. class CWindowObject : public WindowBase
  15. {
  16. std::vector<std::shared_ptr<CPicture>> shadowParts;
  17. void setShadow(bool on);
  18. int options;
  19. protected:
  20. std::shared_ptr<CPicture> background;
  21. //Used only if RCLICK_POPUP was set
  22. bool isPopupWindow() const override;
  23. //To display border
  24. void updateShadow();
  25. void setBackground(const ImagePath & filename);
  26. std::shared_ptr<CPicture> createBg(const ImagePath & imageName, bool playerColored);
  27. public:
  28. enum EOptions
  29. {
  30. PLAYER_COLORED=1, //background will be player-colored
  31. RCLICK_POPUP=2, // window will behave as right-click popup
  32. BORDERED=4, // window will have border if current resolution is bigger than size of window
  33. SHADOW_DISABLED=8, //this window won't display any shadow
  34. NEEDS_ANIMATED_BACKGROUND=16 //there are videos in the background that have to be played
  35. };
  36. /*
  37. * options - EOptions enum
  38. * imageName - name for background image, can be empty
  39. * centerAt - position of window center. Default - center of the screen
  40. */
  41. CWindowObject(int options, const ImagePath & imageName, Point centerAt);
  42. CWindowObject(int options = 0, const ImagePath & imageName = {});
  43. ~CWindowObject();
  44. void showAll(Canvas & to) override;
  45. };
  46. class CStatusbarWindow : virtual public CWindowObject
  47. {
  48. protected:
  49. std::shared_ptr<CGStatusBar> statusbar;
  50. };