GR_Win32USPGraphics Class Reference

#include <gr_Win32USPGraphics.h>

Inheritance diagram for GR_Win32USPGraphics:

GR_Win32Graphics GR_Graphics

List of all members.

Public Member Functions

virtual ~GR_Win32USPGraphics ()
virtual UT_uint32 getClassId ()
virtual GR_Capability getCapability ()
virtual void setFont (const GR_Font *pFont)
virtual void drawChars (const UT_UCSChar *pChars, int iCharOffset, int iLength, UT_sint32 xoff, UT_sint32 yoff, int *pCharWidth)
virtual void drawCharsRelativeToBaseline (const UT_UCSChar *pChars, int iCharOffset, int iLength, UT_sint32 xoff, UT_sint32 yoff, int *pCharWidths=NULL)
virtual UT_uint32 getFontHeight ()
virtual UT_uint32 getFontAscent ()
virtual UT_uint32 getFontDescent ()
virtual UT_uint32 getFontAscent (GR_Font *)
virtual UT_uint32 getFontDescent (GR_Font *)
virtual UT_uint32 getFontHeight (GR_Font *)
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 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 bool needsSpecialCaretPositioning (GR_RenderInfo &ri)
virtual UT_uint32 adjustCaretPosition (GR_RenderInfo &ri, bool bForward)
virtual void adjustDeletePosition (GR_RenderInfo &ri)
virtual const UT_VersionInfogetVersion () const
virtual void setPrintDC (HDC dc)

Static Public Member Functions

static UT_uint32 s_getClassId ()
static const char * graphicsDescriptor ()
static const char * getUSPVersion ()
static GR_GraphicsgraphicsAllocator (GR_AllocInfo &)

Static Public Attributes

static tScriptFreeCache fScriptFreeCache = NULL

Protected Member Functions

bool _needsSpecialBreaking (GR_Win32USPRenderInfo &ri)
bool _needsSpecialCaretPositioning (GR_Win32USPRenderInfo &ri)
bool _scriptBreak (GR_Win32USPRenderInfo &ri)
 GR_Win32USPGraphics (HDC, HWND)
 GR_Win32USPGraphics (HDC, const DOCINFO *, HGLOBAL hDevMode=NULL)

Static Protected Attributes

static tScriptItemize fScriptItemize = NULL
static tScriptShape fScriptShape = NULL
static tScriptStringOut fScriptStringOut = NULL
static tScriptStringAnalyse fScriptStringAnalyse = NULL
static tScriptStringFree fScriptStringFree = NULL
static tScriptTextOut fScriptTextOut = NULL
static tScriptPlace fScriptPlace = NULL
static tScriptJustify fScriptJustify = NULL
static tScriptCPtoX fScriptCPtoX = NULL
static tScriptXtoCP fScriptXtoCP = NULL
static tScriptBreak fScriptBreak = NULL
static tScriptIsComplex fScriptIsComplex = NULL
static tScriptGetProperties fScriptGetProperties = NULL
static
tScriptRecordDigitSubstitution 
fScriptRecordDigitSubstitution = NULL

Private Member Functions

bool _constructorCommonCode ()
virtual GR_Win32Font_newFont (LOGFONT &lf, double fPoints, HDC hdc, HDC printHDC)
void _setupFontOnDC (GR_Win32USPFont *pFont, bool bZoomMe)
void _drawChars (const UT_UCSChar *pChars, int iCharOffset, int iLength, UT_sint32 xoff, UT_sint32 yoff, int *pCharWidth)

Private Attributes

bool m_bConstructorSucceeded

Static Private Attributes

static HINSTANCE s_hUniscribe = NULL
static UT_uint32 s_iInstanceCount = 0
static UT_VersionInfo s_Version
static const SCRIPT_PROPERTIES ** s_ppScriptProperties = NULL
static int s_iMaxScript = 0
static UT_UTF8String s_sDescription
static UT_UTF8String s_sUSPVersion


Constructor & Destructor Documentation

GR_Win32USPGraphics::~GR_Win32USPGraphics (  )  [virtual]

GR_Win32USPGraphics::GR_Win32USPGraphics ( HDC  hdc,
HWND  hwnd 
) [protected]

