]> git.saurik.com Git - wxWidgets.git/commitdiff
Since the wxPyMake_wxObject typemap is also used for constructors we
authorRobin Dunn <robin@alldunn.com>
Wed, 30 Jun 2004 20:12:14 +0000 (20:12 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 30 Jun 2004 20:12:14 +0000 (20:12 +0000)
need to allow it to use the $owner value to specify if the thisown
attribute shoudl be set to true.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/contrib/gizmos/gizmos.i
wxPython/contrib/ogl/_ogldefs.i
wxPython/contrib/ogl/ogl.i
wxPython/include/wx/wxPython/wxPython.h
wxPython/include/wx/wxPython/wxPython_int.h
wxPython/src/_printfw.i
wxPython/src/_window.i
wxPython/src/grid.i
wxPython/src/helpers.cpp
wxPython/src/html.i
wxPython/src/my_typemaps.i

index fea136cb3b58b2a88411ce24f3f67d13fe9c75fd..a6d131ca19715af436eb3c93b30d87950b5de33a 100644 (file)
@@ -285,7 +285,7 @@ public:
         bool found;
         bool blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
-            PyObject* dcobj = wxPyMake_wxObject(&dc);
+            PyObject* dcobj = wxPyMake_wxObject(&dc,false);
             PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), False);
             PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), False);
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
@@ -951,7 +951,7 @@ public:
     wxTreeItemId FindItem (const wxTreeItemId& item, const wxString& str, int flags = 0);
 
     wxWindow* GetHeaderWindow() const;
-    wxWindow* GetMainWindow() const;
+    wxScrolledWindow* GetMainWindow() const;
 
 };
 
index 435225c29c8813a3d9d696d4b102c3cc2f82fdc5..207f8f1895c7d3d657329746ce3b74a75622d018 100644 (file)
 
 
 // OOR Support
