]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/gdi.cpp
don't log mouse events by default
[wxWidgets.git] / wxPython / src / gtk / gdi.cpp
index 72bdcfc7b02053919d8d3e00cb191d50774548b4..ac5c0ef66716a86af69b67684b7c00a9f52c15c4 100644 (file)
@@ -186,6 +186,27 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     wxColour* wxNamedColour(const wxString& colorName) {
         return new wxColour(colorName);
     }
+
+class wxPyPen : public wxPen {
+public:
+    wxPyPen(wxColour& colour, int width=1, int style=wxSOLID)
+        : wxPen(colour, width, style)
+        { m_dash = NULL; }
+    ~wxPyPen() {
+        if (m_dash)
+            delete m_dash;
+    }
+
+    void SetDashes(int nb_dashes, const wxDash *dash) {
+        m_dash = new wxDash[nb_dashes];
+        for (int i=0; i<nb_dashes; i++)
+            m_dash[i] = dash[i];
+        wxPen::SetDashes(nb_dashes, m_dash);
+    }
+
+private:
+    wxDash* m_dash;
+};
                                       // Alternate 'constructor'
     wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC) {
         return new wxMemoryDC(oldDC);
@@ -236,7 +257,7 @@ extern wxFont  wxNullFont;
 extern wxColour  wxNullColour; 
 extern wxFontList * wxTheFontList; 
 extern wxPenList * wxThePenList; 
-extern wxBrushlist * wxTheBrushList; 
+extern wxBrushList * wxTheBrushList; 
 extern wxColourDatabase * wxTheColourDatabase; 
 
 #endif
@@ -1240,7 +1261,7 @@ static PyObject *_wrap_wxTheBrushList_get() {
     PyObject * pyobj;
     char ptemp[128];
 
-    SWIG_MakePtr(ptemp, (char *) wxTheBrushList,"_wxBrushlist_p");
+    SWIG_MakePtr(ptemp, (char *) wxTheBrushList,"_wxBrushList_p");
     pyobj = PyString_FromString(ptemp);
     return pyobj;
 }
@@ -1963,6 +1984,43 @@ static PyObject *_wrap_wxBitmap_GetSubBitmap(PyObject *self, PyObject *args, PyO
     return _resultobj;
 }
 
+#define wxBitmap_CopyFromIcon(_swigobj,_swigarg0)  (_swigobj->CopyFromIcon(_swigarg0))
+static PyObject *_wrap_wxBitmap_CopyFromIcon(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    bool  _result;
+    wxBitmap * _arg0;
+    wxIcon * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _argo1 = 0;
+    char *_kwnames[] = { "self","icon", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxBitmap_CopyFromIcon",_kwnames,&_argo0,&_argo1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_CopyFromIcon. Expected _wxBitmap_p.");
+        return NULL;
+        }
+    }
+    if (_argo1) {
+        if (_argo1 == Py_None) { _arg1 = NULL; }
+        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxIcon_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxBitmap_CopyFromIcon. Expected _wxIcon_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxBitmap_CopyFromIcon(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+    if (PyErr_Occurred()) return NULL;
+}    _resultobj = Py_BuildValue("i",_result);
+    return _resultobj;
+}
+
 static void *SwigwxMaskTowxObject(void *ptr) {
     wxMask *src;
     wxObject *dest;
@@ -4793,47 +4851,147 @@ static PyObject *_wrap_wxPen_SetWidth(PyObject *self, PyObject *args, PyObject *
     return _resultobj;
 }
 
-#define wxPen_GetDashes(_swigobj,_swigarg0)  (_swigobj->GetDashes(_swigarg0))
-static PyObject *_wrap_wxPen_GetDashes(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxPen_SetDashes(_swigobj,_swigarg0,_swigarg1)  (_swigobj->SetDashes(_swigarg0,_swigarg1))
+static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
-    int  _result;
     wxPen * _arg0;
-    wxDash ** _arg1;
+    int  _arg1;
+    wxDash * _arg2;
     PyObject * _argo0 = 0;
-    PyObject * _argo1 = 0;
-    char *_kwnames[] = { "self","dashes", NULL };
+    PyObject * _obj2 = 0;
+    char *_kwnames[] = { "self","choices", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPen_GetDashes",_kwnames,&_argo0,&_argo1)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPen_SetDashes",_kwnames,&_argo0,&_obj2)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
         else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPen_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPen_GetDashes. Expected _wxPen_p.");
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPen_SetDashes. Expected _wxPen_p.");
         return NULL;
         }
     }
