]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/gdi_wrap.cpp
applied patch 890642: wxRE_ADVANCED flag and docs
[wxWidgets.git] / wxPython / src / gtk / gdi_wrap.cpp
index 1bd91967b76eb86bdff142d84a44c3b43e17e122..304aa102bb5674b22e1861a77bb360fe927597d4 100644 (file)
@@ -416,6 +416,8 @@ PyObject *wxPen_GetDashes(wxPen *self){
             wxPyEndBlockThreads();
             return retval;
         }
+bool wxPen___eq__(wxPen *self,wxPen const *other){ return other ? (*self == *other) : False; }
+bool wxPen___ne__(wxPen *self,wxPen const *other){ return other ? (*self != *other) : True;  }
 
 wxPyPen::~wxPyPen()
 {
@@ -477,6 +479,12 @@ void wxBitmap_SetMaskColour(wxBitmap *self,wxColour const &colour){
             wxMask *mask = new wxMask(*self, colour);
             self->SetMask(mask);
         }
+wxMask *new_wxMask(wxBitmap const &bitmap,wxColour const &colour){
+            if ( !colour.Ok() )
+                return new wxMask(bitmap, *wxBLACK);
+            else
+                return new wxMask(bitmap, colour);
+        }
 
 #include <wx/iconbndl.h>
 
@@ -591,6 +599,8 @@ wxFont *new_wxFont(wxString const &info){
 wxFont *new_wxFont(int pointSize,wxFontFamily family,int flags,wxString const &face,wxFontEncoding encoding){
             return wxFont::New(pointSize, family, flags, face, encoding);
         }
+bool wxFont___eq__(wxFont *self,wxFont const *other){ return other ? (*self == *other) : False; }
+bool wxFont___ne__(wxFont *self,wxFont const *other){ return other ? (*self != *other) : True;  }
 
 class wxPyFontEnumerator : public wxFontEnumerator {
 public:
@@ -656,6 +666,11 @@ wxRect wxDC_GetClippingRect(wxDC *self){
             self->GetClippingBox(rect);
             return rect;
         }
+wxArrayInt wxDC_GetPartialTextExtents(wxDC *self,wxString const &text){
+            wxArrayInt widths;
+            self->GetPartialTextExtents(text, widths);
+            return widths;
+        }
 PyObject *wxDC__DrawPointList(wxDC *self,PyObject *pyCoords,PyObject *pyPens,PyObject *pyBrushes){
             return wxPyDrawXXXList(*self, wxPyDrawXXXPoint, pyCoords, pyPens, pyBrushes);
         }
@@ -1925,23 +1940,48 @@ static PyObject *_wrap_Pen_GetDashes(PyObject *self, PyObject *args, PyObject *k
 static PyObject *_wrap_Pen___eq__(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPen *arg1 = (wxPen *) 0 ;
-    wxPen *arg2 = 0 ;
+    wxPen *arg2 = (wxPen *) 0 ;
     bool result;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
-        (char *) "self",(char *) "pen", NULL 
+        (char *) "self",(char *) "other", NULL 
     };
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Pen___eq__",kwnames,&obj0,&obj1)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    if (arg2 == NULL) {
-        PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; 
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)wxPen___eq__(arg1,(wxPen const *)arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
     }
+    resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
+static PyObject *_wrap_Pen___ne__(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPen *arg1 = (wxPen *) 0 ;
+    wxPen *arg2 = (wxPen *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "other", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Pen___ne__",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+    if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (bool)((wxPen const *)arg1)->operator ==((wxPen const &)*arg2);
+        result = (bool)wxPen___ne__(arg1,(wxPen const *)arg2);
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
@@ -3086,35 +3126,8 @@ static PyObject * Bitmap_swigregister(PyObject *self, PyObject *args) {
 static PyObject *_wrap_new_Mask(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxBitmap *arg1 = 0 ;
-    wxMask *result;
-    PyObject * obj0 = 0 ;
-    char *kwnames[] = {
-        (char *) "bitmap", NULL 
-    };
-    
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_Mask",kwnames,&obj0)) goto fail;
-    if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxBitmap,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    if (arg1 == NULL) {
-        PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; 
-    }
-    {
-        PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (wxMask *)new wxMask((wxBitmap const &)*arg1);
-        
-        wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
-    }
-    resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxMask, 1);
-    return resultobj;
-    fail:
-    return NULL;
-}
-
-
-static PyObject *_wrap_new_MaskColour(PyObject *self, PyObject *args, PyObject *kwargs) {
-    PyObject *resultobj;
-    wxBitmap *arg1 = 0 ;
-    wxColour *arg2 = 0 ;
+    wxColour const &arg2_defvalue = wxNullColour ;
+    wxColour *arg2 = (wxColour *) &arg2_defvalue ;
     wxMask *result;
     wxColour temp2 ;
     PyObject * obj0 = 0 ;
@@ -3123,18 +3136,20 @@ static PyObject *_wrap_new_MaskColour(PyObject *self, PyObject *args, PyObject *
         (char *) "bitmap",(char *) "colour", NULL 
     };
     
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:new_MaskColour",kwnames,&obj0,&obj1)) goto fail;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:new_Mask",kwnames,&obj0,&obj1)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxBitmap,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     if (arg1 == NULL) {
         PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; 
     }
-    {
-        arg2 = &temp2;
-        if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail;
+    if (obj1) {
+        {
+            arg2 = &temp2;
+            if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail;
+        }
     }
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (wxMask *)new wxMask((wxBitmap const &)*arg1,(wxColour const &)*arg2);
+        result = (wxMask *)new_wxMask((wxBitmap const &)*arg1,(wxColour const &)*arg2);
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
@@ -7381,23 +7396,20 @@ static PyObject *_wrap_Font_Ok(PyObject *self, PyObject *args, PyObject *kwargs)
 static PyObject *_wrap_Font___eq__(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxFont *arg1 = (wxFont *) 0 ;
-    wxFont *arg2 = 0 ;
+    wxFont *arg2 = (wxFont *) 0 ;
     bool result;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
-        (char *) "self",(char *) "font", NULL 
+        (char *) "self",(char *) "other", NULL 
     };
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Font___eq__",kwnames,&obj0,&obj1)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    if (arg2 == NULL) {
-        PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; 
-    }
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (bool)((wxFont const *)arg1)->operator ==((wxFont const &)*arg2);
+        result = (bool)wxFont___eq__(arg1,(wxFont const *)arg2);
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
@@ -7412,23 +7424,20 @@ static PyObject *_wrap_Font___eq__(PyObject *self, PyObject *args, PyObject *kwa
 static PyObject *_wrap_Font___ne__(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxFont *arg1 = (wxFont *) 0 ;
-    wxFont *arg2 = 0 ;
+    wxFont *arg2 = (wxFont *) 0 ;
     bool result;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
-        (char *) "self",(char *) "font", NULL 
+        (char *) "self",(char *) "other", NULL 
     };
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Font___ne__",kwnames,&obj0,&obj1)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    if (arg2 == NULL) {
-        PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; 
-    }
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (bool)((wxFont const *)arg1)->operator !=((wxFont const &)*arg2);
+        result = (bool)wxFont___ne__(arg1,(wxFont const *)arg2);
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
@@ -12730,6 +12739,55 @@ static PyObject *_wrap_DC_GetMultiLineTextExtent(PyObject *self, PyObject *args,
 }
 
 
+static PyObject *_wrap_DC_GetPartialTextExtents(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxDC *arg1 = (wxDC *) 0 ;
+    wxString *arg2 = 0 ;
+    wxArrayInt result;
+    bool temp2 = False ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "text", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:DC_GetPartialTextExtents",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDC,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+    {
+        arg2 = wxString_in_helper(obj1);
+        if (arg2 == NULL) SWIG_fail;
+        temp2 = True;
+    }
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = wxDC_GetPartialTextExtents(arg1,(wxString const &)*arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = PyList_New(0);
+        size_t idx;
+        for (idx = 0; idx < (&result)->GetCount(); idx += 1) {
+            PyObject* val = PyInt_FromLong( (&result)->Item(idx) );
+            PyList_Append(resultobj, val);
+            Py_DECREF(val);
+        }
+    }
+    {
+        if (temp2)
+        delete arg2;
+    }
+    return resultobj;
+    fail:
+    {
+        if (temp2)
+        delete arg2;
+    }
+    return NULL;
+}
+
+
 static PyObject *_wrap_DC_GetSize(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxDC *arg1 = (wxDC *) 0 ;
@@ -17710,6 +17768,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Pen_SetDashes", (PyCFunction) _wrap_Pen_SetDashes, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Pen_GetDashes", (PyCFunction) _wrap_Pen_GetDashes, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Pen___eq__", (PyCFunction) _wrap_Pen___eq__, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Pen___ne__", (PyCFunction) _wrap_Pen___ne__, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Pen_GetDashCount", (PyCFunction) _wrap_Pen_GetDashCount, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Pen_swigregister", Pen_swigregister, METH_VARARGS },
         { (char *)"new_PyPen", (PyCFunction) _wrap_new_PyPen, METH_VARARGS | METH_KEYWORDS },
@@ -17750,7 +17809,6 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Bitmap_SetDepth", (PyCFunction) _wrap_Bitmap_SetDepth, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Bitmap_swigregister", Bitmap_swigregister, METH_VARARGS },
         { (char *)"new_Mask", (PyCFunction) _wrap_new_Mask, METH_VARARGS | METH_KEYWORDS },
-        { (char *)"new_MaskColour", (PyCFunction) _wrap_new_MaskColour, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Mask_swigregister", Mask_swigregister, METH_VARARGS },
         { (char *)"new_Icon", (PyCFunction) _wrap_new_Icon, METH_VARARGS | METH_KEYWORDS },
         { (char *)"delete_Icon", (PyCFunction) _wrap_delete_Icon, METH_VARARGS | METH_KEYWORDS },
@@ -18036,6 +18094,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"DC_GetTextExtent", (PyCFunction) _wrap_DC_GetTextExtent, METH_VARARGS | METH_KEYWORDS },
         { (char *)"DC_GetFullTextExtent", (PyCFunction) _wrap_DC_GetFullTextExtent, METH_VARARGS | METH_KEYWORDS },
         { (char *)"DC_GetMultiLineTextExtent", (PyCFunction) _wrap_DC_GetMultiLineTextExtent, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"DC_GetPartialTextExtents", (PyCFunction) _wrap_DC_GetPartialTextExtents, METH_VARARGS | METH_KEYWORDS },
         { (char *)"DC_GetSize", (PyCFunction) _wrap_DC_GetSize, METH_VARARGS | METH_KEYWORDS },
         { (char *)"DC_GetSizeTuple", (PyCFunction) _wrap_DC_GetSizeTuple, METH_VARARGS | METH_KEYWORDS },
         { (char *)"DC_GetSizeMM", (PyCFunction) _wrap_DC_GetSizeMM, METH_VARARGS | METH_KEYWORDS },