X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c368d904fc27d35ae1e533155e2154dc496432e4..331a33a1bc4f5a9f3d34acaae47f12e06fd6f57a:/wxPython/src/msw/gdi.cpp diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index 450ae3ea02..6f87090c25 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -63,12 +64,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -85,29 +86,31 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; } static char* wxStringErrorMsg = "string type is required for parameter"; + + static wxString wxPyEmptyStr(""); // Alternate 'constructor' wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1) { return new wxBitmap(width, height, depth); @@ -370,11 +373,22 @@ static PyObject *_wrap_wxNamedColour(PyObject *self, PyObject *args, PyObject *k if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNamedColour",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1072,11 +1086,22 @@ static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:new_wxBitmap",_kwnames,&_obj0,&_arg1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1214,11 +1239,22 @@ static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1257,11 +1293,22 @@ static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } @@ -1851,11 +1898,22 @@ static PyObject *_wrap_new_wxIcon(PyObject *self, PyObject *args, PyObject *kwar if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:new_wxIcon",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1925,11 +1983,22 @@ static PyObject *_wrap_wxIcon_LoadFile(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2242,11 +2311,22 @@ static PyObject *_wrap_new_wxCursor(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:new_wxCursor",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2881,11 +2961,22 @@ static PyObject *_wrap_wxFont_SetFaceName(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4829,11 +4920,22 @@ static PyObject *_wrap_wxDC_DrawRotatedText(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4951,11 +5053,22 @@ static PyObject *_wrap_wxDC_DrawText(PyObject *self, PyObject *args, PyObject *k } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5689,11 +5802,22 @@ static PyObject *_wrap_wxDC_GetTextExtent(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5761,11 +5885,22 @@ static PyObject *_wrap_wxDC_GetFullTextExtent(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } @@ -6640,11 +6775,22 @@ static PyObject *_wrap_wxDC_StartDoc(PyObject *self, PyObject *args, PyObject *k } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -7374,82 +7520,6 @@ static PyObject *_wrap_new_wxWindowDC(PyObject *self, PyObject *args, PyObject * return _resultobj; } -static void *SwigwxPrinterDCTowxDC(void *ptr) { - wxPrinterDC *src; - wxDC *dest; - src = (wxPrinterDC *) ptr; - dest = (wxDC *) src; - return (void *) dest; -} - -#define new_wxPrinterDC(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4) (new wxPrinterDC(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4)) -static PyObject *_wrap_new_wxPrinterDC(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxPrinterDC * _result; - wxString * _arg0; - wxString * _arg1; - wxString * _arg2; - bool _arg3 = (bool ) TRUE; - int _arg4 = (int ) wxPORTRAIT; - PyObject * _obj0 = 0; - PyObject * _obj1 = 0; - PyObject * _obj2 = 0; - int tempbool3 = (int) TRUE; - char *_kwnames[] = { "driver","device","output","interactive","orientation", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|ii:new_wxPrinterDC",_kwnames,&_obj0,&_obj1,&_obj2,&tempbool3,&_arg4)) - return NULL; -{ - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); -} -{ - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); -} -{ - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); -} - _arg3 = (bool ) tempbool3; -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPrinterDC *)new_wxPrinterDC(*_arg0,*_arg1,*_arg2,_arg3,_arg4); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxPrinterDC_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } -{ - if (_obj0) - delete _arg0; -} -{ - if (_obj1) - delete _arg1; -} -{ - if (_obj2) - delete _arg2; -} - return _resultobj; -} - static void *SwigwxMetaFileDCTowxDC(void *ptr) { wxMetaFileDC *src; wxDC *dest; @@ -7472,11 +7542,22 @@ static PyObject *_wrap_new_wxMetaFileDC(PyObject *self, PyObject *args, PyObject return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -8157,7 +8238,6 @@ static PyMethodDef gdicMethods[] = { { "new_wxPalette", (PyCFunction) _wrap_new_wxPalette, METH_VARARGS | METH_KEYWORDS }, { "wxMetaFileDC_Close", (PyCFunction) _wrap_wxMetaFileDC_Close, METH_VARARGS | METH_KEYWORDS }, { "new_wxMetaFileDC", (PyCFunction) _wrap_new_wxMetaFileDC, METH_VARARGS | METH_KEYWORDS }, - { "new_wxPrinterDC", (PyCFunction) _wrap_new_wxPrinterDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxWindowDC", (PyCFunction) _wrap_new_wxWindowDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxPaintDC", (PyCFunction) _wrap_new_wxPaintDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxClientDC", (PyCFunction) _wrap_new_wxClientDC, METH_VARARGS | METH_KEYWORDS }, @@ -8393,8 +8473,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxAcceleratorTable","_wxAcceleratorTable",0}, { "_wxDC","_class_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, { "_wxDC","_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, - { "_wxDC","_class_wxPrinterDC",SwigwxPrinterDCTowxDC}, - { "_wxDC","_wxPrinterDC",SwigwxPrinterDCTowxDC}, { "_wxDC","_class_wxWindowDC",SwigwxWindowDCTowxDC}, { "_wxDC","_wxWindowDC",SwigwxWindowDCTowxDC}, { "_wxDC","_class_wxPaintDC",SwigwxPaintDCTowxDC}, @@ -8414,7 +8492,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_wxWindowID",0}, { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMask","_wxMask",0}, { "_wxColour","_class_wxColour",0}, { "_wxBrush","_class_wxBrush",0}, @@ -8443,8 +8520,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRect","_wxRect",0}, { "_class_wxDC","_class_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, { "_class_wxDC","_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, - { "_class_wxDC","_class_wxPrinterDC",SwigwxPrinterDCTowxDC}, - { "_class_wxDC","_wxPrinterDC",SwigwxPrinterDCTowxDC}, { "_class_wxDC","_class_wxWindowDC",SwigwxWindowDCTowxDC}, { "_class_wxDC","_wxWindowDC",SwigwxWindowDCTowxDC}, { "_class_wxDC","_class_wxPaintDC",SwigwxPaintDCTowxDC}, @@ -8525,7 +8600,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_size_t",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxLayoutConstraints","_wxLayoutConstraints",0}, { "_class_wxIcon","_wxIcon",0},