]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/sizers.cpp
Implemented the first phase of OOR (Original Object Return). See the
[wxWidgets.git] / wxPython / src / gtk / sizers.cpp
index 237c25f748ffcfdfb3a662dcfd68195d4759d924..019378ab183759faae25168951dadc0bb258993a 100644 (file)
@@ -57,6 +57,8 @@ extern PyObject *SWIG_newvarlink(void);
 
 #include "helpers.h"
 
 
 #include "helpers.h"
 
+#include <wx/notebook.h>
+
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
     PyObject*   o2;
     if (!target) {
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
     PyObject*   o2;
     if (!target) {
@@ -103,7 +105,11 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     return target;
 }
 
     return target;
 }
 
-static char* wxStringErrorMsg = "string type is required for parameter";
+#if PYTHON_API_VERSION >= 1009
+    static char* wxStringErrorMsg = "String or Unicode type required";
+#else
+    static char* wxStringErrorMsg = "string type is required for parameter";
+#endif
 
 class wxPySizer : public wxSizer {
     DECLARE_DYNAMIC_CLASS(wxPySizer);
 
 class wxPySizer : public wxSizer {
     DECLARE_DYNAMIC_CLASS(wxPySizer);
@@ -123,6 +129,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxPySizer, wxSizer);
 #ifdef __cplusplus
 extern "C" {
 #endif
 #ifdef __cplusplus
 extern "C" {
 #endif
+static void *SwigwxSizerItemTowxObject(void *ptr) {
+    wxSizerItem *src;
+    wxObject *dest;
+    src = (wxSizerItem *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define wxSizerItem_GetSize(_swigobj)  (_swigobj->GetSize())
 static PyObject *_wrap_wxSizerItem_GetSize(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 #define wxSizerItem_GetSize(_swigobj)  (_swigobj->GetSize())
 static PyObject *_wrap_wxSizerItem_GetSize(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -431,7 +445,6 @@ static PyObject *_wrap_wxSizerItem_GetWindow(PyObject *self, PyObject *args, PyO
     wxSizerItem * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
     wxSizerItem * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSizerItem_GetWindow",_kwnames,&_argo0)) 
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSizerItem_GetWindow",_kwnames,&_argo0)) 
@@ -448,13 +461,7 @@ static PyObject *_wrap_wxSizerItem_GetWindow(PyObject *self, PyObject *args, PyO
         _result = (wxWindow *)wxSizerItem_GetWindow(_arg0);
 
     wxPy_END_ALLOW_THREADS;
         _result = (wxWindow *)wxSizerItem_GetWindow(_arg0);
 
     wxPy_END_ALLOW_THREADS;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxWindow_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
 }
 
     return _resultobj;
 }
 
@@ -501,7 +508,6 @@ static PyObject *_wrap_wxSizerItem_GetSizer(PyObject *self, PyObject *args, PyOb
     wxSizerItem * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
     wxSizerItem * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSizerItem_GetSizer",_kwnames,&_argo0)) 
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSizerItem_GetSizer",_kwnames,&_argo0)) 
@@ -518,13 +524,7 @@ static PyObject *_wrap_wxSizerItem_GetSizer(PyObject *self, PyObject *args, PyOb
         _result = (wxSizer *)wxSizerItem_GetSizer(_arg0);
 
     wxPy_END_ALLOW_THREADS;
         _result = (wxSizer *)wxSizerItem_GetSizer(_arg0);
 
     wxPy_END_ALLOW_THREADS;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxSizer_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
 }
 
     return _resultobj;
 }
 
@@ -796,6 +796,14 @@ static PyObject *_wrap_wxSizerItem_GetUserData(PyObject *self, PyObject *args, P
     return _resultobj;
 }
 
     return _resultobj;
 }
 
+static void *SwigwxSizerTowxObject(void *ptr) {
+    wxSizer *src;
+    wxObject *dest;
+    src = (wxSizer *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 static void  wxSizer_Destroy(wxSizer *self) { delete self; }
 static PyObject *_wrap_wxSizer_Destroy(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 static void  wxSizer_Destroy(wxSizer *self) { delete self; }
 static PyObject *_wrap_wxSizer_Destroy(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -1744,6 +1752,14 @@ static void *SwigwxPySizerTowxSizer(void *ptr) {
     return (void *) dest;
 }
 
     return (void *) dest;
 }
 
+static void *SwigwxPySizerTowxObject(void *ptr) {
+    wxPySizer *src;
+    wxObject *dest;
+    src = (wxPySizer *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define new_wxPySizer() (new wxPySizer())
 static PyObject *_wrap_new_wxPySizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 #define new_wxPySizer() (new wxPySizer())
 static PyObject *_wrap_new_wxPySizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -1814,6 +1830,14 @@ static void *SwigwxBoxSizerTowxSizer(void *ptr) {
     return (void *) dest;
 }
 
     return (void *) dest;
 }
 
+static void *SwigwxBoxSizerTowxObject(void *ptr) {
+    wxBoxSizer *src;
+    wxObject *dest;
+    src = (wxBoxSizer *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define new_wxBoxSizer(_swigarg0) (new wxBoxSizer(_swigarg0))
 static PyObject *_wrap_new_wxBoxSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 #define new_wxBoxSizer(_swigarg0) (new wxBoxSizer(_swigarg0))
 static PyObject *_wrap_new_wxBoxSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -1939,6 +1963,14 @@ static void *SwigwxStaticBoxSizerTowxSizer(void *ptr) {
     return (void *) dest;
 }
 
     return (void *) dest;
 }
 
+static void *SwigwxStaticBoxSizerTowxObject(void *ptr) {
+    wxStaticBoxSizer *src;
+    wxObject *dest;
+    src = (wxStaticBoxSizer *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define new_wxStaticBoxSizer(_swigarg0,_swigarg1) (new wxStaticBoxSizer(_swigarg0,_swigarg1))
 static PyObject *_wrap_new_wxStaticBoxSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 #define new_wxStaticBoxSizer(_swigarg0,_swigarg1) (new wxStaticBoxSizer(_swigarg0,_swigarg1))
 static PyObject *_wrap_new_wxStaticBoxSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -1981,7 +2013,6 @@ static PyObject *_wrap_wxStaticBoxSizer_GetStaticBox(PyObject *self, PyObject *a
     wxStaticBoxSizer * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
     wxStaticBoxSizer * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStaticBoxSizer_GetStaticBox",_kwnames,&_argo0)) 
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStaticBoxSizer_GetStaticBox",_kwnames,&_argo0)) 
@@ -1998,13 +2029,7 @@ static PyObject *_wrap_wxStaticBoxSizer_GetStaticBox(PyObject *self, PyObject *a
         _result = (wxStaticBox *)wxStaticBoxSizer_GetStaticBox(_arg0);
 
     wxPy_END_ALLOW_THREADS;
         _result = (wxStaticBox *)wxStaticBoxSizer_GetStaticBox(_arg0);
 
     wxPy_END_ALLOW_THREADS;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxStaticBox_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
 }
 
     return _resultobj;
 }
 
@@ -2072,6 +2097,14 @@ static void *SwigwxNotebookSizerTowxSizer(void *ptr) {
     return (void *) dest;
 }
 
     return (void *) dest;
 }
 
+static void *SwigwxNotebookSizerTowxObject(void *ptr) {
+    wxNotebookSizer *src;
+    wxObject *dest;
+    src = (wxNotebookSizer *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define new_wxNotebookSizer(_swigarg0) (new wxNotebookSizer(_swigarg0))
 static PyObject *_wrap_new_wxNotebookSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 #define new_wxNotebookSizer(_swigarg0) (new wxNotebookSizer(_swigarg0))
 static PyObject *_wrap_new_wxNotebookSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -2169,7 +2202,6 @@ static PyObject *_wrap_wxNotebookSizer_GetNotebook(PyObject *self, PyObject *arg
     wxNotebookSizer * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
     wxNotebookSizer * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNotebookSizer_GetNotebook",_kwnames,&_argo0)) 
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNotebookSizer_GetNotebook",_kwnames,&_argo0)) 
@@ -2186,13 +2218,7 @@ static PyObject *_wrap_wxNotebookSizer_GetNotebook(PyObject *self, PyObject *arg
         _result = (wxNotebook *)wxNotebookSizer_GetNotebook(_arg0);
 
     wxPy_END_ALLOW_THREADS;
         _result = (wxNotebook *)wxNotebookSizer_GetNotebook(_arg0);
 
     wxPy_END_ALLOW_THREADS;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxNotebook_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
 }
 
     return _resultobj;
 }
 
@@ -2204,6 +2230,14 @@ static void *SwigwxGridSizerTowxSizer(void *ptr) {
     return (void *) dest;
 }
 
     return (void *) dest;
 }
 
+static void *SwigwxGridSizerTowxObject(void *ptr) {
+    wxGridSizer *src;
+    wxObject *dest;
+    src = (wxGridSizer *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define new_wxGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
 static PyObject *_wrap_new_wxGridSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 #define new_wxGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
 static PyObject *_wrap_new_wxGridSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -2525,6 +2559,14 @@ static void *SwigwxFlexGridSizerTowxSizer(void *ptr) {
     return (void *) dest;
 }
 
     return (void *) dest;
 }
 
+static void *SwigwxFlexGridSizerTowxObject(void *ptr) {
+    wxFlexGridSizer *src;
+    wxObject *dest;
+    src = (wxFlexGridSizer *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
 #define new_wxFlexGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxFlexGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
 static PyObject *_wrap_new_wxFlexGridSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
 #define new_wxFlexGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxFlexGridSizer(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
 static PyObject *_wrap_new_wxFlexGridSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -2878,10 +2920,28 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxAcceleratorTable","_wxAcceleratorTable",0},
     { "_class_wxClipboard","_wxClipboard",0},
     { "_class_wxGauge","_wxGauge",0},
     { "_class_wxAcceleratorTable","_wxAcceleratorTable",0},
     { "_class_wxClipboard","_wxClipboard",0},
     { "_class_wxGauge","_wxGauge",0},
+    { "_wxGDIObject","_class_wxGDIObject",0},
     { "_wxDC","_class_wxDC",0},
     { "_wxSizerItem","_class_wxSizerItem",0},
     { "_class_wxBitmapDataObject","_wxBitmapDataObject",0},
     { "_class_wxFlexGridSizer","_wxFlexGridSizer",0},
     { "_wxDC","_class_wxDC",0},
     { "_wxSizerItem","_class_wxSizerItem",0},
     { "_class_wxBitmapDataObject","_wxBitmapDataObject",0},
     { "_class_wxFlexGridSizer","_wxFlexGridSizer",0},
+    { "_class_wxObject","_class_wxFlexGridSizer",SwigwxFlexGridSizerTowxObject},
+    { "_class_wxObject","_wxFlexGridSizer",SwigwxFlexGridSizerTowxObject},
+    { "_class_wxObject","_class_wxGridSizer",SwigwxGridSizerTowxObject},
+    { "_class_wxObject","_wxGridSizer",SwigwxGridSizerTowxObject},
+    { "_class_wxObject","_class_wxNotebookSizer",SwigwxNotebookSizerTowxObject},
+    { "_class_wxObject","_wxNotebookSizer",SwigwxNotebookSizerTowxObject},
+    { "_class_wxObject","_class_wxStaticBoxSizer",SwigwxStaticBoxSizerTowxObject},
+    { "_class_wxObject","_wxStaticBoxSizer",SwigwxStaticBoxSizerTowxObject},
+    { "_class_wxObject","_class_wxBoxSizer",SwigwxBoxSizerTowxObject},
+    { "_class_wxObject","_wxBoxSizer",SwigwxBoxSizerTowxObject},
+    { "_class_wxObject","_class_wxPySizer",SwigwxPySizerTowxObject},
+    { "_class_wxObject","_wxPySizer",SwigwxPySizerTowxObject},
+    { "_class_wxObject","_class_wxSizer",SwigwxSizerTowxObject},
+    { "_class_wxObject","_wxSizer",SwigwxSizerTowxObject},
+    { "_class_wxObject","_class_wxSizerItem",SwigwxSizerItemTowxObject},
+    { "_class_wxObject","_wxSizerItem",SwigwxSizerItemTowxObject},
+    { "_class_wxObject","_wxObject",0},
     { "_wxSpinEvent","_class_wxSpinEvent",0},
     { "_size_t","_wxCoord",0},
     { "_size_t","_wxPrintQuality",0},
     { "_wxSpinEvent","_class_wxSpinEvent",0},
     { "_size_t","_wxCoord",0},
     { "_size_t","_wxPrintQuality",0},
@@ -2914,6 +2974,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxDataObject","_wxDataObject",0},
     { "_wxStaticLine","_class_wxStaticLine",0},
     { "_wxBrush","_class_wxBrush",0},
     { "_class_wxDataObject","_wxDataObject",0},
     { "_wxStaticLine","_class_wxStaticLine",0},
     { "_wxBrush","_class_wxBrush",0},
+    { "_wxToggleButton","_class_wxToggleButton",0},
     { "_wxDataFormat","_class_wxDataFormat",0},
     { "_class_wxDataObjectSimple","_wxDataObjectSimple",0},
     { "_wxShowEvent","_class_wxShowEvent",0},
     { "_wxDataFormat","_class_wxDataFormat",0},
     { "_class_wxDataObjectSimple","_wxDataObjectSimple",0},
     { "_wxShowEvent","_class_wxShowEvent",0},
@@ -3017,6 +3078,23 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
     { "_wxClientDC","_class_wxClientDC",0},
     { "_wxMouseEvent","_class_wxMouseEvent",0},
     { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
     { "_wxClientDC","_class_wxClientDC",0},
     { "_wxMouseEvent","_class_wxMouseEvent",0},
+    { "_wxObject","_class_wxFlexGridSizer",SwigwxFlexGridSizerTowxObject},
+    { "_wxObject","_wxFlexGridSizer",SwigwxFlexGridSizerTowxObject},
+    { "_wxObject","_class_wxGridSizer",SwigwxGridSizerTowxObject},
+    { "_wxObject","_wxGridSizer",SwigwxGridSizerTowxObject},
+    { "_wxObject","_class_wxNotebookSizer",SwigwxNotebookSizerTowxObject},
+    { "_wxObject","_wxNotebookSizer",SwigwxNotebookSizerTowxObject},
+    { "_wxObject","_class_wxStaticBoxSizer",SwigwxStaticBoxSizerTowxObject},
+    { "_wxObject","_wxStaticBoxSizer",SwigwxStaticBoxSizerTowxObject},
+    { "_wxObject","_class_wxBoxSizer",SwigwxBoxSizerTowxObject},
+    { "_wxObject","_wxBoxSizer",SwigwxBoxSizerTowxObject},
+    { "_wxObject","_class_wxPySizer",SwigwxPySizerTowxObject},
+    { "_wxObject","_wxPySizer",SwigwxPySizerTowxObject},
+    { "_wxObject","_class_wxSizer",SwigwxSizerTowxObject},
+    { "_wxObject","_wxSizer",SwigwxSizerTowxObject},
+    { "_wxObject","_class_wxSizerItem",SwigwxSizerItemTowxObject},
+    { "_wxObject","_wxSizerItem",SwigwxSizerItemTowxObject},
+    { "_wxObject","_class_wxObject",0},
     { "_class_wxPoint","_wxPoint",0},
     { "_wxRealPoint","_class_wxRealPoint",0},
     { "_class_wxRadioBox","_wxRadioBox",0},
     { "_class_wxPoint","_wxPoint",0},
     { "_wxRealPoint","_class_wxRealPoint",0},
     { "_class_wxRadioBox","_wxRadioBox",0},
@@ -3075,6 +3153,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxWindowID","_int",0},
     { "_wxWindowID","_signed_int",0},
     { "_wxWindowID","_unsigned_int",0},
     { "_wxWindowID","_int",0},
     { "_wxWindowID","_signed_int",0},
     { "_wxWindowID","_unsigned_int",0},
+    { "_class_wxGDIObject","_wxGDIObject",0},
     { "_class_wxScrollWinEvent","_wxScrollWinEvent",0},
     { "_class_wxSizerItem","_wxSizerItem",0},
     { "_int","_wxCoord",0},
     { "_class_wxScrollWinEvent","_wxScrollWinEvent",0},
     { "_class_wxSizerItem","_wxSizerItem",0},
     { "_int","_wxCoord",0},
@@ -3131,6 +3210,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxEraseEvent","_class_wxEraseEvent",0},
     { "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
     { "_class_wxJoystickEvent","_wxJoystickEvent",0},
     { "_wxEraseEvent","_class_wxEraseEvent",0},
     { "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
     { "_class_wxJoystickEvent","_wxJoystickEvent",0},
+    { "_class_wxToggleButton","_wxToggleButton",0},
     { "_wxRegion","_class_wxRegion",0},
     { "_wxSizer","_class_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer},
     { "_wxSizer","_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer},
     { "_wxRegion","_class_wxRegion",0},
     { "_wxSizer","_class_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer},
     { "_wxSizer","_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer},