Nui
stabilize.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #include <memory>
8 
9 namespace Nui
10 {
12  {
13  public:
15  : stableElement_{}
16  {}
17 
19  void reset();
20 
22  void destroy();
23 
24  friend ElementRenderer stabilize(StableElement& stableElement, ElementRenderer const& encapsulatedRenderer);
25 
27 
28  Dom::Element const& stableElement() const;
29 
30  private:
31  std::shared_ptr<Dom::Element> stableElement_;
32  bool reset_;
33  };
34 
42  ElementRenderer stabilize(StableElement& stableElement, ElementRenderer const& encapsulatedRenderer);
43 }
Definition: element.hpp:42
Definition: stabilize.hpp:12
StableElement()
Definition: stabilize.hpp:14
Dom::Element & stableElement()
Definition: stabilize.cpp:18
void reset()
Resets the stable element, so that it is re-rendered on the next render.
Definition: stabilize.cpp:8
void destroy()
Destroys the stable element directly, which will make it also disappear from the page.
Definition: stabilize.cpp:13
friend ElementRenderer stabilize(StableElement &stableElement, ElementRenderer const &encapsulatedRenderer)
Stabilizes an element, so that it is not re-rendered on every render.
Definition: stabilize.cpp:28
Definition: file_dialog.hpp:6
std::function< std::shared_ptr< Dom::Element >(Dom::Element &, Renderer const &)> ElementRenderer
Definition: element_renderer.hpp:11
ElementRenderer stabilize(StableElement &stableElement, ElementRenderer const &encapsulatedRenderer)
Stabilizes an element, so that it is not re-rendered on every render.
Definition: stabilize.cpp:28