-%typemap(out) wxPyShape*                { $result = wxPyMake_wxShapeEvtHandler($1); }
-%typemap(out) wxPyShapeEvtHandler*      { $result = wxPyMake_wxShapeEvtHandler($1); }
-%typemap(out) wxPyDivisionShape*        { $result = wxPyMake_wxShapeEvtHandler($1); }
-
-%typemap(out) wxPyShapeCanvas*          { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxDiagram*                { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxOGLConstraint*          { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxPseudoMetaFile*         { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxArrowHead*              { $result = wxPyMake_wxObject($1); }
+%typemap(out) wxPyShape*                { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
+%typemap(out) wxPyShapeEvtHandler*      { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
+%typemap(out) wxPyDivisionShape*        { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
+
+%typemap(out) wxPyShapeCanvas*          { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxDiagram*                { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxOGLConstraint*          { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxPseudoMetaFile*         { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxArrowHead*              { $result = wxPyMake_wxObject($1, $owner); }
 
 
 
index fff16bd5a4df1ae6967ab5d3f0190115bce801ca..3dc1464e0486065db3672b4e01413f51251eb632 100644 (file)
@@ -245,7 +245,7 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
 
 //---------------------------------------------------------------------------
 
-PyObject*  wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
+PyObject*  wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source, bool setThisOwn) {
     PyObject* target = NULL;
 
     if (source && wxIsKindOf(source, wxShapeEvtHandler)) {
@@ -260,7 +260,7 @@ PyObject*  wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
         }
     }
     if (! target) {
-        target = wxPyMake_wxObject2(source, FALSE);
+        target = wxPyMake_wxObject2(source, setThisOwn, false);
         if (target != Py_None)
             ((wxShapeEvtHandler*)source)->SetClientObject(new wxPyOORClientData(target));
     }
@@ -301,7 +301,7 @@ PyObject* wxPy_ConvertShapeList(wxListBase* listbase) {
     pyList = PyList_New(0);
     while (node) {
         wxObj = node->GetData();
-        pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj);
+        pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj, false);
         PyList_Append(pyList, pyObj);
         node = node->GetNext();
     }
index dc3a1f68207e4748b9b2cdf309823f055c39d255..4f96d2fcfdb4c721a790c7a336b731f9a1a998a9 100644 (file)
@@ -115,9 +115,9 @@ inline wxPyCoreAPI* wxPyGetCoreAPIPtr()
 #define wxPyCBH_callCallbackObj(a, b)           (wxPyGetCoreAPIPtr()->p_wxPyCBH_callCallbackObj(a, b))
 #define wxPyCBH_delete(a)                       (wxPyGetCoreAPIPtr()->p_wxPyCBH_delete(a))
 
-#define wxPyMake_wxObject(a)                    (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,True))
-#define wxPyMake_wxObject2(a,b)                 (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b))
-#define wxPyMake_wxSizer(a)                     (wxPyGetCoreAPIPtr()->p_wxPyMake_wxSizer(a))
+#define wxPyMake_wxObject(a,b)                  (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b,True))
+#define wxPyMake_wxObject2(a,b,c)               (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b,c))
+#define wxPyMake_wxSizer(a,b)                   (wxPyGetCoreAPIPtr()->p_wxPyMake_wxSizer(a,b))
 #define wxPyPtrTypeMap_Add(a, b)                (wxPyGetCoreAPIPtr()->p_wxPyPtrTypeMap_Add(a, b))
 #define wxPy2int_seq_helper(a, b, c)            (wxPyGetCoreAPIPtr()->p_wxPy2int_seq_helper(a, b, c))
 #define wxPy4int_seq_helper(a, b, c, d, e)      (wxPyGetCoreAPIPtr()->p_wxPy4int_seq_helper(a, b, c, d, e))
index c65b6a9e302008ac89747fba3a5fc66196a278c3..157b58bef01eb032c5499245fd69418696b0dd56 100644 (file)
@@ -109,8 +109,8 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* classname);
 PyObject* wx2PyString(const wxString& src);
 wxString  Py2wxString(PyObject* source);
 
-PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler=True);
-PyObject* wxPyMake_wxSizer(wxSizer* source);
+PyObject* wxPyMake_wxObject(wxObject* source, bool setThisOwn, bool checkEvtHandler=True);
+PyObject* wxPyMake_wxSizer(wxSizer* source, bool setThisOwn);
 void      wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
 
 PyObject* wxPy_ConvertList(wxListBase* list);
@@ -414,8 +414,8 @@ struct wxPyCoreAPI {
     PyObject*           (*p_wxPyCBH_callCallbackObj)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
     void                (*p_wxPyCBH_delete)(wxPyCallbackHelper* cbh);
 
-    PyObject*           (*p_wxPyMake_wxObject)(wxObject* source, bool checkEvtHandler);
-    PyObject*           (*p_wxPyMake_wxSizer)(wxSizer* source);
+    PyObject*           (*p_wxPyMake_wxObject)(wxObject* source, bool setThisOwn, bool checkEvtHandler);
+    PyObject*           (*p_wxPyMake_wxSizer)(wxSizer* source, bool setThisOwn);
     void                (*p_wxPyPtrTypeMap_Add)(const char* commonName, const char* ptrName);
     bool                (*p_wxPy2int_seq_helper)(PyObject* source, int* i1, int* i2);
     bool                (*p_wxPy4int_seq_helper)(PyObject* source, int* i1, int* i2, int* i3, int* i4);
@@ -939,7 +939,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                     \
         bool blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
-            PyObject* obj = wxPyMake_wxObject(&a);                      \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));  \
             Py_DECREF(obj);                                             \
         }                                                               \
@@ -965,7 +965,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                     \
         bool blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
-            PyObject* obj = wxPyMake_wxObject(&a);                      \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
             Py_DECREF(obj);                                             \
         }                                                               \
@@ -989,7 +989,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                     \
         bool blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
-            PyObject* obj = wxPyMake_wxObject(&a);                      \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
             Py_DECREF(obj);                                             \
         }                                                               \
@@ -1056,7 +1056,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                                     \
         bool blocked = wxPyBeginBlockThreads();                                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
-            PyObject* obj = wxPyMake_wxObject(&a);                                      \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));  \
             Py_DECREF(obj);                                                             \
         }                                                                               \
@@ -1081,7 +1081,7 @@ extern wxPyApp *wxPythonApp;
         bool blocked = wxPyBeginBlockThreads();                                         \
         bool rval=False;                                                                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
-            PyObject* obj = wxPyMake_wxObject(&a);                                      \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                                \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
             Py_DECREF(obj);                                                             \
         }                                                                               \
