Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | Friends

GR_CairoGraphics Class Reference

#include <gr_CairoGraphics.h>

Inheritance diagram for GR_CairoGraphics:
GR_Graphics CairoNull_Graphics GR_QtGraphics GR_UnixCairoGraphicsBase GR_CairoPrintGraphics GR_UnixCairoGraphics GR_UnixPangoPixmapGraphics

List of all members.

Public Member Functions

virtual ~GR_CairoGraphics ()
virtual GR_Capability getCapability ()
virtual UT_sint32 measureUnRemappedChar (const UT_UCSChar c, UT_uint32 *height=0)
virtual void drawChars (const UT_UCSChar *pChars, int iCharOffset, int iLength, UT_sint32 xoff, UT_sint32 yoff, int *pCharWidth)
virtual void drawGlyph (UT_uint32 glyph_idx, UT_sint32 xoff, UT_sint32 yoff)
virtual UT_uint32 measureString (const UT_UCSChar *s, int iOffset, int num, UT_GrowBufElement *pWidths, UT_uint32 *height=0)
virtual GR_FontgetDefaultFont (UT_String &fontFamily, const char *pszLang)
virtual void setFont (const GR_Font *)
virtual void clearFont (void)
virtual void setZoomPercentage (UT_uint32 iZoom)
virtual bool itemize (UT_TextIterator &text, GR_Itemization &I)
virtual bool shape (GR_ShapingInfo &si, GR_RenderInfo *&ri)
virtual void prepareToRenderChars (GR_RenderInfo &ri)
virtual void renderChars (GR_RenderInfo &ri)
virtual void measureRenderedCharWidths (GR_RenderInfo &ri)
virtual void appendRenderedCharsToBuff (GR_RenderInfo &ri, UT_GrowBuf &buf) const
virtual bool canBreak (GR_RenderInfo &ri, UT_sint32 &iNext, bool bAfter)
virtual bool needsSpecialCaretPositioning (GR_RenderInfo &ri)
virtual UT_uint32 adjustCaretPosition (GR_RenderInfo &ri, bool bForward)
virtual void adjustDeletePosition (GR_RenderInfo &ri)
virtual bool nativeBreakInfoForRightEdge ()
virtual UT_sint32 resetJustification (GR_RenderInfo &ri, bool bPermanent)
virtual UT_sint32 countJustificationPoints (const GR_RenderInfo &ri) const
virtual void justify (GR_RenderInfo &ri)
virtual UT_uint32 XYToPosition (const GR_RenderInfo &ri, UT_sint32 x, UT_sint32 y) const
virtual void positionToXY (const GR_RenderInfo &ri, UT_sint32 &x, UT_sint32 &y, UT_sint32 &x2, UT_sint32 &y2, UT_sint32 &height, bool &bDirection) const
virtual UT_sint32 getTextWidth (GR_RenderInfo &ri)
virtual const UT_VersionInfogetVersion () const
virtual void setColor (const UT_RGBColor &clr)
virtual void getColor (UT_RGBColor &clr)
PangoFontMap * getFontMap () const
PangoContext * getContext () const
PangoFontMap * getLayoutFontMap () const
PangoContext * getLayoutContext () const
virtual UT_uint32 getFontAscent ()
virtual UT_uint32 getFontDescent ()
virtual UT_uint32 getFontHeight ()
virtual UT_uint32 getFontAscent (const GR_Font *)
virtual UT_uint32 getFontDescent (const GR_Font *)
virtual UT_uint32 getFontHeight (const GR_Font *)
virtual void fillRect (GR_Color3D c, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h)
virtual void fillRect (GR_Color3D c, UT_Rect &r)
virtual void polygon (UT_RGBColor &c, UT_Point *pts, UT_uint32 nPoints)
virtual void clearArea (UT_sint32, UT_sint32, UT_sint32, UT_sint32)
virtual void drawImage (GR_Image *pImg, UT_sint32 xDest, UT_sint32 yDest)
virtual void xorLine (UT_sint32, UT_sint32, UT_sint32, UT_sint32)
virtual void polyLine (UT_Point *pts, UT_uint32 nPoints)
virtual void fillRect (const UT_RGBColor &c, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h)
virtual void invertRect (const UT_Rect *pRect)
virtual void drawLine (UT_sint32, UT_sint32, UT_sint32, UT_sint32)
bool isDingbat (void) const
bool isSymbol (void) const
void resetFontMapResolution (void)
virtual GR_Font_findFont (const char *pszFontFamily, const char *pszFontStyle, const char *pszFontVariant, const char *pszFontWeight, const char *pszFontStretch, const char *pszFontSize, const char *pszLang)
virtual void getCoverage (UT_NumberVector &coverage)
virtual void setLineWidth (UT_sint32)
virtual void setClipRect (const UT_Rect *pRect)
virtual UT_uint32 getDeviceResolution (void) const
double getResolutionRatio (void) const
virtual GR_FontgetDefaultFont (GR_Font::FontFamilyEnum f=GR_Font::FF_Roman, const char *pszLang=NULL)
int dtpu (int d) const
int ptdu (int p) const
int ptlu (int p) const
int ptlunz (int p) const
int ltpu (int l) const
int ltpunz (int l) const
int pftlu (int pf) const
virtual bool queryProperties (GR_Graphics::Properties gp) const
virtual bool startPrint (void)
virtual bool endPrint (void)
virtual bool startPage (const char *szPageLabel, UT_uint32 pageNumber, bool bPortrait, UT_uint32 iWidth, UT_uint32 iHeight)
virtual void setColorSpace (GR_Graphics::ColorSpace c)
virtual GR_Graphics::ColorSpace getColorSpace (void) const
virtual GR_Graphics::Cursor getCursor (void) const
virtual void setColor3D (GR_Color3D c)
virtual bool getColor3D (GR_Color3D name, UT_RGBColor &color)
virtual void saveRectangle (UT_Rect &r, UT_uint32 iIndx)
virtual void restoreRectangle (UT_uint32 iIndx)
virtual void setLineProperties (double inWidth, GR_Graphics::JoinStyle inJoinStyle=JOIN_MITER, GR_Graphics::CapStyle inCapStyle=CAP_BUTT, GR_Graphics::LineStyle inLineStyle=LINE_SOLID)
cairo_t * getCairo ()
void setCairo (cairo_t *cr)

