ipe::PdfViewBase Class Referenceabstract
Ipe canvas

`#include <ipepdfview.h>`

Inherited by ipe::PdfView, and ipe::PdfView.

## Public Member Functions

virtual | ~PdfViewBase ()
void | setPdf (const PdfFile *pdf)
void | setPage (const PdfDict *page, const Rect &paper)
Vector | pan () const
double | zoom () const
Vector | center () const
int | viewWidth () const
int | viewHeight () const
Vector | devToUser (const Vector &arg) const
Vector | userToDev (const Vector &arg) const
void | setPan (const Vector &v)
void | setZoom (double zoom)
Matrix | canvasTfm () const
void | updatePdf ()
virtual void | invalidate (int x, int y, int w, int h)=0
virtual void | invalidate ()=0

## Protected Member Functions

| PdfViewBase ()
void | drawPaper (cairo_t *cc)
void | refreshSurface ()

## Protected Attributes

double | iWidth
double | iHeight
double | iBWidth
double | iBHeight
Vector | iPan
double | iZoom
bool | iRepaint
cairo_surface_t * | iSurface
std::unique_ptr< Cascade > | iCascade
const PdfDict * | iPage
Rect | iPaperBox
const PdfDict * | iStream
const PdfFile * | iPdf
std::unique_ptr< PdfFileResources > | iResources
std::unique_ptr< Fonts > | iFonts

## Detailed Description

A widget (control) that displays a PDF document.

## Constructor & Destructor Documentation

## ~PdfViewBase()

PdfViewBase::~PdfViewBase | ( |  | ) |

virtual

destructor.

References iSurface.

## PdfViewBase()

PdfViewBase::PdfViewBase | ( |  | ) |

protected

Construct a new canvas.

Referenced by viewHeight().

## Member Function Documentation

## setPdf()

void PdfViewBase::setPdf | ( | const PdfFile * | pdf | ) |

Provide the PDF document.

References iFonts, iPage, iPdf, iResources, and iStream.

## setPage()

void PdfViewBase::setPage | ( | const PdfDict * | page,
|  | const Rect & | paper
| ) |  |

Provide the page to view.

References ipe::PdfObj::dict(), ipe::PdfDict::get(), iPage, iPaperBox, iPdf, and iStream.

## pan()

Vector ipe::PdfViewBase::pan | ( |  | ) | const

inline

Return current pan.

References iPan.

## zoom()

double ipe::PdfViewBase::zoom | ( |  | ) | const

inline

Return current zoom.

References iZoom.

Referenced by setZoom(), and viewHeight().

## center()

Vector ipe::PdfViewBase::center | ( |  | ) | const

inline

Return center of view.

References iHeight, and iWidth.

Referenced by canvasTfm(), devToUser(), and userToDev().

## viewWidth()

int ipe::PdfViewBase::viewWidth | ( |  | ) | const

inline

Return width of view.

References iWidth.

## viewHeight()

int ipe::PdfViewBase::viewHeight | ( |  | ) | const

inline

Return height of view.

References canvasTfm(), devToUser(), drawPaper(), iHeight, invalidate(), PdfViewBase(), refreshSurface(), setPan(), setZoom(), updatePdf(), userToDev(), and zoom().

## devToUser()

Vector PdfViewBase::devToUser | ( | const Vector & | arg | ) | const

Convert canvas (device) coordinates to user coordinates.

References center(), iPan, iZoom, ipe::Vector::x, and ipe::Vector::y.

Referenced by viewHeight().

## userToDev()

Vector PdfViewBase::userToDev | ( | const Vector & | arg | ) | const

Convert user coordinates to canvas (device) coordinates.

References center(), iPan, iZoom, ipe::Vector::x, and ipe::Vector::y.

Referenced by viewHeight().

## setPan()

void PdfViewBase::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 viewHeight().

## setZoom()

void PdfViewBase::setZoom | ( | double | zoom | ) |

Set current zoom factor.

The zoom factor maps user coordinates to screen pixel coordinates.

References iZoom, and zoom().

Referenced by viewHeight().

## canvasTfm()

Matrix PdfViewBase::canvasTfm | ( |  | ) | const

Matrix mapping user coordinates to canvas coordinates.

References center(), iPan, and iZoom.

Referenced by viewHeight().

## updatePdf()

void PdfViewBase::updatePdf | ( |  | ) |

Mark for update with redrawing of PDF document.

References invalidate(), and iRepaint.

Referenced by viewHeight().

## invalidate() [1/2]

virtual void ipe::PdfViewBase::invalidate | ( | int | x,
|  | int | y,
|  | int | w,
|  | int | h
| ) |  |

pure virtual

Implemented in ipe::PdfView.

## invalidate() [2/2]

virtual void ipe::PdfViewBase::invalidate | ( |  | ) |

pure virtual

Implemented in ipe::PdfView.

Referenced by updatePdf(), and viewHeight().

## drawPaper()

void PdfViewBase::drawPaper | ( | cairo_t * | cc | ) |

protected

References ipe::Rect::bottom(), ipe::Rect::height(), iPaperBox, ipe::Rect::isEmpty(), ipe::Rect::left(), and ipe::Rect::width().

Referenced by refreshSurface(), and viewHeight().

## refreshSurface()

void PdfViewBase::refreshSurface | ( |  | ) |

protected

References drawPaper(), ipe::CairoPainter::executeStream(), iBHeight, iBWidth, iCascade, iFonts, iHeight, iPage, iPan, iRepaint, iStream, iSurface, iWidth, iZoom, ipe::Vector::x, and ipe::Vector::y.

Referenced by ipe::PdfView::paintEvent(), and viewHeight().

## Member Data Documentation

## iWidth

double ipe::PdfViewBase::iWidth

protected

Referenced by center(), ipe::PdfView::paintEvent(), refreshSurface(), and viewWidth().

## iHeight

double ipe::PdfViewBase::iHeight

protected

Referenced by center(), ipe::PdfView::paintEvent(), refreshSurface(), and viewHeight().

## iBWidth

double ipe::PdfViewBase::iBWidth

protected

Referenced by ipe::PdfView::paintEvent(), and refreshSurface().

## iBHeight

double ipe::PdfViewBase::iBHeight

protected

Referenced by ipe::PdfView::paintEvent(), and refreshSurface().

## iPan

Vector ipe::PdfViewBase::iPan

protected

Referenced by canvasTfm(), devToUser(), pan(), refreshSurface(), setPan(), and userToDev().

## iZoom

double ipe::PdfViewBase::iZoom

protected

Referenced by canvasTfm(), devToUser(), refreshSurface(), setZoom(), userToDev(), and zoom().

## iRepaint

bool ipe::PdfViewBase::iRepaint

protected

Referenced by refreshSurface(), and updatePdf().

## iSurface

cairo_surface_t* ipe::PdfViewBase::iSurface

protected

Referenced by ipe::PdfView::paintEvent(), refreshSurface(), and ~PdfViewBase().

## iCascade

std::unique_ptr<Cascade> ipe::PdfViewBase::iCascade

protected

Referenced by refreshSurface().

## iPage

const PdfDict* ipe::PdfViewBase::iPage

protected

Referenced by refreshSurface(), setPage(), and setPdf().

## iPaperBox

Rect ipe::PdfViewBase::iPaperBox

protected

Referenced by drawPaper(), and setPage().

## iStream

const PdfDict* ipe::PdfViewBase::iStream

protected

Referenced by refreshSurface(), setPage(), and setPdf().

## iPdf

const PdfFile* ipe::PdfViewBase::iPdf

protected

Referenced by setPage(), and setPdf().

## iResources

std::unique_ptr<PdfFileResources> ipe::PdfViewBase::iResources

protected

Referenced by setPdf().

## iFonts

std::unique_ptr<Fonts> ipe::PdfViewBase::iFonts

protected

Referenced by refreshSurface(), and setPdf().

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

- ipepdfview.h
- ipepdfview.cpp