X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cdf14688f51fa5a242df70f86c7af229fe64fd4f..73c13bb93c2eaeb89498d887764d4ffc5c0f5a6e:/wxPython/src/msw/printfw.cpp diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp index 439051fe69..2b13f4c4f0 100644 --- a/wxPython/src/msw/printfw.cpp +++ b/wxPython/src/msw/printfw.cpp @@ -91,7 +91,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { #if PYTHON_API_VERSION >= 1009 static char* wxStringErrorMsg = "String or Unicode type required"; #else - static char* wxStringErrorMsg = "string type is required for parameter"; + static char* wxStringErrorMsg = "String type required"; #endif @@ -99,9 +99,10 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { // 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; @@ -131,10 +132,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) { @@ -2641,11 +2641,11 @@ static void *SwigwxPageSetupDialogTowxDialog(void *ptr) { return (void *) dest; } -static void *SwigwxPageSetupDialogTowxPanel(void *ptr) { +static void *SwigwxPageSetupDialogTowxTopLevelWindow(void *ptr) { wxPageSetupDialog *src; - wxPanel *dest; + wxTopLevelWindow *dest; src = (wxPageSetupDialog *) ptr; - dest = (wxPanel *) src; + dest = (wxTopLevelWindow *) src; return (void *) dest; } @@ -3511,11 +3511,11 @@ static void *SwigwxPrintDialogTowxDialog(void *ptr) { return (void *) dest; } -static void *SwigwxPrintDialogTowxPanel(void *ptr) { +static void *SwigwxPrintDialogTowxTopLevelWindow(void *ptr) { wxPrintDialog *src; - wxPanel *dest; + wxTopLevelWindow *dest; src = (wxPrintDialog *) ptr; - dest = (wxPanel *) src; + dest = (wxTopLevelWindow *) src; return (void *) dest; } @@ -3714,8 +3714,8 @@ static PyObject *_wrap_new_wxPrintout(PyObject *self, PyObject *args, PyObject * return _resultobj; } -#define wxPrintout__setSelf(_swigobj,_swigarg0,_swigarg1) (_swigobj->_setSelf(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxPrintout__setSelf(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxPrintout__setCallbackInfo(_swigobj,_swigarg0,_swigarg1) (_swigobj->_setCallbackInfo(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxPrintout__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxPyPrintout * _arg0; PyObject * _arg1; @@ -3726,12 +3726,12 @@ static PyObject *_wrap_wxPrintout__setSelf(PyObject *self, PyObject *args, PyObj char *_kwnames[] = { "self","self","_class", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxPrintout__setSelf",_kwnames,&_argo0,&_obj1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxPrintout__setCallbackInfo",_kwnames,&_argo0,&_obj1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyPrintout_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPrintout__setSelf. Expected _wxPyPrintout_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPrintout__setCallbackInfo. Expected _wxPyPrintout_p."); return NULL; } } @@ -3743,7 +3743,7 @@ static PyObject *_wrap_wxPrintout__setSelf(PyObject *self, PyObject *args, PyObj } { wxPy_BEGIN_ALLOW_THREADS; - wxPrintout__setSelf(_arg0,_arg1,_arg2); + wxPrintout__setCallbackInfo(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -5145,6 +5145,14 @@ static void *SwigwxPreviewFrameTowxFrame(void *ptr) { return (void *) dest; } +static void *SwigwxPreviewFrameTowxTopLevelWindow(void *ptr) { + wxPreviewFrame *src; + wxTopLevelWindow *dest; + src = (wxPreviewFrame *) ptr; + dest = (wxTopLevelWindow *) src; + return (void *) dest; +} + static void *SwigwxPreviewFrameTowxWindow(void *ptr) { wxPreviewFrame *src; wxWindow *dest; @@ -5327,7 +5335,7 @@ static PyMethodDef printfwcMethods[] = { { "wxPrintout_GetPageSizeMM", (PyCFunction) _wrap_wxPrintout_GetPageSizeMM, METH_VARARGS | METH_KEYWORDS }, { "wxPrintout_GetDC", (PyCFunction) _wrap_wxPrintout_GetDC, METH_VARARGS | METH_KEYWORDS }, { "wxPrintout_Destroy", (PyCFunction) _wrap_wxPrintout_Destroy, METH_VARARGS | METH_KEYWORDS }, - { "wxPrintout__setSelf", (PyCFunction) _wrap_wxPrintout__setSelf, METH_VARARGS | METH_KEYWORDS }, + { "wxPrintout__setCallbackInfo", (PyCFunction) _wrap_wxPrintout__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxPrintout", (PyCFunction) _wrap_new_wxPrintout, METH_VARARGS | METH_KEYWORDS }, { "wxPrintDialog_ShowModal", (PyCFunction) _wrap_wxPrintDialog_ShowModal, METH_VARARGS | METH_KEYWORDS }, { "wxPrintDialog_GetPrintDC", (PyCFunction) _wrap_wxPrintDialog_GetPrintDC, METH_VARARGS | METH_KEYWORDS }, @@ -5464,8 +5472,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_int",0}, { "_size_t","_wxWindowID",0}, { "_size_t","_uint",0}, - { "_wxPanel","_wxPrintDialog",SwigwxPrintDialogTowxPanel}, - { "_wxPanel","_wxPageSetupDialog",SwigwxPageSetupDialogTowxPanel}, + { "_wxTopLevelWindow","_wxPreviewFrame",SwigwxPreviewFrameTowxTopLevelWindow}, + { "_wxTopLevelWindow","_wxPrintDialog",SwigwxPrintDialogTowxTopLevelWindow}, + { "_wxTopLevelWindow","_wxPageSetupDialog",SwigwxPageSetupDialogTowxTopLevelWindow}, { "_uint","_wxCoord",0}, { "_uint","_wxPrintQuality",0}, { "_uint","_time_t",0},