Static Public Member Functions

static const std::vector
< std::string > & 
getAllFontNames (void)
static UT_uint32 getAllFontCount ()
static UT_uint32 getDefaultDeviceResolution ()

Protected Member Functions

void _setProps ()
virtual void _resetClip (void)
 GR_CairoGraphics (cairo_t *cr, UT_uint32 iDeviceResolution)
 GR_CairoGraphics ()
bool _scriptBreak (GR_PangoRenderInfo &ri)
void _scaleCharacterMetrics (GR_PangoRenderInfo &RI)
void _scaleJustification (GR_PangoRenderInfo &RI)
UT_uint32 _measureExtent (PangoGlyphString *pg, PangoFont *pf, UT_BidiCharType iDir, const char *pUtf8, int *&pLogOffsets, UT_sint32 &iStart, UT_sint32 &iEnd)
int * _calculateLogicalOffsets (PangoGlyphString *pGlyphs, UT_BidiCharType iVisDir, const char *pUtf8)
void _setIsSymbol (bool b)
void _setIsDingbat (bool b)
PangoFont * _adjustedPangoFont (GR_PangoFont *pFont, PangoFont *pf)
PangoFont * _adjustedLayoutPangoFont (GR_PangoFont *pFont, PangoFont *pf)
double _tdudX (UT_sint32 layoutUnits) const
 This appears to fix off-by-1 bugs in setting rectangles and drawing text.
double _tdudY (UT_sint32 layoutUnits) const
 This appears to fix off-by-1 bugs in setting rectangles and drawing text.
void _initCairo ()
 init the cairo context once created
void _DeviceContext_SwitchToBuffer ()
void _DeviceContext_SwitchToScreen ()
void _DeviceContext_SuspendDrawing ()
void _DeviceContext_ResumeDrawing ()

Static Protected Member Functions

static cairo_surface_t * _getCairoSurfaceFromContext (cairo_t *cr, const cairo_rectangle_t &rect)
static void _setSource (cairo_t *, const UT_RGBColor &)

Protected Attributes