@@ -1128,7 +1128,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(&a);                              \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Odddd)", obj, b, c, d, e));   \
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -1152,7 +1152,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(&a);                              \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -1177,7 +1177,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(a);                               \
+            PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -1202,7 +1202,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(a);                               \
+            PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddii)", obj, b, c, d, e));   \
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -1679,7 +1679,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(a);                               \
+            PyObject* obj = wxPyMake_wxObject(a,false);                         \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -1705,8 +1705,8 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* win = wxPyMake_wxObject(a);                               \
-            PyObject* dc  = wxPyMake_wxObject(&b);                              \
+            PyObject* win = wxPyMake_wxObject(a,false);                         \
+            PyObject* dc  = wxPyMake_wxObject(&b,false);                        \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc));\
             Py_DECREF(win);                                                     \
             Py_DECREF(dc);                                                      \
@@ -1732,7 +1732,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(a);                               \
+            PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));          \
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -1824,7 +1824,7 @@ extern wxPyApp *wxPythonApp;
         wxFSFile* rval=0;                                                       \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
-            PyObject* obj = wxPyMake_wxObject(&a);                              \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             PyObject* s = wx2PyString(b);                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OO)",        \
                                          obj, s));                              \
@@ -2367,7 +2367,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(&a);                              \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             PyObject* ro = wxPyConstructObject((void*)&b, wxT("wxRect"), 0);    \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOi)", obj, ro, (int)c)); \
             Py_DECREF(obj);                                                     \
@@ -2387,7 +2387,7 @@ extern wxPyApp *wxPythonApp;
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxObject(&a);                              \
+            PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             PyObject* ro = wxPyConstructObject((void*)&b, wxT("wxRect"), 0);    \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOi)", obj, ro, (int)c)); \
             Py_DECREF(obj);                                                     \
index afe09dbd29cc619fc80f4cbc782047b59fdec930..861fa83a8bc6aa5120664b81e9a723f04fe0c19e 100644 (file)
@@ -550,8 +550,8 @@ public:
         bool found;                                                             \
         bool blocked = wxPyBeginBlockThreads();                                                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* win = wxPyMake_wxObject(a);                               \
-            PyObject* dc  = wxPyMake_wxObject(&b);                              \
+            PyObject* win = wxPyMake_wxObject(a,false);                               \
+            PyObject* dc  = wxPyMake_wxObject(&b,false);                              \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc));\
             Py_DECREF(win);                                                     \
             Py_DECREF(dc);                                                      \
index 34285e9f468316d9a6e08fd02acc9b07209b899e..1c382760f36a1628c21c51cafdb244fcf6e8897d 100644 (file)
@@ -32,7 +32,7 @@ struct wxVisualAttributes
     %extend {
         wxVisualAttributes() { return new wxVisualAttributes; }
         ~wxVisualAttributes() { delete self; }
-    }
+    } 
     
     // the font used for control label/text inside it
     wxFont font;
@@ -1302,7 +1302,7 @@ themes represent the appearance chosen by the user to be used for all
 applications on the system.", "");
 
     DocDeclStr(
-        void , SetOwnBackroundColour(const wxColour& colour),
+        void , SetOwnBackgroundColour(const wxColour& colour),
         "", "");
     
 
index 399ad37622434e58a56032d47bf7bf339bd1b4f9..6e8f87af04b983bda683c55555cad963f685a894 100644 (file)
@@ -45,17 +45,17 @@ MAKE_CONST_WXSTRING2(DateTimeFormatStr, wxT("%c"));
 //---------------------------------------------------------------------------
 // OOR related typemaps and helper functions
 