-    if (_argo1) {
-        if (_argo1 == Py_None) { _arg1 = NULL; }
-        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDash_pp")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPen_GetDashes. Expected _wxDash_pp.");
+    if (_obj2)
+{
+    _arg2 = (wxDash*)byte_LIST_helper(_obj2);
+    if (_arg2 == NULL) {
+        return NULL;
+    }
+}
+{
+    if (_obj2) {
+        _arg1 = PyList_Size(_obj2);
+    }
+    else {
+        _arg1 = 0;
+    }
+}
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPen_SetDashes(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+    if (PyErr_Occurred()) return NULL;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+{
+    delete [] _arg2;
+}
+    return _resultobj;
+}
+
+static void *SwigwxPyPenTowxPen(void *ptr) {
+    wxPyPen *src;
+    wxPen *dest;
+    src = (wxPyPen *) ptr;
+    dest = (wxPen *) src;
+    return (void *) dest;
+}
+
+static void *SwigwxPyPenTowxGDIObject(void *ptr) {
+    wxPyPen *src;
+    wxGDIObject *dest;
+    src = (wxPyPen *) ptr;
+    dest = (wxGDIObject *) src;
+    return (void *) dest;
+}
+
+static void *SwigwxPyPenTowxObject(void *ptr) {
+    wxPyPen *src;
+    wxObject *dest;
+    src = (wxPyPen *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
+#define new_wxPyPen(_swigarg0,_swigarg1,_swigarg2) (new wxPyPen(_swigarg0,_swigarg1,_swigarg2))
+static PyObject *_wrap_new_wxPyPen(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxPyPen * _result;
+    wxColour * _arg0;
+    int  _arg1 = (int ) 1;
+    int  _arg2 = (int ) wxSOLID;
+    wxColour  temp;
+    PyObject * _obj0 = 0;
+    char *_kwnames[] = { "colour","width","style", NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:new_wxPyPen",_kwnames,&_obj0,&_arg1,&_arg2)) 
+        return NULL;
+{
+    _arg0 = &temp;
+    if (! wxColour_helper(_obj0, &_arg0))
+        return NULL;
+}
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxPyPen *)new_wxPyPen(*_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+    if (PyErr_Occurred()) return NULL;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyPen_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+    return _resultobj;
+}
+
+#define delete_wxPyPen(_swigobj) (delete _swigobj)
+static PyObject *_wrap_delete_wxPyPen(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxPyPen * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxPyPen",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyPen_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxPyPen. Expected _wxPyPen_p.");
         return NULL;
         }
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        _result = (int )wxPen_GetDashes(_arg0,_arg1);
+        delete_wxPyPen(_arg0);
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    _resultobj = Py_BuildValue("i",_result);
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
     return _resultobj;
 }
 
-#define wxPen_SetDashes(_swigobj,_swigarg0,_swigarg1)  (_swigobj->SetDashes(_swigarg0,_swigarg1))
-static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxPyPen_SetDashes(_swigobj,_swigarg0,_swigarg1)  (_swigobj->SetDashes(_swigarg0,_swigarg1))
+static PyObject *_wrap_wxPyPen_SetDashes(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
-    wxPen * _arg0;
+    wxPyPen * _arg0;
     int  _arg1;
     wxDash * _arg2;
     PyObject * _argo0 = 0;
@@ -4841,12 +4999,12 @@ static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject
     char *_kwnames[] = { "self","choices", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPen_SetDashes",_kwnames,&_argo0,&_obj2)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyPen_SetDashes",_kwnames,&_argo0,&_obj2)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
-        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPen_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPen_SetDashes. Expected _wxPen_p.");
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyPen_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyPen_SetDashes. Expected _wxPyPen_p.");
         return NULL;
         }
     }
@@ -4867,7 +5025,7 @@ static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject
 }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxPen_SetDashes(_arg0,_arg1,_arg2);
