#include <gr_CocoaCairoGraphics.h>
Public Types | |
typedef bool(* | gr_cocoa_graphics_update )(NSRect *rect, GR_CocoaCairoGraphics *pGr, void *param) |
Public Member Functions | |
~GR_CocoaCairoGraphics () | |
virtual UT_uint32 | getClassId () |
XAP_CocoaNSView * | getView () |
virtual GR_Font * | getGUIFont (void) |
virtual void | setCursor (GR_Graphics::Cursor c) |
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 | saveRectangle (UT_Rect &r, UT_uint32 iIndx) |
virtual void | restoreRectangle (UT_uint32 iIndx) |
virtual GR_Image * | genImageFromRectangle (const UT_Rect &r) |
virtual void | _beginPaint () |
virtual void | _endPaint () |
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) |
void | init3dColors () |
void | setIsPrinting (bool) |
void | setGrabCursor (GR_Graphics::Cursor c) |
void | _setUpdateCallback (gr_cocoa_graphics_update callback, void *param) |
bool | _callUpdateCallback (NSRect *aRect) |
Static Public Member Functions | |
static UT_uint32 | s_getClassId () |
static const char * | graphicsDescriptor () |
static GR_Graphics * | graphicsAllocator (GR_AllocInfo &) |
static NSColor * | _utRGBColorToNSColor (const UT_RGBColor &clr) |
static void | _utNSColorToRGBColor (NSColor *c, UT_RGBColor &clr) |
static cairo_t * | _createCairo (NSView *view) |
static const UT_RGBColor & | HBlue () |
static const UT_RGBColor & | VBlue () |
static const UT_RGBColor & | HGrey () |
static const UT_RGBColor & | VGrey () |
static bool | _isFlipped () |
static float | _getScreenResolution (void) |
Protected Member Functions | |
GR_CocoaCairoGraphics (XAP_CocoaNSView *win=nil) | |
virtual UT_uint32 | _getResolution (void) const |
Static Private Member Functions | |
static void | _initColorAndImage (void) |
Private Attributes | |
XAP_CocoaNSView * | m_pWin |
gr_cocoa_graphics_update | m_updateCallback |
void * | m_updateCBparam |
std::vector< cairo_rectangle_t > | m_cacheRectArray |
std::vector< cairo_surface_t * > | m_cacheArray |
GR_Graphics::Cursor | m_GrabCursor |
UT_uint32 | m_screenResolution |
bool | m_bIsPrinting |
bool | m_bIsDrawing |
bool | m_bDoShowPage |
Static Private Attributes | |
static UT_uint32 | s_iInstanceCount |
static bool | m_colorAndImageInited = false |
static UT_RGBColor * | m_colorBlue16x15 = NULL |
static UT_RGBColor * | m_colorBlue11x16 = NULL |
static UT_RGBColor * | m_colorGrey16x15 = NULL |
static UT_RGBColor * | m_colorGrey11x16 = NULL |
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 |
typedef bool(* GR_CocoaCairoGraphics::gr_cocoa_graphics_update)(NSRect *rect, GR_CocoaCairoGraphics *pGr, void *param) |
GR_CocoaCairoGraphics::~GR_CocoaCairoGraphics | ( | ) |
References GR_Graphics::_destroyFonts(), m_cacheArray, and m_pWin.
GR_CocoaCairoGraphics::GR_CocoaCairoGraphics | ( | XAP_CocoaNSView * | win = nil |
) | [protected] |
References _getScreenResolution(), _initColorAndImage(), GR_Graphics::GR_CURSOR_DEFAULT, init3dColors(), GR_CairoGraphics::m_cr, m_pWin, m_screenResolution, setCursor(), UT_ASSERT, and UT_DEBUGMSG.
Referenced by graphicsAllocator().
static UT_uint32 GR_CocoaCairoGraphics::s_getClassId | ( | ) | [inline, static] |
virtual UT_uint32 GR_CocoaCairoGraphics::getClassId | ( | ) | [inline, virtual] |
Implements GR_Graphics.
static const char* GR_CocoaCairoGraphics::graphicsDescriptor | ( | ) | [inline, static] |
Referenced by XAP_CocoaApp::XAP_CocoaApp().
GR_Graphics * GR_CocoaCairoGraphics::graphicsAllocator | ( | GR_AllocInfo & | info | ) | [static] |
References GR_CocoaCairoGraphics(), and GR_CocoaCairoAllocInfo::m_win.
Referenced by XAP_CocoaApp::XAP_CocoaApp().
XAP_CocoaNSView* GR_CocoaCairoGraphics::getView | ( | ) | [inline] |
Referenced by XAP_CocoaDialog_Print::runPrint().
GR_Font * GR_CocoaCairoGraphics::getGUIFont | ( | void | ) | [virtual] |
void GR_CocoaCairoGraphics::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, GR_CairoGraphics::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_CocoaCairoGraphics().
NSColor * GR_CocoaCairoGraphics::_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 XAP_CocoaDialog_FontChooser::runModal, and AP_CocoaDialog_FormatTable::setBackgroundColorInGUI().
void GR_CocoaCairoGraphics::_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, UT_RGBColor::m_red, UT_RGBColor::setPattern(), UT_ASSERT, and UT_DEBUGMSG.
Referenced by AP_CocoaDialog_FormatTableController::bgColorAction:, AP_CocoaDialog_FormatTableController::borderColorAction:, XAP_CocoaNSView::drawRect:, XAP_CocoaFrameImpl::getColorSelBackground(), init3dColors(), and EV_CocoaToolbarTarget::setColor:.
Implements GR_Graphics.
References GR_Graphics::getPrevXOffset(), GR_Graphics::getPrevYOffset(), m_pWin, GR_Graphics::setPrevXOffset(), GR_Graphics::setPrevYOffset(), and GR_Graphics::tdu().
void GR_CocoaCairoGraphics::restoreRectangle | ( | UT_uint32 | iIndx | ) | [virtual] |
void GR_CocoaCairoGraphics::_beginPaint | ( | ) | [virtual] |
Reimplemented from GR_Graphics.
References _createCairo(), GR_CairoGraphics::_initCairo(), GR_CairoGraphics::m_cr, and m_pWin.
void GR_CocoaCairoGraphics::_endPaint | ( | ) | [virtual] |
bool GR_CocoaCairoGraphics::queryProperties | ( | GR_Graphics::Properties | gp | ) | const [virtual] |
Reimplemented from GR_CairoGraphics.
References GR_Graphics::DGP_OPAQUEOVERLAY, GR_Graphics::DGP_PAPER, GR_Graphics::DGP_SCREEN, m_bIsPrinting, and UT_ASSERT_NOT_REACHED.
bool GR_CocoaCairoGraphics::startPrint | ( | void | ) | [virtual] |
bool GR_CocoaCairoGraphics::endPrint | ( | void | ) | [virtual] |
Reimplemented from GR_CairoGraphics.
References m_bDoShowPage, m_bIsPrinting, and GR_CairoGraphics::m_cr.
bool GR_CocoaCairoGraphics::startPage | ( | const char * | szPageLabel, | |
UT_uint32 | pageNumber, | |||
bool | bPortrait, | |||
UT_uint32 | iWidth, | |||
UT_uint32 | iHeight | |||
) | [virtual] |
Reimplemented from GR_CairoGraphics.
References m_bDoShowPage, m_bIsPrinting, and GR_CairoGraphics::m_cr.
cairo_t * GR_CocoaCairoGraphics::_createCairo | ( | NSView * | view | ) | [static] |
References BOOL(), and UT_ASSERT.
Referenced by _beginPaint(), and GR_CocoaCairoAllocInfo::createCairo().
void GR_CocoaCairoGraphics::init3dColors | ( | ) |
References _utNSColorToRGBColor(), GR_Graphics::CLR3D_Background, GR_Graphics::CLR3D_BevelDown, GR_Graphics::CLR3D_BevelUp, GR_Graphics::CLR3D_Foreground, GR_Graphics::CLR3D_Highlight, GR_CairoGraphics::m_3dColors, GR_Graphics::m_bHave3DColors, and UT_DEBUGMSG.
Referenced by GR_CocoaCairoGraphics(), AP_CocoaDialog_FormatTable::runModeless(), and AP_CocoaDialog_FormatFrame::runModeless.
void GR_CocoaCairoGraphics::setIsPrinting | ( | bool | isprinting | ) |
void GR_CocoaCairoGraphics::setGrabCursor | ( | GR_Graphics::Cursor | c | ) | [inline] |
Referenced by AP_CocoaTopRuler::setView(), and AP_CocoaLeftRuler::setView().
static const UT_RGBColor& GR_CocoaCairoGraphics::HBlue | ( | ) | [inline, static] |
static const UT_RGBColor& GR_CocoaCairoGraphics::VBlue | ( | ) | [inline, static] |
static const UT_RGBColor& GR_CocoaCairoGraphics::HGrey | ( | ) | [inline, static] |
static const UT_RGBColor& GR_CocoaCairoGraphics::VGrey | ( | ) | [inline, static] |
bool GR_CocoaCairoGraphics::_isFlipped | ( | ) | [static] |
void GR_CocoaCairoGraphics::_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_CocoaCairoGraphics::_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:.
float GR_CocoaCairoGraphics::_getScreenResolution | ( | void | ) | [static] |
UT_uint32 GR_CocoaCairoGraphics::_getResolution | ( | void | ) | const [protected, virtual] |
References m_screenResolution.
void GR_CocoaCairoGraphics::_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, and m_Cursor_Wait.
Referenced by GR_CocoaCairoGraphics().
UT_uint32 GR_CocoaCairoGraphics::s_iInstanceCount [static, private] |
Reimplemented from GR_CairoGraphics.
XAP_CocoaNSView* GR_CocoaCairoGraphics::m_pWin [private] |
Referenced by _beginPaint(), GR_CocoaCairoGraphics(), saveRectangle(), scroll(), setCursor(), and ~GR_CocoaCairoGraphics().
Referenced by _callUpdateCallback(), and _setUpdateCallback().
void* GR_CocoaCairoGraphics::m_updateCBparam [private] |
Referenced by _callUpdateCallback(), and _setUpdateCallback().
std::vector<cairo_rectangle_t> GR_CocoaCairoGraphics::m_cacheRectArray [private] |
Referenced by restoreRectangle(), and saveRectangle().
std::vector<cairo_surface_t*> GR_CocoaCairoGraphics::m_cacheArray [private] |
Referenced by restoreRectangle(), saveRectangle(), and ~GR_CocoaCairoGraphics().
Referenced by setCursor().
Referenced by _getResolution(), and GR_CocoaCairoGraphics().
bool GR_CocoaCairoGraphics::m_bIsPrinting [private] |
Referenced by endPrint(), queryProperties(), setIsPrinting(), startPage(), and startPrint().
bool GR_CocoaCairoGraphics::m_bIsDrawing [private] |
Referenced by _callUpdateCallback().
bool GR_CocoaCairoGraphics::m_bDoShowPage [private] |
Referenced by endPrint(), startPage(), and startPrint().
bool GR_CocoaCairoGraphics::m_colorAndImageInited = false [static, private] |
Referenced by _initColorAndImage().
UT_RGBColor * GR_CocoaCairoGraphics::m_colorBlue16x15 = NULL [static, private] |
Referenced by _initColorAndImage().
UT_RGBColor * GR_CocoaCairoGraphics::m_colorBlue11x16 = NULL [static, private] |
Referenced by _initColorAndImage().
UT_RGBColor * GR_CocoaCairoGraphics::m_colorGrey16x15 = NULL [static, private] |
Referenced by _initColorAndImage().
UT_RGBColor * GR_CocoaCairoGraphics::m_colorGrey11x16 = NULL [static, private] |
Referenced by _initColorAndImage().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_E = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_N = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_NE = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_NW = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_S = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_SE = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_SW = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_W = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_Wait = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_LeftArrow = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_RightArrow = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_Compass = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_Exchange = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_LeftRight = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_UpDown = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_Crosshair = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_HandPointer = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().
NSCursor * GR_CocoaCairoGraphics::m_Cursor_DownArrow = nil [static, private] |
Referenced by _initColorAndImage(), and setCursor().