]> 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 4df9101cdcc74332d33e21b0b1b3f93ed33161bc..019378ab183759faae25168951dadc0bb258993a 100644 (file)
 #      define SWIGEXPORT(a) __declspec(dllexport) a
 #   else
 #      if defined(__BORLANDC__)
-#          define SWIGEXPORT(a) a _export 
+#          define SWIGEXPORT(a) a _export
 #      else
-#          define SWIGEXPORT(a) a 
+#          define SWIGEXPORT(a) a
 #      endif
 #   endif
 #else
-#   define SWIGEXPORT(a) a 
+#   define SWIGEXPORT(a) a
 #endif
 
+#include "Python.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-#include "Python.h"
+
 extern void SWIG_MakePtr(char *, void *, char *);
 extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
 extern char *SWIG_GetPtr(char *, void **, char *);
@@ -55,14 +57,16 @@ extern PyObject *SWIG_newvarlink(void);
 
 #include "helpers.h"
 
+#include <wx/notebook.h>
+
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
     PyObject*   o2;
-    if (!target) {                   
+    if (!target) {
         target = o;
-    } else if (target == Py_None) {  
+    } else if (target == Py_None) {
         Py_DECREF(Py_None);
         target = o;
-    } else {                         
+    } else {
         if (!PyList_Check(target)) {
             o2 = target;
             target = PyList_New(0);
@@ -79,29 +83,33 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     PyObject*   o2;
     PyObject*   o3;
 
-    if (!target) {                   
+    if (!target) {
         target = o;
-    } else if (target == Py_None) {  
+    } else if (target == Py_None) {
         Py_DECREF(Py_None);
         target = o;
-    } else {                         
+    } else {
         if (!PyTuple_Check(target)) {
             o2 = target;
             target = PyTuple_New(1);
             PyTuple_SetItem(target, 0, o2);
         }
-        o3 = PyTuple_New(1);            
-        PyTuple_SetItem(o3, 0, o);      
+        o3 = PyTuple_New(1);
+        PyTuple_SetItem(o3, 0, o);
 
         o2 = target;
-        target = PySequence_Concat(o2, o3); 
-        Py_DECREF(o2);                      
+        target = PySequence_Concat(o2, o3);
+        Py_DECREF(o2);
         Py_DECREF(o3);
     }
     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);
@@ -121,6 +129,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxPySizer, wxSizer);
 #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;
@@ -429,7 +445,6 @@ static PyObject *_wrap_wxSizerItem_GetWindow(PyObject *self, PyObject *args, PyO
     wxSizerItem * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSizerItem_GetWindow",_kwnames,&_argo0)) 
@@ -446,13 +461,7 @@ static PyObject *_wrap_wxSizerItem_GetWindow(PyObject *self, PyObject *args, PyO
         _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;
 }
 
@@ -499,7 +508,6 @@ static PyObject *_wrap_wxSizerItem_GetSizer(PyObject *self, PyObject *args, PyOb
     wxSizerItem * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSizerItem_GetSizer",_kwnames,&_argo0)) 
@@ -516,13 +524,7 @@ static PyObject *_wrap_wxSizerItem_GetSizer(PyObject *self, PyObject *args, PyOb
         _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;
 }
 
@@ -794,6 +796,14 @@ static PyObject *_wrap_wxSizerItem_GetUserData(PyObject *self, PyObject *args, P
     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;
@@ -1742,6 +1752,14 @@ static void *SwigwxPySizerTowxSizer(void *ptr) {
     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;
@@ -1812,6 +1830,14 @@ static void *SwigwxBoxSizerTowxSizer(void *ptr) {
     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;
@@ -1937,6 +1963,14 @@ static void *SwigwxStaticBoxSizerTowxSizer(void *ptr) {
     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;
@@ -1979,7 +2013,6 @@ static PyObject *_wrap_wxStaticBoxSizer_GetStaticBox(PyObject *self, PyObject *a
     wxStaticBoxSizer * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStaticBoxSizer_GetStaticBox",_kwnames,&_argo0)) 
@@ -1996,13 +2029,7 @@ static PyObject *_wrap_wxStaticBoxSizer_GetStaticBox(PyObject *self, PyObject *a
         _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;
 }
 
@@ -2070,6 +2097,14 @@ static void *SwigwxNotebookSizerTowxSizer(void *ptr) {
     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;
@@ -2167,7 +2202,6 @@ static PyObject *_wrap_wxNotebookSizer_GetNotebook(PyObject *self, PyObject *arg
     wxNotebookSizer * _arg0;
     PyObject * _argo0 = 0;
     char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNotebookSizer_GetNotebook",_kwnames,&_argo0)) 
@@ -2184,13 +2218,7 @@ static PyObject *_wrap_wxNotebookSizer_GetNotebook(PyObject *self, PyObject *arg
         _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;
 }
 
@@ -2202,6 +2230,14 @@ static void *SwigwxGridSizerTowxSizer(void *ptr) {
     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;
@@ -2523,6 +2559,14 @@ static void *SwigwxFlexGridSizerTowxSizer(void *ptr) {
     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;
@@ -2846,6 +2890,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_byte","_unsigned_char",0},
     { "_wxDataObject","_class_wxDataObject",0},
     { "_wxStaticBox","_class_wxStaticBox",0},
+    { "_wxColourDatabase","_class_wxColourDatabase",0},
     { "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
     { "_wxPyDropSource","_class_wxPyDropSource",0},
     { "_wxChoice","_class_wxChoice",0},
@@ -2875,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},
+    { "_wxGDIObject","_class_wxGDIObject",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},
@@ -2911,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},
+    { "_wxToggleButton","_class_wxToggleButton",0},
     { "_wxDataFormat","_class_wxDataFormat",0},
     { "_class_wxDataObjectSimple","_wxDataObjectSimple",0},
     { "_wxShowEvent","_class_wxShowEvent",0},
@@ -2937,6 +3001,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxBoxSizer","_class_wxBoxSizer",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
+    { "_wxPenList","_class_wxPenList",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
     { "_wxTimerEvent","_class_wxTimerEvent",0},
     { "_wxScrollBar","_class_wxScrollBar",0},
@@ -2949,6 +3014,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxStaticBitmap","_wxStaticBitmap",0},
     { "_wxDropTarget","_class_wxDropTarget",0},
     { "_class_wxStaticLine","_wxStaticLine",0},
+    { "_class_wxColourDatabase","_wxColourDatabase",0},
     { "_wxScrollEvent","_class_wxScrollEvent",0},
     { "_EBool","_wxCoord",0},
     { "_EBool","_wxPrintQuality",0},
@@ -2967,7 +3033,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxRect","_wxRect",0},
     { "_class_wxDC","_wxDC",0},
     { "_wxScrollWinEvent","_class_wxScrollWinEvent",0},
+    { "_class_wxBrushList","_wxBrushList",0},
     { "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
+    { "_class_wxPenList","_wxPenList",0},
     { "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
     { "_wxFocusEvent","_class_wxFocusEvent",0},
     { "_wxMaximizeEvent","_class_wxMaximizeEvent",0},
@@ -3004,11 +3072,29 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyValidator","_wxPyValidator",0},
     { "_class_wxCloseEvent","_wxCloseEvent",0},
     { "_wxBusyInfo","_class_wxBusyInfo",0},
+    { "_wxFontList","_class_wxFontList",0},
     { "_class_wxMenuEvent","_wxMenuEvent",0},
     { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",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},
@@ -3067,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},
+    { "_class_wxGDIObject","_wxGDIObject",0},
     { "_class_wxScrollWinEvent","_wxScrollWinEvent",0},
     { "_class_wxSizerItem","_wxSizerItem",0},
     { "_int","_wxCoord",0},
@@ -3123,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},
+    { "_class_wxToggleButton","_wxToggleButton",0},
     { "_wxRegion","_class_wxRegion",0},
     { "_wxSizer","_class_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer},
     { "_wxSizer","_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer},
@@ -3143,9 +3231,11 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxGauge","_class_wxGauge",0},
     { "_class_wxCheckListBox","_wxCheckListBox",0},
     { "_class_wxBusyInfo","_wxBusyInfo",0},
+    { "_class_wxFontList","_wxFontList",0},
     { "_class_wxCommandEvent","_wxCommandEvent",0},
     { "_class_wxClientDC","_wxClientDC",0},
     { "_class_wxSizeEvent","_wxSizeEvent",0},
+    { "_wxBrushList","_class_wxBrushList",0},
     { "_wxCustomDataObject","_class_wxCustomDataObject",0},
     { "_class_wxSize","_wxSize",0},
     { "_class_wxBitmap","_wxBitmap",0},