X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fd4be5571cbbbeaa6c4f7dabcc2ba69fe1e3471..05fd1c9e8e20e959f894ecc300ee40232de38377:/wxPython/src/mac/gdi_wrap.cpp?ds=sidebyside diff --git a/wxPython/src/mac/gdi_wrap.cpp b/wxPython/src/mac/gdi_wrap.cpp index a8afe0e559..9d26d712be 100644 --- a/wxPython/src/mac/gdi_wrap.cpp +++ b/wxPython/src/mac/gdi_wrap.cpp @@ -279,8 +279,8 @@ static swig_type_info *swig_types[56]; #include "wx/wxPython/wxPython.h" #include "wx/wxPython/pyclasses.h" - DECLARE_DEF_STRING(EmptyString); + static const wxString wxPyEmptyString(wxEmptyString); PyObject *wxColour_Get(wxColour *self){ PyObject* rv = PyTuple_New(3); int red = -1; @@ -454,7 +454,7 @@ wxCursor *new_wxCursor(PyObject *bits,int width,int height,int hotSpotX,int hotS wxRegion *new_wxRegion(int points,wxPoint *points_array,int fillStyle){ - PyErr_SetNone(PyExc_NotImplementedError); + wxPyRaiseNotImplemented(); return NULL; } void wxRegionIterator_Next(wxRegionIterator *self){ @@ -579,13 +579,13 @@ static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) { class wxMetaFile : public wxObject { public: wxMetaFile(const wxString&) - { PyErr_SetNone(PyExc_NotImplementedError); } + { wxPyRaiseNotImplemented(); } }; class wxMetaFileDC : public wxClientDC { public: wxMetaFileDC(const wxString&, int, int, const wxString&) - { PyErr_SetNone(PyExc_NotImplementedError); } + { wxPyRaiseNotImplemented(); } }; @@ -3245,6 +3245,7 @@ static PyObject *_wrap_new_IconLocation(PyObject *self, PyObject *args, PyObject wxString *arg1 = (wxString *) &wxPyEmptyString ; int arg2 = (int) 0 ; wxIconLocation *result; + bool temp1 = False ; PyObject * obj0 = 0 ; char *kwnames[] = { (char *) "filename",(char *) "num", NULL @@ -3252,7 +3253,11 @@ static PyObject *_wrap_new_IconLocation(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|Oi:new_IconLocation",kwnames,&obj0,&arg2)) goto fail; if (obj0) { - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxString,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + arg1 = wxString_in_helper(obj0); + if (arg1 == NULL) SWIG_fail; + temp1 = True; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -3262,8 +3267,16 @@ static PyObject *_wrap_new_IconLocation(PyObject *self, PyObject *args, PyObject if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxIconLocation, 1); + { + if (temp1) + delete arg1; + } return resultobj; fail: + { + if (temp1) + delete arg1; + } return NULL; } @@ -3681,13 +3694,18 @@ static PyObject *_wrap_new_Cursor(PyObject *self, PyObject *args, PyObject *kwar int arg3 = (int) 0 ; int arg4 = (int) 0 ; wxCursor *result; + bool temp1 = False ; PyObject * obj0 = 0 ; char *kwnames[] = { (char *) "cursorName",(char *) "flags",(char *) "hotSpotX",(char *) "hotSpotY", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"Ol|ii:new_Cursor",kwnames,&obj0,&arg2,&arg3,&arg4)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxString,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + arg1 = wxString_in_helper(obj0); + if (arg1 == NULL) SWIG_fail; + temp1 = True; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxCursor *)new_wxCursor((wxString const *)arg1,arg2,arg3,arg4); @@ -3696,8 +3714,16 @@ static PyObject *_wrap_new_Cursor(PyObject *self, PyObject *args, PyObject *kwar if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxCursor, 1); + { + if (temp1) + delete arg1; + } return resultobj; fail: + { + if (temp1) + delete arg1; + } return NULL; } @@ -5599,7 +5625,8 @@ static PyObject * NativeFontInfo_swigregister(PyObject *self, PyObject *args) { static PyObject *_wrap_NativeEncodingInfo_facename_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxNativeEncodingInfo *arg1 = (wxNativeEncodingInfo *) 0 ; - wxString arg2 ; + wxString *arg2 = (wxString *) 0 ; + bool temp2 = False ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { @@ -5609,16 +5636,23 @@ static PyObject *_wrap_NativeEncodingInfo_facename_set(PyObject *self, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:NativeEncodingInfo_facename_set",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxNativeEncodingInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { - wxString* sptr = wxString_in_helper(obj1); - if (sptr == NULL) SWIG_fail; - arg2 = *sptr; - delete sptr; + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; } - if (arg1) (arg1)->facename = arg2; + if (arg1) (arg1)->facename = *arg2; Py_INCREF(Py_None); resultobj = Py_None; + { + if (temp2) + delete arg2; + } return resultobj; fail: + { + if (temp2) + delete arg2; + } return NULL; } @@ -5626,7 +5660,7 @@ static PyObject *_wrap_NativeEncodingInfo_facename_set(PyObject *self, PyObject static PyObject *_wrap_NativeEncodingInfo_facename_get(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxNativeEncodingInfo *arg1 = (wxNativeEncodingInfo *) 0 ; - wxString result; + wxString *result; PyObject * obj0 = 0 ; char *kwnames[] = { (char *) "self", NULL @@ -5634,13 +5668,13 @@ static PyObject *_wrap_NativeEncodingInfo_facename_get(PyObject *self, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:NativeEncodingInfo_facename_get",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxNativeEncodingInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - result = ((arg1)->facename); + result = (wxString *)& ((arg1)->facename); { #if wxUSE_UNICODE - resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); #else - resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); #endif } return resultobj; @@ -7701,7 +7735,8 @@ static PyObject *_wrap_LanguageInfo_Language_get(PyObject *self, PyObject *args, static PyObject *_wrap_LanguageInfo_CanonicalName_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxLanguageInfo *arg1 = (wxLanguageInfo *) 0 ; - wxString arg2 ; + wxString *arg2 = (wxString *) 0 ; + bool temp2 = False ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { @@ -7711,16 +7746,23 @@ static PyObject *_wrap_LanguageInfo_CanonicalName_set(PyObject *self, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:LanguageInfo_CanonicalName_set",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxLanguageInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { - wxString* sptr = wxString_in_helper(obj1); - if (sptr == NULL) SWIG_fail; - arg2 = *sptr; - delete sptr; + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; } - if (arg1) (arg1)->CanonicalName = arg2; + if (arg1) (arg1)->CanonicalName = *arg2; Py_INCREF(Py_None); resultobj = Py_None; + { + if (temp2) + delete arg2; + } return resultobj; fail: + { + if (temp2) + delete arg2; + } return NULL; } @@ -7728,7 +7770,7 @@ static PyObject *_wrap_LanguageInfo_CanonicalName_set(PyObject *self, PyObject * static PyObject *_wrap_LanguageInfo_CanonicalName_get(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxLanguageInfo *arg1 = (wxLanguageInfo *) 0 ; - wxString result; + wxString *result; PyObject * obj0 = 0 ; char *kwnames[] = { (char *) "self", NULL @@ -7736,13 +7778,13 @@ static PyObject *_wrap_LanguageInfo_CanonicalName_get(PyObject *self, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:LanguageInfo_CanonicalName_get",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxLanguageInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - result = ((arg1)->CanonicalName); + result = (wxString *)& ((arg1)->CanonicalName); { #if wxUSE_UNICODE - resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); #else - resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); #endif } return resultobj; @@ -7754,7 +7796,8 @@ static PyObject *_wrap_LanguageInfo_CanonicalName_get(PyObject *self, PyObject * static PyObject *_wrap_LanguageInfo_Description_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxLanguageInfo *arg1 = (wxLanguageInfo *) 0 ; - wxString arg2 ; + wxString *arg2 = (wxString *) 0 ; + bool temp2 = False ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { @@ -7764,16 +7807,23 @@ static PyObject *_wrap_LanguageInfo_Description_set(PyObject *self, PyObject *ar if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:LanguageInfo_Description_set",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxLanguageInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { - wxString* sptr = wxString_in_helper(obj1); - if (sptr == NULL) SWIG_fail; - arg2 = *sptr; - delete sptr; + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; } - if (arg1) (arg1)->Description = arg2; + if (arg1) (arg1)->Description = *arg2; Py_INCREF(Py_None); resultobj = Py_None; + { + if (temp2) + delete arg2; + } return resultobj; fail: + { + if (temp2) + delete arg2; + } return NULL; } @@ -7781,7 +7831,7 @@ static PyObject *_wrap_LanguageInfo_Description_set(PyObject *self, PyObject *ar static PyObject *_wrap_LanguageInfo_Description_get(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxLanguageInfo *arg1 = (wxLanguageInfo *) 0 ; - wxString result; + wxString *result; PyObject * obj0 = 0 ; char *kwnames[] = { (char *) "self", NULL @@ -7789,13 +7839,13 @@ static PyObject *_wrap_LanguageInfo_Description_get(PyObject *self, PyObject *ar if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:LanguageInfo_Description_get",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxLanguageInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - result = ((arg1)->Description); + result = (wxString *)& ((arg1)->Description); { #if wxUSE_UNICODE - resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); #else - resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); #endif } return resultobj;