#include <gr_CocoaGraphics.h>
Public Types | |
typedef bool(* | gr_cocoa_graphics_update )(NSRect *rect, GR_CocoaGraphics *pGr, void *param) |
Public Member Functions | |
~GR_CocoaGraphics () | |
virtual UT_uint32 | getClassId () |
virtual GR_Capability | getCapability () |
virtual void | drawGlyph (UT_uint32, UT_sint32, UT_sint32) |
virtual void | drawChars (const UT_UCSChar *pChars, int iCharOffset, int iLength, UT_sint32 xoff, UT_sint32 yoff, int *pCharWidhths=NULL) |
virtual void | setFont (const GR_Font *pFont) |
virtual void | clearFont (void) |
virtual UT_uint32 | getFontHeight () |
virtual UT_sint32 | measureUnRemappedChar (const UT_UCSChar c, UT_uint32 *height=NULL) |
virtual void | getCoverage (UT_NumberVector &coverage) |
virtual void | setColor (const UT_RGBColor &clr) |
virtual void | getColor (UT_RGBColor &clr) |
virtual GR_Font * | getGUIFont () |
virtual UT_uint32 | getFontAscent () |
virtual UT_uint32 | getFontDescent () |
virtual void | drawLine (UT_sint32, UT_sint32, UT_sint32, UT_sint32) |
virtual void | setLineWidth (UT_sint32) |
virtual void | polyLine (UT_Point *pts, UT_uint32 nPoints) |
void | rawPolyAtOffset (NSPoint *point, int npoint, UT_sint32 offset_x, UT_sint32 offset_y, NSColor *color, bool bFill) |
void | fillNSRect (NSRect &aRect, NSColor *color) |
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 | setClipRect (const UT_Rect *pRect) |
virtual void | scroll (UT_sint32, UT_sint32) |
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) |
virtual void | clearArea (UT_sint32, UT_sint32, UT_sint32, UT_sint32) |
virtual void | drawImage (GR_Image *pImg, UT_sint32 xDest, UT_sint32 yDest) |
virtual GR_Image * | createNewImage (const char *pszName, const UT_ByteBuf *pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight, GR_Image::GRType=GR_Image::GRT_Raster) |
virtual void | setLineProperties (double inWidthPixels, JoinStyle inJoinStyle, CapStyle inCapStyle, LineStyle inLineStyle) |
virtual bool | queryProperties (GR_Graphics::Properties gp) const |
virtual bool | startPrint (void) |
virtual bool | startPage (const char *szPageLabel, UT_uint32 pageNumber, bool bPortrait, UT_uint32 iWidth, UT_uint32 iHeight) |
virtual void | setZoomPercentage (UT_uint32 iZoom) |
virtual bool | endPrint (void) |
virtual void | flush (void) |
virtual void | setColorSpace (GR_Graphics::ColorSpace c) |
virtual GR_Graphics::ColorSpace | getColorSpace (void) const |
virtual void | setCursor (GR_Graphics::Cursor c) |
virtual GR_Graphics::Cursor | getCursor (void) const |
void | setGrabCursor (GR_Graphics::Cursor c) |
virtual void | setColor3D (GR_Color3D c) |
void | init3dColors () |
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 UT_uint32 | getFontAscent (const GR_Font *) |
virtual UT_uint32 | getFontDescent (const GR_Font *) |
virtual UT_uint32 | getFontHeight (const GR_Font *) |
virtual GR_Image * | genImageFromRectangle (const UT_Rect &r) |
virtual void | saveRectangle (UT_Rect &r, UT_uint32 iIndx) |
virtual void | restoreRectangle (UT_uint32 iIndx) |
virtual UT_uint32 | getDeviceResolution (void) const |
void | _setUpdateCallback (gr_cocoa_graphics_update callback, void *param) |
bool | _callUpdateCallback (NSRect *aRect) |
XAP_CocoaNSView * | _getView () |
void | setIsPrinting (bool _isPrinting) |
bool | isPrinting (void) const |
Static Public Member Functions | |
static UT_uint32 | s_getClassId () |
static const char * | graphicsDescriptor (void) |
static GR_Graphics * | graphicsAllocator (GR_AllocInfo &) |
static NSColor * | HBlue () |
static NSColor * | VBlue () |
static NSColor * | HGrey () |
static NSColor * | VGrey () |
static bool | _isFlipped () |
static NSColor * | _utRGBColorToNSColor (const UT_RGBColor &clr) |
static void | _utNSColorToRGBColor (NSColor *c, UT_RGBColor &clr) |
static float | _getScreenResolution (void) |
Public Attributes | |
NSColor * | m_3dColors [COUNT_3D_COLORS] |
Protected Member Functions | |
GR_CocoaGraphics (XAP_CocoaNSView *view) | |
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 UT_uint32 | _getResolution (void) const |
void | _setColor (NSColor *c) |
virtual void | _beginPaint (void) |
virtual void | _endPaint (void) |
Private Member Functions | |
void | _setClipRectImpl (const UT_Rect *pRect) |
NSImage * | _makeNewCacheImage () |
void | _resetContext (CGContextRef context) |
float | _measureUnRemappedCharCached (const UT_UCSChar c) |
void | _setCapStyle (CapStyle inCapStyle, CGContextRef *context=0) |
void | _setJoinStyle (JoinStyle inJoinStyle, CGContextRef *context=0) |
void | _setLineStyle (LineStyle inLineStyle, CGContextRef *context=0) |
void | _restartPaint (void) |
void | _realDrawChars (ATSUTextLayout atsuLayout, float x, float y, int begin, int rangelen, float xOffset) |
Static Private Member Functions | |
static void | _initColorAndImage (void) |
Private Attributes | |
gr_cocoa_graphics_update | m_updateCallback |
void * | m_updateCBparam |
XAP_CocoaNSView * | m_pWin |
ATSUStyle | m_atsuStyle |
CGContextRef | m_CGContext |
UT_GenericVector< id > | m_cacheArray |
UT_GenericVector< NSRect * > | m_cacheRectArray |
NSColor * | m_currentColor |
XAP_CocoaFont * | m_pFont |
NSFont * | m_fontForGraphics |
XAP_CocoaFont * | m_pFontGUI |
float | m_fLineWidth |
JoinStyle | m_joinStyle |
CapStyle | m_capStyle |
LineStyle | m_lineStyle |
GR_Graphics::Cursor | m_cursor |
GR_Graphics::Cursor | m_GrabCursor |
GR_Graphics::ColorSpace | m_cs |
UT_uint32 | m_screenResolution |
bool | m_bIsPrinting |
bool | m_bIsDrawing |
StNSViewLocker * | m_viewLocker |
Static Private Attributes | |
static bool | m_colorAndImageInited = false |
static NSImage * | m_imageBlue16x15 = nil |
static NSImage * | m_imageBlue11x16 = nil |
static NSImage * | m_imageGrey16x15 = nil |
static NSImage * | m_imageGrey11x16 = nil |
static NSColor * | m_colorBlue16x15 = nil |
static NSColor * | m_colorBlue11x16 = nil |
static NSColor * | m_colorGrey16x15 = nil |
static NSColor * | m_colorGrey11x16 = nil |
static NSCursor * | m_Cursor_E = nil |
static NSCursor * | m_Cursor_N = nil |
static NSCursor * | m_Cursor_NE = nil |
static NSCursor * | m_Cursor_NW = nil |
static NSCursor * | m_Cursor_S = nil |
static NSCursor * | m_Cursor_SE = nil |
static NSCursor * | m_Cursor_SW = nil |
static NSCursor * | m_Cursor_W = nil |
static NSCursor * | m_Cursor_Wait = nil |
static NSCursor * | m_Cursor_LeftArrow = nil |
static NSCursor * | m_Cursor_RightArrow = nil |
static NSCursor * | m_Cursor_Compass = nil |
static NSCursor * | m_Cursor_Exchange = nil |
static NSCursor * | m_Cursor_LeftRight = nil |
static NSCursor * | m_Cursor_UpDown = nil |
static NSCursor * | m_Cursor_Crosshair = nil |
static NSCursor * | m_Cursor_HandPointer = nil |
static NSCursor * | m_Cursor_DownArrow = nil |
static UT_uint32 | s_iInstanceCount = 0 |
typedef bool(* GR_CocoaGraphics::gr_cocoa_graphics_update)(NSRect *rect, GR_CocoaGraphics *pGr, void *param) |
GR_CocoaGraphics::~GR_CocoaGraphics | ( | ) |
GR_CocoaGraphics::GR_CocoaGraphics | ( | XAP_CocoaNSView * | view | ) | [protected] |
References _getScreenResolution(), _initColorAndImage(), _resetContext(), CG_CONTEXT__, GR_Graphics::GR_COLORSPACE_COLOR, GR_Graphics::GR_CURSOR_DEFAULT, GR_Graphics::GR_CURSOR_INVALID, init3dColors(), m_CGContext, m_cs, m_currentColor, m_cursor, m_pWin, m_screenResolution, s_iInstanceCount, setCursor(), and UT_ASSERT.
Referenced by graphicsAllocator().
static UT_uint32 GR_CocoaGraphics::s_getClassId | ( | ) | [inline, static] |
virtual UT_uint32 GR_CocoaGraphics::getClassId | ( | ) | [inline, virtual] |
virtual GR_Capability GR_CocoaGraphics::getCapability | ( | ) | [inline, virtual] |
static const char* GR_CocoaGraphics::graphicsDescriptor | ( | void | ) | [inline, static] |
Referenced by XAP_CocoaApp::XAP_CocoaApp().
GR_Graphics * GR_CocoaGraphics::graphicsAllocator | ( | GR_AllocInfo & | info | ) | [static] |
References GR_CocoaGraphics(), and GR_CocoaAllocInfo::m_view.
Referenced by XAP_CocoaApp::XAP_CocoaApp().
void GR_CocoaGraphics::drawChars | ( | const UT_UCSChar * | pChars, | |
int | iCharOffset, | |||
int | iLength, | |||
UT_sint32 | xoff, | |||
UT_sint32 | yoff, | |||
int * | pCharWidhths = NULL | |||
) | [virtual] |
Implements GR_Graphics.
References _atsuCreateLayout(), _realDrawChars(), GR_Graphics::_tduY(), FREEP, LOCK_CONTEXT__, m_atsuStyle, m_CGContext, m_pFont, XAP_CocoaFont::needsRemap(), XAP_CocoaFont::remapChar(), TDUX, and UT_DEBUGMSG.
void GR_CocoaGraphics::setFont | ( | const GR_Font * | pFont | ) | [virtual] |
Implements GR_Graphics.
References XAP_CocoaFont::getNSFont(), GR_Graphics::getZoomPercentage(), m_atsuStyle, m_fontForGraphics, m_pFont, XAP_CocoaFont::makeAtsuStyle(), and UT_ASSERT.
virtual void GR_CocoaGraphics::clearFont | ( | void | ) | [inline, virtual] |
UT_uint32 GR_CocoaGraphics::getFontHeight | ( | ) | [virtual] |
UT_sint32 GR_CocoaGraphics::measureUnRemappedChar | ( | const UT_UCSChar | c, | |
UT_uint32 * | height = NULL | |||
) | [virtual] |
Measure unremapped char
Implements GR_Graphics.
References _measureUnRemappedCharCached(), and GR_Graphics::ftluD().
void GR_CocoaGraphics::getCoverage | ( | UT_NumberVector & | coverage | ) | [virtual] |
void GR_CocoaGraphics::setColor | ( | const UT_RGBColor & | clr | ) | [virtual] |
Implements GR_Graphics.
References _setColor(), _utRGBColorToNSColor(), UT_RGBColor::m_blu, UT_RGBColor::m_grn, UT_RGBColor::m_red, and UT_DEBUGMSG.
void GR_CocoaGraphics::getColor | ( | UT_RGBColor & | clr | ) | [virtual] |
static NSColor* GR_CocoaGraphics::HBlue | ( | ) | [inline, static] |
static NSColor* GR_CocoaGraphics::VBlue | ( | ) | [inline, static] |
static NSColor* GR_CocoaGraphics::HGrey | ( | ) | [inline, static] |
static NSColor* GR_CocoaGraphics::VGrey | ( | ) | [inline, static] |
GR_Font * GR_CocoaGraphics::getGUIFont | ( | void | ) | [virtual] |
Implements GR_Graphics.
References GR_Graphics::getZoomPercentage(), m_pFontGUI, UT_ASSERT, and UT_DEBUGMSG.
UT_uint32 GR_CocoaGraphics::getFontAscent | ( | ) | [virtual] |
UT_uint32 GR_CocoaGraphics::getFontDescent | ( | ) | [virtual] |
void GR_CocoaGraphics::drawLine | ( | UT_sint32 | x1, | |
UT_sint32 | y1, | |||
UT_sint32 | x2, | |||
UT_sint32 | y2 | |||
) | [virtual] |
Implements GR_Graphics.
References GR_Graphics::_tduY(), LOCK_CONTEXT__, m_CGContext, m_currentColor, m_fLineWidth, TDUX, and UT_DEBUGMSG.
void GR_CocoaGraphics::setLineWidth | ( | UT_sint32 | iLineWidth | ) | [virtual] |
Implements GR_Graphics.
References _setLineStyle(), m_CGContext, m_fLineWidth, m_lineStyle, m_viewLocker, GR_Graphics::tduD(), and UT_DEBUGMSG.
Implements GR_Graphics.
References GR_Graphics::_tduY(), LOCK_CONTEXT__, m_CGContext, m_fLineWidth, TDUX, and UT_DEBUGMSG.
void GR_CocoaGraphics::rawPolyAtOffset | ( | NSPoint * | point, | |
int | npoint, | |||
UT_sint32 | offset_x, | |||
UT_sint32 | offset_y, | |||
NSColor * | color, | |||
bool | bFill | |||
) |
References GR_Graphics::_tduY(), LOCK_CONTEXT__, m_CGContext, TDUX, and UT_ASSERT.
Referenced by AP_CocoaTopRuler::_drawCellMark(), AP_CocoaLeftRuler::_drawCellMark(), AP_CocoaTopRuler::_drawColumnGapMarker(), AP_CocoaTopRuler::_drawFirstLineIndentMarker(), AP_CocoaTopRuler::_drawLeftIndentMarker(), AP_CocoaTopRuler::_drawMarginProperties(), AP_CocoaLeftRuler::_drawMarginProperties(), and AP_CocoaTopRuler::_drawRightIndentMarker().
void GR_CocoaGraphics::fillNSRect | ( | NSRect & | aRect, | |
NSColor * | color | |||
) |
void GR_CocoaGraphics::fillRect | ( | const UT_RGBColor & | c, | |
UT_sint32 | x, | |||
UT_sint32 | y, | |||
UT_sint32 | w, | |||
UT_sint32 | h | |||
) | [virtual] |
Implements GR_Graphics.
References _utRGBColorToNSColor(), LOCK_CONTEXT__, m_CGContext, GR_Graphics::tduD(), and UT_DEBUGMSG.
Referenced by fillRect().
void GR_CocoaGraphics::invertRect | ( | const UT_Rect * | pRect | ) | [virtual] |
Implements GR_Graphics.
References GR_Graphics::_tduR(), GR_Graphics::_tduY(), UT_Rect::height, UT_Rect::left, LOCK_CONTEXT__, TDUX, UT_Rect::top, UT_ASSERT, UT_DEBUGMSG, and UT_Rect::width.
void GR_CocoaGraphics::setClipRect | ( | const UT_Rect * | pRect | ) | [virtual] |
Implements GR_Graphics.
References _restartPaint(), GR_Graphics::m_pRect, m_viewLocker, and UT_DEBUGMSG.
Implements GR_Graphics.
References GR_Graphics::getPrevXOffset(), GR_Graphics::getPrevYOffset(), m_pWin, GR_Graphics::setPrevXOffset(), GR_Graphics::setPrevYOffset(), and GR_Graphics::tdu().
void GR_CocoaGraphics::clearArea | ( | UT_sint32 | x, | |
UT_sint32 | y, | |||
UT_sint32 | width, | |||
UT_sint32 | height | |||
) | [virtual] |
Implements GR_Graphics.
References GR_Graphics::_tduR(), GR_Graphics::_tduY(), LOCK_CONTEXT__, m_CGContext, TDUX, and UT_DEBUGMSG.
Reimplemented from GR_Graphics.
References GR_Graphics::_tduY(), GR_Image::getDisplayHeight(), GR_Image::getDisplayWidth(), GR_CocoaImage::getNSImage(), GR_Image::getType(), GR_Image::GRT_Raster, LOCK_CONTEXT__, m_CGContext, GR_Image::render(), TDUX, UT_ASSERT, and UT_DEBUGMSG.
GR_Image * GR_CocoaGraphics::createNewImage | ( | const char * | pszName, | |
const UT_ByteBuf * | pBB, | |||
UT_sint32 | iDisplayWidth, | |||
UT_sint32 | iDisplayHeight, | |||
GR_Image::GRType | iType = GR_Image::GRT_Raster | |||
) | [virtual] |
References GR_Graphics::_tduR(), GR_Image::convertFromBuffer(), and GR_Image::GRT_Raster.
void GR_CocoaGraphics::setLineProperties | ( | double | inWidthPixels, | |
JoinStyle | inJoinStyle, | |||
CapStyle | inCapStyle, | |||
LineStyle | inLineStyle | |||
) | [virtual] |
References _setCapStyle(), _setJoinStyle(), _setLineStyle(), m_capStyle, m_CGContext, m_fLineWidth, m_joinStyle, m_lineStyle, m_viewLocker, and GR_Graphics::tduD().
bool GR_CocoaGraphics::queryProperties | ( | GR_Graphics::Properties | gp | ) | const [virtual] |
Implements GR_Graphics.
References GR_Graphics::DGP_OPAQUEOVERLAY, GR_Graphics::DGP_PAPER, GR_Graphics::DGP_SCREEN, isPrinting(), and UT_ASSERT.
bool GR_CocoaGraphics::startPrint | ( | void | ) | [virtual] |
void GR_CocoaGraphics::setZoomPercentage | ( | UT_uint32 | iZoom | ) | [virtual] |
Reimplemented from GR_Graphics.
References DELETEP, m_pFontGUI, and GR_Graphics::setZoomPercentage().
bool GR_CocoaGraphics::endPrint | ( | void | ) | [virtual] |
void GR_CocoaGraphics::flush | ( | void | ) | [virtual] |
void GR_CocoaGraphics::setColorSpace | ( | GR_Graphics::ColorSpace | c | ) | [virtual] |
GR_Graphics::ColorSpace GR_CocoaGraphics::getColorSpace | ( | void | ) | const [virtual] |
void GR_CocoaGraphics::setCursor | ( | GR_Graphics::Cursor | c | ) | [virtual] |
Implements GR_Graphics.
References GR_Graphics::GR_CURSOR_CROSSHAIR, GR_Graphics::GR_CURSOR_DEFAULT, GR_Graphics::GR_CURSOR_DOWNARROW, GR_Graphics::GR_CURSOR_EXCHANGE, GR_Graphics::GR_CURSOR_GRAB, GR_Graphics::GR_CURSOR_HLINE_DRAG, GR_Graphics::GR_CURSOR_IBEAM, GR_Graphics::GR_CURSOR_IMAGE, GR_Graphics::GR_CURSOR_IMAGESIZE_E, GR_Graphics::GR_CURSOR_IMAGESIZE_N, GR_Graphics::GR_CURSOR_IMAGESIZE_NE, GR_Graphics::GR_CURSOR_IMAGESIZE_NW, GR_Graphics::GR_CURSOR_IMAGESIZE_S, GR_Graphics::GR_CURSOR_IMAGESIZE_SE, GR_Graphics::GR_CURSOR_IMAGESIZE_SW, GR_Graphics::GR_CURSOR_IMAGESIZE_W, GR_Graphics::GR_CURSOR_INVALID, GR_Graphics::GR_CURSOR_LEFTARROW, GR_Graphics::GR_CURSOR_LEFTRIGHT, GR_Graphics::GR_CURSOR_LINK, GR_Graphics::GR_CURSOR_RIGHTARROW, GR_Graphics::GR_CURSOR_UPDOWN, GR_Graphics::GR_CURSOR_VLINE_DRAG, GR_Graphics::GR_CURSOR_WAIT, m_cursor, m_Cursor_Compass, m_Cursor_Crosshair, m_Cursor_DownArrow, m_Cursor_E, m_Cursor_Exchange, m_Cursor_HandPointer, m_Cursor_LeftArrow, m_Cursor_LeftRight, m_Cursor_N, m_Cursor_NE, m_Cursor_NW, m_Cursor_RightArrow, m_Cursor_S, m_Cursor_SE, m_Cursor_SW, m_Cursor_UpDown, m_Cursor_W, m_Cursor_Wait, m_GrabCursor, and m_pWin.
Referenced by GR_CocoaGraphics().
GR_Graphics::Cursor GR_CocoaGraphics::getCursor | ( | void | ) | const [virtual] |
void GR_CocoaGraphics::setGrabCursor | ( | GR_Graphics::Cursor | c | ) | [inline] |
References m_GrabCursor.
Referenced by AP_CocoaTopRuler::setView(), and AP_CocoaLeftRuler::setView().
void GR_CocoaGraphics::setColor3D | ( | GR_Color3D | c | ) | [virtual] |
Implements GR_Graphics.
References _setColor(), COUNT_3D_COLORS, m_3dColors, UT_ASSERT, and UT_DEBUGMSG.
void GR_CocoaGraphics::init3dColors | ( | ) |
void GR_CocoaGraphics::fillRect | ( | GR_Color3D | c, | |
UT_sint32 | x, | |||
UT_sint32 | y, | |||
UT_sint32 | w, | |||
UT_sint32 | h | |||
) | [virtual] |
Implements GR_Graphics.
References COUNT_3D_COLORS, LOCK_CONTEXT__, m_3dColors, m_CGContext, GR_Graphics::tdu(), UT_ASSERT, and UT_DEBUGMSG.
void GR_CocoaGraphics::fillRect | ( | GR_Color3D | c, | |
UT_Rect & | r | |||
) | [virtual] |
Implements GR_Graphics.
References COUNT_3D_COLORS, fillRect(), UT_Rect::height, UT_Rect::left, UT_Rect::top, UT_ASSERT, UT_DEBUGMSG, and UT_Rect::width.
void GR_CocoaGraphics::polygon | ( | UT_RGBColor & | c, | |
UT_Point * | pts, | |||
UT_uint32 | nPoints | |||
) | [virtual] |
Reimplemented from GR_Graphics.
References GR_Graphics::_tduY(), _utRGBColorToNSColor(), LOCK_CONTEXT__, m_CGContext, and TDUX.
Implements GR_Graphics.
References GR_Graphics::_tduR(), GR_Graphics::_tduY(), UT_Rect::height, UT_Rect::left, LOCK_CONTEXT__, GR_CocoaImage::setFromImageRep(), TDUX, UT_Rect::top, and UT_Rect::width.
void GR_CocoaGraphics::restoreRectangle | ( | UT_uint32 | iIndx | ) | [virtual] |
Implements GR_Graphics.
References UT_GenericVector< T >::getNthItem(), LOCK_CONTEXT__, m_cacheArray, and m_cacheRectArray.
UT_uint32 GR_CocoaGraphics::getDeviceResolution | ( | void | ) | const [virtual] |
void GR_CocoaGraphics::_setUpdateCallback | ( | gr_cocoa_graphics_update | callback, | |
void * | param | |||
) |
References m_updateCallback, and m_updateCBparam.
Referenced by AP_CocoaTopRuler::setView(), and AP_CocoaLeftRuler::setView().
bool GR_CocoaGraphics::_callUpdateCallback | ( | NSRect * | aRect | ) |
Call the update Callback that has been set
aRect,: | the rect that should be updated |
References m_bIsDrawing, m_updateCallback, and m_updateCBparam.
Referenced by XAP_CocoaNSView::drawRect:.
XAP_CocoaNSView* GR_CocoaGraphics::_getView | ( | ) | [inline] |
bool GR_CocoaGraphics::_isFlipped | ( | ) | [static] |
NSColor * GR_CocoaGraphics::_utRGBColorToNSColor | ( | const UT_RGBColor & | clr | ) | [static] |
Convert a UT_RGBColor to a NSColor
clr | the UT_RGBColor to convert |
References UT_RGBColor::m_blu, UT_RGBColor::m_grn, UT_RGBColor::m_red, and UT_DEBUGMSG.
Referenced by fillRect(), polygon(), XAP_CocoaDialog_FontChooser::runModal, and setColor().
void GR_CocoaGraphics::_utNSColorToRGBColor | ( | NSColor * | c, | |
UT_RGBColor & | clr | |||
) | [static] |
Convert a NSColor to an UT_RGBColor
c | NSColor to convert |
clr | destination UT_RGBColor. |
References UT_RGBColor::m_bIsTransparent, UT_RGBColor::m_blu, UT_RGBColor::m_grn, and UT_RGBColor::m_red.
Referenced by getColor(), and XAP_CocoaFrameImpl::getColorSelBackground().
void GR_CocoaGraphics::setIsPrinting | ( | bool | _isPrinting | ) | [inline] |
bool GR_CocoaGraphics::isPrinting | ( | void | ) | const [inline] |
float GR_CocoaGraphics::_getScreenResolution | ( | void | ) | [static] |
GR_Font * GR_CocoaGraphics::_findFont | ( | const char * | pszFontFamily, | |
const char * | pszFontStyle, | |||
const char * | pszFontVariant, | |||
const char * | pszFontWeight, | |||
const char * | pszFontStretch, | |||
const char * | pszFontSize, | |||
const char * | pszLang | |||
) | [protected, virtual] |
Implements GR_Graphics.
References GR_Graphics::findFont(), XAP_CocoaFont::getNSFont(), s, UT_ASSERT, UT_convertToPoints(), and UT_DEBUGMSG.
UT_uint32 GR_CocoaGraphics::_getResolution | ( | void | ) | const [protected, virtual] |
void GR_CocoaGraphics::_setColor | ( | NSColor * | c | ) | [protected] |
References LOCK_CONTEXT__, m_currentColor, m_viewLocker, and UT_DEBUGMSG.
Referenced by setColor(), and setColor3D().
void GR_CocoaGraphics::_beginPaint | ( | void | ) | [protected, virtual] |
Reimplemented from GR_Graphics.
References _resetContext(), _setClipRectImpl(), CG_CONTEXT__, m_CGContext, m_pWin, m_viewLocker, and UT_ASSERT.
Referenced by _restartPaint().
void GR_CocoaGraphics::_endPaint | ( | void | ) | [protected, virtual] |
Reimplemented from GR_Graphics.
References DELETEP, and m_viewLocker.
Referenced by _restartPaint().
void GR_CocoaGraphics::_setClipRectImpl | ( | const UT_Rect * | pRect | ) | [private] |
References GR_Graphics::_tduR(), GR_Graphics::_tduY(), UT_Rect::height, UT_Rect::left, m_CGContext, GR_Graphics::m_pRect, m_pWin, TDUX, UT_Rect::top, UT_DEBUGMSG, and UT_Rect::width.
Referenced by _beginPaint().
NSImage* GR_CocoaGraphics::_makeNewCacheImage | ( | ) | [inline, private] |
void GR_CocoaGraphics::_resetContext | ( | CGContextRef | context | ) | [private] |
References _setCapStyle(), _setJoinStyle(), _setLineStyle(), m_capStyle, m_currentColor, m_fLineWidth, m_joinStyle, and m_lineStyle.
Referenced by _beginPaint(), and GR_CocoaGraphics().
void GR_CocoaGraphics::_initColorAndImage | ( | void | ) | [static, private] |
References m_colorAndImageInited, m_colorBlue11x16, m_colorBlue16x15, m_colorGrey11x16, m_colorGrey16x15, m_Cursor_Compass, m_Cursor_Crosshair, m_Cursor_DownArrow, m_Cursor_E, m_Cursor_Exchange, m_Cursor_HandPointer, m_Cursor_LeftArrow, m_Cursor_LeftRight, m_Cursor_N, m_Cursor_NE, m_Cursor_NW, m_Cursor_RightArrow, m_Cursor_S, m_Cursor_SE, m_Cursor_SW, m_Cursor_UpDown, m_Cursor_W, m_Cursor_Wait, m_imageBlue11x16, m_imageBlue16x15, m_imageGrey11x16, and m_imageGrey16x15.
Referenced by GR_CocoaGraphics().
float GR_CocoaGraphics::_measureUnRemappedCharCached | ( | const UT_UCSChar | c | ) | [private] |
Internal version to measure unremapped char
References GR_CharWidthsCache::CACHE_FONT_SIZE, GR_Font::getCharWidthFromCache(), XAP_CocoaFont::getSize(), and m_pFont.
Referenced by measureUnRemappedChar().
void GR_CocoaGraphics::_setCapStyle | ( | CapStyle | inCapStyle, | |
CGContextRef * | context = 0 | |||
) | [private] |
References GR_Graphics::CAP_BUTT, GR_Graphics::CAP_PROJECTING, GR_Graphics::CAP_ROUND, m_CGContext, UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.
Referenced by _resetContext(), and setLineProperties().
void GR_CocoaGraphics::_setJoinStyle | ( | JoinStyle | inJoinStyle, | |
CGContextRef * | context = 0 | |||
) | [private] |
References GR_Graphics::JOIN_BEVEL, GR_Graphics::JOIN_MITER, GR_Graphics::JOIN_ROUND, m_CGContext, UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.
Referenced by _resetContext(), and setLineProperties().
void GR_CocoaGraphics::_setLineStyle | ( | LineStyle | inLineStyle, | |
CGContextRef * | context = 0 | |||
) | [private] |
References GR_Graphics::LINE_DOTTED, GR_Graphics::LINE_DOUBLE_DASH, GR_Graphics::LINE_ON_OFF_DASH, GR_Graphics::LINE_SOLID, m_CGContext, m_fLineWidth, UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.
Referenced by _resetContext(), setLineProperties(), and setLineWidth().
void GR_CocoaGraphics::_restartPaint | ( | void | ) | [private] |
Restart the paiting by unlocking and relocking the whole stuff. One of the purpose of this operation is to reset the clipping view
References _beginPaint(), _endPaint(), m_viewLocker, and UT_ASSERT.
Referenced by setClipRect().
void GR_CocoaGraphics::_realDrawChars | ( | ATSUTextLayout | atsuLayout, | |
float | x, | |||
float | y, | |||
int | begin, | |||
int | rangelen, | |||
float | xOffset | |||
) | [private] |
Wrapper to draw the char.
atsuLayout | the ATSU layout | |
x | X position | |
y | Y position | |
begin | the start of the range to draw | |
rangelen | the length of the range |
References m_CGContext, and m_fontForGraphics.
Referenced by drawChars().
Referenced by _callUpdateCallback(), and _setUpdateCallback().
void* GR_CocoaGraphics::m_updateCBparam [private] |
Referenced by _callUpdateCallback(), and _setUpdateCallback().
XAP_CocoaNSView* GR_CocoaGraphics::m_pWin [private] |
Referenced by _beginPaint(), _getView(), _setClipRectImpl(), flush(), GR_CocoaGraphics(), saveRectangle(), scroll(), setCursor(), and ~GR_CocoaGraphics().
ATSUStyle GR_CocoaGraphics::m_atsuStyle [private] |
Referenced by drawChars(), setFont(), and ~GR_CocoaGraphics().
CGContextRef GR_CocoaGraphics::m_CGContext [private] |
UT_GenericVector<id> GR_CocoaGraphics::m_cacheArray [private] |
Referenced by restoreRectangle(), saveRectangle(), and ~GR_CocoaGraphics().
UT_GenericVector<NSRect*> GR_CocoaGraphics::m_cacheRectArray [private] |
Referenced by restoreRectangle(), saveRectangle(), and ~GR_CocoaGraphics().
NSColor* GR_CocoaGraphics::m_currentColor [private] |
Referenced by _resetContext(), _setColor(), drawLine(), getColor(), GR_CocoaGraphics(), and ~GR_CocoaGraphics().
bool GR_CocoaGraphics::m_colorAndImageInited = false [static, private] |
Referenced by _initColorAndImage().
NSImage * GR_CocoaGraphics::m_imageBlue16x15 = nil [static, private] |
Referenced by _initColorAndImage().
NSImage * GR_CocoaGraphics::m_imageBlue11x16 = nil [static, private] |
Referenced by _initColorAndImage().
NSImage * GR_CocoaGraphics::m_imageGrey16x15 = nil [static, private] |
Referenced by _initColorAndImage().
NSImage * GR_CocoaGraphics::m_imageGrey11x16 = nil [static, private] |
Referenced by _initColorAndImage().
NSColor * GR_CocoaGraphics::m_colorBlue16x15 = nil [static, private] |
Referenced by _initColorAndImage(), and HBlue().
NSColor * GR_CocoaGraphics::m_colorBlue11x16 = nil [static, private] |
Referenced by _initColorAndImage(), and VBlue().
NSColor * GR_CocoaGraphics::m_colorGrey16x15 = nil [static, private] |
Referenced by _initColorAndImage(), and HGrey().
NSColor * GR_CocoaGraphics::m_colorGrey11x16 = nil [static, private] |
Referenced by _initColorAndImage(), and VGrey().
NSCursor * GR_CocoaGraphics::m_Cursor_E = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_N = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_NE = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_NW = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_S = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_SE = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_SW = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_W = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_Wait = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_LeftArrow = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_RightArrow = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_Compass = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_Exchange = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_LeftRight = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_UpDown = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_Crosshair = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_HandPointer = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaGraphics::m_Cursor_DownArrow = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
XAP_CocoaFont* GR_CocoaGraphics::m_pFont [private] |
Referenced by _measureUnRemappedCharCached(), clearFont(), drawChars(), getCoverage(), getFontAscent(), getFontDescent(), getFontHeight(), and setFont().
NSFont* GR_CocoaGraphics::m_fontForGraphics [private] |
Referenced by _realDrawChars(), setFont(), and ~GR_CocoaGraphics().
XAP_CocoaFont* GR_CocoaGraphics::m_pFontGUI [private] |
Referenced by getGUIFont(), setZoomPercentage(), and ~GR_CocoaGraphics().
UT_uint32 GR_CocoaGraphics::s_iInstanceCount = 0 [static, private] |
float GR_CocoaGraphics::m_fLineWidth [private] |
Referenced by _resetContext(), _setLineStyle(), drawLine(), polyLine(), setLineProperties(), and setLineWidth().
JoinStyle GR_CocoaGraphics::m_joinStyle [private] |
Referenced by _resetContext(), and setLineProperties().
CapStyle GR_CocoaGraphics::m_capStyle [private] |
Referenced by _resetContext(), and setLineProperties().
LineStyle GR_CocoaGraphics::m_lineStyle [private] |
Referenced by _resetContext(), setLineProperties(), and setLineWidth().
Referenced by getCursor(), GR_CocoaGraphics(), and setCursor().
Referenced by setCursor(), and setGrabCursor().
Referenced by getColorSpace(), and GR_CocoaGraphics().
Referenced by _getResolution(), and GR_CocoaGraphics().
bool GR_CocoaGraphics::m_bIsPrinting [private] |
Referenced by endPrint(), isPrinting(), setIsPrinting(), startPage(), and startPrint().
bool GR_CocoaGraphics::m_bIsDrawing [private] |
Referenced by _callUpdateCallback(), and flush().
NSColor* GR_CocoaGraphics::m_3dColors[COUNT_3D_COLORS] |
Referenced by fillRect(), init3dColors(), setColor3D(), and ~GR_CocoaGraphics().
StNSViewLocker* GR_CocoaGraphics::m_viewLocker [private] |
Referenced by _beginPaint(), _endPaint(), _restartPaint(), _setColor(), setClipRect(), setLineProperties(), setLineWidth(), and ~GR_CocoaGraphics().