40 #ifndef _GLS_TEXT_GRID_H
41 #define _GLS_TEXT_GRID_H
53 #if( defined( GLSGEN_EXPORT_GLSTEXTGRID ) || defined( GLSGEN_IMPORT_GLSTEXTGRID ) || defined( GLSGEN_GLSTEXTGRID_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
54 && defined( _MSC_VER )
55 # if defined( GLSGEN_EXPORT_GLSTEXTGRID ) || defined( GLSGEN_GLSTEXTGRID_EXPORT_GENERATED )
56 # define GLSGEN_GLSTEXTGRID_EXPORT __declspec( dllexport )
58 # define GLSGEN_GLSTEXTGRID_EXPORT __declspec( dllimport )
61 # define GLSGEN_GLSTEXTGRID_EXPORT
65 #define LIB_BASE_NAME "gls_text_grid"
73 #define SET_CHAR_RANGE( startCol, startRow, len, attribute, value ) \
75 unsigned int charsSet( 0 ); \
76 unsigned int col( startCol ); \
77 bool notifyChanged = false; \
79 if( startCol < _cols && startRow < _rows ) \
81 for( unsigned int row = startRow; ( row < _rows ) && ( charsSet < len ); ++row ) \
83 for( ; ( col < _cols ) && ( charsSet < len ); ++col ) \
85 if( _chars[ IndexOf( col, row ) ].attribute != value ) \
87 _chars[ IndexOf( col, row ) ].attribute = value; \
88 notifyChanged = true; \
97 EnablePerCharAttribs(); \
98 InvalidatePainter(); \
109 class GlsGloFileAttribute;
115 GLS_TEXT_GRID_SIZE = GLS_LAST_TEXT_INITIALIZER + 1,
116 GLS_TEXT_GRID_LEFT_TO_RIGHT
135 void PopulateQuadStorage();
139 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
143 friend class GlsTextGridEditor;
149 GLSGEN_GLSTEXTGRID_EXPORT
GlsTextGrid(
const GlsTextGrid& that,
const bool generateNames );
171 virtual GLSGEN_GLSTEXTGRID_EXPORT
void SetAvailableAttributes(
unsigned int value ) DISTI_METHOD_OVERRIDE;
178 GLSGEN_GLSTEXTGRID_EXPORT
void Baseline(
181 float baselineShift );
189 GLSGEN_GLSTEXTGRID_EXPORT
void Baseline(
190 unsigned int startCol,
191 unsigned int startRow,
193 float baselineShift );
200 GLSGEN_GLSTEXTGRID_EXPORT
void BgColor(
211 GLSGEN_GLSTEXTGRID_EXPORT
void BgColor(
212 unsigned int startCol,
213 unsigned int startRow,
221 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Calculate(
double time ) DISTI_METHOD_OVERRIDE;
228 GLSGEN_GLSTEXTGRID_EXPORT
void Char(
unsigned int col,
unsigned int row, Char_t code );
236 GLSGEN_GLSTEXTGRID_EXPORT
void Char(
237 unsigned int startCol,
238 unsigned int startRow,
267 unsigned int startCol,
268 unsigned int startRow,
281 float horizontalSpacing );
291 unsigned int startCol,
292 unsigned int startRow,
294 float horizontalSpacing );
326 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Draw(
void ) DISTI_METHOD_OVERRIDE;
332 GLSGEN_GLSTEXTGRID_EXPORT
void Erase(
unsigned int col,
unsigned int row );
339 GLSGEN_GLSTEXTGRID_EXPORT
void Erase(
340 unsigned int startCol,
341 unsigned int startRow,
350 GLSGEN_GLSTEXTGRID_EXPORT
void Erase(
351 unsigned int startCol,
352 unsigned int startRow,
354 unsigned int endRow );
361 GLSGEN_GLSTEXTGRID_EXPORT
void FauxBold(
unsigned int col,
unsigned int row,
bool bold );
369 GLSGEN_GLSTEXTGRID_EXPORT
void FauxBold(
370 unsigned int startCol,
371 unsigned int startRow,
384 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Initialize();
391 GLSGEN_GLSTEXTGRID_EXPORT
void Inverse(
unsigned int col,
unsigned int row,
bool inverse );
399 GLSGEN_GLSTEXTGRID_EXPORT
void Inverse(
400 unsigned int startCol,
401 unsigned int startRow,
410 GLSGEN_GLSTEXTGRID_EXPORT
unsigned int LineLength(
unsigned int row )
const;
422 void Rows(
unsigned int newRows )
440 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar ) DISTI_METHOD_OVERRIDE;
443 virtual GLSGEN_GLSTEXTGRID_EXPORT
void SetValue(
int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
449 GLSGEN_GLSTEXTGRID_EXPORT
void Size(
unsigned int cols,
unsigned int rows );
456 GLSGEN_GLSTEXTGRID_EXPORT
void StrikeThru(
unsigned int col,
unsigned int row,
bool strike );
465 unsigned int startCol,
466 unsigned int startRow,
476 GLSGEN_GLSTEXTGRID_EXPORT
void String(
477 unsigned int startCol,
478 unsigned int startRow,
479 const std::string& s );
487 void String(
unsigned int startCol,
unsigned int startRow,
const char* s )
489 String( startCol, startRow, std::string( s ) );
497 GLSGEN_GLSTEXTGRID_EXPORT
void TextColor(
508 GLSGEN_GLSTEXTGRID_EXPORT
void TextColor(
509 unsigned int startCol,
510 unsigned int startRow,
521 unsigned int col = 0,
522 unsigned int row = 0 )
const;
529 GLSGEN_GLSTEXTGRID_EXPORT
void Underline(
540 GLSGEN_GLSTEXTGRID_EXPORT
void Underline(
541 unsigned int startCol,
542 unsigned int startRow,
552 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
const char* format, ... );
565 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
566 unsigned int startCol,
567 unsigned int startRow,
584 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
587 unsigned char rgba[],
603 GLSGEN_GLSTEXTGRID_EXPORT
void Center(
bool flag )
612 GLSGEN_GLSTEXTGRID_EXPORT
void Clear(
void )
636 GLSGEN_GLSTEXTGRID_EXPORT
void SetChar(
unsigned int col,
unsigned int row,
char ch )
638 Char( col, row, Char_t( ch ) );
655 unsigned char rgba[] )
657 Char( col, row, Char_t( ch ) );
670 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
const char* s )
687 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
unsigned int col,
unsigned int row,
const char* s )
705 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
708 unsigned char rgba[],
719 GLSGEN_GLSTEXTGRID_EXPORT
void VaSetString(
const char* format, ... );
754 unsigned char rgba[],
761 GLSGEN_GLSTEXTGRID_EXPORT
bool LeftToRight(
void );
766 GLSGEN_GLSTEXTGRID_EXPORT
void LeftToRight(
bool leftToRight );
773 virtual GLSGEN_GLSTEXTGRID_EXPORT
void SetFromGloData(
GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
791 bool _numRowsChanged;
811 GLSGEN_GLSTEXTGRID_EXPORT
void EraseIndex(
unsigned int textIndex );
818 if( !_perCharAttribs )
820 _perCharAttribs =
true;
832 GLSGEN_GLSTEXTGRID_EXPORT
char*
FormatVarArgList(
const char* format, va_list args );
837 GLSGEN_GLSTEXTGRID_EXPORT
float BoxHeight();
842 GLSGEN_GLSTEXTGRID_EXPORT
float BoxWidth();
849 unsigned int IndexOf(
unsigned int col,
unsigned int row )
const
851 unsigned int index( 0 );
853 if( col < _cols && row < _rows )
855 index = ( row *
_cols ) + col;
859 index = _rows *
_cols;
867 GLSGEN_GLSTEXTGRID_EXPORT
float JustificationOffset(
unsigned int row );
872 GLSGEN_GLSTEXTGRID_EXPORT
float LinePixelWidth(
unsigned int line,
float cellWidth )
const;
877 GLSGEN_GLSTEXTGRID_EXPORT
void Rebuild();
882 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcCellSize();
887 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcVertices();
892 GLSGEN_GLSTEXTGRID_EXPORT
void ResizeGrid();
900 GLSGEN_GLSTEXTGRID_EXPORT
901 unsigned int TextIndexOf(
unsigned int col,
unsigned int row,
unsigned int startRow = 0 )
const;
908 GLSGEN_GLSTEXTGRID_EXPORT
909 unsigned int GridIndexOf(
unsigned int col,
unsigned int row )
const;
936 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
961 void IgnoreShadowAndHalo()
963 _allowShadow =
false;
968 const float _cellWidth;
969 const float _cellHeight;
973 const Vector _shadowOffset;
978 const float _underlineOffset;
979 const float _underlineSize;
983 const float _haloOffset;
987 const bool _leftToRight;
990 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
995 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
1000 typedef std::list<LineSegment_t> LineSegmentCont_t;
1001 LineSegmentCont_t _lineSegments;
1006 void OnCellDimensionChanged() DISTI_METHOD_OVERRIDE
1011 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:651
void SetString(unsigned int col, unsigned int row, const char *s)
Definition: gls_text_grid.h:687
Definition: gls_text_grid.h:123
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
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)
Definition: dynamic_array.h:66
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:471
unsigned int _cols
Definition: gls_text_grid.h:786
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
The disti::GlsQuadListVC_3D and GlsQuadListVCT_2D classes.
bool _perCharAttribs
Definition: gls_text_grid.h:798
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
Attributes for each character position in the grid.
Definition: gls_text.h:177
unsigned int GridIndexOf(unsigned int col, unsigned int row) const
void EnablePerCharAttribs(void)
Definition: gls_text_grid.h:816
void RenderLineSegments(void)
unsigned int Columns() const
Definition: gls_text_grid.h:301
Definition: gls_text.h:151
std::string _text
Definition: gls_text.h:711
CharAttrCont_t _chars
Definition: gls_text.h:656
void EraseIndex(unsigned int textIndex)
Definition: gls_quad_storage.h:158
The disti::GlsText class.
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
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:802
void SetChar(unsigned int col, unsigned int row, char ch)
Definition: gls_text_grid.h:636
Definition: gls_glo_file.h:988
float pixelWidth
Definition: gls_text_grid.h:782
Justify_t Justify() const
Definition: gls_text.h:425
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
float CellWidth() const
Definition: gls_text.h:270
virtual void CalculateRowData(void)
Definition: gls_text_grid.h:918
RowInfo * _rowInfo
Definition: gls_text_grid.h:800
void VaString(const char *format,...)
void Char(unsigned int col, unsigned int row, Char_t code)
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
void Clear(void)
Definition: gls_text_grid.h:612
unsigned int startingIndex
Definition: gls_text_grid.h:779
Definition: gls_color.h:53
unsigned int IndexOf(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:849
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
unsigned int Rows() const
Definition: gls_text_grid.h:414
Definition: gls_text_grid.h:777
void Center(bool flag)
Definition: gls_text_grid.h:603
virtual void Draw(void) DISTI_METHOD_OVERRIDE
void SetString(const char *s)
Definition: gls_text_grid.h:670
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:292
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar=0)
CharAttr_t CharAttr(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:243
void VaSetString(const char *format,...)
std::string String() const
Definition: gls_text.h:543
void SetRebuild()
Definition: gls_text.h:587
void String(unsigned int startCol, unsigned int startRow, const char *s)
Definition: gls_text_grid.h:487
unsigned int length
Definition: gls_text_grid.h:781
void ClearChars(void)
Definition: gls_text_grid.h:621
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
void Rows(unsigned int newRows)
Definition: gls_text_grid.h:422
void Columns(unsigned int newCols)
Definition: gls_text_grid.h:309
Definition: gls_quad_storage.h:63
unsigned int TextIndexOf(unsigned int col, unsigned int row, unsigned int startRow=0) const
Definition: bmpimage.h:46
UTF16String _unicodeText
Definition: gls_text_grid.h:805
void Size(unsigned int cols, unsigned int rows)
virtual void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
float CellHeight() const
Definition: gls_text.h:256
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
unsigned int _rows
Definition: gls_text_grid.h:789