-%typemap(out) wxGridCellRenderer*     { $result = wxPyMake_wxGridCellRenderer($1); }
-%typemap(out) wxGridCellEditor*       { $result = wxPyMake_wxGridCellEditor($1); }
-%typemap(out) wxGridCellAttr*         { $result = wxPyMake_wxGridCellAttr($1); }
-%typemap(out) wxGridCellAttrProvider* { $result = wxPyMake_wxGridCellAttrProvider($1); }
-%typemap(out) wxGridTableBase*        { $result = wxPyMake_wxGridTableBase($1); }
+%typemap(out) wxGridCellRenderer*     { $result = wxPyMake_wxGridCellRenderer($1, $owner); }
+%typemap(out) wxGridCellEditor*       { $result = wxPyMake_wxGridCellEditor($1, $owner); }
+%typemap(out) wxGridCellAttr*         { $result = wxPyMake_wxGridCellAttr($1, $owner); }
+%typemap(out) wxGridCellAttrProvider* { $result = wxPyMake_wxGridCellAttrProvider($1, $owner); }
+%typemap(out) wxGridTableBase*        { $result = wxPyMake_wxGridTableBase($1, $owner); }
 
 
 %{
 
 #define wxPyMake_TEMPLATE(TYPE) \
-PyObject* wxPyMake_##TYPE(TYPE* source) { \
+PyObject* wxPyMake_##TYPE(TYPE* source, bool setThisOwn) { \
     PyObject* target = NULL; \
     if (source) { \
         /* Check if there is already a pointer to a Python object in the \
@@ -68,7 +68,7 @@ PyObject* wxPyMake_##TYPE(TYPE* source) { \
         /* Otherwise make a new wrapper for it the old fashioned way and \
            give it the OOR treatment */ \
         if (! target) { \
-            target = wxPyConstructObject(source, wxT(#TYPE), False); \
+            target = wxPyConstructObject(source, wxT(#TYPE), setThisOwn); \
             if (target) \
                 source->SetClientObject(new wxPyOORClientData(target)); \
         } \
@@ -126,7 +126,7 @@ wxPyMake_TEMPLATE(wxGridTableBase)
         bool blocked = wxPyBeginBlockThreads();                                                \
         bool found;                                                             \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxGridCellAttr(attr);                      \
+            PyObject* obj = wxPyMake_wxGridCellAttr(attr,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oii)", obj, a, b));  \
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -145,7 +145,7 @@ wxPyMake_TEMPLATE(wxGridTableBase)
         bool blocked = wxPyBeginBlockThreads();                                                \
         bool found;                                                             \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyMake_wxGridCellAttr(attr);                      \
+            PyObject* obj = wxPyMake_wxGridCellAttr(attr,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, val));    \
             Py_DECREF(obj);                                                     \
         }                                                                       \
@@ -566,9 +566,9 @@ public:
               int row, int col, bool isSelected) {
         bool blocked = wxPyBeginBlockThreads();
         if (wxPyCBH_findCallback(m_myInst, "Draw")) {
-            PyObject* go = wxPyMake_wxObject(&grid);
-            PyObject* dco = wxPyMake_wxObject(&dc);
-            PyObject* ao = wxPyMake_wxGridCellAttr(&attr);
+            PyObject* go = wxPyMake_wxObject(&grid,false);
+            PyObject* dco = wxPyMake_wxObject(&dc,false);
+            PyObject* ao = wxPyMake_wxGridCellAttr(&attr,false);
             PyObject* ro = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
 
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOiii)", go, ao, dco, ro,
@@ -588,9 +588,9 @@ public:
         if (wxPyCBH_findCallback(m_myInst, "GetBestSize")) {
             PyObject* ro;
             wxSize*   ptr;
-            PyObject* go = wxPyMake_wxObject(&grid);
-            PyObject* dco = wxPyMake_wxObject(&dc);
-            PyObject* ao = wxPyMake_wxGridCellAttr(&attr);
+            PyObject* go = wxPyMake_wxObject(&grid,false);
+            PyObject* dco = wxPyMake_wxObject(&dc,false);
+            PyObject* ao = wxPyMake_wxGridCellAttr(&attr,false);
 
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OOOii)",
                                                                  go, ao, dco,
@@ -782,8 +782,8 @@ public:
     void Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler) {
         bool blocked = wxPyBeginBlockThreads();
         if (wxPyCBH_findCallback(m_myInst, "Create")) {
-            PyObject* po = wxPyMake_wxObject(parent);
-            PyObject* eo = wxPyMake_wxObject(evtHandler);
+            PyObject* po = wxPyMake_wxObject(parent,false);
+            PyObject* eo = wxPyMake_wxObject(evtHandler,false);
 
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiO)", po, id, eo));
             Py_DECREF(po);
@@ -796,7 +796,7 @@ public:
     void BeginEdit(int row, int col, wxGrid* grid) {
         bool blocked = wxPyBeginBlockThreads();
         if (wxPyCBH_findCallback(m_myInst, "BeginEdit")) {
-            PyObject* go = wxPyMake_wxObject(grid);
+            PyObject* go = wxPyMake_wxObject(grid,false);
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)", row, col, go));
             Py_DECREF(go);
         }
@@ -808,7 +808,7 @@ public:
         bool rv = False;
         bool blocked = wxPyBeginBlockThreads();
         if (wxPyCBH_findCallback(m_myInst, "EndEdit")) {
-            PyObject* go = wxPyMake_wxObject(grid);
+            PyObject* go = wxPyMake_wxObject(grid,false);
             rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)", row, col, go));
             Py_DECREF(go);
         }
@@ -839,7 +839,7 @@ public:
         bool found;
         bool blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "Show"))) {
-            PyObject* ao = wxPyMake_wxGridCellAttr(attr);
+            PyObject* ao = wxPyMake_wxGridCellAttr(attr,false);
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iO)", show, ao));
             Py_DECREF(ao);
         }
