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"
79 class GlsGloFileAttribute;
99 void PopulateQuadStorage();
106 RESIZE_MODE_AUTO_WIDTH,
107 RESIZE_MODE_AUTO_HEIGHT
110 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
114 friend class GlsTextBoxEditor;
118 GLSGEN_GLSTEXTBOX_EXPORT
GlsTextBox(
const GlsTextBox& that,
const bool generateNames );
147 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Calculate(
double time ) DISTI_METHOD_OVERRIDE;
159 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Draw(
void ) DISTI_METHOD_OVERRIDE;
175 virtual GLSGEN_GLSTEXTBOX_EXPORT
void SetVertices(
unsigned int nPoints,
Vertex* vertices ) DISTI_METHOD_OVERRIDE;
178 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Initialize();
181 GLSGEN_GLSTEXTBOX_EXPORT
void Rebuild();
194 virtual GLSGEN_GLSTEXTBOX_EXPORT
unsigned int MaxLinesToDraw(
void );
197 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar ) DISTI_METHOD_OVERRIDE;
217 return _verticalAlignment;
230 GLSGEN_GLSTEXTBOX_EXPORT
void Clear(
void )
254 GLSGEN_GLSTEXTBOX_EXPORT
void SetString(
const char* s )
264 GLSGEN_GLSTEXTBOX_EXPORT
void VaString(
const char* format, ... );
269 GLSGEN_GLSTEXTBOX_EXPORT
void NextLineInfo(
const unsigned int currentStringIndex,
270 unsigned int* lineEndIndex,
271 unsigned int* nextLineStringIndex,
273 float* lineLengthPixels );
278 GLSGEN_GLSTEXTBOX_EXPORT
unsigned int GetLineCount();
281 GLSGEN_GLSTEXTBOX_EXPORT
void TabSpacing(
float );
296 GLSGEN_GLSTEXTBOX_EXPORT
void LeftToRight(
bool leftToRight );
298 virtual GLSGEN_GLSTEXTBOX_EXPORT
void ResizeMode( ResizeMode_t value );
299 virtual GLSGEN_GLSTEXTBOX_EXPORT ResizeMode_t ResizeMode();
301 virtual GLSGEN_GLSTEXTBOX_EXPORT
void MaxWidth(
float value );
302 virtual GLSGEN_GLSTEXTBOX_EXPORT
float MaxWidth();
304 virtual GLSGEN_GLSTEXTBOX_EXPORT
void MaxHeight(
float value );
305 virtual GLSGEN_GLSTEXTBOX_EXPORT
float MaxHeight();
312 virtual GLSGEN_GLSTEXTBOX_EXPORT
void SetFromGloData(
GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
322 GLSGEN_GLSTEXTBOX_EXPORT
char* FormatVarArgList(
const char* format, va_list args );
329 bool _perCharAttribs;
334 GLSGEN_GLSTEXTBOX_EXPORT
void EnablePerCharAttribs(
void )
336 if( !_perCharAttribs )
338 _perCharAttribs =
true;
344 Align_t _verticalAlignment;
352 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcCellSize();
357 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcVertices();
377 GLSGEN_GLSTEXTBOX_EXPORT
void GetNextRowInfo(
const unsigned int strIndex,
378 unsigned int& rowLength,
379 float& rowPixelWidth,
380 unsigned int& nextRowStartIndex )
const;
382 float GetMaxLineLengthForResizeMode()
const;
384 void SetVerticesToTextBounds();
394 GLSGEN_GLSTEXTBOX_EXPORT
float GetCharWidth(
const unsigned short c )
const;
408 bool _lineCountChanged;
412 float _cellWidthRatio;
414 float _maxLineLengthPixels;
415 float _maxTextHeightPixels;
416 unsigned int _maxLinesToDraw;
421 ResizeMode_t _resizeMode;
422 float _resizeMaxWidth;
423 float _resizeMaxHeight;
446 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
486 void IgnoreShadow(
void );
488 void AllowShadow(
void );
492 const float _cellWidth;
493 const float _cellHeight;
497 const Vector _shadowOffset;
502 const float _underlineOffset;
503 const float _underlineSize;
507 const float _haloOffset;
511 const bool _leftToRight;
514 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
519 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
527 typedef std::list<LineSegment_t> LineSegmentCont_t;
528 LineSegmentCont_t _lineSegments;
532 GlsTextBox& operator=(
const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
533 GlsTextBox( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
536 void OnCellDimensionChanged() DISTI_METHOD_OVERRIDE
545 inline std::istream& operator>>(
546 std::istream& instr, disti::GlsTextBox::Align_t& j )
551 if( str ==
"ALIGN_TOP" )
553 j = disti::GlsTextBox::ALIGN_TOP;
555 else if( str ==
"ALIGN_CENTER" )
557 j = disti::GlsTextBox::ALIGN_CENTER;
559 else if( str ==
"ALIGN_BOTTOM" )
561 j = disti::GlsTextBox::ALIGN_BOTTOM;
567 inline std::ostream&
operator<<( std::ostream& outstr, disti::GlsTextBox::Align_t j )
571 case disti::GlsTextBox::ALIGN_TOP:
572 outstr <<
"ALIGN_TOP";
574 case disti::GlsTextBox::ALIGN_CENTER:
575 outstr <<
"ALIGN_CENTER";
577 case disti::GlsTextBox::ALIGN_BOTTOM:
578 outstr <<
"ALIGN_BOTTOM";
586 inline std::istream& operator>>( std::istream& instr, disti::GlsTextBox::ResizeMode_t& direction )
591 if( str ==
"RESIZE_MODE_FIXED" )
593 direction = disti::GlsTextBox::RESIZE_MODE_FIXED;
595 else if( str ==
"RESIZE_MODE_AUTO_WIDTH" )
597 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH;
599 else if( str ==
"RESIZE_MODE_AUTO_HEIGHT" )
601 direction = disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT;
608 inline std::ostream&
operator<<( std::ostream& outstr, disti::GlsTextBox::ResizeMode_t direction )
612 case disti::GlsTextBox::RESIZE_MODE_FIXED:
613 outstr <<
"RESIZE_MODE_FIXED";
615 case disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH:
616 outstr <<
"RESIZE_MODE_AUTO_WIDTH";
618 case disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT:
619 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:471
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
virtual unsigned int MaxLinesToDraw(void)
unsigned int length
Definition: gls_text_box.h:402
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:410
void Clear(void)
Definition: gls_text_box.h:230
Definition: gls_text_box.h:398
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:254
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
Definition: gls_text_box.h:428
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:407
void ClearChars(void)
Definition: gls_text_box.h:239
bool _leftToRight
Definition: gls_text_box.h:418
Definition: gls_text_box.h:86
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:403
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:215
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:400
UTF16String _unicodeText
Definition: gls_text_box.h:425