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 ) DISTI_METHOD_OVERRIDE;
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 ) DISTI_METHOD_OVERRIDE;
148 
149  /* See base class */
150  virtual GLSGEN_GLSTEXTBOX_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
151 
152  /* See base class */
153  virtual GLSGEN_GLSTEXTBOX_EXPORT void CopyGeometry( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
154 
155  /* See base class */
156  virtual GLSGEN_GLSTEXTBOX_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
157 
158  /* See base class */
159  virtual GLSGEN_GLSTEXTBOX_EXPORT void Draw( void ) DISTI_METHOD_OVERRIDE;
160 
161 #ifndef GLES
162  /* See base class */
163  virtual GLSGEN_GLSTEXTBOX_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
164 
165  /* See base class */
166  virtual GLSGEN_GLSTEXTBOX_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
167 #endif
168 
169 #ifdef GLES
170  /* See base class */
171  virtual GLSGEN_GLSTEXTBOX_EXPORT void PreDraw( const OpenGLMatrices& current, Culler& culler ) DISTI_METHOD_OVERRIDE;
172 #endif
173 
174  /* See base class */
175  virtual GLSGEN_GLSTEXTBOX_EXPORT void SetVertices( unsigned int nPoints, Vertex* vertices ) DISTI_METHOD_OVERRIDE;
176 
177  /* See base class */
178  virtual GLSGEN_GLSTEXTBOX_EXPORT void Initialize();
179 
180  /** Rebuilds this text box layout. This may be an expensive call, so it should only be called when a property changes. */
181  GLSGEN_GLSTEXTBOX_EXPORT void Rebuild();
182 
183  /* Unhides base class implementation. */
184  using BaseClass::Scale;
185 
186  /**
187  We need to know the Max number of lines/rows possible to display, we
188  may run out of characters to print/display before we hit the max
189  number of lines though.
190  \return A value between Zero and INT_MAX, representing the max lines/rows to draw
191  \pre The TextBox object has been initialized
192  \post The value of max lines returned to the caller
193  */
194  virtual GLSGEN_GLSTEXTBOX_EXPORT unsigned int MaxLinesToDraw( void );
195 
196  /* See base class */
197  virtual GLSGEN_GLSTEXTBOX_EXPORT void Scale( float px, float py, float pz, Vertex* anchor, int handleBar ) DISTI_METHOD_OVERRIDE;
198 
199  // Different text justifications.
200  enum Align_t
201  {
202  ALIGN_CENTER,
203  ALIGN_TOP,
204  ALIGN_BOTTOM
205  };
206 
207  /** Set the vertical justification for this text object
208  * \param justification The justification mode (TOP, BOTTOM, CENTER)
209  */
210  GLSGEN_GLSTEXTBOX_EXPORT void VerticalAlignment( Align_t justification );
211 
212  /** Get the vertical justification for this text object
213  * \return vertical justification
214  */
215  virtual Align_t VerticalAlignment() const
216  {
217  return _verticalAlignment;
218  }
219 
220  //-----------------------------------------------------------------------
221  //-----------------------------------------------------------------------
222  // Routines for compatbility with TextDisplay.gls
223  //-----------------------------------------------------------------------
224  //-----------------------------------------------------------------------
225 
226  /** Clears all of the characters and resets the attributes of all
227  * characters (TextDisplay compatability method)
228  * \deprecated use Erase instead
229  */
230  GLSGEN_GLSTEXTBOX_EXPORT void Clear( void )
231  {
232  Erase();
233  }
234 
235  /** Clears all of the characters. Does NOT reset the attributes
236  * of the characters (TextDisplay compatability method)
237  * \deprecated
238  */
239  GLSGEN_GLSTEXTBOX_EXPORT void ClearChars( void )
240  {
241  _text.erase();
242  SetRebuild();
243  }
244 
245  /** SetColor() meaning has changed, now use TextColor */
246 
247  /** Print a string into this text object starting at index 0 and proceeding Left
248  * to right Wraps at newline characters. Does not change the color or any
249  * other modes. Replaces the entire string.
250  * (TextDisplay compatability method)
251  * \param s The string to print
252  * \deprecated use String instead
253  */
254  GLSGEN_GLSTEXTBOX_EXPORT void SetString( const char* s )
255  {
256  String( s );
257  }
258 
259  /** Print a string into this text object
260  * to right. Wraps at newline characters. Does not change the color or any
261  * other modes. Replaces the entire string.
262  * \param format printf style varargs formatting string.
263  */
264  GLSGEN_GLSTEXTBOX_EXPORT void VaString( const char* format, ... );
265 
266  /* Undocumented.
267  * This method is used to calculate the lines of the text box and is likely to change in future releases.
268  */
269  GLSGEN_GLSTEXTBOX_EXPORT void NextLineInfo( const unsigned int currentStringIndex,
270  unsigned int* lineEndIndex,
271  unsigned int* nextLineStringIndex,
272  float* startXpixels,
273  float* lineLengthPixels );
274 
275  /* Undocumented.
276  * This method is used to calculate the lines of the text box and may change in future releases.
277  */
278  GLSGEN_GLSTEXTBOX_EXPORT unsigned int GetLineCount();
279 
280  /** Sets tab space multiplier, 1.0 == same as specified in font */
281  GLSGEN_GLSTEXTBOX_EXPORT void TabSpacing( float );
282 
283  /** Returns the current tab space multiplier
284  * \return the current tab space multiplier
285  */
286  GLSGEN_GLSTEXTBOX_EXPORT float TabSpacing();
287 
288  /** Determine if the text direction is set to left->right or right->left
289  * \return true if if the text direction is set to left->right else false for right->left
290  */
291  GLSGEN_GLSTEXTBOX_EXPORT bool LeftToRight( void );
292 
293  /** Set the text direction
294  * \param leftToRight true for left->right else false for right->left
295  */
296  GLSGEN_GLSTEXTBOX_EXPORT void LeftToRight( bool leftToRight );
297 
298  virtual GLSGEN_GLSTEXTBOX_EXPORT void ResizeMode( ResizeMode_t value );
299  virtual GLSGEN_GLSTEXTBOX_EXPORT ResizeMode_t ResizeMode();
300 
301  virtual GLSGEN_GLSTEXTBOX_EXPORT void MaxWidth( float value );
302  virtual GLSGEN_GLSTEXTBOX_EXPORT float MaxWidth();
303 
304  virtual GLSGEN_GLSTEXTBOX_EXPORT void MaxHeight( float value );
305  virtual GLSGEN_GLSTEXTBOX_EXPORT float MaxHeight();
306 
307 protected:
308 #ifdef GLES
309  /** Set a single attribute from the GLO file.
310  * \param data The attribute to set and its associated data.
311  */
312  virtual GLSGEN_GLSTEXTBOX_EXPORT void SetFromGloData( GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
313 #endif
314 
315  /*
316  * Allocate a text buffer of the appropriate size for this grid and output snprintf style format
317  * into the buffer
318  * \param format snprintf style format spec
319  * \param args arguments for sprintf style formatting
320  * \return formatted textbuffer ( must be deleted by caller )
321  */
322  GLSGEN_GLSTEXTBOX_EXPORT char* FormatVarArgList( const char* format, va_list args );
323 
324  /* true -> grid will draw characters using "per character attributes" else
325  * false -> all characters will be drawn using the first character's attribute
326  * NOTE: This defaults to false and automatically enables to true if the user calls
327  * a method that requires per character attributes
328  */
329  bool _perCharAttribs;
330 
331  /*
332  * Enable per character attribute drawing for this grid
333  */
334  GLSGEN_GLSTEXTBOX_EXPORT void EnablePerCharAttribs( void )
335  {
336  if( !_perCharAttribs )
337  {
338  _perCharAttribs = true;
339  SetRebuild();
340  }
341  }
342 
343  /* Justification setting (TOP, CENTER, BOTTOM) */
344  Align_t _verticalAlignment;
345 
346  /* Space multiplier for tabs */
347  float _tabSpacing;
348 
349  //-----------------------------------------------------------------------
350  /*
351  */
352  GLSGEN_GLSTEXTBOX_EXPORT void RecalcCellSize();
353 
354  //-----------------------------------------------------------------------
355  /*
356  */
357  GLSGEN_GLSTEXTBOX_EXPORT void RecalcVertices();
358 
359  /** Populate the _rowInfo array based on the current display string
360  * \pre none
361  * \post _rowInfo array is populated based on the current display string
362  */
363  GLSGEN_GLSTEXTBOX_EXPORT virtual void CalculateRowData( void );
364 
365  /* Get the row info for the row starting at the given string index
366  * \param strIndex starting index into string
367  * \param rowLength [out] gets number of characters in row
368  * \param rowPixelWidth [out] gets pixel width of row
369  * \param nextRowStartIndex [out] gets starting string index for next row
370  * else GLSUINT32_MAX if there is no string data for the next row
371  * \pre strIndex < _str.GetLength()
372  * \post rowLength has the number of characters in the row,
373  * rowPixelWidth has the pixel width of the row,
374  * nextRowStartIndex has the starting string index for the next row
375  * else GLSUINT32_MAX if there is no string data for the next row
376  */
377  GLSGEN_GLSTEXTBOX_EXPORT void GetNextRowInfo( const unsigned int strIndex,
378  unsigned int& rowLength,
379  float& rowPixelWidth,
380  unsigned int& nextRowStartIndex ) const;
381 
382  float GetMaxLineLengthForResizeMode() const;
383 
384  void SetVerticesToTextBounds();
385 
386 public:
387  /** Get the width for the given character taking into account cell sizing, character spacing, uppercasing
388  * and tab characters width being expanded
389  * \param c character in question
390  * \return width for given character
391  * \pre none
392  * \post none
393  */
394  GLSGEN_GLSTEXTBOX_EXPORT float GetCharWidth( const unsigned short c ) const;
395 
396 protected:
397  /** info for one row of text in the display */
398  struct RowInfo
399  {
400  unsigned int startingIndex; /**< starting text index into the display for row
401  * else GLSUINT32_MAX if row has no characters */
402  unsigned int length; /**< the number of characters in row */
403  float pixelWidth; /**< the width of row in pixels */
404  };
405 
406  /** Number of rows of characters in the text grid (number of lines) */
407  unsigned int _lineCount;
408  bool _lineCountChanged;
409 
410  RowInfo* _rowInfo; /**< array ( _rows number of elements ) of RowInfo */
411 
412  float _cellWidthRatio;
413 
414  float _maxLineLengthPixels;
415  float _maxTextHeightPixels;
416  unsigned int _maxLinesToDraw;
417 
418  bool _leftToRight; /**< true to render characters from left to right else
419  * false for right to left */
420 
421  ResizeMode_t _resizeMode;
422  float _resizeMaxWidth;
423  float _resizeMaxHeight;
424 
425  UTF16String _unicodeText; /**< unicode version of _text from base class, updated by CalculateRowData */
426 
427  /* helper class for processing underline and strike-thru when drawing text grid */
429  {
430  public:
431  /**
432  * \param cellWidth maximum width of a character cell in the text box
433  * \param cellHeight height of a character cell in the text box
434  * \param cellYScale unused
435  * \param shadow true if text box has shadow enabled
436  * \param shadowOffset offset for shadow
437  * \param shadowColor color of shadow in text box
438  * \param underlineOffset offset of underline
439  * \param underlineSize size of underline
440  * \param halo true if text box has halo enabled
441  * \param haloOffset offset for halo
442  * \param haloColor color of halo in text box
443  * \param leftToRight true if text flows left to right else false for right to left
444  */
445  UnderlineStrikeThruHelper( float cellWidth, float cellHeight, float cellYScale, bool shadow, const Vector& shadowOffset, const GlsColor& shadowColor,
446  float underlineOffset, float underlineSize, bool halo, float haloOffset, GlsColor haloColor, bool leftToRight );
447 
448  /**
449  * Setup to process a new row in the text box.
450  */
451  void NewRow( void );
452 
453  /**
454  * Pre Process the given character attributes
455  * \param charAttr attributes in question
456  * \param c the character code to process.
457  * \param cellX x coord of character cell
458  * \param charY y coord of character
459  */
460  void PreProcessCharacter( const CharAttr_t& charAttr, const Char_t& c, float cellX, float charY );
461 
462  /**
463  * Post Process the given character attributes
464  * \param charAttr attributes in question
465  * \param c the character code to process.
466  * \param cellX x coord of character cell
467  * \param charY y coord of character cell
468  * \param cellWidth the width of the current character
469  * \param endOfLine true if character was the end of the current line
470  */
471  void PostProcessCharacter( const CharAttr_t& charAttr, const Char_t& c, float cellX, float charY, float cellWidth, bool endOfLine );
472 
473 #ifdef GLES
474  /**
475  * Render the line segments for the underline / strikethru
476  * \param quadStorage The quad storage list to render
477  */
478  void RenderLineSegments( GlsQuadListVC_3D& quadStorage );
479 #else
480  /**
481  * Render the line segments for the underline / strikethru
482  */
483  void RenderLineSegments( void );
484 #endif
485 
486  void IgnoreShadow( void );
487 
488  void AllowShadow( void );
489 
490  protected:
491  // cell constants
492  const float _cellWidth;
493  const float _cellHeight;
494 
495  // shadow constants
496  const bool _shadow;
497  const Vector _shadowOffset;
498  const GlsColor _shadowColor;
499  bool _allowShadow;
500 
501  // underline constants
502  const float _underlineOffset;
503  const float _underlineSize;
504 
505  // halo constants
506  const bool _halo;
507  const float _haloOffset;
508  const GlsColor _haloColor;
509 
510  // left to right
511  const bool _leftToRight;
512 
513  // state vars for underline processing
514  float _underlineX1, _underlineX2, _underlineY, _underlineScale;
515  GlsColor _underlineColor;
516  bool _underlineOn;
517 
518  // state vars for strike-thru processing
519  float _strikeX1, _strikeX2, _strikeY, _strikeScale;
520  GlsColor _strikeColor;
521  bool _strikeOn;
522 
523  // state vars for line processing
524  bool _whiteSpaceYes;
525 
526  // line segments to draw
527  typedef std::list<LineSegment_t> LineSegmentCont_t;
528  LineSegmentCont_t _lineSegments;
529  };
530 
531 private:
532  GlsTextBox& operator=( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
533  GlsTextBox( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
534 
535  /* See base class */
536  void OnCellDimensionChanged() DISTI_METHOD_OVERRIDE
537  {
538  _needToRebuild = true;
539  }
540 };
541 
542 //---------------------------------------------------------------------------
543 // Stream operators for text enumeration types
544 //---------------------------------------------------------------------------
545 inline std::istream& operator>>(
546  std::istream& instr, disti::GlsTextBox::Align_t& j )
547 {
548  std::string str;
549  instr >> str;
550 
551  if( str == "ALIGN_TOP" )
552  {
553  j = disti::GlsTextBox::ALIGN_TOP;
554  }
555  else if( str == "ALIGN_CENTER" )
556  {
557  j = disti::GlsTextBox::ALIGN_CENTER;
558  }
559  else if( str == "ALIGN_BOTTOM" )
560  {
561  j = disti::GlsTextBox::ALIGN_BOTTOM;
562  }
563  return instr;
564 }
565 
566 //---------------------------------------------------------------------------
567 inline std::ostream& operator<<( std::ostream& outstr, disti::GlsTextBox::Align_t j )
568 {
569  switch( j )
570  {
571  case disti::GlsTextBox::ALIGN_TOP:
572  outstr << "ALIGN_TOP";
573  break;
574  case disti::GlsTextBox::ALIGN_CENTER:
575  outstr << "ALIGN_CENTER";
576  break;
577  case disti::GlsTextBox::ALIGN_BOTTOM:
578  outstr << "ALIGN_BOTTOM";
579  break;
580  }
581  return outstr;
582 }
583 
584 /** In stream operator for ResizeMode_t enumeration.
585  */
586 inline std::istream& operator>>( std::istream& instr, disti::GlsTextBox::ResizeMode_t& direction )
587 {
588  std::string str;
589  instr >> str;
590 
591  if( str == "RESIZE_MODE_FIXED" )
592  {
593  direction = disti::GlsTextBox::RESIZE_MODE_FIXED;
594  }
595  else if( str == "RESIZE_MODE_AUTO_WIDTH" )
596  {
597  direction = disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH;
598  }
599  else if( str == "RESIZE_MODE_AUTO_HEIGHT" )
600  {
601  direction = disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT;
602  }
603  return instr;
604 }
605 
606 /** Out stream operator for ResizeMode_t enumeration.
607  */
608 inline std::ostream& operator<<( std::ostream& outstr, disti::GlsTextBox::ResizeMode_t direction )
609 {
610  switch( direction )
611  {
612  case disti::GlsTextBox::RESIZE_MODE_FIXED:
613  outstr << "RESIZE_MODE_FIXED";
614  break;
615  case disti::GlsTextBox::RESIZE_MODE_AUTO_WIDTH:
616  outstr << "RESIZE_MODE_AUTO_WIDTH";
617  break;
618  case disti::GlsTextBox::RESIZE_MODE_AUTO_HEIGHT:
619  outstr << "RESIZE_MODE_AUTO_HEIGHT";
620  break;
621  }
622  return outstr;
623 }
624 
625 } // namespace disti
626 
627 #endif
The DistiUnhideGlobalsDummyClass class.
Definition: cull.h:49
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
float Baseline()
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
Definition: dynamic_array.h:66
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:471
virtual void PreDraw(const OpenGLMatrices &current, 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
GlsColor TextColor()
Definition: display.h:98
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
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:254
void Char(Char_t code)
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(void)
bool _leftToRight
Definition: gls_text_box.h:418
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:403
virtual ~GlsTextBox()
Definition: gls_color.h:53
The gls_auto_lib.
virtual void Draw(void) DISTI_METHOD_OVERRIDE
float CharScaling()
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)
float CharSpacing()
std::string String() const
Definition: gls_text.h:543
Definition: vertex.h:84
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
The gls_gl.