40 #ifndef _GLS_TEXT_BOX_H
41 #define _GLS_TEXT_BOX_H
44 #if (defined(GLSGEN_EXPORT_GLSTEXTBOX) || \
45 defined(GLSGEN_IMPORT_GLSTEXTBOX) || \
46 defined(GLSGEN_GLSTEXTBOX_EXPORT_GENERATED) || \
47 defined(GLS_IMPORT_GENERATED)) \
49 # if defined(GLSGEN_EXPORT_GLSTEXTBOX) || defined(GLSGEN_GLSTEXTBOX_EXPORT_GENERATED)
50 # define GLSGEN_GLSTEXTBOX_EXPORT __declspec(dllexport)
52 # define GLSGEN_GLSTEXTBOX_EXPORT __declspec(dllimport)
55 # define GLSGEN_GLSTEXTBOX_EXPORT
67 #include "gls_quad_storage.h"
68 #include "gls_state_manager.h"
71 #define LIB_BASE_NAME "gls_text_box"
83 class GlsGloFileAttribute;
97 GlsQuadListVC_3D _backgrounds;
98 GlsQuadListVCT_2D _shadows;
99 GlsQuadListVC_3D _shadowLines;
100 GlsQuadListVCT_2D _characters;
101 GlsQuadListVC_3D _lines;
103 void PopulateQuadStorage();
109 friend class GlsTextBoxEditor;
113 GLSGEN_GLSTEXTBOX_EXPORT
GlsTextBox(
const GlsTextBox& that,
const bool generateNames );
142 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Calculate(
double time);
154 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Draw(
void);
172 virtual GLSGEN_GLSTEXTBOX_EXPORT
void SetVertices(
unsigned int nPoints,
Vertex *vertices);
175 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Initialize();
188 virtual GLSGEN_GLSTEXTBOX_EXPORT
unsigned int MaxLinesToDraw(
void);
191 virtual GLSGEN_GLSTEXTBOX_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex *anchor,
int handleBar);
211 return _verticalAlignment;
224 GLSGEN_GLSTEXTBOX_EXPORT
void Clear(
void)
259 GLSGEN_GLSTEXTBOX_EXPORT
void VaString(
const char* format, ...);
264 GLSGEN_GLSTEXTBOX_EXPORT
void NextLineInfo(
const unsigned int currentStringIndex,
265 unsigned int* lineEndIndex,
266 unsigned int* nextLineStringIndex,
268 float* lineLengthPixels);
273 GLSGEN_GLSTEXTBOX_EXPORT
unsigned int GetLineCount();
276 GLSGEN_GLSTEXTBOX_EXPORT
void TabSpacing(
float);
291 GLSGEN_GLSTEXTBOX_EXPORT
void LeftToRight(
bool leftToRight );
299 virtual GLSGEN_GLSTEXTBOX_EXPORT
void SetFromGloData(GlsGloFileAttribute &data);
309 GLSGEN_GLSTEXTBOX_EXPORT
char* FormatVarArgList(
const char* format, va_list args );
316 bool _perCharAttribs;
321 GLSGEN_GLSTEXTBOX_EXPORT
void EnablePerCharAttribs(
void )
323 if( !_perCharAttribs )
325 _perCharAttribs =
true;
331 Align_t _verticalAlignment;
339 GLSGEN_GLSTEXTBOX_EXPORT
void Rebuild();
344 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcCellSize();
349 GLSGEN_GLSTEXTBOX_EXPORT
void RecalcVertices();
369 void GetNextRowInfo(
const unsigned int strIndex,
370 unsigned int &rowLength,
371 float &rowPixelWidth,
372 unsigned int &nextRowStartIndex)
const;
382 float GetCharWidth(
const unsigned short c)
const;
397 bool _lineCountChanged;
401 float _cellWidthRatio;
403 float _maxLineLengthPixels;
404 float _maxTextHeightPixels;
405 unsigned int _maxLinesToDraw;
432 float underlineOffset,
float underlineSize,
bool halo,
float haloOffset,
glsColor haloColor,
bool leftToRight );
472 void IgnoreShadow(
void );
474 void AllowShadow(
void );
477 const float _cellWidth;
478 const float _cellHeight;
482 const Vector _shadowOffset;
487 const float _underlineOffset;
488 const float _underlineSize;
492 const float _haloOffset;
496 const bool _leftToRight;
499 float _underlineX1, _underlineX2, _underlineY, _underlineScale;
504 float _strikeX1, _strikeX2, _strikeY, _strikeScale;
512 typedef std::list<LineSegment_t> LineSegmentCont_t;
513 LineSegmentCont_t _lineSegments;
517 GlsTextBox& operator=(
const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
518 GlsTextBox( const GlsTextBox& ) DISTI_SPECIAL_MEM_FUN_DELETE;
521 void OnCellDimensionChanged()
530 inline std::istream& operator>>(
531 std::istream& instr, disti::GlsTextBox::Align_t& j)
536 if (str ==
"ALIGN_TOP")
538 j = disti::GlsTextBox::ALIGN_TOP;
540 else if (str ==
"ALIGN_CENTER")
542 j = disti::GlsTextBox::ALIGN_CENTER;
544 else if (str ==
"ALIGN_BOTTOM")
546 j = disti::GlsTextBox::ALIGN_BOTTOM;
552 inline std::ostream& operator<<(std::ostream& outstr, disti::GlsTextBox::Align_t j)
556 case disti::GlsTextBox::ALIGN_TOP:
557 outstr <<
"ALIGN_TOP";
559 case disti::GlsTextBox::ALIGN_CENTER:
560 outstr <<
"ALIGN_CENTER";
562 case disti::GlsTextBox::ALIGN_BOTTOM:
563 outstr <<
"ALIGN_BOTTOM";
The DistiUnhideGlobalsDummyClass class.
virtual void SetVertices(unsigned int nPoints, Vertex *vertices)
UnicodeString _unicodeText
Definition: gls_text_box.h:410
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void SetAvailableAttributes(unsigned int value)
Definition: dynamic_array.h:63
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:281
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
virtual unsigned int MaxLinesToDraw(void)
unsigned int length
Definition: gls_text_box.h:391
void VaString(const char *format,...)
Attributes for each character position in the grid.
Definition: gls_text.h:173
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:399
void Clear(void)
Definition: gls_text_box.h:224
Definition: gls_text_box.h:387
Definition: gls_text.h:152
std::string _text
Definition: gls_text.h:828
The disti::GlsText class.
void PreProcessCharacter(const CharAttr_t &charAttr, const Char_t &c, float cellX, float charY)
void SetString(const char *s)
Definition: gls_text_box.h:248
Definition: gls_text_box.h:413
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
float CellWidth() const
Definition: gls_text.h:390
unsigned int _lineCount
Definition: gls_text_box.h:396
void ClearChars(void)
Definition: gls_text_box.h:233
virtual void CopyGeometry(DisplayObject *src)
bool _leftToRight
Definition: gls_text_box.h:407
Definition: gls_text_box.h:90
void RenderLineSegments(void)
float pixelWidth
Definition: gls_text_box.h:392
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)
Definition: gls_color.h:54
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:412
void Scale(int handleBar, float px, float py, Vertex *anchor=NULL)
Definition: display.h:1111
std::string String() const
Definition: gls_text.h:665
void SetRebuild()
Definition: gls_text.h:709
virtual Align_t VerticalAlignment() const
Definition: gls_text_box.h:209
virtual void CalculateRowData(void)
Macros and helper code to determine what subset of C++11/14/17 is available.
bool _needToRebuild
Definition: gls_text.h:816
Definition: bmpimage.h:46
virtual void Calculate(double time)
float CellHeight() const
Definition: gls_text.h:376
unsigned int startingIndex
Definition: gls_text_box.h:389