]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/drawlist.cpp
Added autoconf makefiles for FoldBar extended samples
[wxWidgets.git] / wxPython / src / drawlist.cpp
index c1274809ea29a509bdd9e13ae02f79616b0a2039..c89342ac84dd5d0ee4186e24824872dc08eb2b7c 100644 (file)
@@ -30,7 +30,7 @@ void wxPyDrawList_SetAPIPtr()
 PyObject* wxPyDrawXXXList(wxDC& dc, wxPyDrawListOp_t doDraw,
                           PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
 {
 PyObject* wxPyDrawXXXList(wxDC& dc, wxPyDrawListOp_t doDraw,
                           PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
 {
-    bool blocked = wxPyBeginBlockThreads(); 
+    wxPyBlock_t blocked = wxPyBeginBlockThreads(); 
 
     bool      isFastSeq  = PyList_Check(pyCoords) || PyTuple_Check(pyCoords);
     bool      isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
 
     bool      isFastSeq  = PyList_Check(pyCoords) || PyTuple_Check(pyCoords);
     bool      isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
@@ -150,10 +150,10 @@ bool wxPyDrawXXXPoint(wxDC& dc, PyObject* coords)
 
     if (! wxPy2int_seq_helper(coords, &x, &y)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y) sequences.");
 
     if (! wxPy2int_seq_helper(coords, &x, &y)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y) sequences.");
-        return False;
+        return false;
     }
     dc.DrawPoint(x, y);
     }
     dc.DrawPoint(x, y);
-    return True;
+    return true;
 }
 
 bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords)
 }
 
 bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords)
@@ -162,10 +162,10 @@ bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords)
 
     if (! wxPy4int_seq_helper(coords, &x1, &y1, &x2, &y2)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x1,y1, x1,y2) sequences.");
 
     if (! wxPy4int_seq_helper(coords, &x1, &y1, &x2, &y2)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x1,y1, x1,y2) sequences.");
-        return False;
+        return false;
     }
     dc.DrawLine(x1,y1, x2,y2);
     }
     dc.DrawLine(x1,y1, x2,y2);
-    return True;
+    return true;
 }
 
 bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords)
 }
 
 bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords)
@@ -174,10 +174,10 @@ bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords)
 
     if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y, w,h) sequences.");
 
     if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y, w,h) sequences.");
-        return False;
+        return false;
     }
     dc.DrawRectangle(x, y, w, h);
     }
     dc.DrawRectangle(x, y, w, h);
-    return True;
+    return true;
 }
 
 bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords)
 }
 
 bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords)
@@ -186,10 +186,10 @@ bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords)
 
     if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y, w,h) sequences.");
 
     if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y, w,h) sequences.");
-        return False;
+        return false;
     }
     dc.DrawEllipse(x, y, w, h);
     }
     dc.DrawEllipse(x, y, w, h);
-    return True;
+    return true;
 }
 
 
 }
 
 
@@ -201,11 +201,11 @@ bool wxPyDrawXXXPolygon(wxDC& dc, PyObject* coords)
     points = wxPoint_LIST_helper(coords, &numPoints);
     if (! points) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of sequences of (x,y) sequences.");
     points = wxPoint_LIST_helper(coords, &numPoints);
     if (! points) {
         PyErr_SetString(PyExc_TypeError, "Expected a sequence of sequences of (x,y) sequences.");
-        return False;
+        return false;
     }
     dc.DrawPolygon(numPoints, points);
     delete [] points;
     }
     dc.DrawPolygon(numPoints, points);
     delete [] points;
-    return True;
+    return true;
 }
 
 
 }
 
 
@@ -215,7 +215,7 @@ bool wxPyDrawXXXPolygon(wxDC& dc, PyObject* coords)
 
 PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyObject* foregroundList, PyObject* backgroundList)
 {
 
 PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyObject* foregroundList, PyObject* backgroundList)
 {
-    bool blocked = wxPyBeginBlockThreads();
+    wxPyBlock_t blocked = wxPyBeginBlockThreads();
 
     bool      isFastSeq  = PyList_Check(pyPoints) || PyTuple_Check(pyPoints);
     bool      isFastText = PyList_Check(textList) || PyTuple_Check(textList);
 
     bool      isFastSeq  = PyList_Check(pyPoints) || PyTuple_Check(pyPoints);
     bool      isFastText = PyList_Check(textList) || PyTuple_Check(textList);
@@ -258,7 +258,7 @@ PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyO
             else {
                 obj = PySequence_GetItem(textList, i);
             }
             else {
                 obj = PySequence_GetItem(textList, i);
             }
-            if (! PyString_Check(obj) ) {
+            if (! PyString_Check(obj) && !PyUnicode_Check(obj) ) {
                 Py_DECREF(obj);
                 goto err1;
             }
                 Py_DECREF(obj);
                 goto err1;
             }