PangoFontMap * m_pFontMap
PangoContext * m_pContext
PangoFontMap * m_pLayoutFontMap
PangoContext * m_pLayoutContext
GR_PangoFontm_pPFont
GR_PangoFontm_pPFontGUI
PangoFont * m_pAdjustedPangoFont
PangoFontDescription * m_pAdjustedPangoFontDescription
UT_sint32 m_iAdjustedPangoFontSize
PangoFont * m_pAdjustedLayoutPangoFont
PangoFontDescription * m_pAdjustedLayoutPangoFontDescription
UT_sint32 m_iAdjustedLayoutPangoFontSize
UT_uint32 m_iDeviceResolution
cairo_t * m_cr
GR_Graphics::Cursor m_cursor
GR_Graphics::ColorSpace m_cs
UT_RGBColor m_3dColors [COUNT_3D_COLORS]
UT_RGBColor m_curColor
bool m_curColorDirty
bool m_clipRectDirty
double m_lineWidth
GR_Graphics::JoinStyle m_joinStyle
GR_Graphics::CapStyle m_capStyle
GR_Graphics::LineStyle m_lineStyle
bool m_linePropsDirty
bool m_bIsSymbol
bool m_bIsDingbat
UT_sint32 m_iPrevX1
UT_sint32 m_iPrevX2
UT_sint32 m_iPrevY1
UT_sint32 m_iPrevY2
UT_uint32 m_iPrevRect
UT_sint32 m_iXORCount
std::vector< UT_Rect * > m_vSaveRect
std::vector< cairo_surface_t * > m_vSaveRectBuf

Private Member Functions

void _initPango ()
 common private init for pango called from the constructor

Static Private Attributes

static UT_uint32 s_iInstanceCount = 0
static UT_VersionInfo s_Version
static int s_iMaxScript = 0

Friends

class GR_UnixImage

Constructor & Destructor Documentation

GR_CairoGraphics::GR_CairoGraphics ( cairo_t *  cr,
UT_uint32  iDeviceResolution 
) [protected]

References _initPango().

GR_CairoGraphics::GR_CairoGraphics (  )  [protected]

References _initPango().


Member Function Documentation

PangoFont * GR_CairoGraphics::_adjustedLayoutPangoFont ( GR_PangoFont pFont,
PangoFont *  pf 
) [protected]
int * GR_CairoGraphics::_calculateLogicalOffsets ( PangoGlyphString *  pGlyphs,
UT_BidiCharType  iVisDir,
const char *  pUtf8 
) [inline, protected]

References gchar, s, UT_BIDI_LTR, and UT_return_val_if_fail.

Referenced by _measureExtent(), and shape().

void GR_CairoGraphics::_DeviceContext_ResumeDrawing (  )  [protected, virtual]

Reimplemented from GR_Graphics.

References m_cr.

void GR_CairoGraphics::_DeviceContext_SuspendDrawing (  )  [protected, virtual]

Reimplemented from GR_Graphics.

References m_cr.

void GR_CairoGraphics::_DeviceContext_SwitchToBuffer (  )  [protected, virtual]

Reimplemented from GR_Graphics.

References m_cr.

void GR_CairoGraphics::_DeviceContext_SwitchToScreen (  )  [protected, virtual]

Reimplemented from GR_Graphics.

References m_cr.

GR_Font * GR_CairoGraphics::_findFont ( const char *  pszFontFamily,
const char *  pszFontStyle,
const char *  pszFontVariant,
const char *  pszFontWeight,
const char *  pszFontStretch,
const char *  pszFontSize,
const char *  pszLang 
) [virtual]
cairo_surface_t * GR_CairoGraphics::_getCairoSurfaceFromContext ( cairo_t *  cr,
const cairo_rectangle_t &  rect 
) [static, protected]

Referenced by saveRectangle().

void GR_CairoGraphics::_initCairo (  )  [protected]

init the cairo context once created

References m_cr, and UT_ASSERT.

Referenced by GR_UnixCairoGraphics::_beginPaint().

void GR_CairoGraphics::_initPango (  )  [private]

common private init for pango called from the constructor

References GR_Graphics::getResolution(), m_iDeviceResolution, m_pContext, m_pFontMap, m_pLayoutContext, m_pLayoutFontMap, pango_font_map_create_context(), and UT_DEBUGMSG.

Referenced by GR_CairoGraphics().

UT_uint32 GR_CairoGraphics::_measureExtent ( PangoGlyphString *  pg,
PangoFont *  pf,
UT_BidiCharType  iDir,
const char *  pUtf8,
int *&  pLogOffsets,
UT_sint32 iStart,
UT_sint32 iEnd 
) [inline, protected]

