]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_printfw.i
reSWIGged
[wxWidgets.git] / wxPython / src / _printfw.i
index 140a336d846fcecdbff80c1df8f8caeb2915ec44..afe09dbd29cc619fc80f4cbc782047b59fdec930 100644 (file)
@@ -40,7 +40,10 @@ enum wxPrintMode
 
 class wxPrintData : public wxObject {
 public:
+    %nokwargs wxPrintData;
     wxPrintData();
+    wxPrintData(const wxPrintData& data);  // for making copies
+    
     ~wxPrintData();
 
     int GetNoCopies();
@@ -103,7 +106,9 @@ public:
 
 class wxPageSetupDialogData : public wxObject {
 public:
+    %nokwargs wxPageSetupDialogData;
     wxPageSetupDialogData();
+    wxPageSetupDialogData(const wxPageSetupDialogData& data);  // for making copies
     ~wxPageSetupDialogData();
 
     void EnableHelp(bool flag);
@@ -149,6 +154,8 @@ public:
 
 
 
+MustHaveApp(wxPageSetupDialog);
+
 class wxPageSetupDialog : public wxDialog {
 public:
     %pythonAppend wxPageSetupDialog         "self._setOORInfo(self)"
@@ -164,7 +171,9 @@ public:
 
 class wxPrintDialogData : public wxObject {
 public:
+    %nokwargs wxPrintDialogData;
     wxPrintDialogData();
+    wxPrintDialogData(const wxPrintData& printData);  // for making copies
     ~wxPrintDialogData();
 
     int GetFromPage() const;
@@ -215,6 +224,8 @@ public:
 };
 
 
+MustHaveApp(wxPrintDialog);
+
 class wxPrintDialog : public wxDialog {
 public:
     %pythonAppend wxPrintDialog         "self._setOORInfo(self)"
@@ -241,6 +252,8 @@ enum wxPrinterError
 };
 
 
+MustHaveApp(wxPrinter);
+
 class wxPrinter : public wxObject {
 public:
     wxPrinter(wxPrintDialogData* data = NULL);
@@ -268,7 +281,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p
     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) {
@@ -299,7 +312,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p
         }
         Py_DECREF(result);
     }
-    wxPyEndBlockThreads();
+    wxPyEndBlockThreads(blocked);
     if (! found)
         wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
 }
@@ -321,6 +334,8 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage);
 %}
 
 
+MustHaveApp(wxPyPrintout);
+
 // Now define the custom class for SWIGging
 %name(Printout) class wxPyPrintout  : public wxObject {
 public:
@@ -375,6 +390,8 @@ public:
 
 
 
+MustHaveApp(wxPreviewCanvas);
+
 class wxPreviewCanvas: public wxScrolledWindow
 {
 public:
@@ -389,6 +406,8 @@ public:
 };
 
 
+MustHaveApp(wxPreviewFrame);
+
 class wxPreviewFrame : public wxFrame {
 public:
     %pythonAppend wxPreviewFrame   "self._setOORInfo(self)"
@@ -428,6 +447,8 @@ enum {
     wxID_PREVIEW_GOTO
 };
 
+MustHaveApp(wxPreviewControlBar);
+
 class wxPreviewControlBar: public wxPanel
 {
 public:
@@ -456,11 +477,17 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxPrintPreview);
+
 class wxPrintPreview : public wxObject {
 public:
+    %nokwargs wxPrintPreview;
     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();
@@ -521,7 +548,7 @@ public:
     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);                              \
@@ -529,7 +556,7 @@ public:
             Py_DECREF(win);                                                     \
             Py_DECREF(dc);                                                      \
         }                                                                       \
-        wxPyEndBlockThreads();                                                  \
+        wxPyEndBlockThreads(blocked);                                                  \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
@@ -545,6 +572,11 @@ class wxPyPrintPreview : public wxPrintPreview
 {
     DECLARE_CLASS(wxPyPrintPreview)
 public:
+    wxPyPrintPreview(wxPyPrintout* printout,
+                     wxPyPrintout* printoutForPrinting,
+                     wxPrintDialogData* data=NULL)
+        : wxPrintPreview(printout, printoutForPrinting, data)
+    {}
     wxPyPrintPreview(wxPyPrintout* printout,
                      wxPyPrintout* printoutForPrinting,
                      wxPrintData* data=NULL)
@@ -581,14 +613,19 @@ IMP_PYCALLBACK_VOID_        (wxPyPrintPreview, wxPrintPreview, DetermineScaling)
 %}
 
 
+MustHaveApp(wxPyPrintPreview);
+
 class wxPyPrintPreview : public wxPrintPreview
 {
 public:
     %pythonAppend wxPyPrintPreview   "self._setCallbackInfo(self, PyPrintPreview)"
-
+    %nokwargs wxPyPrintPreview;
+    wxPyPrintPreview(wxPyPrintout* printout,
+                     wxPyPrintout* printoutForPrinting,
+                     wxPrintDialogData* data=NULL);
     wxPyPrintPreview(wxPyPrintout* printout,
                      wxPyPrintout* printoutForPrinting,
-                     wxPrintData* data=NULL);
+                     wxPrintData* data);
 
     void _setCallbackInfo(PyObject* self, PyObject* _class);
     
@@ -636,6 +673,8 @@ IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateControlBar);
 %}
 
 
+MustHaveApp(wxPyPreviewFrame);
+
 class wxPyPreviewFrame : public wxPreviewFrame
 {
 public:
@@ -690,6 +729,8 @@ IMP_PYCALLBACK_VOID_INT(wxPyPreviewControlBar, wxPreviewControlBar, SetZoomContr
 %}
 
 
+MustHaveApp(wxPyPreviewControlBar);
+
 class wxPyPreviewControlBar : public wxPreviewControlBar
 {
 public: