8 #ifndef SSG_GUIELEMENT_HPP_ 9 #define SSG_GUIELEMENT_HPP_ 13 #include <SFML/Graphics.hpp> 14 #include "ElementBase.hpp" 15 #include "HaveName.hpp" 16 #include "HaveFocus.hpp" 17 #include "HaveVisible.hpp" 19 #include "DestructionNotifier.hpp" 20 #include "ColorProvider.hpp" 33 void mainDraw(sf::RenderTarget& target,
const sf::RenderStates& states = sf::RenderStates());
34 void mainUpdate(sf::RenderWindow& rw);
35 void setParent(
const Element* parent);
36 const Element* getParent()
const;
37 virtual void updateArea();
38 virtual bool setRelativeViewport(sf::RenderTarget& target,
const sf::FloatRect* area =
nullptr)
const;
40 bool isMaximized()
const;
41 void setMaximized(
bool maximized);
42 void setMaximizationMode(MaximizationMode value);
43 sf::Vector2f getPosition()
const;
44 sf::Vector2f getSize()
const;
45 virtual void setSize(sf::Vector2f);
46 virtual void setPosition(sf::Vector2f);
47 void move(sf::Vector2f);
48 sf::FloatRect& getArea();
49 const sf::FloatRect& getArea()
const;
50 void fitToWindow(
const sf::RenderWindow& rw);
51 void setArea(
const sf::FloatRect& area);
52 const sf::FloatRect& getRelativeArea()
const;
53 sf::Vector2f getRelativeViewportCenterShift()
const;
54 sf::Vector2f getViewportCenterShift()
const;
55 void setViewportCenterShift(
const sf::Vector2f& value);
56 sf::String getParentName()
const;
57 sf::String getTypeName()
const;
58 sf::FloatRect getClippedArea()
const;
60 sf::FloatRect computeRelativeArea()
const;
66 const Element* parent =
nullptr;
68 sf::FloatRect lastArea;
69 sf::FloatRect relativeParentArea;
70 sf::FloatRect relativeArea;
71 sf::FloatRect clippedArea;
72 sf::Vector2f viewportCenterShift;
73 sf::Vector2f relativeViewportCenterShift;
74 MaximizationMode maximizationMode = MaximizationMode::Both;
75 bool relativeParentSizeChanged =
false;
76 bool relativeParentWidthChanged =
false;
77 bool relativeParentHeightChanged =
false;
78 bool areaChanged =
false;
79 bool maximized =
false;
81 sf::Vector2f computeRelativeViewportCenterShift()
const;
82 sf::FloatRect computeClipped()
const;
83 sf::FloatRect clipArea(
const sf::FloatRect& scissors, sf::FloatRect toCut)
const;
89 std::ostream& operator<<(std::ostream& o,
const sf::FloatRect& fr);
90 std::vector<sf::String> split(
const sf::String& text,
wchar_t sep);
91 std::basic_string<sf::Uint32> strToUtf32(std::string str);
92 std::basic_string<sf::Uint32> wstrToUtf32(std::wstring str);
93 sf::FloatRect roundRect(
const sf::FloatRect& r);
95 typedef std::shared_ptr<Element> ElementPtr;
Definition: DestructionNotifier.hpp:6
Definition: HaveVisible.hpp:11
Definition: ColorProvider.hpp:15
Definition: HaveName.hpp:12
Definition: Element.hpp:22
Definition: HaveFocus.hpp:15
Definition: ElementBase.hpp:13