X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..4649b5eded522cdc6d76aae074f98a2c162fd648:/wxPython/src/printfw.i diff --git a/wxPython/src/printfw.i b/wxPython/src/printfw.i index c10fad5b2c..4ab596d72e 100644 --- a/wxPython/src/printfw.i +++ b/wxPython/src/printfw.i @@ -41,7 +41,7 @@ -class wxPrintData { +class wxPrintData : public wxObject { public: wxPrintData(); ~wxPrintData(); @@ -69,36 +69,50 @@ public: void SetPaperSize(const wxSize& sz); void SetQuality(wxPrintQuality quality); -// // PostScript-specific data -// const wxString& GetPrinterCommand(); -// const wxString& GetPrinterOptions(); -// const wxString& GetPreviewCommand(); -// const wxString& GetFilename(); -// const wxString& GetFontMetricPath(); -// double GetPrinterScaleX(); -// double GetPrinterScaleY(); -// long GetPrinterTranslateX(); -// long GetPrinterTranslateY(); -// wxPrintMode GetPrintMode(); - -// void SetPrinterCommand(const wxString& command); -// void SetPrinterOptions(const wxString& options); -// void SetPreviewCommand(const wxString& command); -// void SetFilename(const wxString& filename); -// void SetFontMetricPath(const wxString& path); -// void SetPrinterScaleX(double x); -// void SetPrinterScaleY(double y); -// void SetPrinterScaling(double x, double y); -// void SetPrinterTranslateX(long x); -// void SetPrinterTranslateY(long y); -// void SetPrinterTranslation(long x, long y); -// void SetPrintMode(wxPrintMode printMode); + // PostScript-specific data + const wxString& GetPrinterCommand(); + const wxString& GetPrinterOptions(); + const wxString& GetPreviewCommand(); + const wxString& GetFilename(); + const wxString& GetFontMetricPath(); + double GetPrinterScaleX(); + double GetPrinterScaleY(); + long GetPrinterTranslateX(); + long GetPrinterTranslateY(); + wxPrintMode GetPrintMode(); + + void SetPrinterCommand(const wxString& command); + void SetPrinterOptions(const wxString& options); + void SetPreviewCommand(const wxString& command); + void SetFilename(const wxString& filename); + void SetFontMetricPath(const wxString& path); + void SetPrinterScaleX(double x); + void SetPrinterScaleY(double y); + void SetPrinterScaling(double x, double y); + void SetPrinterTranslateX(long x); + void SetPrinterTranslateY(long y); + void SetPrinterTranslation(long x, long y); + void SetPrintMode(wxPrintMode printMode); }; //---------------------------------------------------------------------- -class wxPageSetupDialogData { +#ifdef __WXMSW__ +class wxPrinterDC : public wxDC { +public: + wxPrinterDC(const wxPrintData& printData); + %name(wxPrinterDC2) wxPrinterDC(const wxString& driver, + const wxString& device, + const wxString& output, + bool interactive = TRUE, + int orientation = wxPORTRAIT); +}; +#endif + +//--------------------------------------------------------------------------- + +class wxPageSetupDialogData : public wxObject { public: wxPageSetupDialogData(); ~wxPageSetupDialogData(); @@ -132,7 +146,7 @@ public: void SetMarginBottomRight(const wxPoint& pt); void SetMinMarginTopLeft(const wxPoint& pt); void SetMinMarginBottomRight(const wxPoint& pt); - void SetPaperId(wxPaperSize& id); + void SetPaperId(wxPaperSize id); void SetPaperSize(const wxSize& size); void SetPrintData(const wxPrintData& printData); }; @@ -151,7 +165,7 @@ public: //---------------------------------------------------------------------- -class wxPrintDialogData { +class wxPrintDialogData : public wxObject { public: wxPrintDialogData(); ~wxPrintDialogData(); @@ -205,9 +219,10 @@ public: // Since this one would be tough and ugly to do with the Macros... void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { bool hadErr = FALSE; + bool found; - bool doSave = wxPyRestoreThread(); - if (m_myInst.findCallback("GetPageInfo")) { + wxPyTState* state = wxPyBeginBlockThreads(); + if ((found = m_myInst.findCallback("GetPageInfo"))) { PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()")); if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) { PyObject* val; @@ -237,10 +252,9 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p } Py_DECREF(result); } - else + wxPyEndBlockThreads(state); + if (! found) wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo); - - wxPySaveThread(doSave); } void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { @@ -261,7 +275,7 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage); // Now define the custom class for SWIGging -%name(wxPrintout) class wxPyPrintout { +%name(wxPrintout) class wxPyPrintout : public wxObject { public: wxPyPrintout(const char* title = "Printout"); @@ -290,7 +304,7 @@ public: //---------------------------------------------------------------------- -class wxPrinter { +class wxPrinter : public wxObject { public: wxPrinter(wxPrintDialogData* data = NULL); ~wxPrinter(); @@ -306,7 +320,7 @@ public: //---------------------------------------------------------------------- -class wxPrintPreview { +class wxPrintPreview : public wxObject { public: wxPrintPreview(wxPyPrintout* printout, wxPyPrintout* printoutForPrinting, wxPrintData* data=NULL); // ~wxPrintPreview(); **** ???? @@ -334,8 +348,8 @@ public: class wxPreviewFrame : public wxFrame { public: wxPreviewFrame(wxPrintPreview* preview, wxFrame* parent, const wxString& title, - const wxPoint& pos = wxPyDefaultPosition, - const wxSize& size = wxPyDefaultSize, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, char* name = "frame"); @@ -350,6 +364,11 @@ public: }; //---------------------------------------------------------------------- + +%init %{ + wxPyPtrTypeMap_Add("wxPrintout", "wxPyPrintout"); +%} + //---------------------------------------------------------------------- //----------------------------------------------------------------------