]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/gdi.cpp
accept \r as a delimiter when parsing dates (bug 684617)
[wxWidgets.git] / wxPython / src / gtk / gdi.cpp
index 30d9fd97cd3fc5cb7456fb78712181cf286b8a28..430f4145bcc45fcdb06caebaa74eb1cf6211585b 100644 (file)
@@ -7623,6 +7623,8 @@ static PyObject *_wrap_wxDC_GetBoundingBox(PyObject *self, PyObject *args, PyObj
 }
 
 static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject * pyPens) {
+            wxPyBeginBlockThreads();
+
             bool      isFastSeq  = PyList_Check(pyPoints) || PyTuple_Check(pyPoints);
             bool      isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
             int       numObjs = 0;
@@ -7631,6 +7633,7 @@ static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject *
             PyObject* obj;
             int       x1, y1;
             int       i = 0;
+            PyObject* retval;
 
             if (!PySequence_Check(pyPoints)) {
                 goto err0;
@@ -7673,6 +7676,13 @@ static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject *
                         Py_DECREF(obj);
                     goto err0;
                 }
+                if (PyErr_Occurred()) {
+                    retval = NULL;
+                    if (!isFastPens)
+                        Py_DECREF(obj);
+                    goto exit;
+                }
+
 
                 // Now draw the point
                 self->DrawPoint(x1, y1);
@@ -7682,14 +7692,21 @@ static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject *
             }
 
             Py_INCREF(Py_None);
-            return Py_None;
+            retval = Py_None;
+            goto exit;
 
         err1:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
-            return NULL;
+            retval = NULL;
+            goto exit;
         err0:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y) sequences.");
-            return NULL;
+            retval = NULL;
+            goto exit;
+
+        exit:
+            wxPyEndBlockThreads();
+            return retval;
         }
 static PyObject *_wrap_wxDC__DrawPointList(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -7731,6 +7748,8 @@ static PyObject *_wrap_wxDC__DrawPointList(PyObject *self, PyObject *args, PyObj
 }
 
 static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * pyPens) {
+            wxPyBeginBlockThreads();
+
             bool      isFastSeq  = PyList_Check(pyLines) || PyTuple_Check(pyLines);
             bool      isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
             int       numObjs = 0;
@@ -7739,6 +7758,7 @@ static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * py
             PyObject* obj;
             int       x1, y1, x2, y2;
             int       i = 0;
+            PyObject* retval;
 
             if (!PySequence_Check(pyLines)) {
                 goto err0;
@@ -7781,6 +7801,12 @@ static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * py
                         Py_DECREF(obj);
                     goto err0;
                 }
+                if (PyErr_Occurred()) {
+                    retval = NULL;
+                    if (!isFastPens)
+                        Py_DECREF(obj);
+                    goto exit;
+                }
 
                 // Now draw the line
                 self->DrawLine(x1, y1, x2, y2);
@@ -7790,14 +7816,22 @@ static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * py
             }
 
             Py_INCREF(Py_None);
-            return Py_None;
+            retval = Py_None;
+            goto exit;
 
         err1:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
-            return NULL;
+            retval = NULL;
+            goto exit;
+
         err0:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x1,y1, x2,y2) sequences.");
-            return NULL;
+            retval = NULL;
+            goto exit;
+
+        exit:
+            wxPyEndBlockThreads();
+            return retval;
         }
 static PyObject *_wrap_wxDC__DrawLineList(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -9116,6 +9150,50 @@ static PyObject *_wrap_new_wxRegion(PyObject *self, PyObject *args, PyObject *kw
     return _resultobj;
 }
 
+#define new_wxRegionFromPoints(_swigarg0,_swigarg1,_swigarg2) (new wxRegion(_swigarg0,_swigarg1,_swigarg2))
+static PyObject *_wrap_new_wxRegionFromPoints(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxRegion * _result;
+    int  _arg0;
+    wxPoint * _arg1;
+    int  _arg2 = (int ) wxWINDING_RULE;
+    int  NPOINTS;
+    PyObject * _obj1 = 0;
+    char *_kwnames[] = { "points","fillStyle", NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:new_wxRegionFromPoints",_kwnames,&_obj1,&_arg2)) 
+        return NULL;
+    if (_obj1)
+{
+    _arg1 = wxPoint_LIST_helper(_obj1, &NPOINTS);
+       if (_arg1 == NULL) {
+               return NULL;
+       }
+}
+{
+       _arg0 = NPOINTS;
+}
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxRegion *)new_wxRegionFromPoints(_arg0,_arg1,_arg2);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxRegion_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+{
+    delete [] _arg1;
+}
+    return _resultobj;
+}
+
 #define delete_wxRegion(_swigobj) (delete _swigobj)
 static PyObject *_wrap_delete_wxRegion(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -10203,6 +10281,7 @@ static PyMethodDef gdicMethods[] = {
         { "wxRegion_Offset", (PyCFunction) _wrap_wxRegion_Offset, METH_VARARGS | METH_KEYWORDS },
         { "wxRegion_Clear", (PyCFunction) _wrap_wxRegion_Clear, METH_VARARGS | METH_KEYWORDS },
         { "delete_wxRegion", (PyCFunction) _wrap_delete_wxRegion, METH_VARARGS | METH_KEYWORDS },
+        { "new_wxRegionFromPoints", (PyCFunction) _wrap_new_wxRegionFromPoints, METH_VARARGS | METH_KEYWORDS },
         { "new_wxRegion", (PyCFunction) _wrap_new_wxRegion, METH_VARARGS | METH_KEYWORDS },
         { "wxImageList_GetSize", (PyCFunction) _wrap_wxImageList_GetSize, METH_VARARGS | METH_KEYWORDS },
         { "wxImageList_RemoveAll", (PyCFunction) _wrap_wxImageList_RemoveAll, METH_VARARGS | METH_KEYWORDS },