#include <ipecanvas.h>
Inherited by ipe::Canvas, ipe::Canvas, and ipe::Canvas.
Keyboard modifiers.
Enumerator |
---|
EShift |
|
EControl |
|
EAlt |
|
EMeta |
|
Enumerator |
---|
EStandardCursor |
|
EHandCursor |
|
ECrossCursor |
|
EDotCursor |
|
CanvasBase::~CanvasBase |
( |
| ) |
|
|
virtual |
CanvasBase::CanvasBase |
( |
| ) |
|
|
protected |
Construct a new canvas.
References ipe::CanvasBase::Style::classicGrid, iAdditionalModifiers, ipe::Snap::iAngleSize, iAutoSnap, iCascade, iDimmed, ipe::Snap::iDir, iFifiVisible, iFonts, ipe::Snap::iGridSize, ipe::Snap::iGridVisible, iHeight, iObserver, ipe::Snap::iOrigin, iPage, iPan, iRepaintObjects, iSelectionVisible, ipe::Snap::iSnap, iSnap, ipe::Snap::iSnapDistance, iStyle, iSurface, iTool, iWidth, ipe::Snap::iWithAxes, iZoom, ipe::CanvasBase::Style::numberPages, ipe::CanvasBase::Style::paperClip, ipe::CanvasBase::Style::paperColor, ipe::CanvasBase::Style::pretty, ipe::CanvasBase::Style::thickLine, ipe::CanvasBase::Style::thickStep, ipe::CanvasBase::Style::thinLine, ipe::CanvasBase::Style::thinStep, and ipe::Vector::ZERO.
void CanvasBase::setPage |
( |
const Page * |
page, |
|
|
int |
pno, |
|
|
int |
view, |
|
|
const Cascade * |
sheet |
|
) |
| |
Set the page to be displayed.
Doesn't take ownership of any argument. The page number pno is only needed if page numbering is turned on.
References iCascade, iPage, iPageNumber, and iView.
void CanvasBase::setFontPool |
( |
const FontPool * |
fontPool | ) |
|
Vector ipe::CanvasBase::pan |
( |
| ) |
const |
|
inline |
double ipe::CanvasBase::zoom |
( |
| ) |
const |
|
inline |
const Cascade* ipe::CanvasBase::cascade |
( |
| ) |
const |
|
inline |
Vector ipe::CanvasBase::center |
( |
| ) |
const |
|
inline |
Vector ipe::CanvasBase::pos |
( |
| ) |
const |
|
inline |
Vector ipe::CanvasBase::unsnappedPos |
( |
| ) |
const |
|
inline |
Vector ipe::CanvasBase::globalPos |
( |
| ) |
const |
|
inline |
Vector CanvasBase::simpleSnapPos |
( |
| ) |
const |
const Snap& ipe::CanvasBase::snap |
( |
| ) |
const |
|
inline |
int ipe::CanvasBase::additionalModifiers |
( |
| ) |
const |
|
inline |
void CanvasBase::setAdditionalModifiers |
( |
int |
mod | ) |
|
Set additional modifiers.
These modifier bits are passed to the Tool when a key is pressed or a drawing action is performed in addition to the actual keyboard modifiers.
References iAdditionalModifiers.
void CanvasBase::setCanvasStyle |
( |
const Style & |
style | ) |
|
Set style of canvas drawing.
Includes paper color, pretty text, and grid.
References iStyle.
Style ipe::CanvasBase::canvasStyle |
( |
| ) |
const |
|
inline |
Return canvas style.
References iStyle.
void CanvasBase::setPan |
( |
const Vector & |
v | ) |
|
Set current pan position.
The pan position is the user coordinate that is displayed at the very center of the canvas.
References iPan.
Referenced by ipe::PanTool::mouseButton().
void CanvasBase::setZoom |
( |
double |
zoom | ) |
|
Set current zoom factor.
The zoom factor maps user coordinates to screen pixel coordinates.
References iZoom, and zoom().
void CanvasBase::setSnap |
( |
const Snap & |
s | ) |
|
Set the snapping information.
References iSnap.
void CanvasBase::setDimmed |
( |
bool |
dimmed | ) |
|
Dim whole canvas, except for the Tool.
This mode will be reset when the Tool finishes.
References iDimmed.
void CanvasBase::setAutoOrigin |
( |
const Vector & |
v | ) |
|
Matrix CanvasBase::canvasTfm |
( |
| ) |
const |
Set an observer.
Use 0 to delete current observer.
References iObserver.
void CanvasBase::setFifiVisible |
( |
bool |
visible | ) |
|
Set whether Fifi should be shown.
Fifi will only be shown if a snapping mode is active.
References iFifiVisible, and updateTool().
void CanvasBase::setSelectionVisible |
( |
bool |
visible | ) |
|
void CanvasBase::setTool |
( |
Tool * |
tool | ) |
|
void CanvasBase::finishTool |
( |
| ) |
|
References ipe::CanvasObserver::canvasObserverToolChanged(), EStandardCursor, iAutoSnap, iDimmed, iObserver, iSelectionVisible, iTool, setCursor(), and update().
Referenced by ipe::SelectTool::key(), ipe::PanTool::mouseButton(), ipe::SelectTool::mouseButton(), and ipe::TransformTool::mouseButton().
void CanvasBase::update |
( |
| ) |
|
void CanvasBase::updateTool |
( |
| ) |
|
int ipe::CanvasBase::canvasWidth |
( |
| ) |
const |
|
inline |
int ipe::CanvasBase::canvasHeight |
( |
| ) |
const |
|
inline |
virtual void ipe::CanvasBase::setCursor |
( |
TCursor |
cursor, |
|
|
double |
w = 1.0 , |
|
|
Color * |
color = 0 |
|
) |
| |
|
pure virtual |
void CanvasBase::drawPaper |
( |
cairo_t * |
cc | ) |
|
|
protected |
References ipe::Cascade::findLayout(), ipe::Color::iBlue, iCascade, ipe::Color::iGreen, ipe::Layout::iOrigin, ipe::Layout::iPaperSize, ipe::Color::iRed, iStyle, ipe::CanvasBase::Style::paperColor, ipe::Fixed::toDouble(), ipe::Vector::x, and ipe::Vector::y.
Referenced by refreshSurface().
void CanvasBase::drawFrame |
( |
cairo_t * |
cc | ) |
|
|
protected |
void CanvasBase::drawAxes |
( |
cairo_t * |
cc | ) |
|
|
protected |
void CanvasBase::drawGrid |
( |
cairo_t * |
cc | ) |
|
|
protected |
References ipe::CanvasBase::Style::classicGrid, devToUser(), ipe::Cascade::findLayout(), iCascade, ipe::Layout::iFrameSize, ipe::Snap::iGridSize, iHeight, iSnap, iStyle, iWidth, iZoom, ipe::CanvasBase::Style::thickLine, ipe::CanvasBase::Style::thickStep, ipe::CanvasBase::Style::thinLine, ipe::CanvasBase::Style::thinStep, ipe::Vector::x, ipe::Vector::y, and ipe::Vector::ZERO.
Referenced by refreshSurface().
void CanvasBase::drawObjects |
( |
cairo_t * |
cc | ) |
|
|
protected |
References ipe::Attribute::BACKGROUND(), ipe::Page::count(), ipe::Page::countViews(), ipe::Text::draw(), ipe::Object::draw(), ipe::Page::findLayer(), ipe::Cascade::findLayout(), ipe::Cascade::findPageNumberStyle(), ipe::Cascade::findSymbol(), ipe::Color::iBlue, iCascade, ipe::StyleSheet::PageNumberStyle::iColor, iDimmed, iFonts, ipe::StyleSheet::PageNumberStyle::iFontSize, ipe::Color::iGreen, ipe::Symbol::iObject, ipe::Layout::iOrigin, iPage, iPageNumber, ipe::Layout::iPaperSize, ipe::StyleSheet::PageNumberStyle::iPos, ipe::Color::iRed, iStyle, iView, iZoom, ipe::CanvasBase::Style::numberPages, ipe::Page::object(), ipe::Page::objectVisible(), ipe::CanvasBase::Style::paperClip, ipe::Painter::popMatrix(), ipe::CanvasBase::Style::pretty, ipe::Painter::pushMatrix(), ipe::CairoPainter::setDimmed(), ipe::Page::titleText(), ipe::Fixed::toDouble(), ipe::Vector::x, and ipe::Vector::y.
Referenced by refreshSurface().
void CanvasBase::drawTool |
( |
Painter & |
painter | ) |
|
|
protected |
Draw the current canvas tool.
If no tool is set, it draws the selected objects.
References ipe::Page::count(), ipe::Tool::draw(), ipe::Object::drawSimple(), ipe::EPrimarySelected, ipe::ESecondarySelected, iPage, iSelectionVisible, iTool, iView, ipe::Page::object(), ipe::Page::objectVisible(), ipe::Page::select(), ipe::Painter::setPen(), and ipe::Painter::setStroke().
Referenced by ipe::Canvas::paintEvent().
bool CanvasBase::snapToPaperAndFrame |
( |
| ) |
|
|
protected |
References ipe::Rect::bottomLeft(), ipe::Rect::bottomRight(), ipe::Snap::ESnapBd, ipe::Snap::ESnapVtx, ipe::Cascade::findLayout(), iCascade, ipe::Layout::iFrameSize, iMousePos, ipe::Snap::iSnap, iSnap, ipe::Snap::iSnapDistance, iZoom, ipe::Layout::paper(), snap(), ipe::Vector::snap(), ipe::Rect::topLeft(), ipe::Rect::topRight(), and ipe::Vector::ZERO.
Referenced by computeFifi().
void CanvasBase::refreshSurface |
( |
| ) |
|
|
protected |
References ipe::CanvasObserver::canvasObserverSizeChanged(), drawAxes(), drawFrame(), drawGrid(), drawObjects(), drawPaper(), ipe::Snap::iGridVisible, iHeight, iObserver, iPage, iPan, iRepaintObjects, iSnap, iStyle, iSurface, iWidth, ipe::Snap::iWithAxes, iZoom, ipe::CanvasBase::Style::pretty, ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Canvas::paintEvent().
void CanvasBase::computeFifi |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
protected |
Stores the mouse position in iUnsnappedMousePos, computes Fifi if snapping is enabled, and stores snapped position in iMousePos.
References devToUser(), ipe::Snap::ESnapAuto, iAutoOrigin, iAutoSnap, iFifiVisible, iMousePos, invalidate(), iOldFifi, iPage, ipe::Snap::iSnap, iSnap, ipe::Snap::iSnapDistance, iUnsnappedMousePos, iZoom, ipe::Snap::snap(), snapToPaperAndFrame(), userToDev(), ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Canvas::mouseMoveEvent(), ipe::Canvas::mousePressEvent(), ipe::Canvas::mouseReleaseEvent(), and ipe::Canvas::tabletEvent().
virtual void ipe::CanvasBase::invalidate |
( |
| ) |
|
|
protectedpure virtual |
virtual void ipe::CanvasBase::invalidate |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
protectedpure virtual |
Tool* ipe::CanvasBase::iTool |
|
protected |
const Page* ipe::CanvasBase::iPage |
|
protected |
int ipe::CanvasBase::iPageNumber |
|
protected |
int ipe::CanvasBase::iView |
|
protected |
const Cascade* ipe::CanvasBase::iCascade |
|
protected |
Style ipe::CanvasBase::iStyle |
|
protected |
double ipe::CanvasBase::iZoom |
|
protected |
Referenced by CanvasBase(), canvasTfm(), computeFifi(), devToUser(), drawAxes(), drawFrame(), drawGrid(), drawObjects(), refreshSurface(), setZoom(), simpleSnapPos(), snapToPaperAndFrame(), userToDev(), and zoom().
Snap ipe::CanvasBase::iSnap |
|
protected |
bool ipe::CanvasBase::iDimmed |
|
protected |
bool ipe::CanvasBase::iAutoSnap |
|
protected |
Vector ipe::CanvasBase::iAutoOrigin |
|
protected |
int ipe::CanvasBase::iAdditionalModifiers |
|
protected |
bool ipe::CanvasBase::iRepaintObjects |
|
protected |
int ipe::CanvasBase::iWidth |
|
protected |
int ipe::CanvasBase::iHeight |
|
protected |
cairo_surface_t* ipe::CanvasBase::iSurface |
|
protected |
Vector ipe::CanvasBase::iUnsnappedMousePos |
|
protected |
Vector ipe::CanvasBase::iMousePos |
|
protected |
Vector ipe::CanvasBase::iGlobalPos |
|
protected |
Vector ipe::CanvasBase::iOldFifi |
|
protected |
bool ipe::CanvasBase::iFifiVisible |
|
protected |
bool ipe::CanvasBase::iSelectionVisible |
|
protected |
Fonts* ipe::CanvasBase::iFonts |
|
protected |
The documentation for this class was generated from the following files:
- ipecanvas.h
- ipecanvas.cpp