Ipelib: ipe::PdfViewBase Class Reference

Ipelib

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

`#include <ipepdfview.h>`

Inherited by ipe::PdfView, ipe::PdfView, and 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.

Referenced by blackout().

## 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 blackout(), and 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 canvasTfm(), devToUser(), drawPaper(), iBlackout, 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 blackout(), and 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.

Referenced by blackout().

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

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

## ◆ canvasTfm()

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

Matrix mapping user coordinates to canvas coordinates.

References center(), iPan, and iZoom.

Referenced by blackout().

## ◆ updatePdf()

void PdfViewBase::updatePdf | ( |  | ) |

Mark for update with redrawing of PDF document.

References invalidate(), and iRepaint.

Referenced by blackout().

## ◆ 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 blackout(), and 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 blackout(), and 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 blackout(), PdfView::drawRect(), and ipe::PdfView::paintEvent().

## Member Data Documentation

## ◆ iWidth

double ipe::PdfViewBase::iWidth
| protected

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

## ◆ iHeight

double ipe::PdfViewBase::iHeight
| protected

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

## ◆ iBWidth

double ipe::PdfViewBase::iBWidth
| protected

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

## ◆ iBHeight

double ipe::PdfViewBase::iBHeight
| protected

Referenced by PdfView::drawRect(), 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().

## ◆ iBackground

Color ipe::PdfViewBase::iBackground
| protected

Referenced by refreshSurface(), and setBackground().

## ◆ iBlackout

bool ipe::PdfViewBase::iBlackout
| protected

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

## ◆ iRepaint

bool ipe::PdfViewBase::iRepaint
| protected

Referenced by refreshSurface(), and updatePdf().

## ◆ iSurface

cairo_surface_t* ipe::PdfViewBase::iSurface
| protected

Referenced by PdfView::drawRect(), 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().

## ◆ iFonts

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