Implemented the first phase of OOR (Original Object Return). See the

text in the demo for more details of what this means, but in a
nutshell methods such as wxWindow.GetParent or FindWindowById will now
return a shadow object of the proper type if it can.  By "proper type"
I mean that if the wxWindow pointer returned from FindWindowById
really points to a wxButton then the Python object constructed will be
of a wxButtonPtr class instead of wxWindowPtr as before.  This should
reduce or eliminiate the need for wxPyTypeCast.  (Woo Hoo!)  The
objects returned are still not the original Python object, but that is
the next step.  (Although it will probably only work on Python 2.1 and
beyond because it will use weak references.)

A few other minor tweaks and fixes and additions for things found
while doing the OOR stuff.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-05-18 05:20:01 +00:00
parent 419c299ae5
commit 9df61a29d2
50 changed files with 4883 additions and 2445 deletions

View File

@@ -24,7 +24,7 @@ def wxMemoryFSHandler_AddFile(filename, a, b=''):
__wxMemoryFSHandler_AddFile_Data(filename, a)
else: raise TypeError, 'wxImage, wxBitmap or string expected'
class wxFSFilePtr :
class wxFSFilePtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -54,7 +54,7 @@ class wxFSFile(wxFSFilePtr):
class wxCPPFileSystemHandlerPtr :
class wxCPPFileSystemHandlerPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -79,7 +79,6 @@ class wxFileSystemHandlerPtr(wxCPPFileSystemHandlerPtr):
return val
def OpenFile(self, *_args, **_kwargs):
val = apply(filesysc.wxFileSystemHandler_OpenFile,(self,) + _args, _kwargs)
if val: val = wxFSFilePtr(val)
return val
def FindFirst(self, *_args, **_kwargs):
val = apply(filesysc.wxFileSystemHandler_FindFirst,(self,) + _args, _kwargs)
@@ -113,7 +112,7 @@ class wxFileSystemHandler(wxFileSystemHandlerPtr):
class wxFileSystemPtr :
class wxFileSystemPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -125,7 +124,6 @@ class wxFileSystemPtr :
return val
def OpenFile(self, *_args, **_kwargs):
val = apply(filesysc.wxFileSystem_OpenFile,(self,) + _args, _kwargs)
if val: val = wxFSFilePtr(val)
return val
def FindFirst(self, *_args, **_kwargs):
val = apply(filesysc.wxFileSystem_FindFirst,(self,) + _args, _kwargs)
@@ -152,7 +150,6 @@ class wxInternetFSHandlerPtr(wxCPPFileSystemHandlerPtr):
return val
def OpenFile(self, *_args, **_kwargs):
val = apply(filesysc.wxInternetFSHandler_OpenFile,(self,) + _args, _kwargs)
if val: val = wxFSFilePtr(val)
return val
def __repr__(self):
return "<C wxInternetFSHandler instance at %s>" % (self.this,)
@@ -173,7 +170,6 @@ class wxZipFSHandlerPtr(wxCPPFileSystemHandlerPtr):
return val
def OpenFile(self, *_args, **_kwargs):
val = apply(filesysc.wxZipFSHandler_OpenFile,(self,) + _args, _kwargs)
if val: val = wxFSFilePtr(val)
return val
def FindFirst(self, *_args, **_kwargs):
val = apply(filesysc.wxZipFSHandler_FindFirst,(self,) + _args, _kwargs)
@@ -200,7 +196,6 @@ class wxMemoryFSHandlerPtr(wxCPPFileSystemHandlerPtr):
return val
def OpenFile(self, *_args, **_kwargs):
val = apply(filesysc.wxMemoryFSHandler_OpenFile,(self,) + _args, _kwargs)
if val: val = wxFSFilePtr(val)
return val
def FindFirst(self, *_args, **_kwargs):
val = apply(filesysc.wxMemoryFSHandler_FindFirst,(self,) + _args, _kwargs)