Calculates the extents of string corresponding to glyphstring from *character* offset iStart to iEnd (excluding iEnd);

iDir is the visual direction of the text

pUtf8 pointer to the corresponding utf8 string; can be NULL if pLogOffsets is provided

pLogOffsets is array of logical offsets (see gr_UnixPangoRenderInfo::m_pLogOffsets); if NULL, it will be calculated using the corresponding utf8 string and pointer returned back; the caller needs to delete[] it when no longer needed.

On return iStart and iEnd contain the offset values that correspond to the returned extent (e.g., if the original iStart and/or iEnd are not legal character postions due to clustering rules, these can be different from the requested values).

References _calculateLogicalOffsets(), ptlunz(), UT_ASSERT_HARMLESS, UT_BIDI_LTR, UT_BIDI_RTL, UT_return_val_if_fail, and xxx_UT_DEBUGMSG.

Referenced by getTextWidth(), and measureString().

void GR_CairoGraphics::_resetClip ( void   )  [protected, virtual]

Reimplemented in GR_UnixCairoGraphics.

References m_cr, and xxx_UT_DEBUGMSG.

Referenced by _setProps(), and drawImage().

void GR_CairoGraphics::_scaleJustification ( GR_PangoRenderInfo RI  )  [protected]
void GR_CairoGraphics::_setIsDingbat ( bool  b  )  [inline, protected]

Referenced by setFont().

void GR_CairoGraphics::_setIsSymbol ( bool  b  )  [inline, protected]

Referenced by setFont().

void GR_CairoGraphics::_setSource ( cairo_t *  cr,
const UT_RGBColor clr 
) [static, protected]
double GR_CairoGraphics::_tdudX ( UT_sint32  layoutUnits  )  const [protected]

This appears to fix off-by-1 bugs in setting rectangles and drawing text.

References GR_Graphics::_tduX().

Referenced by _setProps(), drawChars(), drawImage(), fillRect(), polygon(), polyLine(), and renderChars().

double GR_CairoGraphics::_tdudY ( UT_sint32  layoutUnits  )  const [protected]

This appears to fix off-by-1 bugs in setting rectangles and drawing text.

References GR_Graphics::_tduY().

Referenced by _setProps(), drawChars(), drawImage(), fillRect(), polygon(), polyLine(), and renderChars().

UT_uint32 GR_CairoGraphics::adjustCaretPosition ( GR_RenderInfo ri,
bool  bForward 
) [virtual]
void GR_CairoGraphics::adjustDeletePosition ( GR_RenderInfo ri  )  [virtual]
void GR_CairoGraphics::appendRenderedCharsToBuff ( GR_RenderInfo ri,
UT_GrowBuf buf 
) const [virtual]

Reimplemented from GR_Graphics.

References UT_NOT_IMPLEMENTED, and UT_return_if_fail.

