KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::CAIRO_PRINT_CTX Class Reference

Provide a Cairo context created from wxPrintDC or an wxImage. More...

#include <cairo_print.h>

Inheritance diagram for KIGFX::CAIRO_PRINT_CTX:
KIGFX::PRINT_CONTEXT

Public Member Functions

 CAIRO_PRINT_CTX (wxImage *aImage, double aDPI)
 
 CAIRO_PRINT_CTX (wxDC *aDC)
 
 ~CAIRO_PRINT_CTX ()
 
cairo_t * GetContext () const
 
cairo_surface_t * GetSurface () const
 
double GetNativeDPI () const override
 
bool HasNativeLandscapeRotation () const override
 

Private Attributes

wxGCDC * m_gcdc = nullptr
 
wxImage * m_targetImage = nullptr
 
cairo_t * m_ctx = nullptr
 
cairo_surface_t * m_surface = nullptr
 
double m_dpi = 72.0
 

Detailed Description

Provide a Cairo context created from wxPrintDC or an wxImage.

It allows one to prepare printouts using the Cairo library and let wxWidgets handle the rest.

Definition at line 39 of file cairo_print.h.

Constructor & Destructor Documentation

◆ CAIRO_PRINT_CTX() [1/2]

CAIRO_PRINT_CTX::CAIRO_PRINT_CTX ( wxImage * aImage,
double aDPI )

Definition at line 54 of file cairo_print.cpp.

References m_ctx, m_dpi, m_surface, and m_targetImage.

◆ CAIRO_PRINT_CTX() [2/2]

CAIRO_PRINT_CTX::CAIRO_PRINT_CTX ( wxDC * aDC)

Definition at line 74 of file cairo_print.cpp.

References DEFAULT_DPI, m_ctx, m_dpi, m_gcdc, and m_surface.

◆ ~CAIRO_PRINT_CTX()

CAIRO_PRINT_CTX::~CAIRO_PRINT_CTX ( )

Definition at line 141 of file cairo_print.cpp.

References m_ctx, m_gcdc, m_surface, and m_targetImage.

Member Function Documentation

◆ GetContext()

cairo_t * KIGFX::CAIRO_PRINT_CTX::GetContext ( ) const
inline

Definition at line 46 of file cairo_print.h.

References m_ctx.

◆ GetNativeDPI()

double KIGFX::CAIRO_PRINT_CTX::GetNativeDPI ( ) const
inlineoverridevirtual

Implements KIGFX::PRINT_CONTEXT.

Definition at line 56 of file cairo_print.h.

References m_dpi.

◆ GetSurface()

cairo_surface_t * KIGFX::CAIRO_PRINT_CTX::GetSurface ( ) const
inline

Definition at line 51 of file cairo_print.h.

References m_surface.

◆ HasNativeLandscapeRotation()

bool KIGFX::CAIRO_PRINT_CTX::HasNativeLandscapeRotation ( ) const
inlineoverridevirtual

Implements KIGFX::PRINT_CONTEXT.

Definition at line 61 of file cairo_print.h.

Member Data Documentation

◆ m_ctx

cairo_t* KIGFX::CAIRO_PRINT_CTX::m_ctx = nullptr
private

Definition at line 73 of file cairo_print.h.

Referenced by CAIRO_PRINT_CTX(), CAIRO_PRINT_CTX(), GetContext(), and ~CAIRO_PRINT_CTX().

◆ m_dpi

double KIGFX::CAIRO_PRINT_CTX::m_dpi = 72.0
private

Definition at line 81 of file cairo_print.h.

Referenced by CAIRO_PRINT_CTX(), CAIRO_PRINT_CTX(), and GetNativeDPI().

◆ m_gcdc

wxGCDC* KIGFX::CAIRO_PRINT_CTX::m_gcdc = nullptr
private

Definition at line 71 of file cairo_print.h.

Referenced by CAIRO_PRINT_CTX(), and ~CAIRO_PRINT_CTX().

◆ m_surface

cairo_surface_t* KIGFX::CAIRO_PRINT_CTX::m_surface = nullptr
private

Definition at line 74 of file cairo_print.h.

Referenced by CAIRO_PRINT_CTX(), CAIRO_PRINT_CTX(), GetSurface(), and ~CAIRO_PRINT_CTX().

◆ m_targetImage

wxImage* KIGFX::CAIRO_PRINT_CTX::m_targetImage = nullptr
private

Definition at line 72 of file cairo_print.h.

Referenced by CAIRO_PRINT_CTX(), and ~CAIRO_PRINT_CTX().


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