Canvas Class Reference

`#include <ipecanvas_cocoa.h>`

Inherits ipe::CanvasBase.

## Public Member Functions

| Canvas (IpeCanvasView *view)
virtual | ~Canvas ()
IpeCanvasView * | view ()
void | button (bool press, NSEvent *event)
void | mouseMove (NSEvent *event)
bool | key (NSEvent *event)
void | scrollWheel (NSEvent *event)
void | magnify (NSEvent *event)
void | drawRect (NSRect rect)
Public Member Functions inherited from ipe::CanvasBase
virtual | ~CanvasBase ()
void | setPage (const Page *page, int pno, int view, const Cascade *sheet)
void | setResources (const PdfResources *resources)
Vector | pan () const
double | zoom () const
const Cascade * | cascade () const
Vector | center () const
Vector | pos () const
Vector | unsnappedPos () const
Vector | globalPos () const
Vector | simpleSnapPos () const
const Snap & | snap () const
void | setInkMode (bool ink)
int | additionalModifiers () const
void | setAdditionalModifiers (int mod)
Vector | devToUser (const Vector &arg) const
Vector | userToDev (const Vector &arg) const
void | setCanvasStyle (const Style &style)
Style | canvasStyle () const
void | setPan (const Vector &v)
void | setZoom (double zoom)
void | setSnap (const Snap &s)
void | setDimmed (bool dimmed)
void | setAutoOrigin (const Vector &v)
Matrix | canvasTfm () const
void | setObserver (CanvasObserver *observer)
void | setFifiVisible (bool visible)
void | setSelectionVisible (bool visible)
void | setTool (Tool *tool)
void | finishTool ()
Tool * | tool ()
void | update ()
void | updateTool ()
int | canvasWidth () const
int | canvasHeight () const

## Additional Inherited Members

Public Types inherited from ipe::CanvasBase
enum | TModifiers { EShift = 0x100, EControl = 0x200, EAlt = 0x400, EMeta = 0x800, ECommand = 0x1000 }
enum | TCursor { EStandardCursor, EHandCursor, ECrossCursor, EDotCursor }
Static Public Member Functions inherited from ipe::CanvasBase
static int | selectPageOrView (Document *doc, int page=-1, int startIndex=0, int pageWidth=240, int width=600, int height=480)
Protected Member Functions inherited from ipe::CanvasBase
| CanvasBase ()
void | drawPaper (cairo_t *cc)
void | drawFrame (cairo_t *cc)
void | drawAxes (cairo_t *cc)
void | drawGrid (cairo_t *cc)
void | drawObjects (cairo_t *cc)
void | drawTool (Painter &painter)
void | snapToPaperAndFrame ()
void | refreshSurface ()
void | computeFifi (double x, double y)
void | drawFifi (cairo_t *cr)
Protected Attributes inherited from ipe::CanvasBase
CanvasObserver * | iObserver
Tool * | iTool
const Page * | iPage
int | iPageNumber
int | iView
const Cascade * | iCascade
Style | iStyle
Vector | iPan
double | iZoom
Snap | iSnap
bool | iDimmed
bool | iAutoSnap
Vector | iAutoOrigin
int | iAdditionalModifiers
bool | isInkMode
bool | iRepaintObjects
double | iWidth
double | iHeight
double | iBWidth
double | iBHeight
cairo_surface_t * | iSurface
Vector | iUnsnappedMousePos
Vector | iMousePos
Vector | iGlobalPos
Vector | iOldFifi
bool | iFifiVisible
Snap::TSnapModes | iFifiMode
bool | iSelectionVisible
const PdfResources * | iResources
std::unique_ptr< Fonts > | iFonts

## Constructor & Destructor Documentation

## Canvas()

Canvas::Canvas | ( | IpeCanvasView * | view | ) |

References ipe::CanvasBase::iView.

## ~Canvas()

virtual Canvas::~Canvas | ( |  | ) |

virtual

## Member Function Documentation

## view()

IpeCanvasView* Canvas::view | ( |  | ) |

inline

## button()

void Canvas::button | ( | bool | press,
|  | NSEvent * | event
| ) |  |

Referenced by drawRect().

## mouseMove()

void Canvas::mouseMove | ( | NSEvent * | event | ) |

References ipe::CanvasObserver::canvasObserverPositionChanged(), ipe::CanvasBase::computeFifi(), ipe::CanvasBase::iHeight, ipe::CanvasBase::iObserver, ipe::CanvasBase::iTool, ipe::CanvasBase::iView, ipe::Tool::mouseMove(), and mouseMove().

Referenced by mouseMove().

## key()

bool Canvas::key | ( | NSEvent * | event | ) |

References ipe::CanvasBase::iTool, ipe::Tool::key(), and key().

Referenced by key().

## scrollWheel()

void Canvas::scrollWheel | ( | NSEvent * | event | ) |

References ipe::Canvas::Canvas(), ipe::CanvasObserver::canvasObserverWheelMoved(), and ipe::CanvasBase::iObserver.

## magnify()

void Canvas::magnify | ( | NSEvent * | event | ) |

References ipe::CanvasObserver::canvasObserverWheelMoved(), ipe::CanvasBase::devToUser(), ipe::CanvasBase::iHeight, ipe::CanvasBase::iObserver, ipe::CanvasBase::iView, ipe::CanvasBase::iZoom, ipe::CanvasBase::pan(), ipe::CanvasBase::setPan(), ipe::CanvasBase::setZoom(), and ipe::CanvasBase::update().

## drawRect()

void Canvas::drawRect | ( | NSRect | rect | ) |

References button(), ipe::CanvasObserver::canvasObserverMouseAction(), ipe::CanvasBase::canvasTfm(), ipe::CanvasBase::computeFifi(), ipe::Canvas::drawFifi(), ipe::CanvasBase::drawTool(), ipe::CanvasBase::EAlt, ipe::CanvasBase::ECommand, ipe::CanvasBase::EControl, ipe::CanvasBase::EShift, ipe::CanvasBase::iAdditionalModifiers, ipe::CanvasBase::iBHeight, ipe::CanvasBase::iBWidth, ipe::CanvasBase::iCascade, ipe::CanvasBase::iFifiVisible, ipe::CanvasBase::iFonts, ipe::CanvasBase::iGlobalPos, ipe::CanvasBase::iHeight, ipe::CanvasBase::iObserver, ipe::CanvasBase::iPage, ipe::CanvasBase::iSurface, ipe::CanvasBase::iTool, ipe::CanvasBase::iView, ipe::CanvasBase::iWidth, ipe::CanvasBase::iZoom, ipe::Tool::mouseButton(), ipe::CanvasBase::refreshSurface(), ipe::Painter::transform(), and ipe::Canvas::window().

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

- ipecanvas_cocoa.h
- ipecanvas_cocoa.cpp