+        wxPyPen_SetDashes(_arg0,_arg1,_arg2);
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
@@ -5308,6 +5466,14 @@ static PyObject *_wrap_wxBrush_SetStyle(PyObject *self, PyObject *args, PyObject
     return _resultobj;
 }
 
+static void *SwigwxBrushListTowxObject(void *ptr) {
+    wxBrushList *src;
+    wxObject *dest;
+    src = (wxBrushList *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define wxBrushList_AddBrush(_swigobj,_swigarg0)  (_swigobj->AddBrush(_swigarg0))
 static PyObject *_wrap_wxBrushList_AddBrush(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -10800,8 +10966,10 @@ static PyMethodDef gdicMethods[] = {
         { "wxPenList_RemovePen", (PyCFunction) _wrap_wxPenList_RemovePen, METH_VARARGS | METH_KEYWORDS },
         { "wxPenList_FindOrCreatePen", (PyCFunction) _wrap_wxPenList_FindOrCreatePen, METH_VARARGS | METH_KEYWORDS },
         { "wxPenList_AddPen", (PyCFunction) _wrap_wxPenList_AddPen, METH_VARARGS | METH_KEYWORDS },
+        { "wxPyPen_SetDashes", (PyCFunction) _wrap_wxPyPen_SetDashes, METH_VARARGS | METH_KEYWORDS },
+        { "delete_wxPyPen", (PyCFunction) _wrap_delete_wxPyPen, METH_VARARGS | METH_KEYWORDS },
+        { "new_wxPyPen", (PyCFunction) _wrap_new_wxPyPen, METH_VARARGS | METH_KEYWORDS },
         { "wxPen_SetDashes", (PyCFunction) _wrap_wxPen_SetDashes, METH_VARARGS | METH_KEYWORDS },
-        { "wxPen_GetDashes", (PyCFunction) _wrap_wxPen_GetDashes, METH_VARARGS | METH_KEYWORDS },
         { "wxPen_SetWidth", (PyCFunction) _wrap_wxPen_SetWidth, METH_VARARGS | METH_KEYWORDS },
         { "wxPen_SetStyle", (PyCFunction) _wrap_wxPen_SetStyle, METH_VARARGS | METH_KEYWORDS },
         { "wxPen_SetJoin", (PyCFunction) _wrap_wxPen_SetJoin, METH_VARARGS | METH_KEYWORDS },
@@ -10884,6 +11052,7 @@ static PyMethodDef gdicMethods[] = {
         { "new_wxIcon", (PyCFunction) _wrap_new_wxIcon, METH_VARARGS | METH_KEYWORDS },
         { "wxMask_Destroy", (PyCFunction) _wrap_wxMask_Destroy, METH_VARARGS | METH_KEYWORDS },
         { "new_wxMask", (PyCFunction) _wrap_new_wxMask, METH_VARARGS | METH_KEYWORDS },
+        { "wxBitmap_CopyFromIcon", (PyCFunction) _wrap_wxBitmap_CopyFromIcon, METH_VARARGS | METH_KEYWORDS },
         { "wxBitmap_GetSubBitmap", (PyCFunction) _wrap_wxBitmap_GetSubBitmap, METH_VARARGS | METH_KEYWORDS },
         { "wxBitmap_SetDepth", (PyCFunction) _wrap_wxBitmap_SetDepth, METH_VARARGS | METH_KEYWORDS },
         { "wxBitmap_SetHeight", (PyCFunction) _wrap_wxBitmap_SetHeight, METH_VARARGS | METH_KEYWORDS },
@@ -10933,6 +11102,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_wxPrintQuality","_time_t",0},
+    { "_wxPen","_class_wxPyPen",SwigwxPyPenTowxPen},
+    { "_wxPen","_wxPyPen",SwigwxPyPenTowxPen},
     { "_byte","_unsigned_char",0},
     { "_long","_unsigned_long",0},
     { "_long","_signed_long",0},
@@ -10942,6 +11113,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxGDIObject","_wxPalette",SwigwxPaletteTowxGDIObject},
     { "_wxGDIObject","_class_wxBrush",SwigwxBrushTowxGDIObject},
     { "_wxGDIObject","_wxBrush",SwigwxBrushTowxGDIObject},
+    { "_wxGDIObject","_class_wxPyPen",SwigwxPyPenTowxGDIObject},
+    { "_wxGDIObject","_wxPyPen",SwigwxPyPenTowxGDIObject},
     { "_wxGDIObject","_class_wxPen",SwigwxPenTowxGDIObject},
     { "_wxGDIObject","_wxPen",SwigwxPenTowxGDIObject},
     { "_wxGDIObject","_class_wxFont",SwigwxFontTowxGDIObject},
@@ -10986,10 +11159,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxObject","_wxMemoryDC",SwigwxMemoryDCTowxObject},
     { "_class_wxObject","_class_wxDC",SwigwxDCTowxObject},
     { "_class_wxObject","_wxDC",SwigwxDCTowxObject},
+    { "_class_wxObject","_class_wxBrushList",SwigwxBrushListTowxObject},
+    { "_class_wxObject","_wxBrushList",SwigwxBrushListTowxObject},
     { "_class_wxObject","_class_wxBrush",SwigwxBrushTowxObject},
     { "_class_wxObject","_wxBrush",SwigwxBrushTowxObject},
     { "_class_wxObject","_class_wxPenList",SwigwxPenListTowxObject},
     { "_class_wxObject","_wxPenList",SwigwxPenListTowxObject},
+    { "_class_wxObject","_class_wxPyPen",SwigwxPyPenTowxObject},
+    { "_class_wxObject","_wxPyPen",SwigwxPyPenTowxObject},
     { "_class_wxObject","_class_wxPen",SwigwxPenTowxObject},
     { "_class_wxObject","_wxPen",SwigwxPenTowxObject},
     { "_class_wxObject","_class_wxColourDatabase",SwigwxColourDatabaseTowxObject},
@@ -11078,10 +11255,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxObject","_wxMemoryDC",SwigwxMemoryDCTowxObject},
     { "_wxObject","_class_wxDC",SwigwxDCTowxObject},
     { "_wxObject","_wxDC",SwigwxDCTowxObject},
+    { "_wxObject","_class_wxBrushList",SwigwxBrushListTowxObject},
+    { "_wxObject","_wxBrushList",SwigwxBrushListTowxObject},
     { "_wxObject","_class_wxBrush",SwigwxBrushTowxObject},
     { "_wxObject","_wxBrush",SwigwxBrushTowxObject},
     { "_wxObject","_class_wxPenList",SwigwxPenListTowxObject},
     { "_wxObject","_wxPenList",SwigwxPenListTowxObject},
+    { "_wxObject","_class_wxPyPen",SwigwxPyPenTowxObject},
+    { "_wxObject","_wxPyPen",SwigwxPyPenTowxObject},
     { "_wxObject","_class_wxPen",SwigwxPenTowxObject},
     { "_wxObject","_wxPen",SwigwxPenTowxObject},
     { "_wxObject","_class_wxColourDatabase",SwigwxColourDatabaseTowxObject},
@@ -11112,6 +11293,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_unsigned_int","_uint",0},
     { "_unsigned_int","_wxWindowID",0},
     { "_unsigned_int","_int",0},
+    { "_class_wxPen","_class_wxPyPen",SwigwxPyPenTowxPen},
+    { "_class_wxPen","_wxPyPen",SwigwxPyPenTowxPen},
     { "_short","_WXTYPE",0},
     { "_short","_unsigned_short",0},
     { "_short","_signed_short",0},
@@ -11130,6 +11313,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxGDIObject","_wxPalette",SwigwxPaletteTowxGDIObject},
     { "_class_wxGDIObject","_class_wxBrush",SwigwxBrushTowxGDIObject},
     { "_class_wxGDIObject","_wxBrush",SwigwxBrushTowxGDIObject},
+    { "_class_wxGDIObject","_class_wxPyPen",SwigwxPyPenTowxGDIObject},
+    { "_class_wxGDIObject","_wxPyPen",SwigwxPyPenTowxGDIObject},
     { "_class_wxGDIObject","_class_wxPen",SwigwxPenTowxGDIObject},
     { "_class_wxGDIObject","_wxPen",SwigwxPenTowxGDIObject},
     { "_class_wxGDIObject","_class_wxFont",SwigwxFontTowxGDIObject},