]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_gdi_wrap.cpp
Fix to FIXME: better nothing than broken comparison.
[wxWidgets.git] / wxPython / src / gtk / _gdi_wrap.cpp
index 4a4b8cfd524f49625945e34a01facd79f96fc858..108e91f0e94c0e863c977fd526545d1dd538ffdf 100644 (file)
@@ -883,12 +883,38 @@ PyObject *wxPyFontEnumerator_GetFacenames(wxPyFontEnumerator *self){
                 return PyList_New(0);
         }
 
+#include <locale.h>
 
 wxLocale *new_wxLocale(int language,int flags){
+            wxLocale* loc;
             if (language == -1)
-                return new wxLocale();
+                loc = new wxLocale();
             else
-                return new wxLocale(language, flags);
+                loc = new wxLocale(language, flags);
+            // Python before 2.4 needs to have LC_NUMERIC set to "C" in order
+            // for the floating point conversions and such to work right.
+#if PY_VERSION_HEX < 0x02040000
+            setlocale(LC_NUMERIC, "C");
+#endif
+            return loc;
+        }
+bool wxLocale_Init1(wxLocale *self,wxString const &szName,wxString const &szShort,wxString const &szLocale,bool bLoadDefault,bool bConvertEncoding){
+            bool rc = self->Init(szName, szShort, szLocale, bLoadDefault, bConvertEncoding);
+            // Python before 2.4 needs to have LC_NUMERIC set to "C" in order
+            // for the floating point conversions and such to work right.
+#if PY_VERSION_HEX < 0x02040000
+            setlocale(LC_NUMERIC, "C");
+#endif
+            return rc;
+        }
+bool wxLocale_Init2(wxLocale *self,int language,int flags){
+            bool rc = self->Init(language, flags);
+            // Python before 2.4 needs to have LC_NUMERIC set to "C" in order
+            // for the floating point conversions and such to work right.
+#if PY_VERSION_HEX < 0x02040000
+            setlocale(LC_NUMERIC, "C");
+#endif
+            return rc;
         }
 
 #include "wx/wxPython/pydrawxxx.h"
@@ -2670,6 +2696,34 @@ static PyObject *_wrap_Brush_GetStipple(PyObject *, PyObject *args, PyObject *kw
 }
 
 
+static PyObject *_wrap_Brush_IsHatch(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxBrush *arg1 = (wxBrush *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    char *kwnames[] = {
+        (char *) "self", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Brush_IsHatch",kwnames,&obj0)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxBrush,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)((wxBrush const *)arg1)->IsHatch();
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Brush_Ok(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxBrush *arg1 = (wxBrush *) 0 ;
@@ -3340,6 +3394,32 @@ static PyObject *_wrap_Bitmap_LoadFile(PyObject *, PyObject *args, PyObject *kwa
 }
 
 
+static PyObject *_wrap_Bitmap_GetPalette(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxBitmap *arg1 = (wxBitmap *) 0 ;
+    wxPalette *result;
+    PyObject * obj0 = 0 ;
+    char *kwnames[] = {
+        (char *) "self", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Bitmap_GetPalette",kwnames,&obj0)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxBitmap,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (wxPalette *)((wxBitmap const *)arg1)->GetPalette();
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPalette, 0);
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Bitmap_CopyFromIcon(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxBitmap *arg1 = (wxBitmap *) 0 ;
@@ -9563,7 +9643,7 @@ static PyObject *_wrap_Locale_Init1(PyObject *, PyObject *args, PyObject *kwargs
     }
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (bool)(arg1)->Init((wxString const &)*arg2,(wxString const &)*arg3,(wxString const &)*arg4,arg5,arg6);
+        result = (bool)wxLocale_Init1(arg1,(wxString const &)*arg2,(wxString const &)*arg3,(wxString const &)*arg4,arg5,arg6);
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
@@ -9627,7 +9707,7 @@ static PyObject *_wrap_Locale_Init2(PyObject *, PyObject *args, PyObject *kwargs
     }
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (bool)(arg1)->Init(arg2,arg3);
+        result = (bool)wxLocale_Init2(arg1,arg2,arg3);
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
@@ -18533,6 +18613,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Brush_GetColour", (PyCFunction) _wrap_Brush_GetColour, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Brush_GetStyle", (PyCFunction) _wrap_Brush_GetStyle, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Brush_GetStipple", (PyCFunction) _wrap_Brush_GetStipple, METH_VARARGS | METH_KEYWORDS, NULL },
+        { (char *)"Brush_IsHatch", (PyCFunction) _wrap_Brush_IsHatch, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Brush_Ok", (PyCFunction) _wrap_Brush_Ok, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Brush_swigregister", Brush_swigregister, METH_VARARGS, NULL },
         { (char *)"new_Bitmap", (PyCFunction) _wrap_new_Bitmap, METH_VARARGS | METH_KEYWORDS, NULL },
@@ -18554,6 +18635,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Bitmap_GetSubBitmap", (PyCFunction) _wrap_Bitmap_GetSubBitmap, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Bitmap_SaveFile", (PyCFunction) _wrap_Bitmap_SaveFile, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Bitmap_LoadFile", (PyCFunction) _wrap_Bitmap_LoadFile, METH_VARARGS | METH_KEYWORDS, NULL },
+        { (char *)"Bitmap_GetPalette", (PyCFunction) _wrap_Bitmap_GetPalette, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Bitmap_CopyFromIcon", (PyCFunction) _wrap_Bitmap_CopyFromIcon, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Bitmap_SetHeight", (PyCFunction) _wrap_Bitmap_SetHeight, METH_VARARGS | METH_KEYWORDS, NULL },
         { (char *)"Bitmap_SetWidth", (PyCFunction) _wrap_Bitmap_SetWidth, METH_VARARGS | METH_KEYWORDS, NULL },