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
66#define LIB_BASE_NAME "gls_text_grid"
75#define SET_CHAR_RANGE( startCol, startRow, len, attribute, value ) \
77 unsigned int charsSet( 0 ); \
78 unsigned int col( startCol ); \
79 bool notifyChanged = false; \
81 if( startCol < _cols && startRow < _rows ) \
83 for( unsigned int row = startRow; ( row < _rows ) && ( charsSet < len ); ++row ) \
85 for( ; ( col < _cols ) && ( charsSet < len ); ++col ) \
87 if( _chars[ IndexOf( col, row ) ].attribute != value ) \
89 _chars[ IndexOf( col, row ) ].attribute = value; \
90 notifyChanged = true; \
100 EnablePerCharAttribs(); \
112class GlsGloFileAttribute;
118 GLS_TEXT_GRID_SIZE = GLS_LAST_TEXT_INITIALIZER + 1,
119 GLS_TEXT_GRID_LEFT_TO_RIGHT
146 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
150 friend class GlsTextGridEditor;
190 float baselineShift );
199 unsigned int startCol,
200 unsigned int startRow,
202 float baselineShift );
221 unsigned int startCol,
222 unsigned int startRow,
246 unsigned int startCol,
247 unsigned int startRow,
278 unsigned int startCol,
279 unsigned int startRow,
292 float horizontalSpacing );
302 unsigned int startCol,
303 unsigned int startRow,
305 float horizontalSpacing );
346 unsigned int startCol,
347 unsigned int startRow,
357 unsigned int startCol,
358 unsigned int startRow,
360 unsigned int endRow );
376 unsigned int startCol,
377 unsigned int startRow,
403 unsigned int startCol,
404 unsigned int startRow,
425 void Rows(
unsigned int newRows )
468 unsigned int startCol,
469 unsigned int startRow,
480 unsigned int startCol,
481 unsigned int startRow,
482 const std::string& s );
490 void String(
unsigned int startCol,
unsigned int startRow,
const char* s )
492 String( startCol, startRow, std::string( s ) );
512 unsigned int startCol,
513 unsigned int startRow,
524 unsigned int col = 0,
525 unsigned int row = 0 )
const;
544 unsigned int startCol,
545 unsigned int startRow,
569 unsigned int startCol,
570 unsigned int startRow,
590 unsigned char rgba[],
658 unsigned char rgba[] )
711 unsigned char rgba[],
757 unsigned char rgba[],
848 unsigned int IndexOf(
unsigned int col,
unsigned int row )
const
850 unsigned int index( 0 );
854 index = ( row *
_cols ) + col;
895 unsigned int TextIndexOf(
unsigned int col,
unsigned int row,
unsigned int startRow = 0 )
const;
903 unsigned int GridIndexOf(
unsigned int col,
unsigned int row )
const;
930 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar=0)
Definition: dynamic_array.h:79
Definition: gls_color.h:54
Definition: gls_glo_file.h:1243
Definition: gls_quad_storage.h:160
Definition: gls_quad_storage.h:64
Definition: gls_text_grid.h:913
float _underlineY
Current underline state Y coordinate.
Definition: gls_text_grid.h:987
bool _allowShadow
Whether or not shadows are being drawn in general.
Definition: gls_text_grid.h:970
const float _cellHeight
Width of each character cell in the grid in logical units.
Definition: gls_text_grid.h:964
const bool _leftToRight
If true, characters are rendered left to right, otherwise right to left.
Definition: gls_text_grid.h:982
bool _strikeOn
If true, strike through drawing is enabled.
Definition: gls_text_grid.h:998
void IgnoreShadowAndHalo()
Sets the shadow visibility flag to false.
Definition: gls_text_grid.h:956
bool _underlineOn
If true, underline drawing is enabled.
Definition: gls_text_grid.h:990
float _underlineX1
Current underline state left X coordinate.
Definition: gls_text_grid.h:985
LineSegmentCont_t _lineSegments
The list of line segments to draw.
Definition: gls_text_grid.h:1002
float _underlineScale
Current underline drawing scale.
Definition: gls_text_grid.h:988
const GlsColor _shadowColor
Color of the shadow effect behind the characters.
Definition: gls_text_grid.h:969
const GlsColor _haloColor
Color of the halo effect behind the characters.
Definition: gls_text_grid.h:979
const float _underlineOffset
Vertical offset of the underline in logical units.
Definition: gls_text_grid.h:973
float _strikeX2
Current strike through state right X coordinate.
Definition: gls_text_grid.h:994
void ProcessCharacter(const CharAttr_t &charAttr, float cellX, float nextCellX, float charY, bool endOfLine)
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)
float _strikeY
Current strike through state Y coordinate.
Definition: gls_text_grid.h:995
std::list< LineSegment_t > LineSegmentCont_t
Typedef for a list of line segments.
Definition: gls_text_grid.h:1001
const bool _shadow
Whether or not the shadow effect is on.
Definition: gls_text_grid.h:967
const bool _halo
Whether or not the halo effect is on.
Definition: gls_text_grid.h:977
float _underlineX2
Current underline state right X coordinate.
Definition: gls_text_grid.h:986
const float _haloOffset
Offset multiplier for the halo effect.
Definition: gls_text_grid.h:978
GlsColor _underlineColor
Current underline drawing color.
Definition: gls_text_grid.h:989
const float _underlineSize
Thickness of the underline in logical units.
Definition: gls_text_grid.h:974
const float _cellWidth
Height of each character cell in the grid in logical units.
Definition: gls_text_grid.h:963
void RenderLineSegments(GlsQuadListVC_3D &quadStorage)
float _strikeScale
Current strike through drawing scale.
Definition: gls_text_grid.h:996
GlsColor _strikeColor
Current strike through drawing color.
Definition: gls_text_grid.h:997
float _strikeX1
Current strike through state left X coordinate.
Definition: gls_text_grid.h:993
const Vector _shadowOffset
Offset of the shadow effect from the characters. Z component is ignored.
Definition: gls_text_grid.h:968
Definition: gls_text_grid.h:127
GlsQuadListVCT_2D _shadows
Quads used to render the shadow behind the text.
Definition: gls_text_grid.h:135
void EraseIndex(unsigned int textIndex)
GlsColor TextColor(unsigned int col=0, unsigned int row=0) const
unsigned int LineLength(unsigned int row) const
void Inverse(unsigned int col, unsigned int row, bool inverse)
char * FormatVarArgList(const char *format, va_list args)
void SetString(unsigned int col, unsigned int row, const char *s)
Definition: gls_text_grid.h:690
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual void Draw() DISTI_METHOD_OVERRIDE
float JustificationOffset(unsigned int row)
float LinePixelWidth(unsigned int line, float cellWidth) const
GlsQuadListVCT_2D _characters
Quads used to render the characters in the foreground.
Definition: gls_text_grid.h:137
void EnablePerCharAttribs()
Definition: gls_text_grid.h:819
void Size(unsigned int cols, unsigned int rows)
UTF16String _unicodeText
Definition: gls_text_grid.h:808
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
bool _leftToRight
Definition: gls_text_grid.h:805
void String(unsigned int startCol, unsigned int startRow, const std::string &s)
virtual void CalculateRowData()
virtual void SetFromGloData(GlsGloFileAttribute &data) DISTI_METHOD_OVERRIDE
bool _perCharAttribs
Definition: gls_text_grid.h:801
void Char(unsigned int col, unsigned int row, Char_t code)
void String(unsigned int startCol, unsigned int startRow, const char *s)
Definition: gls_text_grid.h:490
void PopulateQuadStorage()
bool _numRowsChanged
If true (note that this is a flag despite the name) the row information will be rebuilt.
Definition: gls_text_grid.h:794
void VaString(const char *format,...)
void LeftToRight(bool leftToRight)
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
void SetChar(unsigned int col, unsigned int row, char ch)
Definition: gls_text_grid.h:639
GlsQuadListVC_3D _shadowLines
Quads used to render the shadows for lines such as underlines and strikethroughs.
Definition: gls_text_grid.h:136
void Underline(unsigned int startCol, unsigned int startRow, unsigned int len, bool underline)
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler) DISTI_METHOD_OVERRIDE
void VaSetString(const char *format,...)
void Inverse(unsigned int startCol, unsigned int startRow, unsigned int len, bool inverse)
void ClearChars()
Definition: gls_text_grid.h:624
void VaString(unsigned int startCol, unsigned int startRow, const char *format,...)
void VaSetString(unsigned int col, unsigned int row, unsigned char rgba[], const char *format,...)
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
void Underline(unsigned int col, unsigned int row, bool underline)
virtual void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
virtual void SetVertices(unsigned int nPoints, Vertex *vertices) DISTI_METHOD_OVERRIDE
unsigned int GridIndexOf(unsigned int col, unsigned int row) const
void SetString(const char *s)
Definition: gls_text_grid.h:673
void Columns(unsigned int newCols)
Definition: gls_text_grid.h:319
void Clear()
Definition: gls_text_grid.h:615
unsigned int _cols
Definition: gls_text_grid.h:789
void CharScaling(unsigned int col, unsigned int row, float newScale)
GlsQuadListVC_3D _backgrounds
Quads used to render the backgrounds. This is rendered behind the other quads associated with this te...
Definition: gls_text_grid.h:134
unsigned int _rows
Definition: gls_text_grid.h:792
void TextColor(unsigned int startCol, unsigned int startRow, unsigned int len, const GlsColor &color)
GlsQuadListVC_3D _lines
Quads used to render lines such as underlines and strikethroughs.
Definition: gls_text_grid.h:138
virtual void Initialize()
Sets the initial state of this object.
void CharScaling(unsigned int startCol, unsigned int startRow, unsigned int len, float newScale)
unsigned int Columns() const
Definition: gls_text_grid.h:311
void SetString(unsigned int col, unsigned int row, unsigned char rgba[], const char *s)
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
void TextColor(unsigned int col, unsigned int row, const GlsColor &color)
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
unsigned int Rows() const
Definition: gls_text_grid.h:417
RowInfo * _rowInfo
Definition: gls_text_grid.h:803
void StrikeThru(unsigned int col, unsigned int row, bool strike)
void StrikeThru(unsigned int startCol, unsigned int startRow, unsigned int len, bool strike)
void CharSpacing(unsigned int startCol, unsigned int startRow, unsigned int len, float horizontalSpacing)
void VaString(unsigned int col, unsigned int row, unsigned char rgba[], const char *format,...)
unsigned int TextIndexOf(unsigned int col, unsigned int row, unsigned int startRow=0) const
void Rows(unsigned int newRows)
Definition: gls_text_grid.h:425
void VaSetString(unsigned int col, unsigned int row, const char *format,...)
CharAttr_t CharAttr(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:254
unsigned int IndexOf(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:848
void Center(bool flag)
Definition: gls_text_grid.h:606
void CharSpacing(unsigned int col, unsigned int row, float horizontalSpacing)
void SetChar(unsigned int col, unsigned int row, char ch, unsigned char rgba[])
Definition: gls_text_grid.h:654
void Rebuild()
Rebuilds this text grid layout. This may be an expensive call, so it should only be called when a pro...
Definition: gls_text.h:154
float CellHeight() const
Definition: gls_text.h:260
float CellWidth() const
Definition: gls_text.h:274
void SetRebuild()
Definition: gls_text.h:583
CharAttrCont_t _chars
Definition: gls_text.h:661
GlsFontBase::Char_t Char_t
Typedef shorthand for GlsFontBase::Char_t.
Definition: gls_text.h:160
Justify_t Justify() const
Definition: gls_text.h:422
std::string String() const
Definition: gls_text.h:539
std::string _text
Definition: gls_text.h:714
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
The disti::GlsQuadListVC_3D and GlsQuadListVCT_2D classes.
The disti::GlsText class.
#define GLSGEN_GLSTEXTGRID_EXPORT
Provides support for creating DLLs.
Definition: gls_text_grid.h:61
Definition: bmpimage.h:47
std::basic_string< unsigned short, CharTraitsUnsignedShort > UTF16String
A cross platform UTF-16 encoded string.
Definition: util.h:428
Definition: gls_text_grid.h:781
unsigned int startingIndex
Definition: gls_text_grid.h:782
float pixelWidth
Definition: gls_text_grid.h:785
unsigned int length
Definition: gls_text_grid.h:784
Attributes for each character position in the grid.
Definition: gls_text.h:179
The DistiUnhideGlobalsDummyClass class.