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
68 #define LIB_BASE_NAME "gls_text_box"
81 class GlsGloFileAttribute;
101 void PopulateQuadStorage();
108 RESIZE_MODE_AUTO_WIDTH,
109 RESIZE_MODE_AUTO_HEIGHT
112 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
116 friend class GlsTextBoxEditor;
120 GLSGEN_GLSTEXTBOX_EXPORT
GlsTextBox(
const GlsTextBox& that,
const bool generateNames );
149 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Calculate(
double time ) DISTI_METHOD_OVERRIDE;
161 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Draw(
void ) DISTI_METHOD_OVERRIDE;
177 virtual GLSGEN_GLSTEXTBOX_EXPORT
void SetVertices(
unsigned int nPoints,
Vertex* vertices ) DISTI_METHOD_OVERRIDE;
180 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Initialize();
183 GLSGEN_GLSTEXTBOX_EXPORT
void Rebuild();
196 virtual GLSGEN_GLSTEXTBOX_EXPORT
unsigned int MaxLinesToDraw(
void );
199 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar ) DISTI_METHOD_OVERRIDE;
219 return _verticalAlignment;
232 GLSGEN_GLSTEXTBOX_EXPORT
void Clear(
void )
256 GLSGEN_GLSTEXTBOX_EXPORT
void SetString(
const char* s )
266 GLSGEN_GLSTEXTBOX_EXPORT
void VaString(
const char* format, ... );
271 GLSGEN_GLSTEXTBOX_EXPORT
void NextLineInfo(
const unsigned int currentStringIndex,
272 unsigned int* lineEndIndex,
273 unsigned int* nextLineStringIndex,
275 float* lineLengthPixels );
280 GLSGEN_GLSTEXTBOX_EXPORT
unsigned int GetLineCount();
283 GLSGEN_GLSTEXTBOX_EXPORT
void TabSpacing(
float );
298 GLSGEN_GLSTEXTBOX_EXPORT
void LeftToRight(
bool leftToRight );
300 virtual GLSGEN_GLSTEXTBOX_EXPORT
void ResizeMode( ResizeMode_t value );
301 virtual GLSGEN_GLSTEXTBOX_EXPORT ResizeMode_t ResizeMode();
303 virtual GLSGEN_GLSTEXTBOX_EXPORT
void MaxWidth(
float value );
304 virtual GLSGEN_GLSTEXTBOX_EXPORT
float MaxWidth();
306 virtual GLSGEN_GLSTEXTBOX_EXPORT
void MaxHeight(
float value );
307 virtual GLSGEN_GLSTEXTBOX_EXPORT
float MaxHeight();
314 virtual GLSGEN_GLSTEXTBOX_EXPORT
void SetFromGloData(
GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
324 GLSGEN_GLSTEXTBOX_EXPORT
char* FormatVarArgList(
const char* format, va_list args );
331 bool _perCharAttribs;
336 GLSGEN_GLSTEXTBOX_EXPORT
void EnablePerCharAttribs(
void )
338 if( !_perCharAttribs )
340 _perCharAttribs =
true;
346 Align_t _verticalAlignment;
354 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcCellSize();
359 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcVertices();
379 GLSGEN_GLSTEXTBOX_EXPORT
void GetNextRowInfo(
const unsigned int strIndex,
380 unsigned int& rowLength,
381 float& rowPixelWidth,
382 unsigned int& nextRowStartIndex )
const;
384 float GetMaxLineLengthForResizeMode()
const;
386 void SetVerticesToTextBounds();
396 GLSGEN_GLSTEXTBOX_EXPORT
float GetCharWidth(
const unsigned short c )
const;
410 bool _lineCountChanged;
414 float _cellWidthRatio;
416 float _maxLineLengthPixels;
417 float _maxTextHeightPixels;
418 unsigned int _maxLinesToDraw;
423 ResizeMode_t _resizeMode;
424 float _resizeMaxWidth;
425 float _resizeMaxHeight;
448 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
488 void IgnoreShadow(
void );
490 void AllowShadow(
void );
494 const float _cellWidth;
495 const float _cellHeight;
499 const Vector _shadowOffset;
504 const float _underlineOffset;
505 const float _underlineSize;
509 const float _haloOffset;
513 const bool _leftToRight;
516 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
521 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
529 typedef std::list<LineSegment_t> LineSegmentCont_t;
530 LineSegmentCont_t _lineSegments;
534 GlsTextBox& operator=(
const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
535 GlsTextBox( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
538 void OnCellDimensionChanged() DISTI_METHOD_OVERRIDE
547 inline std::istream& operator>>(
548 std::istream& instr, disti::GlsTextBox::Align_t& j )
553 if( str ==
"ALIGN_TOP" )
555 j = disti::GlsTextBox::ALIGN_TOP;
557 else if( str ==
"ALIGN_CENTER" )
559 j = disti::GlsTextBox::ALIGN_CENTER;
561 else if( str ==
"ALIGN_BOTTOM" )
563 j = disti::GlsTextBox::ALIGN_BOTTOM;
569 inline std::ostream&
operator<<( std::ostream& outstr, disti::GlsTextBox::Align_t j )
573 case disti::GlsTextBox::ALIGN_TOP:
574 outstr <<
"ALIGN_TOP";
576 case disti::GlsTextBox::ALIGN_CENTER:
577 outstr <<
"ALIGN_CENTER";
579 case disti::GlsTextBox::ALIGN_BOTTOM:
580 outstr <<
"ALIGN_BOTTOM";
588 inline std::istream& operator>>( std::istream& instr, disti::GlsTextBox::ResizeMode_t& direction )
593 if( str ==
"RESIZE_MODE_FIXED" )
595 direction = disti::GlsTextBox::RESIZE_MODE_FIXED;
597 else if( str ==
"RESIZE_MODE_AUTO_WIDTH" )
599 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH;
601 else if( str ==
"RESIZE_MODE_AUTO_HEIGHT" )
603 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT;
610 inline std::ostream&
operator<<( std::ostream& outstr, disti::GlsTextBox::ResizeMode_t direction )
614 case disti::GlsTextBox::RESIZE_MODE_FIXED:
615 outstr <<
"RESIZE_MODE_FIXED";
617 case disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH:
618 outstr <<
"RESIZE_MODE_AUTO_WIDTH";
620 case disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT:
621 outstr <<
"RESIZE_MODE_AUTO_HEIGHT";
The DistiUnhideGlobalsDummyClass class.
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
Definition: dynamic_array.h:66
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:473
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
virtual unsigned int MaxLinesToDraw(void)
unsigned int length
Definition: gls_text_box.h:404
void VaString(const char *format,...)
float GetCharWidth(const unsigned short c) const
The disti::GlsQuadListVC_3D and GlsQuadListVCT_2D classes.
Attributes for each character position in the grid.
Definition: gls_text.h:177
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
void PostProcessCharacter(const CharAttr_t &charAttr, const Char_t &c, float cellX, float charY, float cellWidth, bool endOfLine)
RowInfo * _rowInfo
Definition: gls_text_box.h:412
void Clear(void)
Definition: gls_text_box.h:232
Definition: gls_text_box.h:400
Definition: gls_text.h:151
std::string _text
Definition: gls_text.h:711
Definition: gls_quad_storage.h:158
The disti::GlsText class.
The disti::GlsStateManager factory class. Creates an instance of a state manager that manages the GL ...
void PreProcessCharacter(const CharAttr_t &charAttr, const Char_t &c, float cellX, float charY)
void SetString(const char *s)
Definition: gls_text_box.h:256
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
Definition: gls_text_box.h:430
Definition: gls_glo_file.h:988
std::ostream & operator<<(std::ostream &outstr, const AttributeName &name)
Defines the stream out operator.
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
float CellWidth() const
Definition: gls_text.h:270
unsigned int _lineCount
Definition: gls_text_box.h:409
void ClearChars(void)
Definition: gls_text_box.h:241
bool _leftToRight
Definition: gls_text_box.h:420
Definition: gls_text_box.h:88
void RenderLineSegments(void)
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 pixelWidth
Definition: gls_text_box.h:405
Definition: gls_color.h:53
virtual void Draw(void) DISTI_METHOD_OVERRIDE
virtual void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:292
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar=0)
std::string String() const
Definition: gls_text.h:543
void SetRebuild()
Definition: gls_text.h:587
virtual void SetVertices(unsigned int nPoints, Vertex *vertices) DISTI_METHOD_OVERRIDE
virtual Align_t VerticalAlignment() const
Definition: gls_text_box.h:217
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual void CalculateRowData(void)
Macros and helper code to determine what subset of C++11/14/17 is available.
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
Definition: gls_quad_storage.h:63
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
bool _needToRebuild
Definition: gls_text.h:699
Definition: bmpimage.h:46
float CellHeight() const
Definition: gls_text.h:256
unsigned int startingIndex
Definition: gls_text_box.h:402
UTF16String _unicodeText
Definition: gls_text_box.h:427