KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIPLATFORM::PRINTING Namespace Reference

Classes

class  WIN_PDF_PRINTER
 

Enumerations

enum class  PRINT_RESULT {
  OK = 0 , CANCELLED , FILE_NOT_FOUND , FAILED_TO_LOAD ,
  FAILED_TO_PRINT , UNSUPPORTED , UNKNOWN_ERROR
}
 

Functions

const wxString PrintResultToString (PRINT_RESULT aResult)
 
PRINT_RESULT PrintPDF (const std::string &aFile)
 
void ResetPrintToFilePath (wxPrintData &aData)
 Discard a "print to file" destination in aData that the platform print backend generated for its own spooling, leaving a destination the user chose untouched.
 
PRINT_RESULT PrintPDF (const std::string &aFile, bool fit_to_page)
 
static bool isSpoolName (const wxString &aFileName)
 
static std::wstring Utf8ToWide (std::string const &s)
 

Enumeration Type Documentation

◆ PRINT_RESULT

Enumerator
OK 
CANCELLED 
FILE_NOT_FOUND 
FAILED_TO_LOAD 
FAILED_TO_PRINT 
UNSUPPORTED 
UNKNOWN_ERROR 

Definition at line 33 of file printing.h.

Function Documentation

◆ isSpoolName()

static bool KIPLATFORM::PRINTING::isSpoolName ( const wxString & aFileName)
static

Definition at line 244 of file unix/printing.cpp.

Referenced by ResetPrintToFilePath().

◆ PrintPDF() [1/2]

PRINT_RESULT KIPLATFORM::PRINTING::PrintPDF ( const std::string & aFile)

Definition at line 235 of file unix/printing.cpp.

References PrintPDF().

Referenced by PrintPDF(), and DIALOG_PRINT::TransferDataFromWindow().

◆ PrintPDF() [2/2]

PRINT_RESULT KIPLATFORM::PRINTING::PrintPDF ( const std::string & aFile,
bool fit_to_page )

Definition at line 154 of file unix/printing.cpp.

References CANCELLED, FAILED_TO_LOAD, FAILED_TO_PRINT, FILE_NOT_FOUND, OK, and result.

◆ PrintResultToString()

const wxString KIPLATFORM::PRINTING::PrintResultToString ( PRINT_RESULT aResult)
inline

◆ ResetPrintToFilePath()

void KIPLATFORM::PRINTING::ResetPrintToFilePath ( wxPrintData & aData)

Discard a "print to file" destination in aData that the platform print backend generated for its own spooling, leaving a destination the user chose untouched.

Print settings are carried from one print to the next so that the dialog reopens the way the user left it. Under the GTK portal backend (Flatpak, snap, GTK_USE_PORTAL) that also carries a gtkprintXXXXXX scratch path, because the portal overwrites the output URI with its own temporary file before handing the settings back, and the scratch path then shows up as the suggested output file. It lives in the native GtkPrintSettings output URI, which the wx-level filename does not track, so it has to be inspected there.

Definition at line 252 of file unix/printing.cpp.

References isSpoolName().

Referenced by BOOST_AUTO_TEST_CASE(), InvokeDialogPrint(), DIALOG_PRINT_GENERIC::onPrintButtonClick(), and DIALOG_PRINT::TransferDataFromWindow().

◆ Utf8ToWide()

static std::wstring KIPLATFORM::PRINTING::Utf8ToWide ( std::string const & s)
static

Definition at line 389 of file windows/printing.cpp.

References L.