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

#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< CascadeiCascade
 
const PdfDictiPage
 
Rect iPaperBox
 
const PdfDictiStream
 
const PdfFileiPdf
 
FontsiFonts
 

Detailed Description

A widget (control) that displays a PDF document.

Constructor & Destructor Documentation

◆ ~PdfViewBase()

PdfViewBase::~PdfViewBase ( )
virtual

destructor.

References iSurface.

◆ PdfViewBase()

PdfViewBase::PdfViewBase ( )
protected

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

◆ refreshSurface()

void PdfViewBase::refreshSurface ( )
protected

Member Data Documentation

◆ iWidth

double ipe::PdfViewBase::iWidth
protected

◆ iHeight

double ipe::PdfViewBase::iHeight
protected

◆ iBWidth

double ipe::PdfViewBase::iBWidth
protected

◆ iBHeight

double ipe::PdfViewBase::iBHeight
protected

◆ iPan

Vector ipe::PdfViewBase::iPan
protected

◆ iZoom

double ipe::PdfViewBase::iZoom
protected

◆ iBackground

Color ipe::PdfViewBase::iBackground
protected

◆ iBlackout

bool ipe::PdfViewBase::iBlackout
protected

◆ iRepaint

bool ipe::PdfViewBase::iRepaint
protected

◆ iSurface

cairo_surface_t* ipe::PdfViewBase::iSurface
protected

◆ iCascade

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

Referenced by PdfViewBase(), and refreshSurface().

◆ iPage

const PdfDict* ipe::PdfViewBase::iPage
protected

◆ iPaperBox

Rect ipe::PdfViewBase::iPaperBox
protected

Referenced by drawPaper(), and setPage().

◆ iStream

const PdfDict* ipe::PdfViewBase::iStream
protected

◆ 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: