This is an xp implementation of GR_RenderInfo for use with the built in UT_contextGlyph class. More...
#include <gr_RenderInfo.h>
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_UCS4Char * | m_pChars |
UT_sint32 * | m_pWidths |
UT_sint32 | m_iBufferSize |
UT_sint32 * | m_pSegmentOffset |
UT_sint32 | m_iSegmentCount |
UT_sint32 | m_iSpaceWidthBeforeJustification |
UT_uint32 | m_iTotalLength |
Static Public Attributes | |
static UT_sint32 | s_iClassInstanceCount = 0 |
static UT_UCS4Char * | s_pCharBuff = NULL |
static UT_sint32 * | s_pWidthBuff = NULL |
static UT_sint32 | s_iBuffSize = 0 |
static UT_sint32 * | s_pAdvances = NULL |
static GR_RenderInfo * | s_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 () |
This is an xp implementation of GR_RenderInfo for use with the built in UT_contextGlyph class.
GR_XPRenderInfo::GR_XPRenderInfo | ( | GR_ScriptType | type | ) |
References _constructorCommonCode().
Referenced by split().
GR_XPRenderInfo::~GR_XPRenderInfo | ( | ) | [virtual] |
References m_pChars, m_pWidths, s_iClassInstanceCount, s_pAdvances, s_pCharBuff, s_pOwner, s_pWidthBuff, and xxx_UT_DEBUGMSG.
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] |
References GR_RenderInfo::m_iLength, s_iBuffSize, s_pAdvances, s_pCharBuff, s_pWidthBuff, and UT_return_val_if_fail.
Referenced by prepareToRenderChars().
void GR_XPRenderInfo::_constructorCommonCode | ( | ) | [private] |
References s_iBuffSize, s_iClassInstanceCount, s_pAdvances, s_pCharBuff, s_pWidthBuff, and UT_return_if_fail.
Referenced by GR_XPRenderInfo().
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] |
append data represented by ri to ourselves
NB: combine the justification information
Implements GR_RenderInfo.
References GR_RenderInfo::m_bLastOnLine, m_iBufferSize, GR_RenderInfo::m_iJustificationAmount, GR_RenderInfo::m_iJustificationPoints, GR_RenderInfo::m_iLength, m_iSpaceWidthBeforeJustification, m_iTotalLength, m_pChars, m_pWidths, s_pOwner, UT_DEBUGMSG, UT_return_val_if_fail, UT_UCS4_strncpy(), and xxx_UT_DEBUGMSG.
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] |
creates a new instance of GR_*RenderInfo and splits data between ourselves and it at offset
bReverse == true indicates data in RTL order
we also calculate justification info for the two parts
Implements GR_RenderInfo.
References GR_Graphics::countJustificationPoints(), GR_XPRenderInfo(), isJustified(), GR_RenderInfo::m_bLastOnLine, GR_RenderInfo::m_eScriptType, GR_RenderInfo::m_eShapingResult, m_iBufferSize, GR_RenderInfo::m_iJustificationAmount, GR_RenderInfo::m_iJustificationPoints, GR_RenderInfo::m_iLength, GR_RenderInfo::m_iOffset, m_iSpaceWidthBeforeJustification, m_iTotalLength, m_pChars, GR_RenderInfo::m_pGraphics, GR_RenderInfo::m_pItem, m_pWidths, GR_Item::makeCopy(), UT_ASSERT, UT_return_val_if_fail, and UT_UCS4_strncpy().
Referenced by _calculateCharAdvances(), _stripLigaturePlaceHolders(), append(), GR_Graphics::shape(), and split().
Referenced by fp_TextRun::_draw(), and _stripLigaturePlaceHolders().
Referenced by append(), cut(), GR_Graphics::shape(), and split().
Referenced by fp_TextRun::_refreshDrawBuffer(), _stripLigaturePlaceHolders(), append(), cut(), GR_Graphics::shape(), split(), and ~GR_XPRenderInfo().
Referenced by fp_TextRun::_draw(), and _stripLigaturePlaceHolders().
UT_sint32 GR_XPRenderInfo::s_iBuffSize = 0 [static] |
Referenced by _checkAndFixStaticBuffers(), and _constructorCommonCode().
UT_sint32 GR_XPRenderInfo::s_iClassInstanceCount = 0 [static] |
Referenced by _constructorCommonCode(), and ~GR_XPRenderInfo().
UT_sint32 * GR_XPRenderInfo::s_pAdvances = NULL [static] |
Referenced by _calculateCharAdvances(), _checkAndFixStaticBuffers(), _constructorCommonCode(), and ~GR_XPRenderInfo().
UT_UCS4Char * GR_XPRenderInfo::s_pCharBuff = NULL [static] |
Referenced by _checkAndFixStaticBuffers(), _constructorCommonCode(), _stripLigaturePlaceHolders(), and ~GR_XPRenderInfo().
GR_RenderInfo * GR_XPRenderInfo::s_pOwner = NULL [static] |
Referenced by append(), cut(), prepareToRenderChars(), GR_Graphics::shape(), and ~GR_XPRenderInfo().
UT_sint32 * GR_XPRenderInfo::s_pWidthBuff = NULL [static] |