X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02376d73485f39cc05721e5ea95e43cd48105fd5..3c8ad70ad4de074ff95b5e3629ebc272551921c0:/wxPython/src/_gdicmn.i diff --git a/wxPython/src/_gdicmn.i b/wxPython/src/_gdicmn.i index efe789a039..5ccbf5d5ba 100644 --- a/wxPython/src/_gdicmn.i +++ b/wxPython/src/_gdicmn.i @@ -130,6 +130,11 @@ public: ~wxSize(); +// %extend { +// bool __eq__(const wxSize* other) { return other ? (*self == *other) : False; } +// bool __ne__(const wxSize* other) { return other ? (*self != *other) : True; } +// } + DocDeclStr( bool, operator==(const wxSize& sz), "Test for equality of wx.Size objects."); @@ -173,11 +178,11 @@ public: "Get() -> (width,height)", "Returns the width and height properties as a tuple."); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -246,11 +251,11 @@ public: "Get() -> (x,y)", "Return the x and y properties as a tuple. "); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -301,11 +306,18 @@ public: bool, operator!=(const wxPoint& pt), "Test for inequality of wx.Point objects."); + + +// %nokwargs operator+; +// %nokwargs operator-; +// %nokwargs operator+=; +// %nokwargs operator-=; DocDeclStr( wxPoint, operator+(const wxPoint& pt), "Add pt's proprties to this and return the result."); + DocDeclStr( wxPoint, operator-(const wxPoint& pt), "Subtract pt's proprties from this and return the result"); @@ -319,6 +331,27 @@ public: wxPoint&, operator-=(const wxPoint& pt), "Subtract pt from this object."); + + +// DocDeclStr( +// wxPoint, operator+(const wxSize& sz), +// "Add sz to this Point and return the result."); + +// DocDeclStr( +// wxPoint, operator-(const wxSize& sz), +// "Subtract sz from this Point and return the result"); + + +// DocDeclStr( +// wxPoint&, operator+=(const wxSize& sz), +// "Add sz to this object."); + +// DocDeclStr( +// wxPoint&, operator-=(const wxSize& sz), +// "Subtract sz from this object."); + + + %extend { DocStr(Set, "Set both the x and y properties"); @@ -331,11 +364,11 @@ public: "Get() -> (x,y)", "Return the x and y properties as a tuple. "); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -499,13 +532,13 @@ public: "Get() -> (x,y,width,height)", "Return the rectangle properties as a tuple."); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(4); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width)); PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -543,10 +576,10 @@ DocAStr(wxIntersectRect, dest = reg1.GetBox(); if (dest != wxRect(0,0,0,0)) { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); wxRect* newRect = new wxRect(dest); obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), True); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return obj; } Py_INCREF(Py_None); @@ -630,11 +663,11 @@ public: "Get() -> (x,y)", "Return x and y properties as a tuple."); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->m_y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } }