Ipelib

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ipe::PdfViewBase Class Referenceabstract
Ipe canvas

`#include <ipepdfview.h>`

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

## Public Member Functions
virtual | ~PdfViewBase ()
void | setPdf (const PdfFile *pdf, Fonts *fonts)
void | setPage (const PdfDict *page, const Rect &paper)
void | setBackground (const Color &bg)
void | setBlackout (bool bo)
Vector | pan () const
double | zoom () const
Vector | center () const
int | viewWidth () const
int | viewHeight () const
bool | blackout () 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
Color | iBackground
bool | iBlackout
bool | iRepaint
cairo_surface_t * | iSurface
std::unique_ptr< Cascade > | iCascade
const PdfDict * | iPage
Rect | iPaperBox
const PdfDict * | iStream
const PdfFile * | iPdf
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.

References iBackground, iBHeight, iBlackout, iBWidth, iCascade, iFonts, iHeight, iPage, iPan, iPdf, iRepaint, iStream, iSurface, iWidth, iZoom, ipe::StyleSheet::standard(), and ipe::Vector::ZERO.

## Member Function Documentation

## ◆ setPdf()

void PdfViewBase::setPdf | ( | const PdfFile * | pdf,
|  | Fonts * | fonts
| ) |  |

Provide the PDF document.

References iFonts, iPage, iPdf, 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.

## ◆ setBackground()

void PdfViewBase::setBackground | ( | const Color & | bg | ) |

Set background color.

References iBackground.

## ◆ setBlackout()

void PdfViewBase::setBlackout | ( | bool | bo | ) |

Set blackout.

References iBlackout.

## ◆ 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().

## ◆ 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 iHeight.

## ◆ blackout()

bool ipe::PdfViewBase::blackout | ( |  | ) | const
| inline

Return current blackout state.

References iBlackout.

## ◆ 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 ipe::PdfView::mousePressEvent().

## ◆ 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.

## ◆ 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.

## ◆ setZoom()

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

Set current zoom factor.

The zoom factor maps user coordinates to screen pixel coordinates.

References iZoom, and zoom().

## ◆ canvasTfm()

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

Matrix mapping user coordinates to canvas coordinates.

References center(), iPan, and iZoom.

## ◆ updatePdf()

void PdfViewBase::updatePdf | ( |  | ) |

Mark for update with redrawing of PDF document.

References invalidate(), and iRepaint.

## ◆ 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().

## ◆ 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().

## ◆ refreshSurface()

void PdfViewBase::refreshSurface | ( |  | ) |
| protected

References drawPaper(), ipe::CairoPainter::executeStream(), iBackground, iBHeight, iBlackout, ipe::Color::iBlue, iBWidth, iCascade, iFonts, ipe::Color::iGreen, iHeight, iPage, iPan, ipe::Color::iRed, iRepaint, iStream, iSurface, iWidth, iZoom, ipe::Fixed::toDouble(), ipe::Vector::x, and ipe::Vector::y.

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

## Member Data Documentation

## ◆ iWidth

double ipe::PdfViewBase::iWidth
| protected

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

## ◆ iHeight

double ipe::PdfViewBase::iHeight
| protected

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

## ◆ iBWidth

double ipe::PdfViewBase::iBWidth
| protected

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

## ◆ iBHeight

double ipe::PdfViewBase::iBHeight
| protected

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

## ◆ iPan

Vector ipe::PdfViewBase::iPan
| protected

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

## ◆ iZoom

double ipe::PdfViewBase::iZoom
| protected

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

## ◆ iBackground

Color ipe::PdfViewBase::iBackground
| protected

Referenced by PdfViewBase(), refreshSurface(), and setBackground().

## ◆ iBlackout

bool ipe::PdfViewBase::iBlackout
| protected

Referenced by blackout(), PdfViewBase(), refreshSurface(), and setBlackout().

## ◆ iRepaint

bool ipe::PdfViewBase::iRepaint
| protected

Referenced by PdfViewBase(), refreshSurface(), and updatePdf().

## ◆ iSurface

cairo_surface_t* ipe::PdfViewBase::iSurface
| protected

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

## ◆ iCascade

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

Referenced by PdfViewBase(), and refreshSurface().

## ◆ iPage

const PdfDict* ipe::PdfViewBase::iPage
| protected

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

## ◆ iPaperBox

Rect ipe::PdfViewBase::iPaperBox
| protected

Referenced by drawPaper(), and setPage().

## ◆ iStream

const PdfDict* ipe::PdfViewBase::iStream
| protected

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

## ◆ iPdf

const PdfFile* ipe::PdfViewBase::iPdf
| protected

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

## ◆ iFonts

Fonts* ipe::PdfViewBase::iFonts
| protected

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

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

- ipepdfview.h
- ipepdfview.cpp