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;
807 GLSGEN_GLSTEXTGRID_EXPORT
void EraseIndex(
unsigned int textIndex );
814 if( !_perCharAttribs )
816 _perCharAttribs =
true;
828 GLSGEN_GLSTEXTGRID_EXPORT
char*
FormatVarArgList(
const char* format, va_list args );
833 GLSGEN_GLSTEXTGRID_EXPORT
float BoxHeight();
838 GLSGEN_GLSTEXTGRID_EXPORT
float BoxWidth();
845 unsigned int IndexOf(
unsigned int col,
unsigned int row)
const
847 unsigned int index(0);
849 if (col < _cols && row < _rows)
851 index = (row *
_cols) + col;
855 index = _rows *
_cols;
863 GLSGEN_GLSTEXTGRID_EXPORT
float JustificationOffset(
unsigned int row);
868 GLSGEN_GLSTEXTGRID_EXPORT
float LinePixelWidth(
unsigned int line,
float cellWidth)
const;
873 GLSGEN_GLSTEXTGRID_EXPORT
void Rebuild();
878 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcCellSize();
883 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcVertices();
888 GLSGEN_GLSTEXTGRID_EXPORT
void ResizeGrid();
896 GLSGEN_GLSTEXTGRID_EXPORT
897 unsigned int TextIndexOf(
unsigned int col,
unsigned int row,
unsigned int startRow = 0 )
const;
904 GLSGEN_GLSTEXTGRID_EXPORT
905 unsigned int GridIndexOf(
unsigned int col,
unsigned int row)
const;
933 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
glsColor haloColor,
bool leftToRight );
958 void IgnoreShadowAndHalo()
960 _allowShadow =
false;
965 const float _cellWidth;
966 const float _cellHeight;
970 const Vector _shadowOffset;
975 const float _underlineOffset;
976 const float _underlineSize;
980 const float _haloOffset;
984 const bool _leftToRight;
987 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
992 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
997 typedef std::list<LineSegment_t> LineSegmentCont_t;
998 LineSegmentCont_t _lineSegments;
1003 void OnCellDimensionChanged()
1008 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:289
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:178
unsigned int GridIndexOf(unsigned int col, unsigned int row) const
void EnablePerCharAttribs(void)
Definition: gls_text_grid.h:812
void RenderLineSegments(void)
unsigned int Columns() const
Definition: gls_text_grid.h:293
Definition: gls_text.h:157
std::string _text
Definition: gls_text.h:833
CharAttrCont_t _chars
Definition: gls_text.h:778
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:552
virtual void Calculate(double time)
float CellWidth() const
Definition: gls_text.h:395
UnicodeString _unicodeText
Definition: gls_text_grid.h:800
virtual void CalculateRowData(void)
Definition: gls_text_grid.h:914
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:845
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:417
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:670
void SetRebuild()
Definition: gls_text.h:714
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:381
unsigned int _rows
Definition: gls_text_grid.h:784