MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_TextViewData.h
Go to the documentation of this file.
1
6 #ifndef __MYGUI_TEXT_VIEW_DATA_H__
7 #define __MYGUI_TEXT_VIEW_DATA_H__
8
9 #include "MyGUI_Prerequest.h"
10
11 namespace MyGUI
12 {
13
14 class CharInfo
15 {
16 public:
17 CharInfo() :
18 mIsColour(false)
19 {
20 mMetrics.mWidth = 0.0f;
21 mMetrics.mHeight = 0.0f;
22 mMetrics.mAdvance = 0.0f;
23 mMetrics.mBearingX = 0.0f;
24 mMetrics.mBearingY = 0.0f;
25 }
26
27 CharInfo(
28 const FloatRect& _rect,
29 float _width,
30 float _height,
31 float _advance,
32 float _bearingX,
33 float _bearingY) :
34 mIsColour(false),
35 mUVRect(_rect)
36 {
37 mMetrics.mWidth = _width;
38 mMetrics.mHeight = _height;
39 mMetrics.mAdvance = _advance;
40 mMetrics.mBearingX = _bearingX;
41 mMetrics.mBearingY = _bearingY;
42 }
43
44 CharInfo(uint32 _colour) :
45 mIsColour(true),
46 mColour(_colour)
47 { }
48
49 bool isColour() const
50 {
51 return mIsColour;
52 }
53
54 float getWidth() const
55 {
56 return mMetrics.mWidth;
57 }
58
59 float getHeight() const
60 {
61 return mMetrics.mHeight;
62 }
63
64 float getAdvance() const
65 {
66 return mMetrics.mAdvance;
67 }
68
69 float getBearingX() const
70 {
71 return mMetrics.mBearingX;
72 }
73
74 float getBearingY() const
75 {
76 return mMetrics.mBearingY;
77 }
78
79 const FloatRect& getUVRect() const
80 {
81 return mUVRect;
82 }
83
84 uint32 getColour() const
85 {
86 return mColour;
87 }
88
89 private:
90
91 bool mIsColour;
92 FloatRect mUVRect;
93
94 struct Metrics
95 {
96 float mWidth;
97 float mHeight;
98 float mAdvance;
99 float mBearingX;
100 float mBearingY;
101 };
102
103 union
104 {
105 Metrics mMetrics;
106 uint32 mColour;
107 };
108
109 };
110
111 typedef std::vector<CharInfo> VectorCharInfo;
112
113 struct LineInfo
114 {
115 LineInfo() :
116 width(0),
117 offset(0),
118 count(0)
119 {
120 }
121
122 void clear()
123 {
124 width = 0;
125 count = 0;
126 simbols.clear();
127 offset = 0;
128 }
129
130 int width;
131 int offset;
132 size_t count;
133 VectorCharInfo simbols;
134 };
135
136 typedef std::vector<LineInfo> VectorLineInfo;
137
138 } // namespace MyGUI
139
140 #endif // __MYGUI_TEXT_VIEW_DATA_H__
MyGUI::uint32
unsigned int uint32
Definition: MyGUI_Types.h:63
MyGUI::CharInfo::CharInfo
CharInfo(const FloatRect &_rect, float _width, float _height, float _advance, float _bearingX, float _bearingY)
Definition: MyGUI_TextViewData.h:27
MyGUI::CharInfo::getAdvance
float getAdvance() const
Definition: MyGUI_TextViewData.h:64
MyGUI_Prerequest.h
MyGUI::CharInfo::getBearingY
float getBearingY() const
Definition: MyGUI_TextViewData.h:74
MyGUI::CharInfo::getBearingX
float getBearingX() const
Definition: MyGUI_TextViewData.h:69
MyGUI::VectorLineInfo
std::vector< LineInfo > VectorLineInfo
Definition: MyGUI_TextViewData.h:136
MyGUI::LineInfo::simbols
VectorCharInfo simbols
Definition: MyGUI_TextViewData.h:133
MyGUI::CharInfo::CharInfo
CharInfo()
Definition: MyGUI_TextViewData.h:17
MyGUI::CharInfo::getColour
uint32 getColour() const
Definition: MyGUI_TextViewData.h:84
MyGUI::CharInfo::getHeight
float getHeight() const
Definition: MyGUI_TextViewData.h:59
MyGUI::VectorCharInfo
std::vector< CharInfo > VectorCharInfo
Definition: MyGUI_TextViewData.h:111
MyGUI::CharInfo::mMetrics
Metrics mMetrics
Definition: MyGUI_TextViewData.h:105
MyGUI::CharInfo
Definition: MyGUI_TextViewData.h:14
MyGUI::CharInfo::CharInfo
CharInfo(uint32 _colour)
Definition: MyGUI_TextViewData.h:44
MyGUI::CharInfo::getUVRect
const FloatRect & getUVRect() const
Definition: MyGUI_TextViewData.h:79
MyGUI::CharInfo::mColour
uint32 mColour
Definition: MyGUI_TextViewData.h:106
MyGUI::CharInfo::getWidth
float getWidth() const
Definition: MyGUI_TextViewData.h:54
MyGUI::types::TRect< float >
MyGUI::LineInfo::width
int width
Definition: MyGUI_TextViewData.h:130
MyGUI::CharInfo::isColour
bool isColour() const
Definition: MyGUI_TextViewData.h:49
MyGUI::LineInfo::clear
void clear()
Definition: MyGUI_TextViewData.h:122
MyGUI::LineInfo::LineInfo
LineInfo()
Definition: MyGUI_TextViewData.h:115
MyGUI::LineInfo::offset
int offset
Definition: MyGUI_TextViewData.h:131
MyGUI::LineInfo
Definition: MyGUI_TextViewData.h:113
MyGUI::LineInfo::count
size_t count
Definition: MyGUI_TextViewData.h:132