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"
54 #if defined( ANDROID ) || defined (__APPLE__) || defined(RPI_ARCH) || _MSC_VER >= 1600
55 #define CTL_PTR std::unique_ptr
57 #define CTL_PTR std::auto_ptr
61 #if (defined(GLSGEN_EXPORT_GLSCTLTEXTBOX) || \
62 defined(GLSGEN_IMPORT_GLSCTLTEXTBOX) || \
63 defined(GLSGEN_GLSCTLTEXTBOX_EXPORT_GENERATED) || \
64 defined(GLS_IMPORT_GENERATED)) \
66 # if defined(GLSGEN_EXPORT_GLSCTLTEXTBOX) || defined(GLSGEN_GLSCTLTEXTBOX_EXPORT_GENERATED)
67 # define GLSGEN_GLSCTLTEXTBOX_EXPORT __declspec(dllexport)
69 # define GLSGEN_GLSCTLTEXTBOX_EXPORT __declspec(dllimport)
72 # define GLSGEN_GLSCTLTEXTBOX_EXPORT
82 #ifndef GLS_CTL_FALLBACK_ENABLED
84 # define CTL_BASE_CLASS GlsText
87 # define CTL_BASE_CLASS GlsTextBox
90 #define LIB_BASE_NAME "gls_ctl_text_box"
96 # if !defined(NO_GLS_AUTOLIB) && !defined(GLS_IMPORT_LIBRARY)
98 # define PANGO_SUFFIX "_64"
100 # define PANGO_SUFFIX ""
102 # pragma message( "Will automatically link with libpango" PANGO_SUFFIX "-1.0.lib" )
103 # pragma message( "Will automatically link with libpangoft2" PANGO_SUFFIX "-1.0.lib" )
104 # pragma message( "Will automatically link with libgobject" PANGO_SUFFIX "-2.0.lib" )
105 # pragma comment(lib, "libpango" PANGO_SUFFIX "-1.0.lib")
106 # pragma comment(lib, "libpangoft2" PANGO_SUFFIX "-1.0.lib")
107 # pragma comment(lib, "libgobject" PANGO_SUFFIX "-2.0.lib")
113 #pragma GCC diagnostic push
114 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
121 #ifndef GLS_CTL_FALLBACK_ENABLED
122 class GlsPangoWrapper;
125 class GlsTextBoxFontRenderer;
126 #endif // GLS_CTL_FALLBACK_ENABLED
129 class GlsGloFileAttribute;
130 class GlsStateManager;
131 class GlsQuadListVCT_2D;
152 friend class GlsCTLTextBoxEditor;
154 #ifndef GLS_CTL_FALLBACK_ENABLED
164 #endif // GLS_CTL_FALLBACK_ENABLED
169 VERTICAL_ALIGNMENT_CENTER = ALIGN_CENTER,
170 VERTICAL_ALIGNMENT_TOP = ALIGN_TOP,
171 VERTICAL_ALIGNMENT_BOTTOM = ALIGN_BOTTOM
178 ELLIPSIZE_MODE_START,
179 ELLIPSIZE_MODE_MIDDLE,
218 #ifndef GLS_CTL_FALLBACK_ENABLED
232 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void Draw();
235 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetVertices(
unsigned int nPoints,
Vertex* vertices );
238 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar );
244 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void VaString(
const char* format, ... );
249 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void VerticalAlignment( VerticalAlignment_t verticalAlignment );
262 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void VerticalAlignment( VerticalAlignment_t verticalAlignment ) { _BaseClass::VerticalAlignment( verticalAlignment ); }
265 #endif // GLS_CTL_FALLBACK_ENABLED
280 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void Rebuild();
302 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
unsigned int GetLineCount();
308 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
unsigned int GetGlyphCount();
315 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT GlyphMetrics
GetGlyphMetrics(
const unsigned int glyphIndex );
328 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetAltWidth(
float width );
334 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetAltHeight(
float height );
353 #ifndef GLS_CTL_FALLBACK_ENABLED
373 #endif // GLS_CTL_FALLBACK_ENABLED
378 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void SetFromGloData( GlsGloFileAttribute& data );
380 #ifndef GLS_CTL_FALLBACK_ENABLED
382 CTL_PTR< GlsQuadListVCT_2D > _shadows;
384 CTL_PTR< GlsQuadListVCT_2D > _characters;
387 bool _geometryRefreshDraw;
392 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void PopulateQuadStorage( IGlsStateManager* stateManager );
397 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void DrawText( IGlsStateManager* stateManager );
398 #endif // GLS_CTL_FALLBACK_ENABLED
404 virtual GLSGEN_GLSCTLTEXTBOX_EXPORT
void DrawText();
406 #ifndef GLS_CTL_FALLBACK_ENABLED
410 #endif // GLS_CTL_FALLBACK_ENABLED
414 void OnCellDimensionChanged()
426 #ifndef GLS_CTL_FALLBACK_ENABLED
435 if( str ==
"ALIGN_TOP" || str ==
"VERTICAL_ALIGNMENT_TOP" )
437 verticalAlignment = disti::GlsCTLTextBox::ALIGN_TOP;
439 else if( str ==
"ALIGN_CENTER" || str ==
"VERTICAL_ALIGNMENT_CENTER" )
441 verticalAlignment = disti::GlsCTLTextBox::ALIGN_CENTER;
443 else if( str ==
"ALIGN_BOTTOM" || str ==
"VERTICAL_ALIGNMENT_BOTTOM" )
445 verticalAlignment = disti::GlsCTLTextBox::ALIGN_BOTTOM;
454 switch( verticalAlignment )
456 case disti::GlsCTLTextBox::ALIGN_TOP:
457 outstr <<
"ALIGN_TOP";
459 case disti::GlsCTLTextBox::ALIGN_CENTER:
460 outstr <<
"ALIGN_CENTER";
462 case disti::GlsCTLTextBox::ALIGN_BOTTOM:
463 outstr <<
"ALIGN_BOTTOM";
468 #endif // GLS_CTL_FALLBACK_ENABLED
477 if( str ==
"ELLIPSIZE_MODE_NONE" )
479 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_NONE;
481 else if( str ==
"ELLIPSIZE_MODE_START" )
483 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_START;
485 else if( str ==
"ELLIPSIZE_MODE_MIDDLE" )
487 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_MIDDLE;
489 else if( str ==
"ELLIPSIZE_MODE_END" )
491 ellipsizeMode = disti::GlsCTLTextBox::ELLIPSIZE_MODE_END;
500 switch( ellipsizeMode )
502 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_NONE:
503 outstr <<
"ELLIPSIZE_MODE_NONE";
505 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_START:
506 outstr <<
"ELLIPSIZE_MODE_START";
508 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_MIDDLE:
509 outstr <<
"ELLIPSIZE_MODE_MIDDLE";
511 case disti::GlsCTLTextBox::ELLIPSIZE_MODE_END:
512 outstr <<
"ELLIPSIZE_MODE_END";
520 #pragma GCC diagnostic pop
523 #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:289
virtual void CopyGeometry(DisplayObject *src)
virtual void SetVertices(unsigned int nPoints, Vertex *vertices)
float _altWidth
Definition: gls_ctl_text_box.h:355
virtual DisplayObject * CloneObject(bool generateNames=false)
EllipsizeMode_t
Definition: gls_ctl_text_box.h:175
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:783
virtual void RecalcVertices()
virtual unsigned int GetLineCount()
The disti::GlsText class.
float _altHeight
Definition: gls_ctl_text_box.h:357
virtual unsigned int GetGlyphCount()
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:142
bool ControlCellSize() const
Definition: gls_text.h:466
VerticalAlignmentCTL_t
Definition: gls_ctl_text_box.h:167
static const unsigned int INTERNAL_BORDER
Definition: gls_ctl_text_box.h:150
Definition: gls_ctl_text_box.h:186
VerticalAlignment_t
Definition: gls_ctl_text_box.h:156
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
float _cellWidth
Definition: gls_text.h:786
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
float _textVerticalScale
Definition: gls_ctl_text_box.h:362
virtual EllipsizeMode_t EllipsizeMode()
virtual void SetAltHeight(float height)
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:360
std::auto_ptr< GlsPangoWrapper > _glsPangoWrapper
Definition: gls_ctl_text_box.h:365
Definition: bmpimage.h:46
virtual void SetAltWidth(float width)