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 );
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 );
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 );
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,
386 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Initialize();
393 GLSGEN_GLSTEXTGRID_EXPORT
void Inverse(
unsigned int col,
unsigned int row,
bool inverse );
401 GLSGEN_GLSTEXTGRID_EXPORT
void Inverse(
402 unsigned int startCol,
403 unsigned int startRow,
412 GLSGEN_GLSTEXTGRID_EXPORT
unsigned int LineLength(
unsigned int row )
const;
424 void Rows(
unsigned int newRows )
442 virtual GLSGEN_GLSTEXTGRID_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar );
445 virtual GLSGEN_GLSTEXTGRID_EXPORT
void SetValue(
int spec, va_list& args );
451 GLSGEN_GLSTEXTGRID_EXPORT
void Size(
unsigned int cols,
unsigned int rows );
458 GLSGEN_GLSTEXTGRID_EXPORT
void StrikeThru(
unsigned int col,
unsigned int row,
bool strike );
467 unsigned int startCol,
468 unsigned int startRow,
478 GLSGEN_GLSTEXTGRID_EXPORT
void String(
479 unsigned int startCol,
480 unsigned int startRow,
481 const std::string& s );
489 void String(
unsigned int startCol,
unsigned int startRow,
const char* s )
491 String( startCol, startRow, std::string( s ) );
499 GLSGEN_GLSTEXTGRID_EXPORT
void TextColor(
510 GLSGEN_GLSTEXTGRID_EXPORT
void TextColor(
511 unsigned int startCol,
512 unsigned int startRow,
523 unsigned int col = 0,
524 unsigned int row = 0 )
const;
531 GLSGEN_GLSTEXTGRID_EXPORT
void Underline(
542 GLSGEN_GLSTEXTGRID_EXPORT
void Underline(
543 unsigned int startCol,
544 unsigned int startRow,
554 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
const char* format, ... );
567 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
568 unsigned int startCol,
569 unsigned int startRow,
586 GLSGEN_GLSTEXTGRID_EXPORT
void VaString(
589 unsigned char rgba[],
605 GLSGEN_GLSTEXTGRID_EXPORT
void Center(
bool flag )
614 GLSGEN_GLSTEXTGRID_EXPORT
void Clear(
void )
638 GLSGEN_GLSTEXTGRID_EXPORT
void SetChar(
unsigned int col,
unsigned int row,
char ch )
640 Char( col, row, Char_t( ch ) );
657 unsigned char rgba[] )
659 Char( col, row, Char_t( ch ) );
672 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
const char* s )
689 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
unsigned int col,
unsigned int row,
const char* s )
707 GLSGEN_GLSTEXTGRID_EXPORT
void SetString(
710 unsigned char rgba[],
721 GLSGEN_GLSTEXTGRID_EXPORT
void VaSetString(
const char* format, ... );
756 unsigned char rgba[],
763 GLSGEN_GLSTEXTGRID_EXPORT
bool LeftToRight(
void );
768 GLSGEN_GLSTEXTGRID_EXPORT
void LeftToRight(
bool leftToRight );
793 bool _numRowsChanged;
813 GLSGEN_GLSTEXTGRID_EXPORT
void EraseIndex(
unsigned int textIndex );
820 if( !_perCharAttribs )
822 _perCharAttribs =
true;
834 GLSGEN_GLSTEXTGRID_EXPORT
char*
FormatVarArgList(
const char* format, va_list args );
839 GLSGEN_GLSTEXTGRID_EXPORT
float BoxHeight();
844 GLSGEN_GLSTEXTGRID_EXPORT
float BoxWidth();
851 unsigned int IndexOf(
unsigned int col,
unsigned int row )
const
853 unsigned int index( 0 );
855 if( col < _cols && row < _rows )
857 index = ( row *
_cols ) + col;
861 index = _rows *
_cols;
869 GLSGEN_GLSTEXTGRID_EXPORT
float JustificationOffset(
unsigned int row );
874 GLSGEN_GLSTEXTGRID_EXPORT
float LinePixelWidth(
unsigned int line,
float cellWidth )
const;
879 GLSGEN_GLSTEXTGRID_EXPORT
void Rebuild();
884 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcCellSize();
889 GLSGEN_GLSTEXTGRID_EXPORT
void RecalcVertices();
894 GLSGEN_GLSTEXTGRID_EXPORT
void ResizeGrid();
902 GLSGEN_GLSTEXTGRID_EXPORT
903 unsigned int TextIndexOf(
unsigned int col,
unsigned int row,
unsigned int startRow = 0 )
const;
910 GLSGEN_GLSTEXTGRID_EXPORT
911 unsigned int GridIndexOf(
unsigned int col,
unsigned int row )
const;
938 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
963 void IgnoreShadowAndHalo()
965 _allowShadow =
false;
970 const float _cellWidth;
971 const float _cellHeight;
975 const Vector _shadowOffset;
980 const float _underlineOffset;
981 const float _underlineSize;
985 const float _haloOffset;
989 const bool _leftToRight;
992 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
997 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
1002 typedef std::list<LineSegment_t> LineSegmentCont_t;
1003 LineSegmentCont_t _lineSegments;
1008 void OnCellDimensionChanged()
1013 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:653
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
void SetString(unsigned int col, unsigned int row, const char *s)
Definition: gls_text_grid.h:689
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)
virtual void SetValue(int spec, va_list &args)
Definition: dynamic_array.h:66
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:296
unsigned int _cols
Definition: gls_text_grid.h:788
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
The disti::GlsQuadListVC_3D and GlsQuadListVCT_2D classes.
bool _perCharAttribs
Definition: gls_text_grid.h:800
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:818
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:837
CharAttrCont_t _chars
Definition: gls_text.h:782
void EraseIndex(unsigned int textIndex)
Definition: gls_quad_storage.h:158
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:804
void SetChar(unsigned int col, unsigned int row, char ch)
Definition: gls_text_grid.h:638
Definition: gls_glo_file.h:988
float pixelWidth
Definition: gls_text_grid.h:784
Justify_t Justify() const
Definition: gls_text.h:551
virtual void Calculate(double time)
float CellWidth() const
Definition: gls_text.h:394
UnicodeString _unicodeText
Definition: gls_text_grid.h:807
virtual void CalculateRowData(void)
Definition: gls_text_grid.h:920
RowInfo * _rowInfo
Definition: gls_text_grid.h:802
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:614
unsigned int startingIndex
Definition: gls_text_grid.h:781
Definition: gls_color.h:53
virtual void CopyProperties(DisplayObject *src)
unsigned int IndexOf(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:851
unsigned int Rows() const
Definition: gls_text_grid.h:416
Definition: gls_text_grid.h:779
void Center(bool flag)
Definition: gls_text_grid.h:605
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:672
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:416
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:669
void SetRebuild()
Definition: gls_text.h:713
void String(unsigned int startCol, unsigned int startRow, const char *s)
Definition: gls_text_grid.h:489
unsigned int length
Definition: gls_text_grid.h:783
void ClearChars(void)
Definition: gls_text_grid.h:623
void Rows(unsigned int newRows)
Definition: gls_text_grid.h:424
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
void Size(unsigned int cols, unsigned int rows)
float CellHeight() const
Definition: gls_text.h:380
unsigned int _rows
Definition: gls_text_grid.h:791