39#ifndef DISTI_INCLUDED_GLS_TEXT_GRID_H
40#define DISTI_INCLUDED_GLS_TEXT_GRID_H
52#if( defined( GLSGEN_EXPORT_GLSTEXTGRID ) || defined( GLSGEN_IMPORT_GLSTEXTGRID ) || defined( GLSGEN_GLSTEXTGRID_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
53 && defined( _MSC_VER )
54# if defined( GLSGEN_EXPORT_GLSTEXTGRID ) || defined( GLSGEN_GLSTEXTGRID_EXPORT_GENERATED )
55# define GLSGEN_GLSTEXTGRID_EXPORT __declspec( dllexport )
57# define GLSGEN_GLSTEXTGRID_EXPORT __declspec( dllimport )
60# define GLSGEN_GLSTEXTGRID_EXPORT
65#define LIB_BASE_NAME "gls_text_grid"
74#define SET_CHAR_RANGE( startCol, startRow, len, attribute, value ) \
76 unsigned int charsSet( 0 ); \
77 unsigned int col( startCol ); \
78 bool notifyChanged = false; \
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 if( _chars[ IndexOf( col, row ) ].attribute != value ) \
88 _chars[ IndexOf( col, row ) ].attribute = value; \
89 notifyChanged = true; \
99 EnablePerCharAttribs(); \
111class GlsGloFileAttribute;
117 GLS_TEXT_GRID_SIZE = GLS_LAST_TEXT_INITIALIZER + 1,
118 GLS_TEXT_GRID_LEFT_TO_RIGHT
141 void PopulateQuadStorage();
145 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
149 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[],
639 void SetChar(
unsigned int col,
unsigned int row,
char ch )
658 unsigned char rgba[] )
690 void SetString(
unsigned int col,
unsigned int row,
const char* s )
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 PreDraw(const OpenGLMatrices ¤t, Culler &culler)
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar=0)
Definition: dynamic_array.h:79
Definition: gls_color.h:53
Definition: gls_glo_file.h:1241
Definition: gls_quad_storage.h:156
Definition: gls_quad_storage.h:60
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
void RenderLineSegments()
Render the line segments for the underline / strikethru.
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
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:126
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)
void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
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
float JustificationOffset(unsigned int row)
void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
float LinePixelWidth(unsigned int line, float cellWidth) const
void EnablePerCharAttribs()
Definition: gls_text_grid.h:819
void Size(unsigned int cols, unsigned int rows)
UTF16String _unicodeText
Definition: gls_text_grid.h:808
void CopyProperties(DisplayObject *src) 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()
bool _perCharAttribs
Definition: gls_text_grid.h:801
void Char(unsigned int col, unsigned int row, Char_t code)
void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
void String(unsigned int startCol, unsigned int startRow, const char *s)
Definition: gls_text_grid.h:490
void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
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)
void SetChar(unsigned int col, unsigned int row, char ch)
Definition: gls_text_grid.h:639
void Underline(unsigned int startCol, unsigned int startRow, unsigned int len, bool underline)
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,...)
void SetVertices(unsigned int nPoints, Vertex *vertices) DISTI_METHOD_OVERRIDE
void Draw() DISTI_METHOD_OVERRIDE
void Underline(unsigned int col, unsigned int row, bool underline)
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)
unsigned int _rows
Definition: gls_text_grid.h:792
void TextColor(unsigned int startCol, unsigned int startRow, unsigned int len, const GlsColor &color)
virtual void Initialize()
Sets the initial state of this object.
void CharScaling(unsigned int startCol, unsigned int startRow, unsigned int len, float newScale)
void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
unsigned int Columns() const
Definition: gls_text_grid.h:311
void SetString(unsigned int col, unsigned int row, unsigned char rgba[], const char *s)
void TextColor(unsigned int col, unsigned int row, const GlsColor &color)
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 Calculate(double time) DISTI_METHOD_OVERRIDE
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,...)
DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
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
InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
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:152
virtual Justify_t Justify() const
Definition: gls_text.h:420
virtual float CellWidth() const
Definition: gls_text.h:272
virtual GlsColor BgColor()
virtual float CharSpacing()
virtual GlsColor TextColor()
virtual void SetRebuild()
Definition: gls_text.h:581
virtual float CharScaling()
virtual float CellHeight() const
Definition: gls_text.h:258
virtual bool StrikeThru()
CharAttrCont_t _chars
Definition: gls_text.h:659
virtual std::string String() const
Definition: gls_text.h:537
GlsFontBase::Char_t Char_t
Typedef shorthand for GlsFontBase::Char_t.
Definition: gls_text.h:158
std::string _text
Definition: gls_text.h:712
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:540
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:487
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:221
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:60
Definition: bmpimage.h:46
std::basic_string< unsigned short, CharTraitsUnsignedShort > UTF16String
A cross platform UTF-16 encoded string.
Definition: util.h:425
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:177
The DistiUnhideGlobalsDummyClass class.