41 #ifndef INCLUDED_GLS_CTL_TEXT_BOX_H
42 #define INCLUDED_GLS_CTL_TEXT_BOX_H
47 #if defined(EMSCRIPTEN) || defined(RPI_ARCH)
48 # define GLS_CTL_FALLBACK_ENABLED
50 # error "GLES should always be enabled when using the CTL fallback code"
55 #if (defined(GLSGEN_EXPORT_GLSCTLTEXTBOX) || \
56 defined(GLSGEN_IMPORT_GLSCTLTEXTBOX) || \
57 defined(GLSGEN_GLSCTLTEXTBOX_EXPORT_GENERATED) || \
58 defined(GLS_IMPORT_GENERATED)) \
60 # if defined(GLSGEN_EXPORT_GLSCTLTEXTBOX) || defined(GLSGEN_GLSCTLTEXTBOX_EXPORT_GENERATED)
61 # define GLSGEN_GLSCTLTEXTBOX_EXPORT __declspec(dllexport)
63 # define GLSGEN_GLSCTLTEXTBOX_EXPORT __declspec(dllimport)
66 # define GLSGEN_GLSCTLTEXTBOX_EXPORT
76 #ifndef GLS_CTL_FALLBACK_ENABLED
78 # define CTL_BASE_CLASS GlsText
81 # define CTL_BASE_CLASS GlsTextBox
84 #define LIB_BASE_NAME "gls_ctl_text_box"
90 # if !defined(NO_GLS_AUTOLIB) && !defined(GLS_IMPORT_LIBRARY)
92 # define PANGO_SUFFIX "_64"
94 # define PANGO_SUFFIX ""
96 # pragma message( "Will automatically link with libpango" PANGO_SUFFIX "-1.0.lib" )
97 # pragma message( "Will automatically link with libpangoft2" PANGO_SUFFIX "-1.0.lib" )
98 # pragma message( "Will automatically link with libgobject" PANGO_SUFFIX "-2.0.lib" )
99 # pragma comment(lib, "libpango" PANGO_SUFFIX "-1.0.lib")
100 # pragma comment(lib, "libpangoft2" PANGO_SUFFIX "-1.0.lib")
101 # pragma comment(lib, "libgobject" PANGO_SUFFIX "-2.0.lib")
109 #ifndef GLS_CTL_FALLBACK_ENABLED
110 class GlsPangoWrapper;
113 class GlsTextBoxFontRenderer;
114 #endif // GLS_CTL_FALLBACK_ENABLED
117 class GlsGloFileAttribute;
118 class GlsStateManager;
119 class GlsQuadListVCT_2D;
140 friend class GlsCTLTextBoxEditor;
142 #ifndef GLS_CTL_FALLBACK_ENABLED
152 #endif // GLS_CTL_FALLBACK_ENABLED
157 VERTICAL_ALIGNMENT_CENTER = ALIGN_CENTER,
158 VERTICAL_ALIGNMENT_TOP = ALIGN_TOP,
159 VERTICAL_ALIGNMENT_BOTTOM = ALIGN_BOTTOM
166 ELLIPSIZE_MODE_START,
167 ELLIPSIZE_MODE_MIDDLE,
206 #ifndef GLS_CTL_FALLBACK_ENABLED
220 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void Draw();
223 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetVertices(
unsigned int nPoints,
Vertex* vertices );
226 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar );
232 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void VaString(
const char* format, ... );
237 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void VerticalAlignment( VerticalAlignment_t verticalAlignment );
250 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void VerticalAlignment( VerticalAlignment_t verticalAlignment ) { _BaseClass::VerticalAlignment( verticalAlignment ); }
253 #endif // GLS_CTL_FALLBACK_ENABLED
268 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void Rebuild();
290 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
unsigned int GetLineCount();
296 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
unsigned int GetGlyphCount();
303 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT GlyphMetrics
GetGlyphMetrics(
const unsigned int glyphIndex );
316 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetAltWidth(
float width );
322 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetAltHeight(
float height );
341 #ifndef GLS_CTL_FALLBACK_ENABLED
361 #endif // GLS_CTL_FALLBACK_ENABLED
366 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetFromGloData( GlsGloFileAttribute& data );
368 #ifndef GLS_CTL_FALLBACK_ENABLED
375 bool _geometryRefreshDraw;
380 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void PopulateQuadStorage( IGlsStateManager* stateManager );
385 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void DrawText( IGlsStateManager* stateManager );
386 #endif // GLS_CTL_FALLBACK_ENABLED
392 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void DrawText();
394 #ifndef GLS_CTL_FALLBACK_ENABLED
398 #endif // GLS_CTL_FALLBACK_ENABLED
402 void OnCellDimensionChanged()
414 #ifndef GLS_CTL_FALLBACK_ENABLED
423 if( str ==
"ALIGN_TOP" || str ==
"VERTICAL_ALIGNMENT_TOP" )
425 verticalAlignment = disti::GlsCTLTextBox::ALIGN_TOP;
427 else if( str ==
"ALIGN_CENTER" || str ==
"VERTICAL_ALIGNMENT_CENTER" )
429 verticalAlignment = disti::GlsCTLTextBox::ALIGN_CENTER;
431 else if( str ==
"ALIGN_BOTTOM" || str ==
"VERTICAL_ALIGNMENT_BOTTOM" )
433 verticalAlignment = disti::GlsCTLTextBox::ALIGN_BOTTOM;
442 switch( verticalAlignment )
444 case disti::GlsCTLTextBox::ALIGN_TOP:
445 outstr <<
"ALIGN_TOP";
447 case disti::GlsCTLTextBox::ALIGN_CENTER:
448 outstr <<
"ALIGN_CENTER";
450 case disti::GlsCTLTextBox::ALIGN_BOTTOM:
451 outstr <<
"ALIGN_BOTTOM";
456 #endif // GLS_CTL_FALLBACK_ENABLED
465 if( str ==
"ELLIPSIZE_MODE_NONE" )
467 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_NONE;
469 else if( str ==
"ELLIPSIZE_MODE_START" )
471 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_START;
473 else if( str ==
"ELLIPSIZE_MODE_MIDDLE" )
475 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_MIDDLE;
477 else if( str ==
"ELLIPSIZE_MODE_END" )
479 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_END;
488 switch( ellipsizeMode )
490 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_NONE:
491 outstr <<
"ELLIPSIZE_MODE_NONE";
493 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_START:
494 outstr <<
"ELLIPSIZE_MODE_START";
496 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_MIDDLE:
497 outstr <<
"ELLIPSIZE_MODE_MIDDLE";
499 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_END:
500 outstr <<
"ELLIPSIZE_MODE_END";
508 #endif // INCLUDED_GLS_CTL_TEXT_BOX_H
The DistiUnhideGlobalsDummyClass class.
virtual VerticalAlignment_t VerticalAlignment()
The disti::GlsTextBox class.
virtual float TextHorizontalScale()
void AdjustImageVertsAndCoords(PangoRect &verts, PangoRect &texCoords)
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:281
virtual void CopyGeometry(DisplayObject *src)
virtual void SetVertices(unsigned int nPoints, Vertex *vertices)
float _altWidth
Definition: gls_ctl_text_box.h:343
virtual DisplayObject * CloneObject(bool generateNames=false)
EllipsizeMode_t
Definition: gls_ctl_text_box.h:163
virtual void SetAvailableAttributes(unsigned int value)
virtual void VaString(const char *format,...)
virtual GlyphMetrics GetGlyphMetrics(const unsigned int glyphIndex)
float _cellHeight
Definition: gls_text.h:778
virtual void RecalcVertices()
virtual unsigned int GetLineCount()
The disti::GlsText class.
float _altHeight
Definition: gls_ctl_text_box.h:345
virtual unsigned int GetGlyphCount()
ScopedPtr< GlsPangoWrapper > _glsPangoWrapper
Definition: gls_ctl_text_box.h:353
virtual void CopyProperties(DisplayObject *src)
virtual float TextVerticalScale()
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
The Gls CTL (Complex Text Layout) Text Box.
Definition: gls_ctl_text_box.h:130
bool ControlCellSize() const
Definition: gls_text.h:461
VerticalAlignmentCTL_t
Definition: gls_ctl_text_box.h:155
static const unsigned int INTERNAL_BORDER
Definition: gls_ctl_text_box.h:138
Definition: gls_ctl_text_box.h:174
VerticalAlignment_t
Definition: gls_ctl_text_box.h:144
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
float _cellWidth
Definition: gls_text.h:781
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
float _textVerticalScale
Definition: gls_ctl_text_box.h:350
virtual EllipsizeMode_t EllipsizeMode()
virtual void SetAltHeight(float height)
A smart pointer with unique ownership – poor man's std::unique_ptr.
virtual void SetLayoutAutoDir(bool autoDir)
Macros and helper code to determine what subset of C++11/14/17 is available.
float _textHorizontalScale
Definition: gls_ctl_text_box.h:348
Definition: bmpimage.h:46
virtual void SetAltWidth(float width)