40 #ifndef _GLS_TEXT_GRID_H
41 #define _GLS_TEXT_GRID_H
49 #include "gls_quad_storage.h"
53 #if (defined(GLSGEN_EXPORT_GLSTEXTGRID) || \
54 defined(GLSGEN_IMPORT_GLSTEXTGRID) || \
55 defined(GLSGEN_GLSTEXTGRID_EXPORT_GENERATED) || \
56 defined(GLS_IMPORT_GENERATED)) \
58 # if defined(GLSGEN_EXPORT_GLSTEXTGRID) || defined(GLSGEN_GLSTEXTGRID_EXPORT_GENERATED)
59 # define GLSGEN_GLSTEXTGRID_EXPORT __declspec(dllexport)
61 # define GLSGEN_GLSTEXTGRID_EXPORT __declspec(dllimport)
64 # define GLSGEN_GLSTEXTGRID_EXPORT
68 #define LIB_BASE_NAME "gls_text_grid"
76 #define SET_CHAR_RANGE(startCol, startRow, len, attribute, value) \
77 {unsigned int charsSet(0); \
78 unsigned int col(startCol); \
80 if (startCol < _cols && startRow < _rows) \
82 for (unsigned int row = startRow; (row < _rows) && (charsSet < len); ++row) \
84 for ( ; (col < _cols) && (charsSet < len); ++col) \
86 _chars[IndexOf(col, row)].attribute = value; \
92 EnablePerCharAttribs(); \
102 class GlsGloFileAttribute;
108 GLS_TEXT_GRID_SIZE = GLS_LAST_TEXT_INITIALIZER + 1,
109 GLS_TEXT_GRID_LEFT_TO_RIGHT
123 GlsQuadListVC_3D _backgrounds;
124 GlsQuadListVCT_2D _shadows;
125 GlsQuadListVC_3D _shadowLines;
126 GlsQuadListVCT_2D _characters;
127 GlsQuadListVC_3D _lines;
129 void PopulateQuadStorage();
135 friend class GlsTextGridEditor;
141 GLSGEN_GLSTEXTGRID_EXPORT
GlsTextGrid(
const GlsTextGrid& that,
const bool generateNames );
170 GLSGEN_GLSTEXTGRID_EXPORT
void Baseline(
173 float baselineShift);
181 GLSGEN_GLSTEXTGRID_EXPORT
void Baseline(
182 unsigned int startCol,
183 unsigned int startRow,
185 float baselineShift);
192 GLSGEN_GLSTEXTGRID_EXPORT
void BgColor(
203 GLSGEN_GLSTEXTGRID_EXPORT
void BgColor(
204 unsigned int startCol,
205 unsigned int startRow,
213 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Calculate(
double time);
220 GLSGEN_GLSTEXTGRID_EXPORT
void Char(
unsigned int col,
unsigned int row, Char_t code);
228 GLSGEN_GLSTEXTGRID_EXPORT
void Char(
229 unsigned int startCol,
230 unsigned int startRow,
259 unsigned int startCol,
260 unsigned int startRow,
273 float horizontalSpacing);
283 unsigned int startCol,
284 unsigned int startRow,
286 float horizontalSpacing);
318 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Draw(
void);
324 GLSGEN_GLSTEXTGRID_EXPORT
void Erase(
unsigned int col,
unsigned int row);
331 GLSGEN_GLSTEXTGRID_EXPORT
void Erase(
332 unsigned int startCol,
333 unsigned int startRow,
342 GLSGEN_GLSTEXTGRID_EXPORT
void Erase(
343 unsigned int startCol,
344 unsigned int startRow,
346 unsigned int endRow);
353 GLSGEN_GLSTEXTGRID_EXPORT
void FauxBold(
unsigned int col,
unsigned int row,
bool bold);
361 GLSGEN_GLSTEXTGRID_EXPORT
void FauxBold(
362 unsigned int startCol,
363 unsigned int startRow,
378 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Initialize();
385 GLSGEN_GLSTEXTGRID_EXPORT
void Inverse(
unsigned int col,
unsigned int row,
bool inverse);
393 GLSGEN_GLSTEXTGRID_EXPORT
void Inverse(
394 unsigned int startCol,
395 unsigned int startRow,
404 GLSGEN_GLSTEXTGRID_EXPORT
unsigned int LineLength(
unsigned int row)
const;
416 void Rows(
unsigned int newRows)
434 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex *anchor,
int handleBar);
437 virtual GLSGEN_GLSTEXTGRID_EXPORT
void SetValue(
int spec, va_list& args);
443 GLSGEN_GLSTEXTGRID_EXPORT
void Size(
unsigned int cols,
unsigned int rows);
450 GLSGEN_GLSTEXTGRID_EXPORT
void StrikeThru(
unsigned int col,
unsigned int row,
bool strike);
459 unsigned int startCol,
460 unsigned int startRow,
470 GLSGEN_GLSTEXTGRID_EXPORT
void String(
471 unsigned int startCol,
472 unsigned int startRow,
473 const std::string& s);
481 void String(
unsigned int startCol,
unsigned int startRow,
const char* s)
483 String(startCol, startRow, std::string(s));
491 GLSGEN_GLSTEXTGRID_EXPORT
void TextColor(
502 GLSGEN_GLSTEXTGRID_EXPORT
void TextColor(
503 unsigned int startCol,
504 unsigned int startRow,
515 unsigned int col = 0,
516 unsigned int row = 0)
const;
523 GLSGEN_GLSTEXTGRID_EXPORT
void Underline(
534 GLSGEN_GLSTEXTGRID_EXPORT
void Underline(
535 unsigned int startCol,
536 unsigned int startRow,
546 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
const char* format, ...);
559 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
560 unsigned int startCol,
561 unsigned int startRow,
578 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
581 unsigned char rgba[],
597 GLSGEN_GLSTEXTGRID_EXPORT
void Center(
bool flag)
606 GLSGEN_GLSTEXTGRID_EXPORT
void Clear(
void)
630 GLSGEN_GLSTEXTGRID_EXPORT
void SetChar(
unsigned int col,
unsigned int row,
char ch)
632 Char(col, row, Char_t(ch));
649 unsigned char rgba[])
651 Char(col, row, Char_t(ch));
681 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
unsigned int col,
unsigned int row,
const char* s)
699 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
702 unsigned char rgba[],
713 GLSGEN_GLSTEXTGRID_EXPORT
void VaSetString(
const char *format, ...);
748 unsigned char rgba[],
755 GLSGEN_GLSTEXTGRID_EXPORT
bool LeftToRight(
void );
760 GLSGEN_GLSTEXTGRID_EXPORT
void LeftToRight(
bool leftToRight );
768 virtual GLSGEN_GLSTEXTGRID_EXPORT
void SetFromGloData(GlsGloFileAttribute &data);
786 bool _numRowsChanged;
806 GLSGEN_GLSTEXTGRID_EXPORT
void EraseIndex(
unsigned int textIndex );
813 if( !_perCharAttribs )
815 _perCharAttribs =
true;
827 GLSGEN_GLSTEXTGRID_EXPORT
char*
FormatVarArgList(
const char* format, va_list args );
832 GLSGEN_GLSTEXTGRID_EXPORT
float BoxHeight();
837 GLSGEN_GLSTEXTGRID_EXPORT
float BoxWidth();
844 unsigned int IndexOf(
unsigned int col,
unsigned int row)
const
846 unsigned int index(0);
848 if (col < _cols && row < _rows)
850 index = (row *
_cols) + col;
854 index = _rows *
_cols;
862 GLSGEN_GLSTEXTGRID_EXPORT
float JustificationOffset(
unsigned int row);
867 GLSGEN_GLSTEXTGRID_EXPORT
float LinePixelWidth(
unsigned int line,
float cellWidth)
const;
872 GLSGEN_GLSTEXTGRID_EXPORT
void Rebuild();
877 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcCellSize();
882 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcVertices();
887 GLSGEN_GLSTEXTGRID_EXPORT
void ResizeGrid();
895 GLSGEN_GLSTEXTGRID_EXPORT
896 unsigned int TextIndexOf(
unsigned int col,
unsigned int row,
unsigned int startRow = 0 )
const;
903 GLSGEN_GLSTEXTGRID_EXPORT
904 unsigned int GridIndexOf(
unsigned int col,
unsigned int row)
const;
932 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
glsColor haloColor,
bool leftToRight );
957 void IgnoreShadowAndHalo()
959 _allowShadow =
false;
964 const float _cellWidth;
965 const float _cellHeight;
969 const Vector _shadowOffset;
974 const float _underlineOffset;
975 const float _underlineSize;
979 const float _haloOffset;
983 const bool _leftToRight;
986 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
991 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
996 typedef std::list<LineSegment_t> LineSegmentCont_t;
997 LineSegmentCont_t _lineSegments;
1002 void OnCellDimensionChanged()
1007 GlsTextGrid& operator=(
const GlsTextGrid& );
The DistiUnhideGlobalsDummyClass class.
char * FormatVarArgList(const char *format, va_list args)
void SetChar(unsigned int col, unsigned int row, char ch, unsigned char rgba[])
Definition: gls_text_grid.h:645
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
void SetString(unsigned int col, unsigned int row, const char *s)
Definition: gls_text_grid.h:681
Definition: gls_text_grid.h:117
virtual void SetValue(int spec, va_list &args)
Definition: dynamic_array.h:63
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:281
unsigned int _cols
Definition: gls_text_grid.h:781
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
bool _perCharAttribs
Definition: gls_text_grid.h:793
Attributes for each character position in the grid.
Definition: gls_text.h:173
unsigned int GridIndexOf(unsigned int col, unsigned int row) const
void EnablePerCharAttribs(void)
Definition: gls_text_grid.h:811
void RenderLineSegments(void)
unsigned int Columns() const
Definition: gls_text_grid.h:293
Definition: gls_text.h:152
std::string _text
Definition: gls_text.h:828
CharAttrCont_t _chars
Definition: gls_text.h:773
void EraseIndex(unsigned int textIndex)
The disti::GlsText class.
virtual void CopyGeometry(DisplayObject *src)
void ProcessCharacter(const CharAttr_t &charAttr, float cellX, float nextCellX, float charY, bool endOfLine)
unsigned int LineLength(unsigned int row) const
bool _leftToRight
Definition: gls_text_grid.h:797
void SetChar(unsigned int col, unsigned int row, char ch)
Definition: gls_text_grid.h:630
float pixelWidth
Definition: gls_text_grid.h:777
Justify_t Justify() const
Definition: gls_text.h:547
virtual void Calculate(double time)
float CellWidth() const
Definition: gls_text.h:390
UnicodeString _unicodeText
Definition: gls_text_grid.h:800
virtual void CalculateRowData(void)
Definition: gls_text_grid.h:913
RowInfo * _rowInfo
Definition: gls_text_grid.h:795
void VaString(const char *format,...)
virtual DisplayObject * CloneObject(bool generateNames=false)
void Char(unsigned int col, unsigned int row, Char_t code)
void Clear(void)
Definition: gls_text_grid.h:606
unsigned int startingIndex
Definition: gls_text_grid.h:774
virtual void CopyProperties(DisplayObject *src)
unsigned int IndexOf(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:844
unsigned int Rows() const
Definition: gls_text_grid.h:408
Definition: gls_text_grid.h:772
void Center(bool flag)
Definition: gls_text_grid.h:597
Definition: gls_color.h:54
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
virtual void SetAvailableAttributes(unsigned int value)
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
void SetString(const char *s)
Definition: gls_text_grid.h:664
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:412
CharAttr_t CharAttr(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:235
void Scale(int handleBar, float px, float py, Vertex *anchor=NULL)
Definition: display.h:1111
void VaSetString(const char *format,...)
std::string String() const
Definition: gls_text.h:665
void SetRebuild()
Definition: gls_text.h:709
void String(unsigned int startCol, unsigned int startRow, const char *s)
Definition: gls_text_grid.h:481
unsigned int length
Definition: gls_text_grid.h:776
void ClearChars(void)
Definition: gls_text_grid.h:615
void Rows(unsigned int newRows)
Definition: gls_text_grid.h:416
void Columns(unsigned int newCols)
Definition: gls_text_grid.h:301
unsigned int TextIndexOf(unsigned int col, unsigned int row, unsigned int startRow=0) const
Definition: bmpimage.h:46
UnderlineStrikeThruHelper(float cellWidth, float cellHeight, float cellYScale, bool shadow, const Vector &shadowOffset, const glsColor &shadowColor, float underlineOffset, float underlineSize, bool halo, float haloOffset, glsColor haloColor, bool leftToRight)
void Size(unsigned int cols, unsigned int rows)
float CellHeight() const
Definition: gls_text.h:376
unsigned int _rows
Definition: gls_text_grid.h:784