GR_Win32USPGraphics::GR_Win32USPGraphics ( HDC  hdc,
const DOCINFO *  pDI,
HGLOBAL  hDevMode = NULL 
) [protected]


Member Function Documentation

static UT_uint32 GR_Win32USPGraphics::s_getClassId (  )  [inline, static]

Reimplemented from GR_Win32Graphics.

References GRID_WIN32_UNISCRIBE.

Referenced by XAP_Win32App::XAP_Win32App().

virtual UT_uint32 GR_Win32USPGraphics::getClassId (  )  [inline, virtual]

Reimplemented from GR_Win32Graphics.

References GR_Win32Graphics::s_getClassId().

virtual GR_Capability GR_Win32USPGraphics::getCapability (  )  [inline, virtual]

Reimplemented from GR_Win32Graphics.

References GRCAP_SCREEN_AND_PRINTER.

const char * GR_Win32USPGraphics::graphicsDescriptor ( void   )  [static]

Reimplemented from GR_Win32Graphics.

References s_sDescription, and UT_UTF8String::utf8_str().

Referenced by XAP_Win32App::XAP_Win32App().

const char * GR_Win32USPGraphics::getUSPVersion (  )  [static]

GR_Graphics * GR_Win32USPGraphics::graphicsAllocator ( GR_AllocInfo info  )  [static]

void GR_Win32USPGraphics::setFont ( const GR_Font pFont  )  [virtual]

The USP library maintains an internal font cache, which allows it to avoid accessing the DC for things like measuring fonts, etc. This means that often it is not necessary to have the font selected into the DC, and as SelectObject() is very time consuming, we will not be calling it from here at all, instead, we will only note which font is being set and call SelectObject() from inside the functions that access the DC only if that is necessary.

Reimplemented from GR_Win32Graphics.

References GR_Font::getAllocNumber(), GR_Graphics::m_iFontAllocNo, GR_Win32Graphics::m_pFont, and UT_ASSERT_HARMLESS.

Referenced by getFontAscent(), getFontDescent(), and getFontHeight().

void GR_Win32USPGraphics::drawChars ( const UT_UCSChar pChars,
int  iCharOffset,
int  iLength,
UT_sint32  xoff,
UT_sint32  yoff,
int *  pCharWidth 
) [virtual]

Reimplemented from GR_Win32Graphics.

References _drawChars(), and GR_Win32Graphics::m_hdc.

void GR_Win32USPGraphics::drawCharsRelativeToBaseline ( const UT_UCSChar pChars,
int  iCharOffset,
int  iLength,
UT_sint32  xoff,
UT_sint32  yoff,
int *  pCharWidths = NULL 
) [virtual]

Reimplemented from GR_Graphics.

References _drawChars(), and GR_Win32Graphics::m_hdc.

UT_uint32 GR_Win32USPGraphics::getFontHeight (  )  [virtual]

UT_uint32 GR_Win32USPGraphics::getFontAscent (  )  [virtual]

UT_uint32 GR_Win32USPGraphics::getFontDescent (  )  [virtual]

UT_uint32 GR_Win32USPGraphics::getFontAscent ( GR_Font fnt  )  [virtual]

UT_uint32 GR_Win32USPGraphics::getFontDescent ( GR_Font fnt  )  [virtual]

UT_uint32 GR_Win32USPGraphics::getFontHeight ( GR_Font fnt  )  [virtual]

void GR_Win32USPGraphics::setZoomPercentage ( UT_uint32  iZoom  )  [virtual]

bool GR_Win32USPGraphics::itemize ( UT_TextIterator text,
GR_Itemization I 
) [virtual]

bool GR_Win32USPGraphics::shape ( GR_ShapingInfo si,
GR_RenderInfo *&  ri 
) [virtual]

void GR_Win32USPGraphics::prepareToRenderChars ( GR_RenderInfo ri  )  [virtual]

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

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

void GR_Win32USPGraphics::appendRenderedCharsToBuff ( GR_RenderInfo ri,
UT_GrowBuf buf 
) const [virtual]

Reimplemented from GR_Graphics.

References UT_NOT_IMPLEMENTED, and UT_return_if_fail.

bool GR_Win32USPGraphics::canBreak ( GR_RenderInfo ri,
UT_sint32 iNext,
bool  bAfter 
) [virtual]

