MyGUI  3.2.0
MyGUI_TextViewData.h
Go to the documentation of this file.
00001 
00006 #ifndef __MYGUI_TEXT_VIEW_DATA_H__
00007 #define __MYGUI_TEXT_VIEW_DATA_H__
00008 
00009 #include "MyGUI_Prerequest.h"
00010 
00011 namespace MyGUI
00012 {
00013 
00014     class CharInfo
00015     {
00016     public:
00017         CharInfo() :
00018             width(0)
00019         {
00020         }
00021 
00022         CharInfo(const FloatRect& _rect, int _width) :
00023             rect(_rect),
00024             width(_width)
00025         {
00026         }
00027 
00028         CharInfo(uint32 _colour) :
00029             rect(-1, 0, 0, 0),
00030             width((int)_colour)
00031         {
00032         }
00033 
00034         bool isColour() const
00035         {
00036             return rect.left == -1;
00037         }
00038 
00039         int getWidth() const
00040         {
00041             return width;
00042         }
00043 
00044         const FloatRect& getUVRect() const
00045         {
00046             return rect;
00047         }
00048 
00049         uint32 getColour() const
00050         {
00051             return (uint32)width;
00052         }
00053 
00054     private:
00055         FloatRect rect;
00056         int width;
00057     };
00058 
00059     typedef std::vector<CharInfo> VectorCharInfo;
00060 
00061     struct LineInfo
00062     {
00063         LineInfo() :
00064             width(0),
00065             offset(0),
00066             count(0)
00067         {
00068         }
00069 
00070         void clear()
00071         {
00072             width = 0;
00073             count = 0;
00074             simbols.clear();
00075             offset = 0;
00076         }
00077 
00078         int width;
00079         int offset;
00080         size_t count;
00081         VectorCharInfo simbols;
00082     };
00083 
00084     typedef std::vector<LineInfo> VectorLineInfo;
00085 
00086 } // namespace MyGUI
00087 
00088 #endif // __MYGUI_TEXT_VIEW_DATA_H__