Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions

GR_XPRenderInfo Class Reference

This is an xp implementation of GR_RenderInfo for use with the built in UT_contextGlyph class. More...

#include <gr_RenderInfo.h>

Inheritance diagram for GR_XPRenderInfo:
GR_RenderInfo

List of all members.

Public Member Functions

 GR_XPRenderInfo (GR_ScriptType type)
virtual ~GR_XPRenderInfo ()
virtual GRRI_Type getType () const
virtual bool append (GR_RenderInfo &ri, bool bReverse=false)
virtual bool split (GR_RenderInfo *&pri, bool bReverse=false)
virtual bool cut (UT_uint32 offset, UT_uint32 len, bool bReverse=false)
 remove section of length iLen starting at offset from any chaches ...
virtual bool isJustified () const
void prepareToRenderChars ()

Public Attributes

UT_UCS4Charm_pChars
UT_sint32m_pWidths
UT_sint32 m_iBufferSize
UT_sint32m_pSegmentOffset
UT_sint32 m_iSegmentCount
UT_sint32 m_iSpaceWidthBeforeJustification
UT_uint32 m_iTotalLength

Static Public Attributes

static UT_sint32 s_iClassInstanceCount = 0
static UT_UCS4Chars_pCharBuff = NULL
static UT_sint32s_pWidthBuff = NULL
static UT_sint32 s_iBuffSize = 0
static UT_sint32s_pAdvances = NULL
static GR_RenderInfos_pOwner = NULL

Private Member Functions

void _constructorCommonCode ()
void _stripLigaturePlaceHolders ()
void _calculateCharAdvances ()
 The following code calculates the advances for individual characters that are to be fed to gr_Graphics::drawChars() Note, that character advances are not necessarily identical to character widths; in the case of combining characters the required advance depends on the width of the base character and the properties of the combining character, and it can be both positive and negative.
bool _checkAndFixStaticBuffers ()

Detailed Description

This is an xp implementation of GR_RenderInfo for use with the built in UT_contextGlyph class.


Constructor & Destructor Documentation

GR_XPRenderInfo::GR_XPRenderInfo ( GR_ScriptType  type  ) 

References _constructorCommonCode().

Referenced by split().

GR_XPRenderInfo::~GR_XPRenderInfo (  )  [virtual]

Member Function Documentation

void GR_XPRenderInfo::_calculateCharAdvances (  )  [inline, private]

The following code calculates the advances for individual characters that are to be fed to gr_Graphics::drawChars() Note, that character advances are not necessarily identical to character widths; in the case of combining characters the required advance depends on the width of the base character and the properties of the combining character, and it can be both positive and negative.

At the moment, we calculate the advances here puting them into a static array. Should this prove to be too much of a performance bottleneck, we could cache this in a member array, and refresh it inside refreshDrawBuffer()

References GR_OC_LEFT_FLUSHED, m_iBufferSize, GR_RenderInfo::m_iLength, GR_RenderInfo::m_iVisDir, GR_RenderInfo::m_xoff, s_pAdvances, s_pWidthBuff, UT_BIDI_RTL, UT_return_if_fail, and xxx_UT_DEBUGMSG.

Referenced by prepareToRenderChars().

bool GR_XPRenderInfo::_checkAndFixStaticBuffers (  )  [inline, private]
void GR_XPRenderInfo::_constructorCommonCode (  )  [private]
void GR_XPRenderInfo::_stripLigaturePlaceHolders (  )  [inline, private]

This function no longer does any ligature handling (use the Pango graphics for that); It still does some preprocessing on the static buffers that is needed by _calculateCharacterAdvances.

References m_iBufferSize, GR_RenderInfo::m_iLength, m_iSegmentCount, GR_RenderInfo::m_iVisDir, m_pChars, m_pSegmentOffset, GR_RenderInfo::m_pText, m_pWidths, s_pCharBuff, s_pWidthBuff, UT_BIDI_RTL, and UT_return_if_fail.

Referenced by prepareToRenderChars().

bool GR_XPRenderInfo::append ( GR_RenderInfo ri,
bool  bReverse = false 
) [virtual]
bool GR_XPRenderInfo::cut ( UT_uint32  offset,
UT_uint32  iLen,
bool  bReverse = false 
) [virtual]

remove section of length iLen starting at offset from any chaches ...

return value false indicates that simple removal was not possible and the caller needs to re-shape.

Implements GR_RenderInfo.

References d, GR_RenderInfo::m_eShapingResult, GR_RenderInfo::m_eState, GR_RenderInfo::m_iLength, m_iTotalLength, GR_RenderInfo::m_iVisDir, m_pChars, GR_RenderInfo::m_pText, m_pWidths, s, s_pOwner, UT_BIDI_RTL, UT_return_val_if_fail, and UT_UCS4_strncpy().

virtual GRRI_Type GR_XPRenderInfo::getType ( void   )  const [inline, virtual]

Implements GR_RenderInfo.

virtual bool GR_XPRenderInfo::isJustified (  )  const [inline, virtual]

Implements GR_RenderInfo.

Referenced by GR_Graphics::shape(), and split().

void GR_XPRenderInfo::prepareToRenderChars (  ) 
bool GR_XPRenderInfo::split ( GR_RenderInfo *&  pri,
bool  bReverse = false 
) [virtual]

Member Data Documentation


The documentation for this class was generated from the following files: