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

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 DOCINFOW *, 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 (LOGFONTW &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 DOCINFOW *  pDI,
HGLOBAL  hDevMode = NULL 
) [protected]

Member Function Documentation

bool GR_Win32USPGraphics::_needsSpecialBreaking ( GR_Win32USPRenderInfo ri  )  [inline, protected]
GR_Win32Font * GR_Win32USPGraphics::_newFont ( LOGFONTW &  lf,
double  fPoints,
HDC  hdc,
HDC  printHDC 
) [private, virtual]

Reimplemented from GR_Win32Graphics.

References GR_Win32USPFont::newFont().

UT_uint32 GR_Win32USPGraphics::adjustCaretPosition ( GR_RenderInfo ri,
bool  bForward 
) [virtual]
void GR_Win32USPGraphics::adjustDeletePosition ( 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_RenderInfo::getType(), GRRI_WIN32_UNISCRIBE, GR_RenderInfo::m_iLength, GR_RenderInfo::m_iOffset, and UT_return_val_if_fail.

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.

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

Reimplemented from GR_Win32Graphics.

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

Reimplemented from GR_Win32Graphics.

References GR_Win32Graphics::s_getClassId().

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]
const char * GR_Win32USPGraphics::getUSPVersion (  )  [static]
virtual const UT_VersionInfo& GR_Win32USPGraphics::getVersion (  )  const [inline, virtual]

Reimplemented from GR_Graphics.

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

Reimplemented from GR_Win32Graphics.

References s_sDescription, and UT_UTF8String::utf8_str().

Referenced by XAP_Win32App::XAP_Win32App().

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

Reimplemented from GR_Graphics.

bool GR_Win32USPGraphics::needsSpecialCaretPositioning ( GR_RenderInfo ri  )  [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::resetJustification ( GR_RenderInfo ri,
bool  bPermanent 
) [virtual]

Reimplemented from GR_Graphics.

References GR_RenderInfo::getType(), and UT_return_val_if_fail.

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

Reimplemented from GR_Win32Graphics.

Referenced by XAP_Win32App::XAP_Win32App().

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().


Member Data Documentation

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

Referenced by _scriptBreak().

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

Referenced by positionToXY().

tScriptGetProperties GR_Win32USPGraphics::fScriptGetProperties = NULL [static, protected]

Referenced by _constructorCommonCode().

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

Referenced by shape().

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

Referenced by itemize().

tScriptJustify GR_Win32USPGraphics::fScriptJustify = NULL [static, protected]
tScriptPlace GR_Win32USPGraphics::fScriptPlace = NULL [static, protected]
tScriptRecordDigitSubstitution GR_Win32USPGraphics::fScriptRecordDigitSubstitution = NULL [static, protected]

Referenced by shape().

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

Referenced by shape().

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

Referenced by _drawChars().

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

Referenced by _drawChars().

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

Referenced by _drawChars().

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

Referenced by renderChars().

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

Referenced by XYToPosition().

HINSTANCE GR_Win32USPGraphics::s_hUniscribe = NULL [static, private]
int GR_Win32USPGraphics::s_iMaxScript = 0 [static, private]

Referenced by _constructorCommonCode().

Reimplemented from GR_Graphics.

Referenced by _constructorCommonCode().


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