@@ -856,7 +856,7 @@ public:
         bool found;
         bool blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "PaintBackground)"))) {
-            PyObject* ao = wxPyMake_wxGridCellAttr(attr);
+            PyObject* ao = wxPyMake_wxGridCellAttr(attr,false);
             PyObject* ro = wxPyConstructObject((void*)&rectCell, wxT("wxRect"), 0);
 
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", ro, ao));
index b89e8fec50b036ab87155f49bb9edd48fab25dfe..3984fd52b02c941f319b769d57d309f31551729d 100644 (file)
@@ -953,7 +953,7 @@ void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName) {
 
 
 
-PyObject*  wxPyMake_wxObject(wxObject* source, bool checkEvtHandler) {
+PyObject*  wxPyMake_wxObject(wxObject* source, bool setThisOwn, bool checkEvtHandler) {
     PyObject* target = NULL;
     bool      isEvtHandler = False;
 
@@ -986,7 +986,7 @@ PyObject*  wxPyMake_wxObject(wxObject* source, bool checkEvtHandler) {
                 exists = wxPyCheckSwigType(name);
             }
             if (info) {
-                target = wxPyConstructObject((void*)source, name, False);
+                target = wxPyConstructObject((void*)source, name, setThisOwn);
                 if (target && isEvtHandler)
                     ((wxEvtHandler*)source)->SetClientObject(new wxPyOORClientData(target));
             } else {
@@ -1003,7 +1003,7 @@ PyObject*  wxPyMake_wxObject(wxObject* source, bool checkEvtHandler) {
 }
 
 
-PyObject*  wxPyMake_wxSizer(wxSizer* source) {
+PyObject*  wxPyMake_wxSizer(wxSizer* source, bool setThisOwn) {
     PyObject* target = NULL;
 
     if (source && wxIsKindOf(source, wxSizer)) {
@@ -1018,7 +1018,7 @@ PyObject*  wxPyMake_wxSizer(wxSizer* source) {
         }
     }
     if (! target) {
-        target = wxPyMake_wxObject(source, False);
+        target = wxPyMake_wxObject(source, setThisOwn, False);
         if (target != Py_None)
             ((wxSizer*)source)->SetClientObject(new wxPyOORClientData(target));
     }
@@ -1841,7 +1841,7 @@ PyObject* wxPy_ConvertList(wxListBase* listbase) {
     pyList = PyList_New(0);
     while (node) {
         wxObj = node->GetData();
-        pyObj = wxPyMake_wxObject(wxObj);
+        pyObj = wxPyMake_wxObject(wxObj,false);
         PyList_Append(pyList, pyObj);
         node = node->GetNext();
     }
index 74cc3ac90f2abd8e36338c6c1a90b16cfb3f3c17..828805da14824465ba518906dccf69d09e6cca4e 100644 (file)
@@ -636,7 +636,7 @@ public:
         bool found;
         bool blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "CanRead"))) {
-            PyObject* obj = wxPyMake_wxObject((wxFSFile*)&file);  // cast away const
+            PyObject* obj = wxPyMake_wxObject((wxFSFile*)&file,false);  // cast away const
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
             Py_DECREF(obj);
         }
@@ -652,7 +652,7 @@ public:
         bool found;
         bool blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "ReadFile"))) {
-            PyObject* obj = wxPyMake_wxObject((wxFSFile*)&file);  // cast away const
+            PyObject* obj = wxPyMake_wxObject((wxFSFile*)&file,false);  // cast away const
             PyObject* ro;
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)", obj));
             Py_DECREF(obj);
index f1bfc3cd7d5f12debab316ece71830acee2fd957..cd0d21826db66deddd89cd77ba1a8022c576ae0f 100644 (file)
 
 
 
-// Typemaps to convert an array of ints to a list for return values
+// Typemaps to convert an array of strings to a list for return values
 %typemap(out) wxArrayString& {
     $result = wxArrayString2PyList_helper(*$1);
 }
@@ -340,57 +340,53 @@ SWIG_AsDouble(PyObject *obj)
 // to the real derived type, if possible.  See wxPyMake_wxObject in
 // helpers.cpp
 
-%typemap(out) wxEvtHandler*             { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxMenu*                   { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxValidator*              { $result = wxPyMake_wxObject($1); }
-
-%typemap(out) wxApp*                    { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxPyApp*                  { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxDC*                     { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxFSFile*                 { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxFileSystem*             { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxGridTableBase*          { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxImageList*              { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxListItem*               { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxMenuItem*               { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxMouseEvent*             { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxObject*                 { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxPyPrintout*             { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxToolBarToolBase*        { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxToolTip*                { $result = wxPyMake_wxObject($1); }
-
-
-%typemap(out) wxBitmapButton*           { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxButton*                 { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxControl*                { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxFrame*                  { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxGrid*                   { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxListCtrl*               { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxMDIChildFrame*          { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxMDIClientWindow*        { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxMenuBar*                { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxNotebook*               { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxStaticBox*              { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxStatusBar*              { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxTextCtrl*               { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxToolBar*                { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxToolBarBase*            { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxTreeCtrl*               { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxPyTreeCtrl*             { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxWindow*                 { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxHtmlWindow*             { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxPyHtmlWindow*           { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxWizardPage*             { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxPanel*                  { $result = wxPyMake_wxObject($1); }
-%typemap(out) wxDialog*                 { $result = wxPyMake_wxObject($1); }
-
-%typemap(out) wxSizer*                  { $result = wxPyMake_wxSizer($1); }
-
-
-//%typemap(python, out) wxHtmlCell*               { $target = wxPyMake_wxObject($source); }
-//%typemap(python, out) wxHtmlContainerCell*      { $target = wxPyMake_wxObject($source); }
-//%typemap(python, out) wxHtmlParser*             { $target = wxPyMake_wxObject($source); }
-//%typemap(python, out) wxHtmlWinParser*          { $target = wxPyMake_wxObject($source); }
+%typemap(out) wxEvtHandler*             { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxMenu*                   { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxValidator*              { $result = wxPyMake_wxObject($1, $owner); }
+
+%typemap(out) wxApp*                    { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxPyApp*                  { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxDC*                     { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxFSFile*                 { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxFileSystem*             { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxGridTableBase*          { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxImageList*              { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxListItem*               { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxMenuItem*               { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxMouseEvent*             { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxObject*                 { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxPyPrintout*             { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxToolBarToolBase*        { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxToolTip*                { $result = wxPyMake_wxObject($1, $owner); }
+
+
+%typemap(out) wxBitmapButton*           { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxButton*                 { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxControl*                { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxFrame*                  { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxGrid*                   { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxListCtrl*               { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxMDIChildFrame*          { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxMDIClientWindow*        { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxMenuBar*                { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxNotebook*               { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxStaticBox*              { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxStatusBar*              { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxTextCtrl*               { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxToolBar*                { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxToolBarBase*            { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxTreeCtrl*               { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxPyTreeCtrl*             { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxWindow*                 { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxHtmlWindow*             { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxPyHtmlWindow*           { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxWizardPage*             { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxPanel*                  { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxDialog*                 { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxScrolledWindow*         { $result = wxPyMake_wxObject($1, $owner); }
+
+%typemap(out) wxSizer*                  { $result = wxPyMake_wxSizer($1, $owner); }
+
 
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------