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();
105 friend class GlsTextBoxEditor;
109 GLSGEN_GLSTEXTBOX_EXPORT
GlsTextBox(
const GlsTextBox& that,
const bool generateNames );
138 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Calculate(
double time );
150 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Draw(
void );
168 virtual GLSGEN_GLSTEXTBOX_EXPORT
void SetVertices(
unsigned int nPoints,
Vertex* vertices );
171 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Initialize();
184 virtual GLSGEN_GLSTEXTBOX_EXPORT
unsigned int MaxLinesToDraw(
void );
187 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar );
207 return _verticalAlignment;
220 GLSGEN_GLSTEXTBOX_EXPORT
void Clear(
void )
244 GLSGEN_GLSTEXTBOX_EXPORT
void SetString(
const char* s )
255 GLSGEN_GLSTEXTBOX_EXPORT
void VaString(
const char* format, ... );
260 GLSGEN_GLSTEXTBOX_EXPORT
void NextLineInfo(
const unsigned int currentStringIndex,
261 unsigned int* lineEndIndex,
262 unsigned int* nextLineStringIndex,
264 float* lineLengthPixels );
269 GLSGEN_GLSTEXTBOX_EXPORT
unsigned int GetLineCount();
272 GLSGEN_GLSTEXTBOX_EXPORT
void TabSpacing(
float );
287 GLSGEN_GLSTEXTBOX_EXPORT
void LeftToRight(
bool leftToRight );
304 GLSGEN_GLSTEXTBOX_EXPORT
char* FormatVarArgList(
const char* format, va_list args );
311 bool _perCharAttribs;
316 GLSGEN_GLSTEXTBOX_EXPORT
void EnablePerCharAttribs(
void )
318 if( !_perCharAttribs )
320 _perCharAttribs =
true;
326 Align_t _verticalAlignment;
334 GLSGEN_GLSTEXTBOX_EXPORT
void Rebuild();
339 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcCellSize();
344 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcVertices();
364 GLSGEN_GLSTEXTBOX_EXPORT
void GetNextRowInfo(
const unsigned int strIndex,
365 unsigned int& rowLength,
366 float& rowPixelWidth,
367 unsigned int& nextRowStartIndex )
const;
377 GLSGEN_GLSTEXTBOX_EXPORT
float GetCharWidth(
const unsigned short c)
const;
391 bool _lineCountChanged;
395 float _cellWidthRatio;
397 float _maxLineLengthPixels;
398 float _maxTextHeightPixels;
399 unsigned int _maxLinesToDraw;
425 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
GlsColor haloColor,
bool leftToRight );
465 void IgnoreShadow(
void );
467 void AllowShadow(
void );
471 const float _cellWidth;
472 const float _cellHeight;
476 const Vector _shadowOffset;
481 const float _underlineOffset;
482 const float _underlineSize;
486 const float _haloOffset;
490 const bool _leftToRight;
493 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
498 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
506 typedef std::list<LineSegment_t> LineSegmentCont_t;
507 LineSegmentCont_t _lineSegments;
511 GlsTextBox& operator=(
const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
512 GlsTextBox( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
515 void OnCellDimensionChanged()
524 inline std::istream& operator>>(
525 std::istream& instr, disti::GlsTextBox::Align_t& j )
530 if( str ==
"ALIGN_TOP" )
532 j = disti::GlsTextBox::ALIGN_TOP;
534 else if( str ==
"ALIGN_CENTER" )
536 j = disti::GlsTextBox::ALIGN_CENTER;
538 else if( str ==
"ALIGN_BOTTOM" )
540 j = disti::GlsTextBox::ALIGN_BOTTOM;
546 inline std::ostream& operator<<( std::ostream& outstr, disti::GlsTextBox::Align_t j )
550 case disti::GlsTextBox::ALIGN_TOP:
551 outstr <<
"ALIGN_TOP";
553 case disti::GlsTextBox::ALIGN_CENTER:
554 outstr <<
"ALIGN_CENTER";
556 case disti::GlsTextBox::ALIGN_BOTTOM:
557 outstr <<
"ALIGN_BOTTOM";
The DistiUnhideGlobalsDummyClass class.
virtual void SetVertices(unsigned int nPoints, Vertex *vertices)
UnicodeString _unicodeText
Definition: gls_text_box.h:404
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void SetAvailableAttributes(unsigned int value)
Definition: dynamic_array.h:62
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:278
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
virtual unsigned int MaxLinesToDraw(void)
unsigned int length
Definition: gls_text_box.h:385
void VaString(const char *format,...)
The disti::GlsQuadListVC_3D and GlsQuadListVCT_2D classes.
Attributes for each character position in the grid.
Definition: gls_text.h:175
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:393
void Clear(void)
Definition: gls_text_box.h:220
Definition: gls_text_box.h:381
Definition: gls_text.h:151
std::string _text
Definition: gls_text.h:834
Definition: gls_quad_storage.h:156
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:244
Definition: gls_text_box.h:407
Definition: gls_glo_file.h:835
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
float CellWidth() const
Definition: gls_text.h:392
unsigned int _lineCount
Definition: gls_text_box.h:390
void ClearChars(void)
Definition: gls_text_box.h:229
virtual void CopyGeometry(DisplayObject *src)
bool _leftToRight
Definition: gls_text_box.h:401
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:386
Definition: gls_color.h:53
virtual void CopyProperties(DisplayObject *src)
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:414
void Scale(int handleBar, float px, float py, Vertex *anchor=NULL)
Definition: display.h:1111
std::string String() const
Definition: gls_text.h:667
void SetRebuild()
Definition: gls_text.h:711
virtual Align_t VerticalAlignment() const
Definition: gls_text_box.h:205
virtual void CalculateRowData(void)
Macros and helper code to determine what subset of C++11/14/17 is available.
Definition: gls_quad_storage.h:63
bool _needToRebuild
Definition: gls_text.h:822
Definition: bmpimage.h:46
virtual void Calculate(double time)
float CellHeight() const
Definition: gls_text.h:378
unsigned int startingIndex
Definition: gls_text_box.h:383