39#ifndef DISTI_INCLUDED_GLS_TEXT_BOX_H
40#define DISTI_INCLUDED_GLS_TEXT_BOX_H
43#if( defined( GLSGEN_EXPORT_GLSTEXTBOX ) || defined( GLSGEN_IMPORT_GLSTEXTBOX ) || defined( GLSGEN_GLSTEXTBOX_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
44 && defined( _MSC_VER )
45# if defined( GLSGEN_EXPORT_GLSTEXTBOX ) || defined( GLSGEN_GLSTEXTBOX_EXPORT_GENERATED )
46# define GLSGEN_GLSTEXTBOX_EXPORT __declspec( dllexport )
48# define GLSGEN_GLSTEXTBOX_EXPORT __declspec( dllimport )
51# define GLSGEN_GLSTEXTBOX_EXPORT
68#define LIB_BASE_NAME "gls_text_box"
81class GlsGloFileAttribute;
106 void PopulateQuadStorage();
114 RESIZE_MODE_AUTO_WIDTH,
115 RESIZE_MODE_AUTO_HEIGHT
118 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
122 friend class GlsTextBoxEditor;
269 unsigned int* lineEndIndex,
270 unsigned int* nextLineStringIndex,
272 float* lineLengthPixels );
379 unsigned int& rowLength,
380 float& rowPixelWidth,
381 unsigned int& nextRowStartIndex )
const;
448 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
559 if( str ==
"ALIGN_TOP" )
561 j = disti::GlsTextBox::ALIGN_TOP;
563 else if( str ==
"ALIGN_CENTER" )
565 j = disti::GlsTextBox::ALIGN_CENTER;
567 else if( str ==
"ALIGN_BOTTOM" )
569 j = disti::GlsTextBox::ALIGN_BOTTOM;
582 case disti::GlsTextBox::ALIGN_TOP:
583 outstr <<
"ALIGN_TOP";
585 case disti::GlsTextBox::ALIGN_CENTER:
586 outstr <<
"ALIGN_CENTER";
588 case disti::GlsTextBox::ALIGN_BOTTOM:
589 outstr <<
"ALIGN_BOTTOM";
604 if( str ==
"RESIZE_MODE_FIXED" )
606 direction = disti::GlsTextBox::RESIZE_MODE_FIXED;
608 else if( str ==
"RESIZE_MODE_AUTO_WIDTH" )
610 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH;
612 else if( str ==
"RESIZE_MODE_AUTO_HEIGHT" )
614 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT;
627 case disti::GlsTextBox::RESIZE_MODE_FIXED:
628 outstr <<
"RESIZE_MODE_FIXED";
630 case disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH:
631 outstr <<
"RESIZE_MODE_AUTO_WIDTH";
633 case disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT:
634 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:53
Definition: gls_glo_file.h:1241
Definition: gls_quad_storage.h:156
Definition: gls_quad_storage.h:60
Definition: gls_text_box.h:431
void AllowShadow()
Sets the underlying shadow visibility flag to true.
float _underlineY
Current underline state Y coordinate.
Definition: gls_text_box.h:519
bool _whiteSpaceYes
If true, the currently processed character is whitespace.
Definition: gls_text_box.h:533
bool _allowShadow
Whether or not shadows are being drawn in general.
Definition: gls_text_box.h:502
const float _cellHeight
Width of each character cell in the grid in logical units.
Definition: gls_text_box.h:496
const bool _leftToRight
If true, characters are rendered left to right, otherwise right to left.
Definition: gls_text_box.h:514
bool _strikeOn
If true, strike through drawing is enabled.
Definition: gls_text_box.h:530
bool _underlineOn
If true, underline drawing is enabled.
Definition: gls_text_box.h:522
float _underlineX1
Current underline state left X coordinate.
Definition: gls_text_box.h:517
void RenderLineSegments()
LineSegmentCont_t _lineSegments
The list of line segments to draw.
Definition: gls_text_box.h:537
float _underlineScale
Current underline drawing scale.
Definition: gls_text_box.h:520
const GlsColor _shadowColor
Color of the shadow effect behind the characters.
Definition: gls_text_box.h:501
const GlsColor _haloColor
Color of the halo effect behind the characters.
Definition: gls_text_box.h:511
const float _underlineOffset
Vertical offset of the underline in logical units.
Definition: gls_text_box.h:505
float _strikeX2
Current strike through state right X coordinate.
Definition: gls_text_box.h:526
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:527
std::list< LineSegment_t > LineSegmentCont_t
Typedef for a list of line segments.
Definition: gls_text_box.h:536
const bool _shadow
Whether or not the shadow effect is on.
Definition: gls_text_box.h:499
const bool _halo
Whether or not the halo effect is on.
Definition: gls_text_box.h:509
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:518
const float _haloOffset
Offset multiplier for the halo effect.
Definition: gls_text_box.h:510
GlsColor _underlineColor
Current underline drawing color.
Definition: gls_text_box.h:521
const float _underlineSize
Thickness of the underline in logical units.
Definition: gls_text_box.h:506
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:495
void IgnoreShadow()
Sets the underlying shadow visibility flag to false.
float _strikeScale
Current strike through drawing scale.
Definition: gls_text_box.h:528
GlsColor _strikeColor
Current strike through drawing color.
Definition: gls_text_box.h:529
float _strikeX1
Current strike through state left X coordinate.
Definition: gls_text_box.h:525
const Vector _shadowOffset
Offset of the shadow effect from the characters. Z component is ignored.
Definition: gls_text_box.h:500
Definition: gls_text_box.h:89
void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
char * FormatVarArgList(const char *format, va_list args)
virtual Align_t VerticalAlignment() const
Definition: gls_text_box.h:214
float _tabSpacing
Space multiplier for tabs.
Definition: gls_text_box.h:350
float _cellWidthRatio
Holds cell width / max char width ratio used for horizontal advance.
Definition: gls_text_box.h:415
void EnablePerCharAttribs()
Enable per character attribute drawing for this grid.
Definition: gls_text_box.h:339
UTF16String _unicodeText
Definition: gls_text_box.h:427
void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
bool _leftToRight
true to render characters from left to right else, false for right to left.
Definition: gls_text_box.h:421
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:200
float _resizeMaxWidth
The calculated maximum width in logical units based on the current resize behavior.
Definition: gls_text_box.h:424
bool _perCharAttribs
Definition: gls_text_box.h:336
float GetCharWidth(const unsigned short c) const
void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
unsigned int _lineCount
Number of rows of characters in the text grid (number of lines).
Definition: gls_text_box.h:410
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:238
void SetVertices(unsigned int nPoints, Vertex *vertices) DISTI_METHOD_OVERRIDE
ResizeMode_t _resizeMode
The current automatic resize behavior.
Definition: gls_text_box.h:423
void Draw() DISTI_METHOD_OVERRIDE
void SetString(const char *s)
Definition: gls_text_box.h:253
virtual void ResizeMode(ResizeMode_t value)
float _maxLineLengthPixels
Calculated maximimum line width in "pixels" (logical units).
Definition: gls_text_box.h:417
virtual float MaxHeight()
void Clear()
Definition: gls_text_box.h:229
unsigned int _maxLinesToDraw
Calculated maximum number of lines that can fit.
Definition: gls_text_box.h:419
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:411
virtual void Initialize()
Sets the initial state of this object.
void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
RowInfo * _rowInfo
Definition: gls_text_box.h:413
void Calculate(double time) DISTI_METHOD_OVERRIDE
DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
Align_t _verticalAlignment
Justification setting (TOP, CENTER, BOTTOM).
Definition: gls_text_box.h:348
ResizeMode_t
The ResizeMode_t enumeration. Describes the resize behavior of this text object.
Definition: gls_text_box.h:112
float GetMaxLineLengthForResizeMode() const
InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
float _resizeMaxHeight
The calculated maximim height in logical units based on the current resize behavior.
Definition: gls_text_box.h:425
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:418
Definition: gls_text.h:152
virtual CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:295
virtual float CellWidth() const
Definition: gls_text.h:272
virtual GlsColor BgColor()
virtual void Char(Char_t code)
virtual float CharSpacing()
bool _needToRebuild
Definition: gls_text.h:701
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()
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
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:245
#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::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:51
Definition: bmpimage.h:46
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:425
Definition: gls_text_box.h:403
unsigned int startingIndex
Definition: gls_text_box.h:404
float pixelWidth
Definition: gls_text_box.h:407
unsigned int length
Definition: gls_text_box.h:406
Attributes for each character position in the grid.
Definition: gls_text.h:177
The DistiUnhideGlobalsDummyClass class.