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

GR_Graphics Class Reference

#include <gr_Graphics.h>

Inheritance diagram for GR_Graphics:
GR_CairoGraphics GR_Win32Graphics CairoNull_Graphics GR_QtGraphics GR_UnixCairoGraphicsBase GR_Win32PrintPreviewGraphics GR_Win32USPGraphics GR_CairoPrintGraphics GR_UnixCairoGraphics

List of all members.

Public Types

enum  Cursor {
enum  GR_Color3D {
  CLR3D_Foreground = 0, CLR3D_Background = 1, CLR3D_BevelUp = 2, CLR3D_BevelDown = 3,
  CLR3D_Highlight = 4

Public Member Functions

virtual ~GR_Graphics ()
virtual UT_uint32 getClassId ()=0
virtual GR_Capability getCapability ()
AllCaretsallCarets ()
void disableAllCarets ()
void enableAllCarets ()
UT_sint32 tdu (UT_sint32 layoutUnits) const
UT_sint32 tlu (UT_sint32 deviceUnits) const
double tduD (double layoutUnits) const
double tluD (double deviceUnits) const
void antiAliasAlways (bool bAntiAlias)
bool getAntiAliasAlways (void)
UT_sint32 ftlu (UT_sint32 fontUnits) const
double ftluD (double fontUnits) const
virtual void setFont (const GR_Font *pFont)=0
virtual void clearFont (void)=0
virtual UT_uint32 getFontAscent ()=0
virtual UT_uint32 getFontDescent ()=0
virtual UT_uint32 getFontHeight ()=0
void invalidateCache (void)
virtual bool canQuickPrint (void) const
virtual UT_uint32 measureString (const UT_UCSChar *s, int iOffset, int num, UT_GrowBufElement *pWidths, UT_uint32 *height=0)
virtual UT_sint32 measureUnRemappedChar (const UT_UCSChar c, UT_uint32 *height=0)=0
virtual void getCoverage (UT_NumberVector &coverage)=0
virtual UT_uint32 getFontAscent (const GR_Font *)=0
virtual UT_uint32 getFontDescent (const GR_Font *)=0
virtual UT_uint32 getFontHeight (const GR_Font *)=0
virtual double getResolutionRatio (void) const
void getMaxCharacterDimension (const UT_UCSChar *s, UT_uint32 Length, UT_uint32 &width, UT_uint32 &height)
virtual void setColor (const UT_RGBColor &clr)=0
virtual void getColor (UT_RGBColor &clr)=0
virtual GR_FontgetGUIFont ()=0
GR_FontfindFont (const char *pszFontFamily, const char *pszFontStyle, const char *pszFontVariant, const char *pszFontWeight, const char *pszFontStretch, const char *pszFontSize, const char *pszLang)
const char * invertDimension (UT_Dimension, double) const
bool scaleDimensions (const char *szLeftIn, const char *szWidthIn, UT_uint32 iWidthAvail, UT_sint32 *piLeft, UT_uint32 *piWidth) const
virtual GR_ImagecreateNewImage (const char *pszName, const UT_ConstByteBufPtr &pBB, const std::string &mimetype, UT_sint32 iWidth, UT_sint32 iHeight, GR_Image::GRType iType=GR_Image::GRT_Raster)
virtual void setLineWidth (UT_sint32)=0
virtual void setClipRect (const UT_Rect *pRect)=0
const UT_RectgetClipRect (void) const
virtual void scroll (UT_sint32, UT_sint32)=0
virtual void scroll (UT_sint32 x_dest, UT_sint32 y_dest, UT_sint32 x_src, UT_sint32 y_src, UT_sint32 width, UT_sint32 height)=0
virtual void setLineProperties (double inWidthPixels, JoinStyle inJoinStyle=JOIN_MITER, CapStyle inCapStyle=CAP_BUTT, LineStyle inLineStyle=LINE_SOLID)
virtual bool queryProperties (GR_Graphics::Properties gp) const =0
virtual bool startPrint (void)=0
virtual bool startPage (const char *szPageLabel, UT_uint32 pageNumber, bool bPortrait, UT_uint32 iWidth, UT_uint32 iHeight)=0
virtual bool endPrint (void)=0
virtual void flush (void)
virtual void setColorSpace (GR_Graphics::ColorSpace c)=0
virtual GR_Graphics::ColorSpace getColorSpace (void) const =0
virtual void setCursor (GR_Graphics::Cursor c)=0
virtual GR_Graphics::Cursor getCursor (void) const =0
virtual void setZoomPercentage (UT_uint32 iZoom)
UT_uint32 getZoomPercentage (void) const
void setPortrait (bool b)
bool isPortrait (void) const
virtual void setColor3D (GR_Color3D c)=0
virtual bool getColor3D (GR_Color3D, UT_RGBColor &)=0
const GR_TransformgetTransform () const
bool setTransform (const GR_Transform &tr)
void createCaret ()
GR_CaretcreateCaret (const std::string &sID)
GR_CaretgetCaret (const std::string &sID) const
GR_CaretgetNthCaret (UT_sint32 i) const
void removeCaret (const std::string &sID)
virtual void saveRectangle (UT_Rect &r, UT_uint32 iIndx)=0
virtual void restoreRectangle (UT_uint32 iIndx)=0
virtual UT_uint32 getDeviceResolution (void) const =0
UT_sint32 getPrevYOffset (void) const
UT_sint32 getPrevXOffset (void) const
void setPrevYOffset (UT_sint32 y)
void setPrevXOffset (UT_sint32 x)
UT_sint32 _tduX (UT_sint32 layoutUnits) const
virtual bool itemize (UT_TextIterator &text, GR_Itemization &I) VIRTUAL_SFX
virtual bool shape (GR_ShapingInfo &si, GR_RenderInfo *&ri) VIRTUAL_SFX
virtual void prepareToRenderChars (GR_RenderInfo &ri) VIRTUAL_SFX
virtual void renderChars (GR_RenderInfo &ri) VIRTUAL_SFX
virtual void appendRenderedCharsToBuff (GR_RenderInfo &ri, UT_GrowBuf &buf) const VIRTUAL_SFX
virtual void measureRenderedCharWidths (GR_RenderInfo &ri) VIRTUAL_SFX
virtual bool canBreak (GR_RenderInfo &ri, UT_sint32 &iNext, bool bAfter) VIRTUAL_SFX
virtual bool needsSpecialCaretPositioning (GR_RenderInfo &) VIRTUAL_SFX
virtual UT_uint32 adjustCaretPosition (GR_RenderInfo &ri, bool bForward) VIRTUAL_SFX
virtual void adjustDeletePosition (GR_RenderInfo &ri) VIRTUAL_SFX
virtual bool nativeBreakInfoForRightEdge () VIRTUAL_SFX
virtual UT_sint32 resetJustification (GR_RenderInfo &ri, bool bPermanent) VIRTUAL_SFX
virtual UT_sint32 countJustificationPoints (const GR_RenderInfo &ri) const VIRTUAL_SFX
virtual void justify (GR_RenderInfo &ri) VIRTUAL_SFX
virtual UT_uint32 XYToPosition (const GR_RenderInfo &ri, UT_sint32 x, UT_sint32 y) const VIRTUAL_SFX
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_SFX
virtual UT_sint32 getTextWidth (GR_RenderInfo &ri) VIRTUAL_SFX
virtual const UT_VersionInfogetVersion () const
UT_uint32 getPaintCount (void) const
void beginPaint ()
void endPaint ()

Static Public Member Functions

static const char * findNearestFont (const char *pszFontFamily, const char *, const char *, const char *, const char *, const char *, const char *)
static UT_uint32 getResolution (void)
static GR_GraphicsnewNullGraphics ()
 Creates an offscreen graphics context.

Public Attributes

UT_uint32 m_iRasterPosition

Protected Types

enum  DeviceContextSwitchType { SWITCHED_TO_BUFFER = 0, DRAWING_SUSPENDED }

Protected Member Functions

