]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_printfw.i
some methods missing wxPyBeginBlockThreads/wxPyEndBlockThreads
[wxWidgets.git] / wxPython / src / _printfw.i
index 48708018bc4bee518599a45a36115076f75c8a73..e81578d220f794d98dce0f689d65e55418df2416 100644 (file)
@@ -32,7 +32,8 @@ enum wxPrintMode
     wxPRINT_MODE_NONE =    0,
     wxPRINT_MODE_PREVIEW = 1,   // Preview in external application
     wxPRINT_MODE_FILE =    2,   // Print to file
     wxPRINT_MODE_NONE =    0,
     wxPRINT_MODE_PREVIEW = 1,   // Preview in external application
     wxPRINT_MODE_FILE =    2,   // Print to file
-    wxPRINT_MODE_PRINTER = 3    // Send to printer
+    wxPRINT_MODE_PRINTER = 3,   // Send to printer
+    wxPRINT_MODE_STREAM = 4     // Send postscript data into a stream 
 };
 
 
 };
 
 
@@ -92,6 +93,9 @@ public:
     void SetPrinterTranslation(long x, long y);
     void SetPrintMode(wxPrintMode printMode);
 
     void SetPrinterTranslation(long x, long y);
     void SetPrintMode(wxPrintMode printMode);
 
+    wxOutputStream* GetOutputStream();
+    void SetOutputStream(wxOutputStream* outputstream);
+
     %pythoncode { def __nonzero__(self): return self.Ok() }
 };
 
     %pythoncode { def __nonzero__(self): return self.Ok() }
 };
 
@@ -160,7 +164,9 @@ public:
 
 class wxPrintDialogData : public wxObject {
 public:
 
 class wxPrintDialogData : public wxObject {
 public:
+    %nokwargs wxPrintDialogData;
     wxPrintDialogData();
     wxPrintDialogData();
+    wxPrintDialogData(const wxPrintData& printData);
     ~wxPrintDialogData();
 
     int GetFromPage() const;
     ~wxPrintDialogData();
 
     int GetFromPage() const;
@@ -264,7 +270,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p
     bool hadErr = False;
     bool found;
 
     bool hadErr = False;
     bool found;
 
-    wxPyBeginBlockThreads();
+    bool blocked = wxPyBeginBlockThreads();
     if ((found = wxPyCBH_findCallback(m_myInst, "GetPageInfo"))) {
         PyObject* result = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
         if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
     if ((found = wxPyCBH_findCallback(m_myInst, "GetPageInfo"))) {
         PyObject* result = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
         if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
@@ -295,7 +301,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p
         }
         Py_DECREF(result);
     }
         }
         Py_DECREF(result);
     }
-    wxPyEndBlockThreads();
+    wxPyEndBlockThreads(blocked);
     if (! found)
         wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
 }
     if (! found)
         wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
 }
@@ -454,9 +460,13 @@ public:
 
 class wxPrintPreview : public wxObject {
 public:
 
 class wxPrintPreview : public wxObject {
 public:
+    %nokwargs wxPrintPreview;
     wxPrintPreview(wxPyPrintout* printout,
                    wxPyPrintout* printoutForPrinting,
     wxPrintPreview(wxPyPrintout* printout,
                    wxPyPrintout* printoutForPrinting,
-                   wxPrintData* data=NULL);
+                   wxPrintDialogData *data=NULL);
+    wxPrintPreview(wxPyPrintout* printout,
+                  wxPyPrintout* printoutForPrinting,
+                  wxPrintData* data);
 
     virtual bool SetCurrentPage(int pageNum);
     int GetCurrentPage();
 
     virtual bool SetCurrentPage(int pageNum);
     int GetCurrentPage();
@@ -517,7 +527,7 @@ public:
     bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) {                           \
         bool rval=False;                                                        \
         bool found;                                                             \
     bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) {                           \
         bool rval=False;                                                        \
         bool found;                                                             \
-        wxPyBeginBlockThreads();                                                \
+        bool blocked = wxPyBeginBlockThreads();                                                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* win = wxPyMake_wxObject(a);                               \
             PyObject* dc  = wxPyMake_wxObject(&b);                              \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* win = wxPyMake_wxObject(a);                               \
             PyObject* dc  = wxPyMake_wxObject(&b);                              \
@@ -525,7 +535,7 @@ public:
             Py_DECREF(win);                                                     \
             Py_DECREF(dc);                                                      \
         }                                                                       \
             Py_DECREF(win);                                                     \
             Py_DECREF(dc);                                                      \
         }                                                                       \
-        wxPyEndBlockThreads();                                                  \
+        wxPyEndBlockThreads(blocked);                                                  \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
@@ -541,6 +551,11 @@ class wxPyPrintPreview : public wxPrintPreview
 {
     DECLARE_CLASS(wxPyPrintPreview)
 public:
 {
     DECLARE_CLASS(wxPyPrintPreview)
 public:
+    wxPyPrintPreview(wxPyPrintout* printout,
+                     wxPyPrintout* printoutForPrinting,
+                     wxPrintDialogData* data=NULL)
+        : wxPrintPreview(printout, printoutForPrinting, data)
+    {}
     wxPyPrintPreview(wxPyPrintout* printout,
                      wxPyPrintout* printoutForPrinting,
                      wxPrintData* data=NULL)
     wxPyPrintPreview(wxPyPrintout* printout,
                      wxPyPrintout* printoutForPrinting,
                      wxPrintData* data=NULL)
@@ -581,10 +596,13 @@ class wxPyPrintPreview : public wxPrintPreview
 {
 public:
     %pythonAppend wxPyPrintPreview   "self._setCallbackInfo(self, PyPrintPreview)"
 {
 public:
     %pythonAppend wxPyPrintPreview   "self._setCallbackInfo(self, PyPrintPreview)"
-
+    %nokwargs wxPyPrintPreview;
+    wxPyPrintPreview(wxPyPrintout* printout,
+                     wxPyPrintout* printoutForPrinting,
+                     wxPrintDialogData* data=NULL);
     wxPyPrintPreview(wxPyPrintout* printout,
                      wxPyPrintout* printoutForPrinting,
     wxPyPrintPreview(wxPyPrintout* printout,
                      wxPyPrintout* printoutForPrinting,
-                     wxPrintData* data=NULL);
+                     wxPrintData* data);
 
     void _setCallbackInfo(PyObject* self, PyObject* _class);
     
 
     void _setCallbackInfo(PyObject* self, PyObject* _class);