this function should return true if break can occur AFTER the character at indicated position; Uniscribe functions indicate if break can occur BEFORE the character

Reimplemented from GR_Graphics.

References _needsSpecialBreaking(), _scriptBreak(), GR_Graphics::canBreak(), GR_RenderInfo::getType(), GRRI_WIN32_UNISCRIBE, GR_RenderInfo::m_iLength, GR_RenderInfo::m_iOffset, and UT_return_val_if_fail.

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

Reimplemented from GR_Graphics.

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

UT_sint32 GR_Win32USPGraphics::countJustificationPoints ( const GR_RenderInfo ri  )  const [virtual]

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

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

void GR_Win32USPGraphics::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 GR_Win32USPGraphics::getTextWidth ( GR_RenderInfo ri  )  [virtual]

bool GR_Win32USPGraphics::needsSpecialCaretPositioning ( GR_RenderInfo ri  )  [virtual]

UT_uint32 GR_Win32USPGraphics::adjustCaretPosition ( GR_RenderInfo ri,
bool  bForward 
) [virtual]

void GR_Win32USPGraphics::adjustDeletePosition ( GR_RenderInfo ri  )  [virtual]

bool GR_Win32USPGraphics::_needsSpecialBreaking ( GR_Win32USPRenderInfo ri  )  [inline, protected]

bool GR_Win32USPGraphics::_needsSpecialCaretPositioning ( GR_Win32USPRenderInfo ri  )  [inline, protected]

bool GR_Win32USPGraphics::_scriptBreak ( GR_Win32USPRenderInfo ri  )  [inline, protected]

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

Reimplemented from GR_Graphics.

void GR_Win32USPGraphics::setPrintDC ( HDC  dc  )  [virtual]

bool GR_Win32USPGraphics::_constructorCommonCode (  )  [private]

GR_Win32Font * GR_Win32USPGraphics::_newFont ( LOGFONT &  lf,
double  fPoints,
HDC  hdc,
HDC  printHDC 
) [private, virtual]

Reimplemented from GR_Win32Graphics.

References GR_Win32USPFont::newFont().

void GR_Win32USPGraphics::_setupFontOnDC ( GR_Win32USPFont pFont,
bool  bZoomMe 
) [private]

void GR_Win32USPGraphics::_drawChars ( const UT_UCSChar pChars,
int  iCharOffset,
int  iLength,
UT_sint32  xoff,
UT_sint32  yoff,
int *  pCharWidth 
) [private]


Member Data Documentation

HINSTANCE GR_Win32USPGraphics::s_hUniscribe = NULL [static, private]

Reimplemented from GR_Win32Graphics.

Referenced by _constructorCommonCode(), and ~GR_Win32USPGraphics().

Reimplemented from GR_Graphics.

Referenced by _constructorCommonCode().

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

Referenced by _constructorCommonCode().

tScriptItemize GR_Win32USPGraphics::fScriptItemize = NULL [static, protected]

Referenced by itemize().

tScriptShape GR_Win32USPGraphics::fScriptShape = NULL [static, protected]

Referenced by shape().

tScriptStringOut GR_Win32USPGraphics::fScriptStringOut = NULL [static, protected]

Referenced by _drawChars().

tScriptStringAnalyse GR_Win32USPGraphics::fScriptStringAnalyse = NULL [static, protected]

Referenced by _drawChars().

tScriptStringFree GR_Win32USPGraphics::fScriptStringFree = NULL [static, protected]

Referenced by _drawChars().

tScriptTextOut GR_Win32USPGraphics::fScriptTextOut = NULL [static, protected]

Referenced by renderChars().

tScriptPlace GR_Win32USPGraphics::fScriptPlace = NULL [static, protected]

tScriptJustify GR_Win32USPGraphics::fScriptJustify = NULL [static, protected]

tScriptCPtoX GR_Win32USPGraphics::fScriptCPtoX = NULL [static, protected]

Referenced by positionToXY().

tScriptXtoCP GR_Win32USPGraphics::fScriptXtoCP = NULL [static, protected]

Referenced by XYToPosition().

tScriptBreak GR_Win32USPGraphics::fScriptBreak = NULL [static, protected]

Referenced by _scriptBreak().

tScriptIsComplex GR_Win32USPGraphics::fScriptIsComplex = NULL [static, protected]

Referenced by