 GR_Graphics ()
GR_CaretgetCaret ()
virtual void _beginPaint ()
virtual void _endPaint ()
UT_sint32 _tduY (UT_sint32 layoutUnits) const
UT_sint32 _tduR (UT_sint32 layoutUnits) const
void _destroyFonts ()
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)=0
virtual void drawLine (UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2)=0
virtual void xorLine (UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2)=0
virtual void invertRect (const UT_Rect *pRect)=0
void xorRect (UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h)
void xorRect (const UT_Rect &r)
virtual void fillRect (GR_Image *pImg, const UT_Rect &src, const UT_Rect &dest)
virtual void fillRect (const UT_RGBColor &c, const UT_Rect &r)
virtual void fillRect (const UT_RGBColor &c, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h)=0
virtual void clearArea (UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h)=0
virtual void drawImage (GR_Image *pImg, UT_sint32 xDest, UT_sint32 yDest)
virtual void fillRect (GR_Color3D c, UT_Rect &r)=0
virtual void fillRect (GR_Color3D c, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h)=0
virtual void polygon (const UT_RGBColor &c, const UT_Point *pts, UT_uint32 nPoints)
virtual void polyLine (const UT_Point *pts, UT_uint32 nPoints)=0
virtual void drawGlyph (UT_uint32 glyph_idx, UT_sint32 xoff, UT_sint32 yoff)=0
virtual void drawChars (const UT_UCSChar *pChars, int iCharOffset, int iLength, UT_sint32 xoff, UT_sint32 yoff, int *pCharWidths=NULL)=0
virtual void drawCharsRelativeToBaseline (const UT_UCSChar *pChars, int iCharOffset, int iLength, UT_sint32 xoff, UT_sint32 yoff, int *pCharWidths=NULL)
virtual GR_ImagegenImageFromRectangle (const UT_Rect &r)=0
virtual void _DeviceContext_SwitchToBuffer ()
virtual void _DeviceContext_SwitchToScreen ()
bool beginDoubleBuffering ()
void endDoubleBuffering (bool token)
virtual void _DeviceContext_SuspendDrawing ()
virtual void _DeviceContext_ResumeDrawing ()
bool suspendDrawing ()
void resumeDrawing (bool token)

Protected Attributes

UT_uint32 m_iZoomPercentage
UT_uint32 m_iFontAllocNo
std::unique_ptr< const UT_Rectm_pRect
bool m_bHave3DColors
UT_uint32 m_paintCount
bool m_bDoubleBufferingActive
bool m_bDrawingSuspended
UT_NumberStack m_DCSwitchManagementStack

Static Protected Attributes

static XAP_PrefsSchemem_pPrefsScheme
static UT_uint32 m_uTick

Private Types

typedef std::map< std::string,
GR_Font * > 

Private Member Functions

virtual bool _setTransform (const GR_Transform &)
bool _PtInPolygon (const UT_Point *pts, UT_uint32 nPoints, UT_sint32 x, UT_sint32 y)

Private Attributes

bool m_bIsPortrait
bool m_bSpawnedRedraw
UT_Rect m_PendingExposeArea
UT_Rect m_RecentExposeArea
bool m_bExposePending
bool m_bIsExposedAreaAccessed
bool m_bDontRedraw
bool m_bDoMerge
UT_sint32 m_iPrevYOffset
UT_sint32 m_iPrevXOffset
GR_Transform m_Transform
FontCache m_hashFontCache
UT_GenericVector< GR_Caret * > m_vecCarets
AllCarets m_AllCarets
bool m_bAntiAliasAlways

Static Private Attributes

static UT_VersionInfo s_Version
static UT_uint32 s_iInstanceCount
static UT_UCS4Char s_cDefaultGlyph = '?'


class GR_Painter
class GR_Caret
class AllCarets

Member Typedef Documentation

typedef std::map<std::string, GR_Font*> GR_Graphics::FontCache [private]

Member Enumeration Documentation


Constructor & Destructor Documentation

GR_Graphics::GR_Graphics (  )  [protected]

Member Function Documentation

virtual void GR_Graphics::_beginPaint (  )  [inline, protected, virtual]

Reimplemented in GR_UnixCairoGraphics.

Referenced by beginPaint().

virtual void GR_Graphics::_DeviceContext_ResumeDrawing (  )  [inline, protected, virtual]

Reimplemented in GR_Win32Graphics, and GR_CairoGraphics.

Referenced by resumeDrawing().

virtual void GR_Graphics::_DeviceContext_SuspendDrawing (  )  [inline, protected, virtual]

Reimplemented in GR_Win32Graphics, and GR_CairoGraphics.

Referenced by suspendDrawing().

virtual void GR_Graphics::_DeviceContext_SwitchToBuffer (  )  [inline, protected, virtual]

Reimplemented in GR_Win32Graphics, and GR_CairoGraphics.

Referenced by beginDoubleBuffering().

virtual void GR_Graphics::_DeviceContext_SwitchToScreen (  )  [inline, protected, virtual]

Reimplemented in GR_Win32Graphics, and GR_CairoGraphics.

Referenced by endDoubleBuffering().

virtual void GR_Graphics::_endPaint (  )  [inline, protected, virtual]

Reimplemented in GR_UnixCairoGraphics.

Referenced by endPaint().

virtual GR_Font* GR_Graphics::_findFont ( const char *  pszFontFamily,
const char *  pszFontStyle,
const char *  pszFontVariant,
const char *  pszFontWeight,
const char *  pszFontStretch,
const char *  pszFontSize,
const char *  pszLang 
) [protected, pure virtual]
bool GR_Graphics::_PtInPolygon ( const UT_Point pts,
UT_uint32  nPoints,
UT_sint32  x,
UT_sint32  y 
) [private]

Referenced by polygon().

virtual bool GR_Graphics::_setTransform ( const GR_Transform  )  [inline, private, virtual]

Reimplemented in GR_Win32Graphics.


UT_sint32 GR_Graphics::_tduR ( UT_sint32  layoutUnits  )  const [protected]
UT_uint32 GR_Graphics::adjustCaretPosition ( GR_RenderInfo ri,
bool  bForward 
) [virtual]
void GR_Graphics::adjustDeletePosition ( GR_RenderInfo ri  )  [virtual]
void GR_Graphics::antiAliasAlways ( bool  bAntiAlias  )  [inline]
void GR_Graphics::appendRenderedCharsToBuff ( GR_RenderInfo ri,
UT_GrowBuf buf 
) const [virtual]
bool GR_Graphics::beginDoubleBuffering (  )  [protected]
bool GR_Graphics::canBreak ( GR_RenderInfo ri,
UT_sint32 iNext,
bool  bAfter 
) [virtual]
virtual bool GR_Graphics::canQuickPrint ( void   )  const [inline, virtual]

Reimplemented in GR_CairoPrintGraphics.

Referenced by fp_Line::draw().

virtual void GR_Graphics::clearArea ( UT_sint32  x,
UT_sint32  y,
UT_sint32  w,
UT_sint32  h 
) [protected, pure virtual]
virtual void GR_Graphics::clearFont ( void   )  [pure virtual]
UT_sint32 GR_Graphics::countJustificationPoints ( const GR_RenderInfo ri  )  const [virtual]

countJustificationPoints() counts the number of points between which any extra justification width could be distributed (in Latin text these are typically spaces).spaces in the text;

The function returns the count as negative value if the run contains only blank data (i.e., only spaces in Latin text).

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

References GR_RenderInfo::getType(), GR_RenderInfo::m_bLastOnLine, UCS_SPACE, and UT_return_val_if_fail.

Referenced by fp_TextRun::countJustificationPoints(), GR_Win32USPRenderInfo::split(), and GR_XPRenderInfo::split().

void GR_Graphics::createCaret (  )  [inline]
GR_Caret * GR_Graphics::createCaret ( const std::string &  sID  ) 
GR_Image * GR_Graphics::createNewImage ( const char *  pszName,
const UT_ConstByteBufPtr pBB,
const std::string &  mimetype,
UT_sint32  iDisplayWidth,
UT_sint32  iDisplayHeight,
GR_Image::GRType  iType = GR_Image::GRT_Raster 
) [virtual]

Create a new image from the Raster rgba byte buffer defined by pBB. The dimensions of iWidth and iHeight are in logical units but the image doesn't scale if the resolution or zoom changes. Instead you must create a new image.

Reimplemented in GR_UnixCairoGraphicsBase, and CairoNull_Graphics.

References GR_VectorImage::convertFromBuffer(), GR_Image::getBufferType(), GR_Image::GRT_Unknown, and GR_Image::GRT_Vector.

Referenced by AP_Dialog_FormatFrame::_makeImageForRaster(), AP_Dialog_FormatTable::askForGraphicPathName(), AP_FormatTable_preview::draw(), AP_FormatFrame_preview::draw(), FG_GraphicVector::generateImage(), FG_GraphicRaster::generateImage(), GR_EmbedManager::render(), and AP_Dialog_FormatTable::setCurCellProps().

void GR_Graphics::disableAllCarets (  ) 
virtual void GR_Graphics::drawChars ( const UT_UCSChar pChars,
int  iCharOffset,
int  iLength,
UT_sint32  xoff,
UT_sint32  yoff,
int *  pCharWidths = NULL 
) [protected, pure virtual]
void GR_Graphics::drawCharsRelativeToBaseline ( const UT_UCSChar pChars,
int  iCharOffset,
int  iLength,
UT_sint32  xoff,
UT_sint32  yoff,
int *  pCharWidths = NULL 
) [protected, virtual]

This method is just like drawChars() except it treats yoff as position of the font baseline. The default implementation simply subtracts the ascent of the current font from yoff and calls drawChars(), which should work on all platforms except for win32.

On win32 because of the trickery we use to achieve wysiwyg layout the acent of the font we work with is slightly smaller than that of the actual font the system uses to draw on the screen. As a result, the characters end up positioned slightly higher than they should and this has proved a problem in the math plugin (see screen shots in #9500)

Reimplemented in GR_Win32USPGraphics.

References drawChars(), and getFontAscent().

Referenced by GR_Painter::drawCharsRelativeToBaseline().

virtual void GR_Graphics::drawGlyph ( UT_uint32  glyph_idx,
UT_sint32  xoff,
UT_sint32  yoff 
) [protected, pure virtual]
void GR_Graphics::drawImage ( GR_Image pImg,
UT_sint32  xDest,
UT_sint32  yDest 
) [protected, virtual]

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

Reimplemented in GR_Win32Graphics, GR_CairoGraphics, CairoNull_Graphics, and GR_Win32PrintPreviewGraphics.

References GR_Image::render().

Referenced by GR_Painter::drawImage(), and fillRect().

virtual void GR_Graphics::drawLine ( UT_sint32  x1,
UT_sint32  y1,
UT_sint32  x2,
UT_sint32  y2 
) [protected, pure virtual]
void GR_Graphics::enableAllCarets (  ) 
virtual bool GR_Graphics::endPrint ( void   )  [pure virtual]
void GR_Graphics::fillRect ( GR_Image pImg,
const UT_Rect src,
const UT_Rect dest 
) [protected, virtual]

This method fills the distination rectangle with a piece of the image pImg. The size and location of the piece of the image is defined by src. src and dest are in logical units.

References GR_Image::createImageSegment(), drawImage(), UT_Rect::left, UT_Rect::top, and UT_return_if_fail.

Referenced by fp_FmtMarkRun::_clearScreen(), GR_Painter::fillRect(), fillRect(), and polygon().

void GR_Graphics::fillRect ( const UT_RGBColor c,
const UT_Rect r 
) [protected, virtual]

Fill the specified rectangle with color defined by "c". The dimensions of UT_Rect are in logical units.

References fillRect(), UT_Rect::height, UT_Rect::left, UT_Rect::top, and UT_Rect::width.

virtual void GR_Graphics::fillRect ( const UT_RGBColor c,
UT_sint32  x,
UT_sint32  y,
UT_sint32  w,
UT_sint32  h 
) [protected, pure virtual]
virtual void GR_Graphics::fillRect ( GR_Color3D  c,
UT_Rect r 
) [protected, pure virtual]
virtual void GR_Graphics::fillRect ( GR_Color3D  c,
UT_sint32  x,
UT_sint32  y,
UT_sint32  w,
UT_sint32  h 
) [protected, pure virtual]
const char * GR_Graphics::findNearestFont ( const char *  pszFontFamily,
const char *  pszFontStyle,
const char *  pszFontVariant,
const char *  pszFontWeight,
const char *  pszFontStretch,
const char *  pszFontSize,
const char *   
) [inline, static]

Referenced by FV_View::FV_View().

UT_sint32 GR_Graphics::ftlu ( UT_sint32  fontUnits  )  const

Font units to layout units. Returns the dimension in layout units since font are not Zoomed

References getDeviceResolution(), and getResolution().

double GR_Graphics::ftluD ( double  fontUnits  )  const
virtual GR_Image* GR_Graphics::genImageFromRectangle ( const UT_Rect r  )  [protected, pure virtual]
virtual GR_Capability GR_Graphics::getCapability (  )  [inline, virtual]
GR_Caret* GR_Graphics::getCaret (  )  [inline, protected]
GR_Caret * GR_Graphics::getCaret ( const std::string &  sID  )  const
virtual void GR_Graphics::getColor ( UT_RGBColor clr  )  [pure virtual]
virtual GR_Graphics::ColorSpace GR_Graphics::getColorSpace ( void   )  const [pure virtual]
virtual void GR_Graphics::getCoverage ( UT_NumberVector coverage  )  [pure virtual]
virtual GR_Graphics::Cursor GR_Graphics::getCursor ( void   )  const [pure virtual]
virtual UT_uint32 GR_Graphics::getFontAscent ( const GR_Font  )  [pure virtual]

Implemented in GR_Win32Graphics, and GR_CairoGraphics.

virtual UT_uint32 GR_Graphics::getFontDescent ( const GR_Font  )  [pure virtual]

Implemented in GR_Win32Graphics, and GR_CairoGraphics.

virtual UT_uint32 GR_Graphics::getFontHeight ( const GR_Font  )  [pure virtual]

Implemented in GR_Win32Graphics, and GR_CairoGraphics.

void GR_Graphics::getMaxCharacterDimension ( const UT_UCSChar s,
UT_uint32  Length,
UT_uint32 width,
UT_uint32 height 

References DELETEPV, and measureString().

Referenced by XAP_Draw_Symbol::setFontToGC().

GR_Caret * GR_Graphics::getNthCaret ( UT_sint32  i  )  const
UT_uint32 GR_Graphics::getPaintCount ( void   )  const [inline]
UT_sint32 GR_Graphics::getPrevXOffset ( void   )  const [inline]
UT_sint32 GR_Graphics::getPrevYOffset ( void   )  const [inline]
virtual double GR_Graphics::getResolutionRatio ( void   )  const [inline, virtual]
const GR_Transform& GR_Graphics::getTransform (  )  const [inline]
virtual const UT_VersionInfo& GR_Graphics::getVersion (  )  const [inline, virtual]
void GR_Graphics::invalidateCache ( void   ) 

WARNING! WARNING! WARNING! Only gr_UnixGraphics should call this! Because xap_UnixFontManager "owns" it's fonts, keeps it's own cache of them and will happily destroy them. If it does this, the cache of pointers here is no longer valid. It would be better to simply remove the font from this cache too but the key used in the xap_UnixFontManager class is different fromt the key used here. Until a better solution appears I'll leave this here. Other classes should use _destroyFonts to remove the cache.

References m_hashFontCache.

Referenced by GR_Win32PrintPreviewGraphics::endPage().

virtual void GR_Graphics::invertRect ( const UT_Rect pRect  )  [protected, pure virtual]
bool GR_Graphics::isPortrait ( void   )  const [inline]
bool GR_Graphics::itemize ( UT_TextIterator text,
GR_Itemization I 
) [virtual]

itemize() analyses text represented by text, notionally dividing it into segments that from the point of the shaper are uniform; this notional division is stored in GR_Itemization I.

The default implementation that only deals with bidi reordering

derrived classes can either provide entirely different implementation, or call the default implementation first and then further divide the results into items with same shaping needs

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

References GR_Itemization::addItem(), GR_Itemization::clear(), UT_TextIterator::getChar(), UT_TextIterator::getPosition(), UT_TextIterator::getStatus(), GRScriptType_Undefined, GRScriptType_Void, UT_TextIterator::setPosition(), UT_BIDI_IS_NEUTRAL, UT_BIDI_IS_STRONG, UT_bidiGetCharType(), UT_return_val_if_fail, and xxx_UT_DEBUGMSG.

Referenced by fl_BlockLayout::itemizeSpan().

void GR_Graphics::justify ( GR_RenderInfo ri  )  [virtual]

justify() distributes justification information into the text.

The justification information consists of ri.m_iJustificationPoints and m_iJustificationAmount

NB: This function must not modify the original values in ri.m_iJustificationAmount and ri.m_iJustificationPoints

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

References GR_RenderInfo::getType(), GR_RenderInfo::m_iJustificationAmount, GR_RenderInfo::m_iJustificationPoints, UCS_SPACE, UT_return_if_fail, and xxx_UT_DEBUGMSG.

Referenced by fp_TextRun::justify(), measureRenderedCharWidths(), and shape().

void GR_Graphics::measureRenderedCharWidths ( GR_RenderInfo ri  )  [virtual]
virtual UT_sint32 GR_Graphics::measureUnRemappedChar ( const UT_UCSChar  c,
UT_uint32 height = 0 
) [pure virtual]
virtual bool GR_Graphics::nativeBreakInfoForRightEdge (  )  [inline, virtual]

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

virtual bool GR_Graphics::needsSpecialCaretPositioning ( GR_RenderInfo  )  [inline, virtual]

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

GR_Graphics * GR_Graphics::newNullGraphics (  )  [static]

Creates an offscreen graphics context.

Only used for measuring font metrics and whatnot, not actually for drawing

References GR_Win32Graphics::createbestmetafilehdc(), XAP_App::getApp(), GR_Win32Graphics::getDocInfo(), GRID_CAIRO_NULL, GRID_WIN32, and XAP_App::newGraphics().

Referenced by FakeAccountHandler::_loadDocument(), IE_Exp_S5::_writeDocument(), and IE_FieldUpdater::updateFields().

void GR_Graphics::polygon ( const UT_RGBColor c,
const UT_Point pts,
UT_uint32  nPoints 
) [protected, virtual]
virtual void GR_Graphics::polyLine ( const UT_Point pts,
UT_uint32  nPoints 
) [protected, pure virtual]
void GR_Graphics::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_Graphics::prepareToRenderChars ( GR_RenderInfo ri  )  [virtual]

prepareToRenderChars() does any preprocessing necessary immediately prior to the actual output on screen (which is done by renderChars()), and must be always called before renderChars().

What this function does is entirely dependend of the specific shaping engine (and in some cases might not do anthing at all). For example, this function might refresh any temporary buffers, etc.

The reason for dividing the actual drawing into two steps (prepare and render) is to limit the amount of processing in cases where the caller needs to make several calls to renderChars() with the same GR_RenderInfo. For example, fp_TextRun::_draw() draws the text in one, two or three segments depending whether there is a selection and where in the run it is. It will make one call to prepareToRenderChars() and then 1-3 calls to renderChars() chaning the background and text colour in between those calls.

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

References GR_RenderInfo::getType(), and UT_return_if_fail.

Referenced by fp_TextRun::_draw(), fp_TextRun::_drawFirstChar(), and fp_TextRun::_drawLastChar().

virtual bool GR_Graphics::queryProperties ( GR_Graphics::Properties  gp  )  const [pure virtual]

Implemented in GR_CairoPrintGraphics, GR_UnixCairoGraphics, GR_Win32Graphics, GR_CairoGraphics, CairoNull_Graphics, and GR_Win32PrintPreviewGraphics.

Referenced by fp_Line::_doClearScreenFromRunToEnd(), IE_Exp_HTML::_doOptions(), fp_TextRun::_draw(), fp_ForcedPageBreakRun::_draw(), fp_ForcedColumnBreakRun::_draw(), fp_ImageRun::_draw(), fp_BookmarkRun::_draw(), fp_TabRun::_draw(), fp_MathRun::_draw(), fp_EmbedRun::_draw(), fp_CellContainer::_drawBoundaries(), fp_Column::_drawBoundaries(), fp_VerticalContainer::_drawBoundaries(), fp_TableContainer::_drawBrokenBoundaries(), fp_Page::_drawCropMarks(), fp_TextRun::_drawFirstChar(), fp_ShadowContainer::_drawHdrFtrBoundaries(), fp_CellContainer::_getBrokenRect(), fl_TableLayout::_lookupMarginProperties(), fl_FrameLayout::_lookupMarginProperties(), fl_BlockLayout::_lookupMarginProperties(), fp_FieldRun::_lookupProperties(), fp_ImageRun::_lookupProperties(), fp_MathRun::_lookupProperties(), fp_EmbedRun::_lookupProperties(), fl_TableLayout::_lookupProperties(), fl_BlockLayout::_lookupProperties(), FL_DocLayout::_redrawUpdate(), fp_Page::_reformatAnnotations(), fp_Page::_reformatColumns(), fp_Page::_reformatFootnotes(), XAP_UnixFrameImpl::_setCursor(), fp_Line::clearScreen(), fp_Line::clearScreenFromRunToEnd(), IE_Exp_EPUB::doOptions(), fp_CellContainer::draw(), fp_Run::draw(), fp_Page::draw(), fp_Line::draw(), fp_FrameContainer::draw(), fp_ShadowContainer::draw(), fp_Line::drawBorders(), fp_FrameContainer::drawBoundaries(), fp_CellContainer::drawBroken(), fp_FrameContainer::drawHandles(), fp_Container::drawLine(), fp_CellContainer::drawLines(), fp_Run::Fill(), fg_FillType::Fill(), FL_DocLayout::fillLayouts(), FL_DocLayout::FL_DocLayout(), fl_DocListener::fl_DocListener(), FV_View::FV_View(), fp_Line::getAbsLeftRight(), fp_Run::getAscent(), fp_Run::getDescent(), FL_DocLayout::getHeight(), FV_View::getPageViewLeftMargin(), FV_View::getPageViewSep(), FV_View::getPageViewTopMargin(), fp_CellContainer::getScreenPositions(), FL_DocLayout::getWidth(), fp_VerticalContainer::getY(), fp_Run::lookupProperties(), fp_Page::redrawDamagedFrames(), fp_ImageRun::regenerateImage(), s_doPrint(), FV_View::setGraphics(), fl_DocSectionLayout::setPaperColor(), and fp_Page::updateColumnX().

void GR_Graphics::renderChars ( GR_RenderInfo ri  )  [virtual]

renderChars() outputs textual data represented by ri onto the device (screen, priter, etc.).

The output starts at ri.m_iOffset, is ri.m_iLength long and the drawing starts at ri.m_xoff, ri.m_yoff

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

References drawChars(), GR_RenderInfo::getType(), and UT_return_if_fail.

Referenced by GR_Painter::renderChars().

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

resetJustification() makes the data represented by ri unjustified and returns value by which the total width changed as a result such that OriginalWidth + ReturnValue = NewWidth (i.e., the return value should normally be negative).

The parameter bPermanent indicates that the resetting is permanent and any buffers used to hold justification information can be remove, e.g., the paragraph alignment has changed from justified to left (in some circumstance the reset can be only temporary and we will be asked to subsequently recalculate the justification information; in such case it makes sense to keep the buffers in place)

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

References GR_RenderInfo::getType(), UCS_SPACE, and UT_return_val_if_fail.

Referenced by fp_TextRun::resetJustification().

virtual void GR_Graphics::restoreRectangle ( UT_uint32  iIndx  )  [pure virtual]
virtual void GR_Graphics::saveRectangle ( UT_Rect r,
UT_uint32  iIndx 
) [pure virtual]
bool GR_Graphics::scaleDimensions ( const char *  szLeftIn,
const char *  szWidthIn,
UT_uint32  iWidthAvail,
UT_sint32 piLeft,
UT_uint32 piWidth 
) const
virtual void GR_Graphics::scroll ( UT_sint32  x_dest,
UT_sint32  y_dest,
UT_sint32  x_src,
UT_sint32  y_src,
UT_sint32  width,
UT_sint32  height 
) [pure virtual]
virtual void GR_Graphics::setColor ( const UT_RGBColor clr  )  [pure virtual]
virtual void GR_Graphics::setColorSpace ( GR_Graphics::ColorSpace  c  )  [pure virtual]
void GR_Graphics::setPortrait ( bool  b  )  [inline]

Referenced by s_actuallyPrint().

void GR_Graphics::setPrevXOffset ( UT_sint32  x  )  [inline]
void GR_Graphics::setPrevYOffset ( UT_sint32  y  )  [inline]
bool GR_Graphics::setTransform ( const GR_Transform tr  )  [inline]
bool GR_Graphics::shape ( GR_ShapingInfo si,
GR_RenderInfo *&  pri 
) [virtual]

shape() processes the information encapsulated by GR_ShapingInfo si and stores results in GR_*RenderInfo* pri.

If the contents of pri are NULL the function must create a new instance of GR_*RenderInfo of the appropriate type and store the pointer in pri; it also must store pointer to this graphics instance in pri->m_pGraphics.

If ri indicates that the text is justified, appropriate processing needs to be done

This function is tied closely together to a class derrived from GR_RenderInfo which may contain caches of various data that will speed subsequent calls to prepareToRenderChars() and renderChars()

Reimplemented in GR_Win32USPGraphics, and GR_CairoGraphics.

References GR_ShapingInfo::CAPITALIZE, GR_Font::doesGlyphExist(), UT_TextIterator::getChar(), UT_TextIterator::getStatus(), GR_Item::getType(), GRScriptType_Void, GR_XPRenderInfo::isJustified(), justify(), GR_ShapingInfo::LOWERCASE, GR_RenderInfo::m_eScriptType, GR_RenderInfo::m_eState, GR_XPRenderInfo::m_iBufferSize, GR_RenderInfo::m_iLength, GR_ShapingInfo::m_iLength, GR_XPRenderInfo::m_iTotalLength, GR_ShapingInfo::m_iVisDir, GR_XPRenderInfo::m_pChars, GR_ShapingInfo::m_pFont, GR_RenderInfo::m_pGraphics, GR_RenderInfo::m_pItem, GR_ShapingInfo::m_pItem, GR_ShapingInfo::m_previousWasSpace, GR_XPRenderInfo::m_pWidths, GR_ShapingInfo::m_Text, GR_ShapingInfo::m_TextTransform, s_cDefaultGlyph, s_getMirrorChar(), GR_XPRenderInfo::s_pOwner, s_remapGlyph(), GR_ShapingInfo::UPPERCASE, UT_BIDI_RTL, and UT_return_val_if_fail.

Referenced by fp_TextRun::_refreshDrawBuffer().

virtual bool GR_Graphics::startPage ( const char *  szPageLabel,
UT_uint32  pageNumber,
bool  bPortrait,
UT_uint32  iWidth,
UT_uint32  iHeight 
) [pure virtual]
virtual bool GR_Graphics::startPrint ( void   )  [pure virtual]
bool GR_Graphics::suspendDrawing (  )  [protected]
UT_sint32 GR_Graphics::tdu ( UT_sint32  layoutUnits  )  const
UT_sint32 GR_Graphics::tlu ( UT_sint32  deviceUnits  )  const

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

Referenced by FV_VisualDragText::_actuallyScroll(), FV_FrameEdit::_actuallyScroll(), AP_Preview_Paragraph::_appendLine(), FV_VisualDragText::_autoScroll(), FV_VisualInlineImage::_autoScroll(), FV_FrameEdit::_autoScroll(), AP_TopRuler::_autoScroll(), GR_Caret::_blink(), fp_CellContainer::_clear(), fp_TextRun::_clearScreen(), AP_Win32FrameImpl::_ContainerWndProc(), AP_Preview_Annotation::_createAnnotationPreviewFromGC(), XAP_FontPreview::_createFontPreviewFromGC(), fp_Line::_doClearScreenFromRunToEnd(), AP_Win32FrameImpl::_DocumentWndProc(), FV_Base::_doMouseDrag(), FV_View::_draw(), fp_TextRun::_draw(), fp_ImageRun::_draw(), AP_TopRuler::_draw(), fp_TabRun::_drawArrow(), AP_TopRuler::_drawBar(), fp_CellContainer::_drawBoundaries(), fp_Column::_drawBoundaries(), fp_VerticalContainer::_drawBoundaries(), fp_TableContainer::_drawBrokenBoundaries(), AP_TopRuler::_drawCellGap(), AP_TopRuler::_drawCellMark(), AP_LeftRuler::_drawCellMark(), AP_TopRuler::_drawCellProperties(), AP_TopRuler::_drawColumnGapMarker(), fp_Page::_drawCropMarks(), AP_TopRuler::_drawFirstLineIndentMarker(), fp_ShadowContainer::_drawHdrFtrBoundaries(), AP_TopRuler::_drawLeftIndentMarker(), fp_FrameContainer::_drawLine(), AP_TopRuler::_drawMarginProperties(), AP_LeftRuler::_drawMarginProperties(), AP_Preview_Paragraph::_drawPageBackground(), AP_Preview_Paragraph::_drawPageBorder(), fp_MathRun::_drawResizeBox(), FV_View::_drawResizeHandle(), AP_TopRuler::_drawRightIndentMarker(), AP_TopRuler::_drawTabProperties(), AP_TopRuler::_drawTabStop(), AP_TopRuler::_drawTabToggle(), AP_TopRuler::_drawTickMark(), AP_TopRuler::_drawTicks(), FV_View::_fixInsertionPointCoords(), AP_TopRuler::_getCellMarkerRect(), AP_LeftRuler::_getCellMarkerRects(), AP_TopRuler::_getColumnMarkerRect(), AP_TopRuler::_getFirstPixelInColumn(), AP_TopRuler::_getMarginMarkerRects(), AP_LeftRuler::_getMarginMarkerRects(), AP_TopRuler::_getParagraphMarkerRects(), AP_TopRuler::_getTabStopRect(), AP_TopRuler::_getTabToggleRect(), AP_TopRuler::_getTabZoneRect(), AP_TopRuler::_getUnitsFromRulerLeft(), AP_TopRuler::_isInBottomBoxOfLeftIndent(), AP_Win32LeftRuler::_LeftRulerWndProc(), fp_ImageRun::_lookupProperties(), fl_FrameLayout::_lookupProperties(), FV_VisualDragText::_mouseDrag(), FV_VisualInlineImage::_mouseDrag(), FV_FrameEdit::_mouseDrag(), FV_View::_moveInsPtNextPrevLine(), XAP_Win32Dialog_FileOpenSaveAs::_previewPicture(), AP_CocoaFrameImpl::_scrollAction, AP_Win32FrameImpl::_scrollFuncX(), AP_Win32FrameImpl::_scrollFuncY(), GR_Win32Graphics::_setTransform(), AP_Win32FrameImpl::_setXScrollRange(), AP_Win32FrameImpl::_setYScrollRange(), _tduR(), AP_Win32TopRuler::_TopRulerWndProc(), AP_TopRuler::_xorGuide(), AP_LeftRuler::_xorGuide(), AP_Preview_Abi::AP_Preview_Abi(), AP_UnixTopRuler::_fe::button_press_event(), AP_UnixLeftRuler::_fe::button_press_event(), AP_UnixTopRuler::_fe::button_release_event(), AP_UnixLeftRuler::_fe::button_release_event(), XAP_Draw_Symbol::calcSymbol(), XAP_Preview_FontPreview::clearScreen(), fp_Line::clearScreen(), AP_Preview_Annotation::clearScreen(), FV_View::cmdScroll(), fp_VerticalContainer::distanceFromPoint(), XAP_UnixFrameImpl::_fe::do_ZoomUpdate(), XAP_UnixFrameImpl::_fe::draw(), XAP_Preview_Zoom::draw(), XAP_Draw_Symbol::draw(), XAP_Preview_FontPreview::draw(), XAP_CustomWidgetLU::draw(), fp_Run::draw(), fp_FootnoteContainer::draw(), fp_VerticalContainer::draw(), AP_Preview_Annotation::draw(), AP_Preview_PageNumbers::draw(), AP_Lists_preview::draw(), AP_FormatTable_preview::draw(), AP_FormatFrame_preview::draw(), AP_Columns_preview_drawer::draw(), AP_Columns_preview::draw(), AP_Border_Shading_preview::draw(), XAP_Draw_Symbol::drawarea(), fp_CellContainer::drawBroken(), FV_VisualDragText::drawCursor(), FV_VisualInlineImage::drawCursor(), fp_Run::drawDecors(), fp_FrameContainer::drawHandles(), fp_Container::drawLine(), fp_CellContainer::drawLines(), AP_LeftRuler::drawLU(), FV_View::drawSelectionBox(), fg_FillType::Fill(), FG_GraphicRaster::generateImage(), GR_EmbedManager::getAscent(), AP_TopRuler::getHeight(), AP_LeftRuler::getHeight(), FV_VisualInlineImage::getImageFromSelection(), FV_View::getImageSelInfo(), fl_BlockLayout::getLeftRightForWrapping(), GR_Image::GetOffsetFromLeft(), GR_Image::GetOffsetFromRight(), FV_View::getPageViewSep(), FV_VisualDragText::getPosFromXY(), FV_VisualInlineImage::getPosFromXY(), FV_View::getTabToggleAreaWidth(), AP_TopRuler::getTabToggleAreaWidth(), GR_EmbedManager::getWidth(), AP_TopRuler::getWidth(), AP_LeftRuler::getWidth(), AP_TopRuler::isMouseOverTab(), GR_Caret::JustErase(), fp_AnnotationContainer::layout(), fp_FootnoteContainer::layout(), AP_UnixApp::makePngPreview(), fp_Page::mapXYToPosition(), AP_UnixTopRuler::_fe::motion_notify_event(), AP_UnixLeftRuler::_fe::motion_notify_event(), FV_FrameEdit::mouseLeftPress(), AP_TopRuler::mouseMotion(), AP_LeftRuler::mouseMotion(), AP_TopRuler::mousePress(), FV_VisualInlineImage::mouseRelease(), AP_TopRuler::mouseRelease(), AP_TopRuler::notify(), EV_Win32Mouse::onButtonDown(), EV_Win32Mouse::onButtonMove(), EV_Win32Mouse::onButtonUp(), EV_Win32Mouse::onButtonWheel(), EV_Win32Mouse::onDoubleClick(), fp_FrameContainer::overlapsRect(), XAP_UnixDialog_FileOpenSaveAs::previewPicture(), fp_Line::recalcMaxWidth(), GR_EmbedManager::render(), FV_VisualDragText::reposOffsets(), s_loadImage(), AP_TopRuler::scrollRuler(), AP_LeftRuler::scrollRuler(), XAP_Draw_Symbol::setAreaSize(), fl_CellLayout::setCellContainerProperties(), fl_FrameLayout::setContainerProperties(), FV_VisualInlineImage::setDragType(), FV_FrameEdit::setDragType(), AP_Preview_Paragraph_Block::setFormat(), fp_Line::setMaxWidth(), AP_Preview_Annotation::setSizeFromAnnotation(), AP_TopRuler::setTableLineDrag(), AP_LeftRuler::setTableLineDrag(), AV_View::setWindowSize(), XAP_Draw_Symbol::setWindowSize(), FV_View::setXScrollOffset(), AP_CocoaFrame::setXScrollRange(), AP_CocoaFrame::setYScrollRange(), FV_SelectionHandles::updateCursor(), FV_SelectionHandles::updateSelectionEnd(), FV_SelectionHandles::updateSelectionStart(), and GR_CairoGraphics::xorLine().

virtual void GR_Graphics::xorLine ( UT_sint32  x1,
UT_sint32  y1,
UT_sint32  x2,
UT_sint32  y2 
) [protected, pure virtual]
void GR_Graphics::xorRect ( UT_sint32  x,
UT_sint32  y,
UT_sint32  w,
UT_sint32  h 
) [protected]

References xorLine().

Referenced by GR_Painter::xorRect(), and xorRect().

void GR_Graphics::xorRect ( const UT_Rect r  )  [protected]
UT_uint32 GR_Graphics::XYToPosition ( const GR_RenderInfo ri,
UT_sint32  x,
UT_sint32  y 
) const [virtual]

Friends And Related Function Documentation

friend class AllCarets [friend]
friend class GR_Caret [friend]

Referenced by createCaret().

friend class GR_Painter [friend]

Member Data Documentation

bool GR_Graphics::m_bDoMerge [private]

Referenced by ~GR_Graphics().

UT_uint32 GR_Graphics::m_uTick [static, protected]
UT_UCS4Char GR_Graphics::s_cDefaultGlyph = '?' [static, private]

Referenced by shape().

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