bool GR_CairoGraphics::canBreak ( GR_RenderInfo ri,
UT_sint32 iNext,
bool  bAfter 
) [virtual]
void GR_CairoGraphics::clearArea ( UT_sint32  x,
UT_sint32  y,
UT_sint32  width,
UT_sint32  height 
) [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References fillRect().

virtual void GR_CairoGraphics::clearFont ( void   )  [inline, virtual]

Implements GR_Graphics.

void GR_CairoGraphics::drawGlyph ( UT_uint32  glyph_idx,
UT_sint32  xoff,
UT_sint32  yoff 
) [virtual]

Implements GR_Graphics.

References drawChars().

void GR_CairoGraphics::drawImage ( GR_Image pImg,
UT_sint32  xDest,
UT_sint32  yDest 
) [virtual]

Draw the specified image at the location specified in local units (xDest,yDest). xDest and yDest are in logical units.

Reimplemented from GR_Graphics.

Reimplemented in CairoNull_Graphics.

References _resetClip(), _setProps(), _tdudX(), _tdudY(), GR_Graphics::DGP_PAPER, GR_Graphics::getAntiAliasAlways(), GR_Image::getType(), m_cr, queryProperties(), and UT_ASSERT.

void GR_CairoGraphics::drawLine ( UT_sint32  x1,
UT_sint32  y1,
UT_sint32  x2,
UT_sint32  y2 
) [virtual]
int GR_CairoGraphics::dtpu ( int  d  )  const [inline]

Convert device units to pango units

bool GR_CairoGraphics::endPrint ( void   )  [virtual]

Implements GR_Graphics.

Reimplemented in GR_CairoPrintGraphics, and CairoNull_Graphics.

References UT_ASSERT.

void GR_CairoGraphics::fillRect ( GR_Color3D  c,
UT_Rect r 
) [virtual]
void GR_CairoGraphics::fillRect ( GR_Color3D  c,
UT_sint32  x,
UT_sint32  y,
UT_sint32  w,
UT_sint32  h 
) [virtual]

Rob sez: the original (before cairo) implementation did not restore colours after drawing. We're trying to do the right thing here instead.

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References _setProps(), _setSource(), GR_Graphics::getAntiAliasAlways(), m_3dColors, m_cr, and GR_Graphics::tdu().

Referenced by clearArea(), and fillRect().

void GR_CairoGraphics::fillRect ( const UT_RGBColor c,
UT_sint32  x,
UT_sint32  y,
UT_sint32  w,
UT_sint32  h 
) [virtual]
UT_uint32 GR_CairoGraphics::getAllFontCount (  )  [static]
virtual GR_Capability GR_CairoGraphics::getCapability (  )  [inline, virtual]

Reimplemented from GR_Graphics.

Reimplemented in GR_CairoPrintGraphics, and CairoNull_Graphics.

void GR_CairoGraphics::getColor ( UT_RGBColor clr  )  [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References m_curColor.

bool GR_CairoGraphics::getColor3D ( GR_Color3D  name,
UT_RGBColor color 
) [virtual]

Reimplemented from GR_Graphics.

Reimplemented in CairoNull_Graphics.

References m_3dColors, and GR_Graphics::m_bHave3DColors.

GR_Graphics::ColorSpace GR_CairoGraphics::getColorSpace ( void   )  const [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References m_cs.

PangoContext* GR_CairoGraphics::getContext (  )  const [inline]
GR_Graphics::Cursor GR_CairoGraphics::getCursor ( void   )  const [virtual]
UT_uint32 GR_CairoGraphics::getDefaultDeviceResolution (  )  [static]
GR_Font * GR_CairoGraphics::getDefaultFont ( UT_String fontFamily,
const char *  pszLang 
) [virtual]
GR_Font * GR_CairoGraphics::getDefaultFont ( GR_Font::FontFamilyEnum  f = GR_Font::FF_Roman,
const char *  pszLang = NULL 
) [virtual]
UT_uint32 GR_CairoGraphics::getDeviceResolution ( void   )  const [virtual]

Implements GR_Graphics.

References m_iDeviceResolution.

Referenced by ltpu(), and ptlu().

UT_uint32 GR_CairoGraphics::getFontAscent (  )  [virtual]

Implements GR_Graphics.

References m_pPFont.

Referenced by drawChars(), and renderChars().

UT_uint32 GR_CairoGraphics::getFontAscent ( const GR_Font pFont  )  [virtual]
UT_uint32 GR_CairoGraphics::getFontDescent (  )  [virtual]

Implements GR_Graphics.

References m_pPFont.

UT_uint32 GR_CairoGraphics::getFontDescent ( const GR_Font pFont  )  [virtual]
UT_uint32 GR_CairoGraphics::getFontHeight (  )  [virtual]
UT_uint32 GR_CairoGraphics::getFontHeight ( const GR_Font pFont  )  [virtual]
PangoFontMap* GR_CairoGraphics::getFontMap (  )  const [inline]

Referenced by drawChars(), measureString(), and shape().

PangoContext* GR_CairoGraphics::getLayoutContext (  )  const [inline]
PangoFontMap* GR_CairoGraphics::getLayoutFontMap (  )  const [inline]
double GR_CairoGraphics::getResolutionRatio ( void   )  const [inline, virtual]

Reimplemented from GR_Graphics.

Reimplemented in GR_CairoPrintGraphics.

virtual const UT_VersionInfo& GR_CairoGraphics::getVersion (  )  const [inline, virtual]

Reimplemented from GR_Graphics.

void GR_CairoGraphics::invertRect ( const UT_Rect pRect  )  [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References UT_ASSERT_NOT_REACHED.

bool GR_CairoGraphics::isDingbat ( void   )  const [inline]
bool GR_CairoGraphics::isSymbol ( void   )  const [inline]
void GR_CairoGraphics::justify ( GR_RenderInfo ri  )  [virtual]

We take the same approach as with Uniscribe; we store the justification amount in a separate array of the ri and add it to the offsets before we draw. We will probably need some static buffers to speed things up

It requires as input RI.m_iJustificationAmount and RI.m_iJustificationPoints. These are determined in fp_TextRun using calculations in layout units

Reimplemented from GR_Graphics.

References _scaleCharacterMetrics(), UT_TextIterator::getChar(), UT_TextIterator::getStatus(), GR_RenderInfo::getType(), ltpunz(), text, UCS_SPACE, UT_BIDI_LTR, UT_BIDI_RTL, UT_return_if_fail, UTIter_OK, and xxx_UT_DEBUGMSG.

int GR_CairoGraphics::ltpu ( int  l  )  const [inline]

Convert layout units to pango units

References getDeviceResolution(), GR_Graphics::getResolution(), and GR_Graphics::getZoomPercentage().

int GR_CairoGraphics::ltpunz ( int  l  )  const [inline]

Convert layout units to pango units without zoom

Referenced by justify(), and XYToPosition().

void GR_CairoGraphics::measureRenderedCharWidths ( GR_RenderInfo ri  )  [virtual]

This function is called after shaping and before any operations are done on the glyphs. Although Pango does not have a separate character placement stage, we need to scale the glyph metrics to appropriate zoom level (since we shape % zoom).

NB: this is probably not ideal with int arithmetic as moving from one zoom to another, and back we are bound to end up with incorrect metrics due to rounding errors.

Reimplemented from GR_Graphics.

References _scaleCharacterMetrics(), _scaleJustification(), GR_RenderInfo::getType(), and UT_return_if_fail.

UT_sint32 GR_CairoGraphics::measureUnRemappedChar ( const UT_UCSChar  c,
UT_uint32 height = 0 
) [virtual]

Implements GR_Graphics.

References measureString().

virtual bool GR_CairoGraphics::nativeBreakInfoForRightEdge (  )  [inline, virtual]

Reimplemented from GR_Graphics.

bool GR_CairoGraphics::needsSpecialCaretPositioning ( GR_RenderInfo ri  )  [virtual]
int GR_CairoGraphics::pftlu ( int  pf  )  const [inline]

Convert pango font units to layout units

(Pango font units == point size * PANGO_SCALE, hence at zoom of 100% there are 20/PANGO_SCALE layout units to each pango font unit.)

References GR_Graphics::getZoomPercentage().

void GR_CairoGraphics::polygon ( UT_RGBColor c,
UT_Point pts,
UT_uint32  nPoints 
) [virtual]
Todo:
Rob find out how to have this function used, and test.

Reimplemented from GR_Graphics.

References _setProps(), _setSource(), _tdudX(), _tdudY(), GR_Graphics::getAntiAliasAlways(), m_cr, and UT_return_if_fail.

void GR_CairoGraphics::polyLine ( UT_Point pts,
UT_uint32  nPoints 
) [virtual]
void GR_CairoGraphics::positionToXY ( const GR_RenderInfo ri,
UT_sint32 x,
UT_sint32 y,
UT_sint32 x2,
UT_sint32 y2,
UT_sint32 height,
bool &  bDirection 
) const [virtual]
void GR_CairoGraphics::prepareToRenderChars ( GR_RenderInfo ri  )  [virtual]

Do any pre-processing that might be needed for rendering our text (This function is guaranteed to be called just before renderChars(), but where drawing of a single RI item is done inside of a loop, e.g., drawing the different segments of partially selected run, this function can be take out of the loop.)

Reimplemented from GR_Graphics.

References _scaleCharacterMetrics(), GR_RenderInfo::getType(), GR_Graphics::getZoomPercentage(), and UT_return_if_fail.

int GR_CairoGraphics::ptdu ( int  p  )  const [inline]

Convert pango units to device units

int GR_CairoGraphics::ptlu ( int  p  )  const [inline]

Convert pango units to layout units

References getDeviceResolution(), GR_Graphics::getResolution(), and GR_Graphics::getZoomPercentage().

int GR_CairoGraphics::ptlunz ( int  p  )  const [inline]

Convert pango units to layout units without zoom

Referenced by _measureExtent(), positionToXY(), and resetJustification().

void GR_CairoGraphics::resetFontMapResolution ( void   ) 

References m_iDeviceResolution, and m_pFontMap.

UT_sint32 GR_CairoGraphics::resetJustification ( GR_RenderInfo ri,
bool  bPermanent 
) [virtual]

I believe this code clears all the justification points. MES June 2008 It returns the total space assigned to justify the text in layout units.

Reimplemented from GR_Graphics.

References _scaleCharacterMetrics(), GR_RenderInfo::getType(), ptlunz(), and UT_return_val_if_fail.

void GR_CairoGraphics::restoreRectangle ( UT_uint32  iIndx  )  [virtual]
void GR_CairoGraphics::setCairo ( cairo_t *  cr  ) 

References m_cr.

Referenced by abi_widget_render_page_to_image().

void GR_CairoGraphics::setClipRect ( const UT_Rect pRect  )  [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References m_clipRectDirty, and GR_Graphics::m_pRect.

void GR_CairoGraphics::setColor ( const UT_RGBColor clr  )  [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References m_curColor, and m_curColorDirty.

Referenced by setColor3D().

void GR_CairoGraphics::setColor3D ( GR_Color3D  c  )  [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References COUNT_3D_COLORS, m_3dColors, setColor(), and UT_ASSERT.

void GR_CairoGraphics::setColorSpace ( GR_Graphics::ColorSpace  c  )  [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.

void GR_CairoGraphics::setFont ( const GR_Font pFont  )  [virtual]
void GR_CairoGraphics::setLineProperties ( double  inWidth,
GR_Graphics::JoinStyle  inJoinStyle = JOIN_MITER,
GR_Graphics::CapStyle  inCapStyle = CAP_BUTT,
GR_Graphics::LineStyle  inLineStyle = LINE_SOLID 
) [virtual]

Reimplemented from GR_Graphics.

Reimplemented in CairoNull_Graphics.

References m_capStyle, m_joinStyle, m_linePropsDirty, m_lineStyle, and m_lineWidth.

void GR_CairoGraphics::setLineWidth ( UT_sint32  iLineWidth  )  [virtual]

Implements GR_Graphics.

Reimplemented in CairoNull_Graphics.

References m_linePropsDirty, and m_lineWidth.

void GR_CairoGraphics::setZoomPercentage ( UT_uint32  iZoom  )  [virtual]
bool GR_CairoGraphics::startPage ( const char *  szPageLabel,
UT_uint32  pageNumber,
bool  bPortrait,
UT_uint32  iWidth,
UT_uint32  iHeight 
) [virtual]

Implements GR_Graphics.

Reimplemented in GR_CairoPrintGraphics, and CairoNull_Graphics.

References UT_ASSERT.

bool GR_CairoGraphics::startPrint ( void   )  [virtual]

Implements GR_Graphics.

Reimplemented in GR_CairoPrintGraphics, and CairoNull_Graphics.

References UT_ASSERT.

UT_uint32 GR_CairoGraphics::XYToPosition ( const GR_RenderInfo ri,
UT_sint32  x,
UT_sint32  y 
) const [virtual]

This function takes (x,y) in layout units and determines the location in the pango string.

Reimplemented from GR_Graphics.

References adobeDingbatsToUnicode(), adobeToUnicode(), UT_UTF8String::byteLength(), GR_RenderInfo::getType(), isDingbat(), isSymbol(), ltpunz(), GR_CairoPangoItem::m_pi, GR_RenderInfo::m_pItem, UT_return_val_if_fail, and UT_UTF8String::utf8_str().


Friends And Related Function Documentation


Member Data Documentation

Referenced by _setProps(), and setColor().

Referenced by xorLine().

Referenced by xorLine().

Referenced by xorLine().

Referenced by xorLine().

PangoContext* GR_CairoGraphics::m_pContext [protected]
PangoContext* GR_CairoGraphics::m_pLayoutContext [protected]

Referenced by _initPango(), and ~GR_CairoGraphics().

PangoFontMap* GR_CairoGraphics::m_pLayoutFontMap [protected]

Referenced by _initPango(), and ~GR_CairoGraphics().

std::vector<cairo_surface_t*> GR_CairoGraphics::m_vSaveRectBuf [protected]

Reimplemented from GR_Graphics.

int GR_CairoGraphics::s_iMaxScript = 0 [static, private]

Reimplemented from GR_Graphics.


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