]> git.saurik.com Git - wxWidgets.git/commitdiff
Use the DISOWN typemap
authorRobin Dunn <robin@alldunn.com>
Tue, 27 Jan 2004 00:52:47 +0000 (00:52 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 27 Jan 2004 00:52:47 +0000 (00:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/_clipbrd.i
wxPython/src/_dataobj.i
wxPython/src/_dnd.i
wxPython/src/_listctrl.i
wxPython/src/_notebook.i
wxPython/src/_treectrl.i
wxPython/src/_window.i

index b1d42c2046e896f4251bc7025dcb1c331f5c9388..ef48ae8daa9d96f3bec9396edc393d118b23c32b 100644 (file)
@@ -40,6 +40,9 @@ public:
     // query whether the clipboard is opened
     virtual bool IsOpened() const;
 
+
+    %apply SWIGTYPE *DISOWN { wxDataObject *data };
+    
     // add to the clipboard data
     //
     // NB: the clipboard owns the pointer and will delete it, so data must be
@@ -50,6 +53,8 @@ public:
     // AddData()
     virtual bool SetData( wxDataObject *data );
 
+    %clear wxDataObject *data;
+    
     // ask if data in correct format is available
     virtual bool IsSupported( const wxDataFormat& format );
 
index 7a52a473055b79f925efd25bca8c8615e1f6bb6d..8dacc168d8588d278f4b6e8c80067efa2068cfac 100644 (file)
@@ -240,8 +240,9 @@ class wxDataObjectComposite : public wxDataObject {
 public:
     wxDataObjectComposite();
 
-    %addtofunc Add "args[1].thisown = 0"
+    %apply SWIGTYPE *DISOWN { wxDataObjectSimple *dataObject };
     void Add(wxDataObjectSimple *dataObject, int preferred = False);
+    %clear wxDataObjectSimple *dataObject;
 };
 
 //---------------------------------------------------------------------------
index 4e59285844a28d551dfe2633fed9b83e0478b364..19a9494430d2021d60d17dc721497a68883b3f6e 100644 (file)
@@ -119,8 +119,8 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop);
 {
 public:
     %addtofunc wxPyDropTarget
-       "if args: args[0].thisown = 0;
-        self._setCallbackInfo(self, DropTarget)"
+       "self._setCallbackInfo(self, DropTarget)"
+    %apply SWIGTYPE *DISOWN { wxDataObject *dataObject };
 
     wxPyDropTarget(wxDataObject *dataObject = NULL);
     void _setCallbackInfo(PyObject* self, PyObject* _class);
@@ -129,9 +129,10 @@ public:
 
     // get/set the associated wxDataObject
     wxDataObject *GetDataObject();
-    %addtofunc SetDataObject "args[1].thisown = 0"
     void SetDataObject(wxDataObject *dataObject);
 
+    %clear wxDataObject *dataObject;
+
     wxDragResult base_OnEnter(wxCoord x, wxCoord y, wxDragResult def);
     wxDragResult base_OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
     void base_OnLeave();
index 156c2f658df7af3e18fda8e478335c5646b7243a..60f6ba3edc61e837d92d183008c7b648ace76187 100644 (file)
@@ -578,9 +578,10 @@ public:
 
     // is there a way to tell SWIG to disown this???
 
-    %addtofunc AssignImageList "args[1].thisown = 0";    
+    %apply SWIGTYPE *DISOWN { wxImageList *imageList };
     void AssignImageList(wxImageList *imageList, int which);
-
+    %clear wxImageList *imageList;
+    
     // returns True if it is a virtual list control
     bool IsVirtual() const;
 
index baff847c7694330d8124b82945fbc4d9a9ccd0c5..5cfb31366748289e7972a8086105d6c6a8546bcd 100644 (file)
@@ -64,8 +64,9 @@ public:
     virtual void SetImageList(wxImageList *imageList);
 
     // as SetImageList() but we will delete the image list ourselves
-    %addtofunc AssignImageList "args[1].thisown = 0"
+    %apply SWIGTYPE *DISOWN { wxImageList *imageList };
     void AssignImageList(wxImageList *imageList);
+    %clear wxImageList *imageList;
 
     // get pointer (may be NULL) to the associated image list
     wxImageList* GetImageList() const;
index 1fac4850c11114ebc867fdfaaf6c9b3014767dc6..616322344c0d3819dd3d81dce163c761d52a0059 100644 (file)
@@ -371,10 +371,10 @@ public:
     void SetImageList(wxImageList *imageList);
     void SetStateImageList(wxImageList *imageList);
 
-    %addtofunc AssignImageList      "args[1].thisown = 0";
-    %addtofunc AssignStateImageList "args[1].thisown = 0";
+    %apply SWIGTYPE *DISOWN { wxImageList *imageList };
     void AssignImageList(wxImageList *imageList);
     void AssignStateImageList(wxImageList *imageList);
+    %clear wxImageList *imageList;
     
 
     // retrieve items label
index b446de9d06412db6a14219817d2cc06eaff44b5f..3ffc44537df66e10d274cd41973459318f1d7d96 100644 (file)
@@ -683,8 +683,10 @@ public:
 
     // set/retrieve the drop target associated with this window (may be
     // NULL; it's owned by the window and will be deleted by it)
-    %addtofunc SetDropTarget "args[1].thisown = 0"
+    %apply SWIGTYPE *DISOWN { wxPyDropTarget *dropTarget };
     virtual void SetDropTarget( wxPyDropTarget *dropTarget );
+    %clear wxPyDropTarget *dropTarget;
+    
     virtual wxPyDropTarget *GetDropTarget() const;
 
 #ifdef __WXMSW__  // TODO:  should I drop-kick this?