TextLayout.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "FontMesh.hpp"
4 
5 #include "../Elements/Elem.hpp"
6 #include "../Elements/ElementRenderer.hpp"
7 #include "../Elements/Slot.hpp"
8 
9 namespace iv
10 {
11 
15 {
16 public:
18  TextSegment( Elem * elem );
19  Instance * instance() const;
20 
21  Elem * elem();
22  Elem const * elem() const;
23 
24 
25 // synthesized parameters
32 
36 
37 // inherited parameters
41 
42 private:
43  Elem * _elem;
44 };
45 
52 class TextLayout : public VectorChildrenElem< TextSegment >, public SlotChild
53 {
54 public:
56 using Elem::instance;
57  TextLayout( Instance * );
58 
59 // initialization parameters
61 
62 // utility methods
63  TextLayout * line_spacing( float );
64 
65 protected:
66  virtual void first_pass_impl( ElementRenderer * ) override;
67  virtual void second_pass_impl( ElementRenderer * ) override;
68 
69 private:
70  void RepositionChildren();
71 
72 private:
73  Heap heap;
74  bool geometry_dirty;
75 };
76 
77 }