GL Studio Safety Critical Embedded C++ Runtime Library
|
#include <gls_text_box.h>
Classes | |
struct | InitParameters |
Public Types | |
enum | VerticalAlignment { VERTICAL_ALIGNMENT_TOP, VERTICAL_ALIGNMENT_CENTER, VERTICAL_ALIGNMENT_BOTTOM } |
Public Types inherited from GlsText | |
enum | Justification { JUSTIFICATION_LEFT, JUSTIFICATION_CENTER, JUSTIFICATION_RIGHT } |
Public Types inherited from GlsDisplayObject | |
enum | ObjectType { OBJECT_TYPE_COMPOSITE, OBJECT_TYPE_RENDERABLE } |
enum | PickMode { PICK_MODE_NEVER, PICK_MODE_FIRST, PICK_MODE_ALWAYS } |
Public Member Functions | |
GlsTextBox (const InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher) | |
virtual void | SetCharAttributes (const GlsText::CharAttribute &charAttribute) |
Public Member Functions inherited from GlsText | |
virtual void | Draw (GlsStateManager &gl, const GlsFloat64 time) |
virtual void | SetAlphaMode (const GlsAlphaMode alphaMode) |
virtual void | SetFillColor (const GlsColor &fillColor) |
virtual void | SetLineColor (const GlsColor &lineColor) |
virtual void | SetLineWidth (const GlsFloat32 lineWidth) |
virtual void | SetPolygonMode (const GlsPolygonMode polygonMode) |
virtual void | SetTextureIndex (const GlsUInt32 textureIndex) |
virtual void | OffsetTexture (const GlsVector2D &offset) |
void | SetString (const GlsChar *const str) |
void | SetHaloColor (const GlsColor &haloColor) |
void | SetShadowColor (const GlsColor &shadowColor) |
Public Member Functions inherited from GlsDisplayObject | |
virtual void | Calculate (const GlsFloat64 time) |
virtual GlsDisplayObject * | PickTest (const GlsVector2D &windowCoord, GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix) |
GlsDisplayObject * | HandleEvent (GlsEvent &event) |
ObjectType | GetObjectType (void) const |
void | SetBlinking (const GlsBool blinking) |
void | SetBlinkRate (const GlsFloat32 blinkRate) |
void | SetDynamicRotation (const GlsVector3D &dynamicRotation) |
void | SetDynamicScale (const GlsVector3D &dynamicScale) |
void | SetDynamicTranslation (const GlsVector3D &dynamicTranslation) |
void | SetVisibility (const GlsBool visible) |
void | SetParent (GlsDisplayObject *const parent) |
void | SetPickMode (const PickMode pickMode) |
GlsBool | NeedCalculate (void) const |
void | InvalidatePickCache (void) |
Protected Member Functions | |
virtual void | DrawCharacters (GlsStateManager &gl) |
virtual void | CalculateRowData (void) |
void | GetNextRowInfo (const GlsUInt32 strIndex, GlsUInt32 &rowLength, GlsFloat32 &rowPixelWidth, GlsUInt32 &nextRowStartIndex) const |
GlsFloat32 | GetCharWidth (const GlsChar c) const |
virtual | ~GlsTextBox () |
Protected Member Functions inherited from GlsText | |
GlsText (const InitParameters &initParameters, const GlsUInt32 maxNumLineSegmentsPerRow, GlsEventDispatcher *const eventDispatcher) | |
GlsFloat32 | JustificationOffset (const GlsUInt32 row) const |
void | ResetUnderineStrikeThruRenderers (void) |
virtual | ~GlsText () |
Protected Member Functions inherited from GlsRenderObject | |
GlsRenderObject (const InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher) | |
GLint | GlsTextureFilterModeToGL (const GlsTextureFilterMode mode) const |
void | SetupDepthTest (GlsStateManager &gl) const |
void | SetupAlpha (GlsStateManager &gl) const |
GlsBool | SetupTexture (GlsStateManager &gl, const GlsUInt32 textureIndex) const |
void | SetupTextureFilterSettings (GlsStateManager &gl) const |
void | SetupBackfaceCulling (GlsStateManager &gl) const |
void | SetupShading (GlsStateManager &gl) const |
void | SetupLineStyle (GlsStateManager &gl) const |
void | SetupAntiAlias (GlsStateManager &gl) const |
virtual | ~GlsRenderObject () |
Protected Member Functions inherited from GlsDisplayObject | |
GlsDisplayObject (const InitParameters &initParameters, const ObjectType objectType, GlsEventDispatcher *const eventDispatcher) | |
virtual | ~GlsDisplayObject () |
GlsBool | CalcDrawMatrix (const GlsMatrixAffineD *const additionalTransform, const GlsBool includeLocation) |
virtual void | CalcWindowPickRegion (GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix) |
GlsBool | IsBlinkedOff (const GlsFloat64 time) const |
Static Protected Attributes | |
static const GlsFloat32 | TAB_SPACING |
Static Protected Attributes inherited from GlsText | |
static const GlsUInt32 | NUM_VERTS_BACKGROUND_POLY = 4u |
static const GlsChar | NEW_LINE_CHAR |
static const GlsChar | SPACE_CHAR |
Static Protected Attributes inherited from GlsRenderObject | |
static const GLclampf | ALPHA_MODE_2_LEVEL_REF |
This class implements a box of proportionally spaced text
GlsTextBox::GlsTextBox | ( | const InitParameters & | initParameters, |
GlsEventDispatcher *const | eventDispatcher | ||
) |
Constructor - create an instance
initParameters | initialization parameters |
eventDispatcher | event dispatcher for this object else GLS_NULL |
|
protectedvirtual |
Destructor - shall never be called
|
protectedvirtual |
Populate the _rowInfo array and _startingCellY based on the current display string
Implements GlsText.
|
protectedvirtual |
Draw the characters associated with the text box
gl | GL state manager to draw into |
Implements GlsText.
|
protected |
Get the width for the given character taking into account cell sizing, character spacing, uppercasing and tab characters width being expanded
c | character in question |
|
protected |
Get the row info for the row starting at the given string index
strIndex | starting index into string |
rowLength | [out] gets number of characters in row |
rowPixelWidth | [out] gets pixel width of row |
nextRowStartIndex | [out] gets starting string index for next row else GLSUINT32_MAX if there is no string data for the next row |
|
virtual |
Set the character attributes for all of the text
charAttribute | new character attributes for the text |
Implements GlsText.
|
protected |
ratio of cell width to width of widest character in the font
|
protected |
character attribute for all characters
|
protected |
starting Y coordinate of first cell in text box ( populated by CalculateRowData() )
|
protected |
vertical alignment mode for text
|
staticprotected |
number of tab char widths to count for one tab char