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
140 void PopulateQuadStorage();
144 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
148 friend class GlsTextGridEditor;
188 float baselineShift );
197 unsigned int startCol,
198 unsigned int startRow,
200 float baselineShift );
219 unsigned int startCol,
220 unsigned int startRow,
244 unsigned int startCol,
245 unsigned int startRow,
276 unsigned int startCol,
277 unsigned int startRow,
290 float horizontalSpacing );
300 unsigned int startCol,
301 unsigned int startRow,
303 float horizontalSpacing );
344 unsigned int startCol,
345 unsigned int startRow,
355 unsigned int startCol,
356 unsigned int startRow,
358 unsigned int endRow );
374 unsigned int startCol,
375 unsigned int startRow,
401 unsigned int startCol,
402 unsigned int startRow,
423 void Rows(
unsigned int newRows )
466 unsigned int startCol,
467 unsigned int startRow,
478 unsigned int startCol,
479 unsigned int startRow,
480 const std::string& s );
488 void String(
unsigned int startCol,
unsigned int startRow,
const char* s )
490 String( startCol, startRow, std::string( s ) );
510 unsigned int startCol,
511 unsigned int startRow,
522 unsigned int col = 0,
523 unsigned int row = 0 )
const;
542 unsigned int startCol,
543 unsigned int startRow,
567 unsigned int startCol,
568 unsigned int startRow,
588 unsigned char rgba[],
656 unsigned char rgba[] )
709 unsigned char rgba[],
755 unsigned char rgba[],
846 unsigned int IndexOf(
unsigned int col,
unsigned int row )
const
848 unsigned int index( 0 );
852 index = ( row *
_cols ) + col;
893 unsigned int TextIndexOf(
unsigned int col,
unsigned int row,
unsigned int startRow = 0 )
const;
901 unsigned int GridIndexOf(
unsigned int col,
unsigned int row )
const;
928 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:54
Definition: gls_glo_file.h:1243
Definition: gls_quad_storage.h:160
Definition: gls_quad_storage.h:64
Definition: gls_text_grid.h:911
float _underlineY
Current underline state Y coordinate.
Definition: gls_text_grid.h:985
bool _allowShadow
Whether or not shadows are being drawn in general.
Definition: gls_text_grid.h:968
const float _cellHeight
Width of each character cell in the grid in logical units.
Definition: gls_text_grid.h:962
const bool _leftToRight
If true, characters are rendered left to right, otherwise right to left.
Definition: gls_text_grid.h:980
bool _strikeOn
If true, strike through drawing is enabled.
Definition: gls_text_grid.h:996
void IgnoreShadowAndHalo()
Sets the shadow visibility flag to false.
Definition: gls_text_grid.h:954
bool _underlineOn
If true, underline drawing is enabled.
Definition: gls_text_grid.h:988
float _underlineX1
Current underline state left X coordinate.
Definition: gls_text_grid.h:983
void RenderLineSegments()
LineSegmentCont_t _lineSegments
The list of line segments to draw.
Definition: gls_text_grid.h:1000
float _underlineScale
Current underline drawing scale.
Definition: gls_text_grid.h:986
const GlsColor _shadowColor
Color of the shadow effect behind the characters.
Definition: gls_text_grid.h:967
const GlsColor _haloColor
Color of the halo effect behind the characters.
Definition: gls_text_grid.h:977
const float _underlineOffset
Vertical offset of the underline in logical units.
Definition: gls_text_grid.h:971
float _strikeX2
Current strike through state right X coordinate.
Definition: gls_text_grid.h:992
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:993
std::list< LineSegment_t > LineSegmentCont_t
Typedef for a list of line segments.
Definition: gls_text_grid.h:999
const bool _shadow
Whether or not the shadow effect is on.
Definition: gls_text_grid.h:965
const bool _halo
Whether or not the halo effect is on.
Definition: gls_text_grid.h:975
float _underlineX2
Current underline state right X coordinate.
Definition: gls_text_grid.h:984
const float _haloOffset
Offset multiplier for the halo effect.
Definition: gls_text_grid.h:976
GlsColor _underlineColor
Current underline drawing color.
Definition: gls_text_grid.h:987
const float _underlineSize
Thickness of the underline in logical units.
Definition: gls_text_grid.h:972
const float _cellWidth
Height of each character cell in the grid in logical units.
Definition: gls_text_grid.h:961
float _strikeScale
Current strike through drawing scale.
Definition: gls_text_grid.h:994
GlsColor _strikeColor
Current strike through drawing color.
Definition: gls_text_grid.h:995
float _strikeX1
Current strike through state left X coordinate.
Definition: gls_text_grid.h:991
const Vector _shadowOffset
Offset of the shadow effect from the characters. Z component is ignored.
Definition: gls_text_grid.h:966
Definition: gls_text_grid.h:127
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
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:688
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual void Draw() DISTI_METHOD_OVERRIDE
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
float JustificationOffset(unsigned int row)
float LinePixelWidth(unsigned int line, float cellWidth) const
void EnablePerCharAttribs()
Definition: gls_text_grid.h:817
void Size(unsigned int cols, unsigned int rows)
UTF16String _unicodeText
Definition: gls_text_grid.h:806
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
bool _leftToRight
Definition: gls_text_grid.h:803
void String(unsigned int startCol, unsigned int startRow, const std::string &s)
virtual void CalculateRowData()
bool _perCharAttribs
Definition: gls_text_grid.h:799
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:488
bool _numRowsChanged
If true (note that this is a flag despite the name) the row information will be rebuilt.
Definition: gls_text_grid.h:792
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:637
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:622
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:671
void Columns(unsigned int newCols)
Definition: gls_text_grid.h:317
void Clear()
Definition: gls_text_grid.h:613
unsigned int _cols
Definition: gls_text_grid.h:787
void CharScaling(unsigned int col, unsigned int row, float newScale)
unsigned int _rows
Definition: gls_text_grid.h:790
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)
unsigned int Columns() const
Definition: gls_text_grid.h:309
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:415
RowInfo * _rowInfo
Definition: gls_text_grid.h:801
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:423
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:252
unsigned int IndexOf(unsigned int col, unsigned int row) const
Definition: gls_text_grid.h:846
void Center(bool flag)
Definition: gls_text_grid.h:604
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:652
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:457
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
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
Force inclusion of the DirectShow library.
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:779
unsigned int startingIndex
Definition: gls_text_grid.h:780
float pixelWidth
Definition: gls_text_grid.h:783
unsigned int length
Definition: gls_text_grid.h:782
Attributes for each character position in the grid.
Definition: gls_text.h:179
The DistiUnhideGlobalsDummyClass class.