GL Studio C++ Runtime API
gls_text_box.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::GlsTextBox class.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 #ifndef _GLS_TEXT_BOX_H
41 #define _GLS_TEXT_BOX_H
42 
43 //////////////////// Provides support for creating DLLs ////////////////////////
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 )
48 # else
49 # define GLSGEN_GLSTEXTBOX_EXPORT __declspec( dllimport )
50 # endif
51 #else
52 # define GLSGEN_GLSTEXTBOX_EXPORT
53 #endif
54 ///////////////////////////////////////////////////////////////////////////////
55 
56 #include "gls_gl.h"
57 #include <string>
58 
59 #include "gls_cpp_lang_support.h"
60 #include "gls_text.h"
61 #include "unhide_globals.h"
62 
63 #ifdef GLES
64 # include "gls_quad_storage.h"
65 # include "gls_state_manager.h"
66 #endif
67 
68 #define LIB_BASE_NAME "gls_text_box"
69 #include "gls_auto_lib.h"
70 #undef LIB_BASE_NAME
71 
72 //===========================================================================
73 // BEGIN NAMESPACE
74 //===========================================================================
75 namespace disti
76 {
77 #ifdef GLES
78 // Forward Declaration
79 class GlsGloFileAttribute;
80 #endif
81 
82 //===========================================================================
83 /**
84 * The GlsTextBox
85 */
86 class GlsTextBox : public GlsText
87 {
88 protected:
90  void DrawText();
91 
92 #ifdef GLES
93  GlsQuadListVC_3D _backgrounds;
94  GlsQuadListVCT_2D _shadows;
95  GlsQuadListVC_3D _shadowLines;
96  GlsQuadListVCT_2D _characters;
97  GlsQuadListVC_3D _lines;
98 
99  void PopulateQuadStorage();
100 #endif
101 
102 public:
103  enum ResizeMode_t
104  {
105  RESIZE_MODE_FIXED,
106  RESIZE_MODE_AUTO_WIDTH,
107  RESIZE_MODE_AUTO_HEIGHT
108  };
109 
110  DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
111  typedef GlsText _BaseClass;
112  typedef GlsText BaseClass;
113 
114  friend class GlsTextBoxEditor;
115 
116  /** Class Constructor. */
117  GLSGEN_GLSTEXTBOX_EXPORT GlsTextBox();
118  GLSGEN_GLSTEXTBOX_EXPORT GlsTextBox( const GlsTextBox& that, const bool generateNames );
119 
120  /** Class Constructor. */
121  virtual GLSGEN_GLSTEXTBOX_EXPORT ~GlsTextBox();
122 
123  // Need to declare using all base class methods that we overload
124  using BaseClass::Baseline;
125  using BaseClass::BgColor;
126  using BaseClass::CellHeight;
127  using BaseClass::CellWidth;
128  using BaseClass::Char;
129  using BaseClass::CharAttr;
132  using BaseClass::Erase;
133  using BaseClass::FauxBold;
134  using BaseClass::Inverse;
135  using BaseClass::StrikeThru;
136  using BaseClass::String;
137  using BaseClass::TextColor;
138  using BaseClass::Underline;
139 
140  /* See base class */
141  virtual GLSGEN_GLSTEXTBOX_EXPORT void SetAvailableAttributes( unsigned int value );
142 
143  /* Peform any necessary non-draw calculations like resizing
144  * the grid.
145  * \param time The time since the start of program execution
146  */
147  virtual GLSGEN_GLSTEXTBOX_EXPORT void Calculate( double time );
148 
149  /* See base class */
150  virtual GLSGEN_GLSTEXTBOX_EXPORT DisplayObject* CloneObject( bool generateNames = false );
151 
152  /* See base class */
153  virtual GLSGEN_GLSTEXTBOX_EXPORT void CopyGeometry( DisplayObject* src );
154 
155  /* See base class */
156  virtual GLSGEN_GLSTEXTBOX_EXPORT void CopyProperties( DisplayObject* src );
157 
158  /* See base class */
159  virtual GLSGEN_GLSTEXTBOX_EXPORT void Draw( void );
160 
161 #ifndef GLES
162  /* See base class */
163  virtual GLSGEN_GLSTEXTBOX_EXPORT InterfaceListType* GetCppInterfaceDescription(
164  InterfaceListType* addToThisList = NULL );
165 
166  /* See base class */
167  virtual GLSGEN_GLSTEXTBOX_EXPORT void GetCppInterfaceDescriptionFree(
168  InterfaceListType* array );
169 #endif
170 
171 #ifdef GLES
172  /* See base class */
173  virtual GLSGEN_GLSTEXTBOX_EXPORT void PreDraw( const OpenGLMatrices& current, Culler& culler );
174 #endif
175 
176  /* See base class */
177  virtual GLSGEN_GLSTEXTBOX_EXPORT void SetVertices( unsigned int nPoints, Vertex* vertices );
178 
179  /* See base class */
180  virtual GLSGEN_GLSTEXTBOX_EXPORT void Initialize();
181 
182  /** Rebuilds this text box layout. This may be an expensive call, so it should only be called when a property changes. */
183  GLSGEN_GLSTEXTBOX_EXPORT void Rebuild();
184 
185  /* Unhides base class implementation. */
186  using BaseClass::Scale;
187 
188  /**
189  We need to know the Max number of lines/rows possible to display, we
190  may run out of characters to print/display before we hit the max
191  number of lines though.
192  \return A value between Zero and INT_MAX, representing the max lines/rows to draw
193  \pre The TextBox object has been initialized
194  \post The value of max lines returned to the caller
195  */
196  virtual GLSGEN_GLSTEXTBOX_EXPORT unsigned int MaxLinesToDraw( void );
197 
198  /* See base class */
199  virtual GLSGEN_GLSTEXTBOX_EXPORT void Scale( float px, float py, float pz, Vertex* anchor, int handleBar );
200 
201  // Different text justifications.
202  enum Align_t
203  {
204  ALIGN_CENTER,
205  ALIGN_TOP,
206  ALIGN_BOTTOM
207  };
208 
209  /** Set the vertical justification for this text object
210  * \param justification The justification mode (TOP, BOTTOM, CENTER)
211  */
212  GLSGEN_GLSTEXTBOX_EXPORT void VerticalAlignment( Align_t justification );
213 
214  /** Get the vertical justification for this text object
215  * \return vertical justification
216  */
217  virtual Align_t VerticalAlignment() const
218  {
219  return _verticalAlignment;
220  }
221 
222  //-----------------------------------------------------------------------
223  //-----------------------------------------------------------------------
224  // Routines for compatbility with TextDisplay.gls
225  //-----------------------------------------------------------------------
226  //-----------------------------------------------------------------------
227 
228  /** Clears all of the characters and resets the attributes of all
229  * characters (TextDisplay compatability method)
230  * \deprecated use Erase instead
231  */
232  GLSGEN_GLSTEXTBOX_EXPORT void Clear( void )
233  {
234  Erase();
235  }
236 
237  /** Clears all of the characters. Does NOT reset the attributes
238  * of the characters (TextDisplay compatability method)
239  * \deprecated
240  */
241  GLSGEN_GLSTEXTBOX_EXPORT void ClearChars( void )
242  {
243  _text.erase();
244  SetRebuild();
245  }
246 
247  /** SetColor() meaning has changed, now use TextColor */
248 
249  /** Print a string into this text object starting at index 0 and proceeding Left
250  * to right Wraps at newline characters. Does not change the color or any
251  * other modes. Replaces the entire string.
252  * (TextDisplay compatability method)
253  * \param s The string to print
254  * \deprecated use String instead
255  */
256  GLSGEN_GLSTEXTBOX_EXPORT void SetString( const char* s )
257  {
258  String( s );
259  }
260 
261  /** Print a string into this text object
262  * to right. Wraps at newline characters. Does not change the color or any
263  * other modes. Replaces the entire string.
264  * \param format printf style varargs formatting string.
265  */
266  GLSGEN_GLSTEXTBOX_EXPORT void VaString( const char* format, ... );
267 
268  /* Undocumented.
269  * This method is used to calculate the lines of the text box and is likely to change in future releases.
270  */
271  GLSGEN_GLSTEXTBOX_EXPORT void NextLineInfo( const unsigned int currentStringIndex,
272  unsigned int* lineEndIndex,
273  unsigned int* nextLineStringIndex,
274  float* startXpixels,
275  float* lineLengthPixels );
276 
277  /* Undocumented.
278  * This method is used to calculate the lines of the text box and may change in future releases.
279  */
280  GLSGEN_GLSTEXTBOX_EXPORT unsigned int GetLineCount();
281 
282  /** Sets tab space multiplier, 1.0 == same as specified in font */
283  GLSGEN_GLSTEXTBOX_EXPORT void TabSpacing( float );
284 
285  /** Returns the current tab space multiplier
286  * \return the current tab space multiplier
287  */
288  GLSGEN_GLSTEXTBOX_EXPORT float TabSpacing();
289 
290  /** Determine if the text direction is set to left->right or right->left
291  * \return true if if the text direction is set to left->right else false for right->left
292  */
293  GLSGEN_GLSTEXTBOX_EXPORT bool LeftToRight( void );
294 
295  /** Set the text direction
296  * \param leftToRight true for left->right else false for right->left
297  */
298  GLSGEN_GLSTEXTBOX_EXPORT void LeftToRight( bool leftToRight );
299 
300  virtual GLSGEN_GLSTEXTBOX_EXPORT void ResizeMode( ResizeMode_t value );
301  virtual GLSGEN_GLSTEXTBOX_EXPORT ResizeMode_t ResizeMode();
302 
303  virtual GLSGEN_GLSTEXTBOX_EXPORT void MaxWidth( float value );
304  virtual GLSGEN_GLSTEXTBOX_EXPORT float MaxWidth();
305 
306  virtual GLSGEN_GLSTEXTBOX_EXPORT void MaxHeight( float value );
307  virtual GLSGEN_GLSTEXTBOX_EXPORT float MaxHeight();
308 
309 protected:
310 #ifdef GLES
311  /** Set a single attribute from the GLO file.
312  * \param data The attribute to set and its associated data.
313  */
314  virtual GLSGEN_GLSTEXTBOX_EXPORT void SetFromGloData( GlsGloFileAttribute& data );
315 #endif
316 
317  /*
318  * Allocate a text buffer of the appropriate size for this grid and output snprintf style format
319  * into the buffer
320  * \param format snprintf style format spec
321  * \param args arguments for sprintf style formatting
322  * \return formatted textbuffer ( must be deleted by caller )
323  */
324  GLSGEN_GLSTEXTBOX_EXPORT char* FormatVarArgList( const char* format, va_list args );
325 
326  /* true -> grid will draw characters using "per character attributes" else
327  * false -> all characters will be drawn using the first character's attribute
328  * NOTE: This defaults to false and automatically enables to true if the user calls
329  * a method that requires per character attributes
330  */
331  bool _perCharAttribs;
332 
333  /*
334  * Enable per character attribute drawing for this grid
335  */
336  GLSGEN_GLSTEXTBOX_EXPORT void EnablePerCharAttribs( void )
337  {
338  if( !_perCharAttribs )
339  {
340  _perCharAttribs = true;
341  SetRebuild();
342  }
343  }
344 
345  /* Justification setting (TOP, CENTER, BOTTOM) */
346  Align_t _verticalAlignment;
347 
348  /* Space multiplier for tabs */
349  float _tabSpacing;
350 
351  //-----------------------------------------------------------------------
352  /*
353  */
354  GLSGEN_GLSTEXTBOX_EXPORT void RecalcCellSize();
355 
356  //-----------------------------------------------------------------------
357  /*
358  */
359  GLSGEN_GLSTEXTBOX_EXPORT void RecalcVertices();
360 
361  /** Populate the _rowInfo array based on the current display string
362  * \pre none
363  * \post _rowInfo array is populated based on the current display string
364  */
365  GLSGEN_GLSTEXTBOX_EXPORT virtual void CalculateRowData( void );
366 
367  /* Get the row info for the row starting at the given string index
368  * \param strIndex starting index into string
369  * \param rowLength [out] gets number of characters in row
370  * \param rowPixelWidth [out] gets pixel width of row
371  * \param nextRowStartIndex [out] gets starting string index for next row
372  * else GLSUINT32_MAX if there is no string data for the next row
373  * \pre strIndex < _str.GetLength()
374  * \post rowLength has the number of characters in the row,
375  * rowPixelWidth has the pixel width of the row,
376  * nextRowStartIndex has the starting string index for the next row
377  * else GLSUINT32_MAX if there is no string data for the next row
378  */
379  GLSGEN_GLSTEXTBOX_EXPORT void GetNextRowInfo( const unsigned int strIndex,
380  unsigned int& rowLength,
381  float& rowPixelWidth,
382  unsigned int& nextRowStartIndex ) const;
383 
384  float GetMaxLineLengthForResizeMode() const;
385 
386  void SetVerticesToTextBounds();
387 
388 public:
389  /** Get the width for the given character taking into account cell sizing, character spacing, uppercasing
390  * and tab characters width being expanded
391  * \param c character in question
392  * \return width for given character
393  * \pre none
394  * \post none
395  */
396  GLSGEN_GLSTEXTBOX_EXPORT float GetCharWidth( const unsigned short c ) const;
397 
398 protected:
399  /** info for one row of text in the display */
400  struct RowInfo
401  {
402  unsigned int startingIndex; /**< starting text index into the display for row
403  * else GLSUINT32_MAX if row has no characters */
404  unsigned int length; /**< the number of characters in row */
405  float pixelWidth; /**< the width of row in pixels */
406  };
407 
408  /** Number of rows of characters in the text grid (number of lines) */
409  unsigned int _lineCount;
410  bool _lineCountChanged;
411 
412  RowInfo* _rowInfo; /**< array ( _rows number of elements ) of RowInfo */
413 
414  float _cellWidthRatio;
415 
416  float _maxLineLengthPixels;
417  float _maxTextHeightPixels;
418  unsigned int _maxLinesToDraw;
419 
420  bool _leftToRight; /**< true to render characters from left to right else
421  * false for right to left */
422 
423  ResizeMode_t _resizeMode;
424  float _resizeMaxWidth;
425  float _resizeMaxHeight;
426 
427  UnicodeString _unicodeText; /**< unicode version of _text from base class, updated by CalculateRowData */
428 
429  /* helper class for processing underline and strike-thru when drawing text grid */
431  {
432  public:
433  /**
434  * \param cellWidth maximum width of a character cell in the text box
435  * \param cellHeight height of a character cell in the text box
436  * \param cellYScale unused
437  * \param shadow true if text box has shadow enabled
438  * \param shadowOffset offset for shadow
439  * \param shadowColor color of shadow in text box
440  * \param underlineOffset offset of underline
441  * \param underlineSize size of underline
442  * \param halo true if text box has halo enabled
443  * \param haloOffset offset for halo
444  * \param haloColor color of halo in text box
445  * \param leftToRight true if text flows left to right else false for right to left
446  */
447  UnderlineStrikeThruHelper( float cellWidth, float cellHeight, float cellYScale, bool shadow, const Vector& shadowOffset, const GlsColor& shadowColor,
448  float underlineOffset, float underlineSize, bool halo, float haloOffset, GlsColor haloColor, bool leftToRight );
449 
450  /**
451  * Setup to process a new row in the text box.
452  */
453  void NewRow( void );
454 
455  /**
456  * Pre Process the given character attributes
457  * \param charAttr attributes in question
458  * \param c the character code to process.
459  * \param cellX x coord of character cell
460  * \param charY y coord of character
461  */
462  void PreProcessCharacter( const CharAttr_t& charAttr, const Char_t& c, float cellX, float charY );
463 
464  /**
465  * Post Process the given character attributes
466  * \param charAttr attributes in question
467  * \param c the character code to process.
468  * \param cellX x coord of character cell
469  * \param charY y coord of character cell
470  * \param cellWidth the width of the current character
471  * \param endOfLine true if character was the end of the current line
472  */
473  void PostProcessCharacter( const CharAttr_t& charAttr, const Char_t& c, float cellX, float charY, float cellWidth, bool endOfLine );
474 
475 #ifdef GLES
476  /**
477  * Render the line segments for the underline / strikethru
478  * \param quadStorage The quad storage list to render
479  */
480  void RenderLineSegments( GlsQuadListVC_3D& quadStorage );
481 #else
482  /**
483  * Render the line segments for the underline / strikethru
484  */
485  void RenderLineSegments( void );
486 #endif
487 
488  void IgnoreShadow( void );
489 
490  void AllowShadow( void );
491 
492  protected:
493  // cell constants
494  const float _cellWidth;
495  const float _cellHeight;
496 
497  // shadow constants
498  const bool _shadow;
499  const Vector _shadowOffset;
500  const GlsColor _shadowColor;
501  bool _allowShadow;
502 
503  // underline constants
504  const float _underlineOffset;
505  const float _underlineSize;
506 
507  // halo constants
508  const bool _halo;
509  const float _haloOffset;
510  const GlsColor _haloColor;
511 
512  // left to right
513  const bool _leftToRight;
514 
515  // state vars for underline processing
516  float _underlineX1, _underlineX2, _underlineY, _underlineScale;
517  GlsColor _underlineColor;
518  bool _underlineOn;
519 
520  // state vars for strike-thru processing
521  float _strikeX1, _strikeX2, _strikeY, _strikeScale;
522  GlsColor _strikeColor;
523  bool _strikeOn;
524 
525  // state vars for line processing
526  bool _whiteSpaceYes;
527 
528  // line segments to draw
529  typedef std::list<LineSegment_t> LineSegmentCont_t;
530  LineSegmentCont_t _lineSegments;
531  };
532 
533 private:
534  GlsTextBox& operator=( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
535  GlsTextBox( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
536 
537  /* See base class */
538  void OnCellDimensionChanged()
539  {
540  _needToRebuild = true;
541  }
542 };
543 
544 //---------------------------------------------------------------------------
545 // Stream operators for text enumeration types
546 //---------------------------------------------------------------------------
547 inline std::istream& operator>>(
548  std::istream& instr, disti::GlsTextBox::Align_t& j )
549 {
550  std::string str;
551  instr >> str;
552 
553  if( str == "ALIGN_TOP" )
554  {
555  j = disti::GlsTextBox::ALIGN_TOP;
556  }
557  else if( str == "ALIGN_CENTER" )
558  {
559  j = disti::GlsTextBox::ALIGN_CENTER;
560  }
561  else if( str == "ALIGN_BOTTOM" )
562  {
563  j = disti::GlsTextBox::ALIGN_BOTTOM;
564  }
565  return instr;
566 }
567 
568 //---------------------------------------------------------------------------
569 inline std::ostream& operator<<( std::ostream& outstr, disti::GlsTextBox::Align_t j )
570 {
571  switch( j )
572  {
573  case disti::GlsTextBox::ALIGN_TOP:
574  outstr << "ALIGN_TOP";
575  break;
576  case disti::GlsTextBox::ALIGN_CENTER:
577  outstr << "ALIGN_CENTER";
578  break;
579  case disti::GlsTextBox::ALIGN_BOTTOM:
580  outstr << "ALIGN_BOTTOM";
581  break;
582  }
583  return outstr;
584 }
585 
586 /** In stream operator for ResizeMode_t enumeration.
587  */
588 inline std::istream& operator>>( std::istream& instr, disti::GlsTextBox::ResizeMode_t& direction )
589 {
590  std::string str;
591  instr >> str;
592 
593  if( str == "RESIZE_MODE_FIXED" )
594  {
595  direction = disti::GlsTextBox::RESIZE_MODE_FIXED;
596  }
597  else if( str == "RESIZE_MODE_AUTO_WIDTH" )
598  {
599  direction = disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH;
600  }
601  else if( str == "RESIZE_MODE_AUTO_HEIGHT" )
602  {
603  direction = disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT;
604  }
605  return instr;
606 }
607 
608 /** Out stream operator for ResizeMode_t enumeration.
609  */
610 inline std::ostream& operator<<( std::ostream& outstr, disti::GlsTextBox::ResizeMode_t direction )
611 {
612  switch( direction )
613  {
614  case disti::GlsTextBox::RESIZE_MODE_FIXED:
615  outstr << "RESIZE_MODE_FIXED";
616  break;
617  case disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH:
618  outstr << "RESIZE_MODE_AUTO_WIDTH";
619  break;
620  case disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT:
621  outstr << "RESIZE_MODE_AUTO_HEIGHT";
622  break;
623  }
624  return outstr;
625 }
626 
627 } // namespace disti
628 
629 #endif
The DistiUnhideGlobalsDummyClass class.
Definition: cull.h:49
virtual void SetVertices(unsigned int nPoints, Vertex *vertices)
float Baseline()
UnicodeString _unicodeText
Definition: gls_text_box.h:427
Definition: vertex.h:409
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void SetAvailableAttributes(unsigned int value)
Definition: dynamic_array.h:66
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:296
virtual void PreDraw(const OpenGLMatrices &current, 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
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
GlsColor TextColor()
Definition: display.h:98
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:837
Definition: gls_quad_storage.h:158
GlsColor BgColor()
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
void Char(Char_t code)
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 Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
float CellWidth() const
Definition: gls_text.h:394
unsigned int _lineCount
Definition: gls_text_box.h:409
void ClearChars(void)
Definition: gls_text_box.h:241
virtual void CopyGeometry(DisplayObject *src)
bool LeftToRight(void)
bool _leftToRight
Definition: gls_text_box.h:420
Definition: gls_text_box.h:86
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
virtual ~GlsTextBox()
Definition: gls_color.h:53
The gls_auto_lib.
virtual void CopyProperties(DisplayObject *src)
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
float CharScaling()
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:416
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar=0)
float CharSpacing()
std::string String() const
Definition: gls_text.h:669
Definition: vertex.h:84
void SetRebuild()
Definition: gls_text.h:713
virtual Align_t VerticalAlignment() const
Definition: gls_text_box.h:217
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:825
Definition: bmpimage.h:46
virtual void Calculate(double time)
virtual void Draw(void)
float CellHeight() const
Definition: gls_text.h:380
unsigned int startingIndex
Definition: gls_text_box.h:402
The gls_gl.