40#ifndef _GLS_TEXT_BOX_H
41#define _GLS_TEXT_BOX_H
44#if( defined( GLSGEN_EXPORT_GLSTEXTBOX ) || defined( GLSGEN_IMPORT_GLSTEXTBOX ) || defined( GLSGEN_GLSTEXTBOX_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
45 && defined( _MSC_VER )
46# if defined( GLSGEN_EXPORT_GLSTEXTBOX ) || defined( GLSGEN_GLSTEXTBOX_EXPORT_GENERATED )
47# define GLSGEN_GLSTEXTBOX_EXPORT __declspec( dllexport )
49# define GLSGEN_GLSTEXTBOX_EXPORT __declspec( dllimport )
52# define GLSGEN_GLSTEXTBOX_EXPORT
69#define LIB_BASE_NAME "gls_text_box"
82class GlsGloFileAttribute;
105 void PopulateQuadStorage();
113 RESIZE_MODE_AUTO_WIDTH,
114 RESIZE_MODE_AUTO_HEIGHT
117 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
121 friend class GlsTextBoxEditor;
267 unsigned int* lineEndIndex,
268 unsigned int* nextLineStringIndex,
270 float* lineLengthPixels );
377 unsigned int& rowLength,
378 float& rowPixelWidth,
379 unsigned int& nextRowStartIndex )
const;
446 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
557 if( str ==
"ALIGN_TOP" )
559 j = disti::GlsTextBox::ALIGN_TOP;
561 else if( str ==
"ALIGN_CENTER" )
563 j = disti::GlsTextBox::ALIGN_CENTER;
565 else if( str ==
"ALIGN_BOTTOM" )
567 j = disti::GlsTextBox::ALIGN_BOTTOM;
580 case disti::GlsTextBox::ALIGN_TOP:
581 outstr <<
"ALIGN_TOP";
583 case disti::GlsTextBox::ALIGN_CENTER:
584 outstr <<
"ALIGN_CENTER";
586 case disti::GlsTextBox::ALIGN_BOTTOM:
587 outstr <<
"ALIGN_BOTTOM";
602 if( str ==
"RESIZE_MODE_FIXED" )
604 direction = disti::GlsTextBox::RESIZE_MODE_FIXED;
606 else if( str ==
"RESIZE_MODE_AUTO_WIDTH" )
608 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH;
610 else if( str ==
"RESIZE_MODE_AUTO_HEIGHT" )
612 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT;
625 case disti::GlsTextBox::RESIZE_MODE_FIXED:
626 outstr <<
"RESIZE_MODE_FIXED";
628 case disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH:
629 outstr <<
"RESIZE_MODE_AUTO_WIDTH";
631 case disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT:
632 outstr <<
"RESIZE_MODE_AUTO_HEIGHT";
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_box.h:429
void AllowShadow()
Sets the underlying shadow visibility flag to true.
float _underlineY
Current underline state Y coordinate.
Definition: gls_text_box.h:517
bool _whiteSpaceYes
If true, the currently processed character is whitespace.
Definition: gls_text_box.h:531
bool _allowShadow
Whether or not shadows are being drawn in general.
Definition: gls_text_box.h:500
const float _cellHeight
Width of each character cell in the grid in logical units.
Definition: gls_text_box.h:494
const bool _leftToRight
If true, characters are rendered left to right, otherwise right to left.
Definition: gls_text_box.h:512
bool _strikeOn
If true, strike through drawing is enabled.
Definition: gls_text_box.h:528
bool _underlineOn
If true, underline drawing is enabled.
Definition: gls_text_box.h:520
float _underlineX1
Current underline state left X coordinate.
Definition: gls_text_box.h:515
void RenderLineSegments()
LineSegmentCont_t _lineSegments
The list of line segments to draw.
Definition: gls_text_box.h:535
float _underlineScale
Current underline drawing scale.
Definition: gls_text_box.h:518
const GlsColor _shadowColor
Color of the shadow effect behind the characters.
Definition: gls_text_box.h:499
const GlsColor _haloColor
Color of the halo effect behind the characters.
Definition: gls_text_box.h:509
const float _underlineOffset
Vertical offset of the underline in logical units.
Definition: gls_text_box.h:503
float _strikeX2
Current strike through state right X coordinate.
Definition: gls_text_box.h:524
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_box.h:525
std::list< LineSegment_t > LineSegmentCont_t
Typedef for a list of line segments.
Definition: gls_text_box.h:534
const bool _shadow
Whether or not the shadow effect is on.
Definition: gls_text_box.h:497
const bool _halo
Whether or not the halo effect is on.
Definition: gls_text_box.h:507
void PostProcessCharacter(const CharAttr_t &charAttr, const Char_t &c, float cellX, float charY, float cellWidth, bool endOfLine)
float _underlineX2
Current underline state right X coordinate.
Definition: gls_text_box.h:516
const float _haloOffset
Offset multiplier for the halo effect.
Definition: gls_text_box.h:508
GlsColor _underlineColor
Current underline drawing color.
Definition: gls_text_box.h:519
const float _underlineSize
Thickness of the underline in logical units.
Definition: gls_text_box.h:504
void PreProcessCharacter(const CharAttr_t &charAttr, const Char_t &c, float cellX, float charY)
const float _cellWidth
Height of each character cell in the grid in logical units.
Definition: gls_text_box.h:493
void IgnoreShadow()
Sets the underlying shadow visibility flag to false.
float _strikeScale
Current strike through drawing scale.
Definition: gls_text_box.h:526
GlsColor _strikeColor
Current strike through drawing color.
Definition: gls_text_box.h:527
float _strikeX1
Current strike through state left X coordinate.
Definition: gls_text_box.h:523
const Vector _shadowOffset
Offset of the shadow effect from the characters. Z component is ignored.
Definition: gls_text_box.h:498
Definition: gls_text_box.h:90
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
char * FormatVarArgList(const char *format, va_list args)
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual Align_t VerticalAlignment() const
Definition: gls_text_box.h:212
virtual void Draw() DISTI_METHOD_OVERRIDE
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
float _tabSpacing
Space multiplier for tabs.
Definition: gls_text_box.h:348
float _cellWidthRatio
Holds cell width / max char width ratio used for horizontal advance.
Definition: gls_text_box.h:413
void EnablePerCharAttribs()
Enable per character attribute drawing for this grid.
Definition: gls_text_box.h:337
UTF16String _unicodeText
Definition: gls_text_box.h:425
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
bool _leftToRight
true to render characters from left to right else, false for right to left.
Definition: gls_text_box.h:419
virtual void CalculateRowData()
void VerticalAlignment(Align_t justification)
void GetNextRowInfo(const unsigned int strIndex, unsigned int &rowLength, float &rowPixelWidth, unsigned int &nextRowStartIndex) const
virtual unsigned int MaxLinesToDraw()
Align_t
Different text justifications.
Definition: gls_text_box.h:198
float _resizeMaxWidth
The calculated maximum width in logical units based on the current resize behavior.
Definition: gls_text_box.h:422
bool _perCharAttribs
Definition: gls_text_box.h:334
float GetCharWidth(const unsigned short c) const
unsigned int _lineCount
Number of rows of characters in the text grid (number of lines).
Definition: gls_text_box.h:408
void VaString(const char *format,...)
void LeftToRight(bool leftToRight)
virtual ResizeMode_t ResizeMode()
void SetVerticesToTextBounds()
Helper function that adjusts the vertices to contain the text based on the resize behavior.
virtual void MaxWidth(float value)
void ClearChars()
Definition: gls_text_box.h:236
ResizeMode_t _resizeMode
The current automatic resize behavior.
Definition: gls_text_box.h:421
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
virtual void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
virtual void SetVertices(unsigned int nPoints, Vertex *vertices) DISTI_METHOD_OVERRIDE
void SetString(const char *s)
Definition: gls_text_box.h:251
virtual void ResizeMode(ResizeMode_t value)
float _maxLineLengthPixels
Calculated maximimum line width in "pixels" (logical units).
Definition: gls_text_box.h:415
virtual float MaxHeight()
void Clear()
Definition: gls_text_box.h:227
unsigned int _maxLinesToDraw
Calculated maximum number of lines that can fit.
Definition: gls_text_box.h:417
virtual void MaxHeight(float value)
bool _lineCountChanged
If true, the line count has changed, and row information needs to be rebuilt.
Definition: gls_text_box.h:409
virtual void Initialize()
Sets the initial state of this object.
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
RowInfo * _rowInfo
Definition: gls_text_box.h:411
Align_t _verticalAlignment
Justification setting (TOP, CENTER, BOTTOM).
Definition: gls_text_box.h:346
ResizeMode_t
The ResizeMode_t enumeration. Describes the resize behavior of this text object.
Definition: gls_text_box.h:111
float GetMaxLineLengthForResizeMode() const
float _resizeMaxHeight
The calculated maximim height in logical units based on the current resize behavior.
Definition: gls_text_box.h:423
void Rebuild()
Rebuilds this text box layout. This may be an expensive call, so it should only be called when a prop...
float _maxTextHeightPixels
Calculated maximimum height in "pixels" (logical units).
Definition: gls_text_box.h:416
Definition: gls_text.h:154
float CellHeight() const
Definition: gls_text.h:260
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:297
float CellWidth() const
Definition: gls_text.h:274
bool _needToRebuild
Definition: gls_text.h:703
void SetRebuild()
Definition: gls_text.h:583
GlsFontBase::Char_t Char_t
Typedef shorthand for GlsFontBase::Char_t.
Definition: gls_text.h:160
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
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:235
#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::GlsStateManager factory class. Creates an instance of a state manager that manages the GL ...
The disti::GlsText class.
#define GLSGEN_GLSTEXTBOX_EXPORT
Provides support for creating DLLs.
Definition: gls_text_box.h:52
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
std::ostream & operator<<(std::ostream &outstr, const AttributeName &name)
std::istream & operator>>(std::istream &instr, GlsColor &color)
std::basic_string< unsigned short, CharTraitsUnsignedShort > UTF16String
A cross platform UTF-16 encoded string.
Definition: util.h:428
Definition: gls_text_box.h:401
unsigned int startingIndex
Definition: gls_text_box.h:402
float pixelWidth
Definition: gls_text_box.h:405
unsigned int length
Definition: gls_text_box.h:404
Attributes for each character position in the grid.
Definition: gls_text.h:179
The DistiUnhideGlobalsDummyClass class.