Changes needed to be able to build with SWIG 1.3.24, 1.3.27 as well as
the upcoming 1.3.28, using #if statements on SWIG_VERSION. Adjustments to ownership of SWIG objects, add some destructors and explicitly disown non-window objects when their ownership is transfered to a C++ object. Since all window objects are owned by their parent, or by themselves, always set their thisown attribute to False. Explicitly set thisown to False after any Destroy() methods are called, so SWIG doesn't try to destroy them again. Etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
# if this breaks something at your end, let me know and we can
|
# if this breaks something at your end, let me know and we can
|
||||||
# figure out some solution for both of us.
|
# figure out some solution for both of us.
|
||||||
if [ "$SWIGDIR" = "" ]; then
|
if [ "$SWIGDIR" = "" ]; then
|
||||||
SWIGDIR=$PROJECTS\\SWIG-cvs
|
SWIGDIR=$PROJECTS\\SWIG-1.3.27
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FLAGS="USE_SWIG=1 SWIG=$SWIGDIR\\swig.exe"
|
FLAGS="USE_SWIG=1 SWIG=$SWIGDIR\\swig.exe"
|
||||||
|
@@ -700,6 +700,7 @@ if os.name == 'nt':
|
|||||||
('WXUSINGDLL', '1'),
|
('WXUSINGDLL', '1'),
|
||||||
|
|
||||||
('SWIG_TYPE_TABLE', WXPYTHON_TYPE_TABLE),
|
('SWIG_TYPE_TABLE', WXPYTHON_TYPE_TABLE),
|
||||||
|
('SWIG_PYTHON_OUTPUT_TUPLE', None),
|
||||||
('WXP_USE_THREAD', '1'),
|
('WXP_USE_THREAD', '1'),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -754,7 +755,7 @@ elif os.name == 'posix':
|
|||||||
WXDIR = '..'
|
WXDIR = '..'
|
||||||
includes = ['include', 'src']
|
includes = ['include', 'src']
|
||||||
defines = [('SWIG_TYPE_TABLE', WXPYTHON_TYPE_TABLE),
|
defines = [('SWIG_TYPE_TABLE', WXPYTHON_TYPE_TABLE),
|
||||||
('HAVE_CONFIG_H', None),
|
('SWIG_PYTHON_OUTPUT_TUPLE', None),
|
||||||
('WXP_USE_THREAD', '1'),
|
('WXP_USE_THREAD', '1'),
|
||||||
]
|
]
|
||||||
if UNDEF_NDEBUG:
|
if UNDEF_NDEBUG:
|
||||||
@@ -873,7 +874,7 @@ i_files_includes = [ '-I' + opj(WXPY_SRC, 'src'),
|
|||||||
swig_cmd = SWIG
|
swig_cmd = SWIG
|
||||||
swig_force = force
|
swig_force = force
|
||||||
swig_args = ['-c++',
|
swig_args = ['-c++',
|
||||||
'-Wall',
|
#'-Wall',
|
||||||
'-python',
|
'-python',
|
||||||
'-new_repr',
|
'-new_repr',
|
||||||
'-modern',
|
'-modern',
|
||||||
|
@@ -582,11 +582,11 @@ public:
|
|||||||
void SetStateImageList(wxImageList *imageList);
|
void SetStateImageList(wxImageList *imageList);
|
||||||
void SetButtonsImageList(wxImageList *imageList);
|
void SetButtonsImageList(wxImageList *imageList);
|
||||||
|
|
||||||
%apply SWIGTYPE *DISOWN { wxImageList *imageList };
|
%disownarg( wxImageList *imageList );
|
||||||
void AssignImageList(wxImageList *imageList);
|
void AssignImageList(wxImageList *imageList);
|
||||||
void AssignStateImageList(wxImageList *imageList);
|
void AssignStateImageList(wxImageList *imageList);
|
||||||
void AssignButtonsImageList(wxImageList *imageList);
|
void AssignButtonsImageList(wxImageList *imageList);
|
||||||
%clear wxImageList *imageList;
|
%cleardisown( wxImageList *imageList );
|
||||||
|
|
||||||
|
|
||||||
// adds a column
|
// adds a column
|
||||||
|
@@ -245,19 +245,22 @@ public:
|
|||||||
|
|
||||||
%pythonAppend wxPyArtProvider "self._setCallbackInfo(self, ArtProvider)"
|
%pythonAppend wxPyArtProvider "self._setCallbackInfo(self, ArtProvider)"
|
||||||
wxPyArtProvider();
|
wxPyArtProvider();
|
||||||
|
~wxPyArtProvider();
|
||||||
|
|
||||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||||
|
|
||||||
|
%disownarg( wxPyArtProvider *provider );
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
static void , PushProvider(wxPyArtProvider *provider),
|
static void , PushProvider(wxPyArtProvider *provider),
|
||||||
"Add new provider to the top of providers stack.", "");
|
"Add new provider to the top of providers stack.", "");
|
||||||
|
%cleardisown( wxPyArtProvider *provider );
|
||||||
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
static bool , PopProvider(),
|
static bool , PopProvider(),
|
||||||
"Remove latest added provider and delete it.", "");
|
"Remove latest added provider and delete it.", "");
|
||||||
|
|
||||||
|
%pythonAppend RemoveProvider "args[1].thisown = 1";
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
static bool , RemoveProvider(wxPyArtProvider *provider),
|
static bool , RemoveProvider(wxPyArtProvider *provider),
|
||||||
"Remove provider. The provider must have been added previously! The
|
"Remove provider. The provider must have been added previously! The
|
||||||
@@ -286,6 +289,7 @@ topmost provider if platform_dependent = false", "");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
%extend { void Destroy() { delete self; }}
|
%extend { void Destroy() { delete self; }}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ True on success.", "");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
%apply SWIGTYPE *DISOWN { wxDataObject *data };
|
%disownarg( wxDataObject *data );
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
virtual bool , AddData( wxDataObject *data ),
|
virtual bool , AddData( wxDataObject *data ),
|
||||||
@@ -84,8 +84,8 @@ do not delete the data explicitly.
|
|||||||
|
|
||||||
:see: `wx.DataObject`", "");
|
:see: `wx.DataObject`", "");
|
||||||
|
|
||||||
|
%cleardisown( wxDataObject *data );
|
||||||
|
|
||||||
%clear wxDataObject *data;
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
virtual bool , IsSupported( const wxDataFormat& format ),
|
virtual bool , IsSupported( const wxDataFormat& format ),
|
||||||
|
@@ -289,23 +289,22 @@ which will be used when the dialog is first displayed. After the
|
|||||||
dialog is shown, this is the index selected by the user.", "");
|
dialog is shown, this is the index selected by the user.", "");
|
||||||
|
|
||||||
|
|
||||||
|
%extend {
|
||||||
DocStr(GetFilenames,
|
DocStr(GetFilenames,
|
||||||
"Returns a list of filenames chosen in the dialog. This function
|
"Returns a list of filenames chosen in the dialog. This function
|
||||||
should only be used with the dialogs which have wx.MULTIPLE style, use
|
should only be used with the dialogs which have wx.MULTIPLE style, use
|
||||||
GetFilename for the others.", "");
|
GetFilename for the others.", "");
|
||||||
|
|
||||||
DocStr(GetPaths,
|
|
||||||
"Fills the array paths with the full paths of the files chosen. This
|
|
||||||
function should only be used with the dialogs which have wx.MULTIPLE
|
|
||||||
style, use GetPath for the others.", "");
|
|
||||||
|
|
||||||
%extend {
|
|
||||||
PyObject* GetFilenames() {
|
PyObject* GetFilenames() {
|
||||||
wxArrayString arr;
|
wxArrayString arr;
|
||||||
self->GetFilenames(arr);
|
self->GetFilenames(arr);
|
||||||
return wxArrayString2PyList_helper(arr);
|
return wxArrayString2PyList_helper(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DocStr(GetPaths,
|
||||||
|
"Fills the array paths with the full paths of the files chosen. This
|
||||||
|
function should only be used with the dialogs which have wx.MULTIPLE
|
||||||
|
style, use GetPath for the others.", "");
|
||||||
|
|
||||||
PyObject* GetPaths() {
|
PyObject* GetPaths() {
|
||||||
wxArrayString arr;
|
wxArrayString arr;
|
||||||
self->GetPaths(arr);
|
self->GetPaths(arr);
|
||||||
|
@@ -85,12 +85,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
%apply SWIGTYPE *DISOWN { wxConfigBase *config };
|
%disownarg( wxConfigBase *config );
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
static wxConfigBase *, Set(wxConfigBase *config),
|
static wxConfigBase *, Set(wxConfigBase *config),
|
||||||
"Sets the global config object (the one returned by Get) and returns a
|
"Sets the global config object (the one returned by Get) and returns a
|
||||||
reference to the previous global config object.", "");
|
reference to the previous global config object.", "");
|
||||||
%clear wxConfigBase *config;
|
%cleardisown( wxConfigBase *config );
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
static wxConfigBase *, Get(bool createOnDemand = true),
|
static wxConfigBase *, Get(bool createOnDemand = true),
|
||||||
|
@@ -106,8 +106,9 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) {
|
|||||||
PyObject* robj = NULL;
|
PyObject* robj = NULL;
|
||||||
|
|
||||||
swig_type_info* swigType = wxPyFindSwigType(className);
|
swig_type_info* swigType = wxPyFindSwigType(className);
|
||||||
wxCHECK_MSG(swigType != NULL, NULL, wxT("Unknown type in wxPyConvertSwigPtr"));
|
wxCHECK_MSG(swigType != NULL, NULL, wxT("Unknown type in wxPyMakeSwigPtr"));
|
||||||
|
|
||||||
|
#if SWIG_VERSION < 0x010328
|
||||||
#ifdef SWIG_COBJECT_TYPES
|
#ifdef SWIG_COBJECT_TYPES
|
||||||
robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)swigType->name);
|
robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)swigType->name);
|
||||||
#else
|
#else
|
||||||
@@ -117,7 +118,9 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) {
|
|||||||
PyString_FromString(result) : 0;
|
PyString_FromString(result) : 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#else // SWIG_VERSION >= 1.3.28
|
||||||
|
robj = PySwigObject_New(ptr, swigType, 0);
|
||||||
|
#endif
|
||||||
return robj;
|
return robj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -208,11 +208,14 @@ application using wx.HelpProvider.Set().", "");
|
|||||||
class wxHelpProvider
|
class wxHelpProvider
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
%disownarg( wxHelpProvider *helpProvider );
|
||||||
|
%newobject Set;
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
static wxHelpProvider *, Set(wxHelpProvider *helpProvider),
|
static wxHelpProvider *, Set(wxHelpProvider *helpProvider),
|
||||||
"Sset the current, application-wide help provider. Returns the previous
|
"Sset the current, application-wide help provider. Returns the previous
|
||||||
one. Unlike some other classes, the help provider is not created on
|
one. Unlike some other classes, the help provider is not created on
|
||||||
demand. This must be explicitly done by the application.", "");
|
demand. This must be explicitly done by the application.", "");
|
||||||
|
%cleardisown( wxHelpProvider *helpProvider );
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
static wxHelpProvider *, Get(),
|
static wxHelpProvider *, Get(),
|
||||||
@@ -250,6 +253,7 @@ table of help strings will fill up and when window pointers are
|
|||||||
reused, the wrong help string will be found.", "");
|
reused, the wrong help string will be found.", "");
|
||||||
|
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
%extend { void Destroy() { delete self; } }
|
%extend { void Destroy() { delete self; } }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -230,14 +230,11 @@ data.", "");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// return all formats in the provided array (of size GetFormatCount())
|
%extend {
|
||||||
//virtual void GetAllFormats(wxDataFormat *formats,
|
|
||||||
// Direction dir = Get) const;
|
|
||||||
DocAStr(GetAllFormats,
|
DocAStr(GetAllFormats,
|
||||||
"GetAllFormats(self, int dir=Get) -> [formats]",
|
"GetAllFormats(self, int dir=Get) -> [formats]",
|
||||||
"Returns a list of all the wx.DataFormats that this dataobject supports
|
"Returns a list of all the wx.DataFormats that this dataobject supports
|
||||||
in the given direction.", "");
|
in the given direction.", "");
|
||||||
%extend {
|
|
||||||
PyObject* GetAllFormats(Direction dir = Get) {
|
PyObject* GetAllFormats(Direction dir = Get) {
|
||||||
size_t count = self->GetFormatCount(dir);
|
size_t count = self->GetFormatCount(dir);
|
||||||
wxDataFormat* formats = new wxDataFormat[count];
|
wxDataFormat* formats = new wxDataFormat[count];
|
||||||
@@ -262,12 +259,11 @@ in the given direction.", "");
|
|||||||
// True if data copied successfully, False otherwise
|
// True if data copied successfully, False otherwise
|
||||||
// virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
|
// virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
|
||||||
|
|
||||||
|
%extend {
|
||||||
DocAStr(GetDataHere,
|
DocAStr(GetDataHere,
|
||||||
"GetDataHere(self, DataFormat format) -> String",
|
"GetDataHere(self, DataFormat format) -> String",
|
||||||
"Get the data bytes in the specified format, returns None on failure.
|
"Get the data bytes in the specified format, returns None on failure.", "
|
||||||
", "
|
|
||||||
:todo: This should use the python buffer interface isntead...");
|
:todo: This should use the python buffer interface isntead...");
|
||||||
%extend {
|
|
||||||
PyObject* GetDataHere(const wxDataFormat& format) {
|
PyObject* GetDataHere(const wxDataFormat& format) {
|
||||||
PyObject* rval = NULL;
|
PyObject* rval = NULL;
|
||||||
size_t size = self->GetDataSize(format);
|
size_t size = self->GetDataSize(format);
|
||||||
@@ -353,12 +349,12 @@ assumed that the format is supported in both directions.", "");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%extend {
|
||||||
DocAStr(GetDataHere,
|
DocAStr(GetDataHere,
|
||||||
"GetDataHere(self) -> String",
|
"GetDataHere(self) -> String",
|
||||||
"Returns the data bytes from the data object as a string, returns None
|
"Returns the data bytes from the data object as a string, returns None
|
||||||
on failure. Must be implemented in the derived class if the object
|
on failure. Must be implemented in the derived class if the object
|
||||||
supports rendering its data.", "");
|
supports rendering its data.", "");
|
||||||
%extend {
|
|
||||||
PyObject* GetDataHere() {
|
PyObject* GetDataHere() {
|
||||||
PyObject* rval = NULL;
|
PyObject* rval = NULL;
|
||||||
size_t size = self->GetDataSize();
|
size_t size = self->GetDataSize();
|
||||||
@@ -379,12 +375,12 @@ supports rendering its data.", "");
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%extend {
|
||||||
DocAStr(SetData,
|
DocAStr(SetData,
|
||||||
"SetData(self, String data) -> bool",
|
"SetData(self, String data) -> bool",
|
||||||
"Copy the data value to the data object. Must be implemented in the
|
"Copy the data value to the data object. Must be implemented in the
|
||||||
derived class if the object supports setting its data.
|
derived class if the object supports setting its data.
|
||||||
", "");
|
", "");
|
||||||
%extend {
|
|
||||||
bool SetData(PyObject* data) {
|
bool SetData(PyObject* data) {
|
||||||
bool rval;
|
bool rval;
|
||||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||||
@@ -520,14 +516,14 @@ class wxDataObjectComposite : public wxDataObject {
|
|||||||
public:
|
public:
|
||||||
wxDataObjectComposite();
|
wxDataObjectComposite();
|
||||||
|
|
||||||
%apply SWIGTYPE *DISOWN { wxDataObjectSimple *dataObject };
|
%disownarg( wxDataObjectSimple *dataObject );
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
void , Add(wxDataObjectSimple *dataObject, bool preferred = false),
|
void , Add(wxDataObjectSimple *dataObject, bool preferred = false),
|
||||||
"Adds the dataObject to the list of supported objects and it becomes
|
"Adds the dataObject to the list of supported objects and it becomes
|
||||||
the preferred object if preferred is True.", "");
|
the preferred object if preferred is True.", "");
|
||||||
|
|
||||||
%clear wxDataObjectSimple *dataObject;
|
%cleardisown( wxDataObjectSimple *dataObject );
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -757,10 +753,10 @@ public:
|
|||||||
wxCustomDataObject();
|
wxCustomDataObject();
|
||||||
|
|
||||||
|
|
||||||
|
%extend {
|
||||||
DocAStr(SetData,
|
DocAStr(SetData,
|
||||||
"SetData(self, String data) -> bool",
|
"SetData(self, String data) -> bool",
|
||||||
"Copy the data value to the data object.", "");
|
"Copy the data value to the data object.", "");
|
||||||
%extend {
|
|
||||||
bool SetData(PyObject* data) {
|
bool SetData(PyObject* data) {
|
||||||
bool rval;
|
bool rval;
|
||||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||||
@@ -783,10 +779,10 @@ public:
|
|||||||
"Get the size of the data.", "");
|
"Get the size of the data.", "");
|
||||||
|
|
||||||
|
|
||||||
|
%extend {
|
||||||
DocAStr(GetData,
|
DocAStr(GetData,
|
||||||
"GetData(self) -> String",
|
"GetData(self) -> String",
|
||||||
"Returns the data bytes from the data object as a string.", "");
|
"Returns the data bytes from the data object as a string.", "");
|
||||||
%extend {
|
|
||||||
PyObject* GetData() {
|
PyObject* GetData() {
|
||||||
PyObject* obj;
|
PyObject* obj;
|
||||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Globally turn on the autodoc feature
|
|
||||||
|
|
||||||
|
// Globally turn on the autodoc feature
|
||||||
%feature("autodoc", "1"); // 0 == no param types, 1 == show param types
|
%feature("autodoc", "1"); // 0 == no param types, 1 == show param types
|
||||||
|
|
||||||
// Turn on kwargs by default
|
// Turn on kwargs by default
|
||||||
@@ -22,24 +22,39 @@
|
|||||||
// Don't generate separate wrappers for each default args combination
|
// Don't generate separate wrappers for each default args combination
|
||||||
%feature("compactdefaultargs");
|
%feature("compactdefaultargs");
|
||||||
|
|
||||||
|
#if SWIG_VERSION < 0x010328
|
||||||
// Don't generate default ctors or dtors if the C++ doesn't have them
|
// Don't generate default ctors or dtors if the C++ doesn't have them
|
||||||
%feature("nodefault");
|
%feature("nodefault");
|
||||||
|
#else
|
||||||
// This is the SWIG 1.3.28 way to do the above...
|
// This is the SWIG 1.3.28 way to do the above...
|
||||||
// // Don't generate default ctors or dtors if the C++ doesn't have them
|
%feature("nodefaultctor");
|
||||||
// %feature("nodefaultctor");
|
%feature("nodefaultdtor");
|
||||||
// %feature("nodefaultdtor");
|
#endif
|
||||||
|
|
||||||
|
// For now, just supress the warning about using Python keywords as parameter
|
||||||
|
// names. Will need to come back later and correct these rather than just
|
||||||
|
// hide them...
|
||||||
|
#pragma SWIG nowarn=314
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Tell SWIG to wrap all the wrappers with our thread protection by default
|
|
||||||
|
|
||||||
|
// Tell SWIG to wrap all the wrappers with our thread protection
|
||||||
|
%define %threadWrapperOn
|
||||||
%exception {
|
%exception {
|
||||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
$action
|
$action
|
||||||
wxPyEndAllowThreads(__tstate);
|
wxPyEndAllowThreads(__tstate);
|
||||||
if (PyErr_Occurred()) SWIG_fail;
|
if (PyErr_Occurred()) SWIG_fail;
|
||||||
}
|
}
|
||||||
|
%enddef
|
||||||
|
|
||||||
|
// This one will turn off the generation of the thread wrapper code
|
||||||
|
%define %threadWrapperOff
|
||||||
|
%exception
|
||||||
|
%enddef
|
||||||
|
|
||||||
|
// Turn it on by default
|
||||||
|
%threadWrapperOn
|
||||||
|
|
||||||
// This one can be used to add a check for an existing wxApp before the real
|
// This one can be used to add a check for an existing wxApp before the real
|
||||||
// work is done. An exception is raised if there isn't one.
|
// work is done. An exception is raised if there isn't one.
|
||||||
@@ -75,10 +90,19 @@ typedef unsigned long wxUIntPtr;
|
|||||||
|
|
||||||
#define %pythonAppend %feature("pythonappend")
|
#define %pythonAppend %feature("pythonappend")
|
||||||
#define %pythonPrepend %feature("pythonprepend")
|
#define %pythonPrepend %feature("pythonprepend")
|
||||||
#define %kwargs %feature("kwargs")
|
|
||||||
#define %nokwargs %feature("kwargs", "0")
|
|
||||||
#define %noautodoc %feature("noautodoc")
|
#define %noautodoc %feature("noautodoc")
|
||||||
|
|
||||||
|
#if SWIG_VERSION >= 0x010327
|
||||||
|
#define %kwargs %feature("kwargs", "1")
|
||||||
|
#define %nokwargs %feature("kwargs", "0")
|
||||||
|
#else
|
||||||
|
#define %kwargs %feature("kwargs")
|
||||||
|
#define %nokwargs %feature("nokwargs")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN
|
||||||
|
#define %cleardisown(typespec) %typemap(in) typespec
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef %pythoncode
|
#ifndef %pythoncode
|
||||||
|
@@ -137,7 +137,8 @@ class wxPyDropTarget // : public wxDropTarget
|
|||||||
public:
|
public:
|
||||||
%pythonAppend wxPyDropTarget
|
%pythonAppend wxPyDropTarget
|
||||||
"self._setCallbackInfo(self, DropTarget)"
|
"self._setCallbackInfo(self, DropTarget)"
|
||||||
%apply SWIGTYPE *DISOWN { wxDataObject *dataObject };
|
|
||||||
|
%disownarg( wxDataObject *dataObject );
|
||||||
|
|
||||||
wxPyDropTarget(wxDataObject *dataObject = NULL);
|
wxPyDropTarget(wxDataObject *dataObject = NULL);
|
||||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||||
@@ -148,7 +149,7 @@ public:
|
|||||||
wxDataObject *GetDataObject();
|
wxDataObject *GetDataObject();
|
||||||
void SetDataObject(wxDataObject *dataObject);
|
void SetDataObject(wxDataObject *dataObject);
|
||||||
|
|
||||||
%clear wxDataObject *dataObject;
|
%cleardisown( wxDataObject *dataObject );
|
||||||
|
|
||||||
wxDragResult base_OnEnter(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult base_OnEnter(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
wxDragResult base_OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult base_OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
|
@@ -72,6 +72,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%pythonAppend _setOORInfo "args[0].thisown = 0";
|
||||||
%extend {
|
%extend {
|
||||||
void _setOORInfo(PyObject* _self, bool incref=true) {
|
void _setOORInfo(PyObject* _self, bool incref=true) {
|
||||||
if (_self && _self != Py_None) {
|
if (_self && _self != Py_None) {
|
||||||
|
@@ -73,6 +73,7 @@ class wxGBPosition
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxGBPosition(int row=0, int col=0);
|
wxGBPosition(int row=0, int col=0);
|
||||||
|
~wxGBPosition();
|
||||||
|
|
||||||
int GetRow() const;
|
int GetRow() const;
|
||||||
int GetCol() const;
|
int GetCol() const;
|
||||||
@@ -143,6 +144,8 @@ public:
|
|||||||
colspan. The default is (1,1). (Meaning that the item occupies one
|
colspan. The default is (1,1). (Meaning that the item occupies one
|
||||||
cell in each direction.", "");
|
cell in each direction.", "");
|
||||||
|
|
||||||
|
~wxGBSpan();
|
||||||
|
|
||||||
int GetRowspan() const;
|
int GetRowspan() const;
|
||||||
int GetColspan() const;
|
int GetColspan() const;
|
||||||
void SetRowspan(int rowspan);
|
void SetRowspan(int rowspan);
|
||||||
@@ -218,6 +221,9 @@ item can be used in a Sizer.
|
|||||||
You will probably never need to create a wx.GBSizerItem directly as they
|
You will probably never need to create a wx.GBSizerItem directly as they
|
||||||
are created automatically when the sizer's Add method is called.", "");
|
are created automatically when the sizer's Add method is called.", "");
|
||||||
|
|
||||||
|
~wxGBSizerItem();
|
||||||
|
|
||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
DocStr(wxGBSizerItem( wxWindow *window, const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ),
|
DocStr(wxGBSizerItem( wxWindow *window, const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ),
|
||||||
"Construct a `wx.GBSizerItem` for a window.", "");
|
"Construct a `wx.GBSizerItem` for a window.", "");
|
||||||
@@ -241,6 +247,7 @@ are created automatically when the sizer's Add method is called.", "");
|
|||||||
|
|
||||||
DocStr(wxGBSizerItem( wxSizer *sizer,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ),
|
DocStr(wxGBSizerItem( wxSizer *sizer,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ),
|
||||||
"Construct a `wx.GBSizerItem` for a sizer", "");
|
"Construct a `wx.GBSizerItem` for a sizer", "");
|
||||||
|
%disownarg( wxSizer *sizer );
|
||||||
%RenameCtor(GBSizerItemSizer, wxGBSizerItem( wxSizer *sizer,
|
%RenameCtor(GBSizerItemSizer, wxGBSizerItem( wxSizer *sizer,
|
||||||
const wxGBPosition& pos,
|
const wxGBPosition& pos,
|
||||||
const wxGBSpan& span,
|
const wxGBSpan& span,
|
||||||
@@ -256,6 +263,7 @@ are created automatically when the sizer's Add method is called.", "");
|
|||||||
}
|
}
|
||||||
return new wxGBSizerItem(sizer, pos, span, flag, border, data);
|
return new wxGBSizerItem(sizer, pos, span, flag, border, data);
|
||||||
}
|
}
|
||||||
|
%cleardisown( wxSizer *sizer );
|
||||||
|
|
||||||
|
|
||||||
DocStr(wxGBSizerItem( int width,int height,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL),
|
DocStr(wxGBSizerItem( int width,int height,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL),
|
||||||
@@ -392,6 +400,8 @@ position, False if something was already there.
|
|||||||
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
||||||
if ( userData && (info.window || info.sizer || info.gotSize) )
|
if ( userData && (info.window || info.sizer || info.gotSize) )
|
||||||
data = new wxPyUserData(userData);
|
data = new wxPyUserData(userData);
|
||||||
|
if ( info.sizer )
|
||||||
|
PyObject_SetAttrString(item,"thisown",Py_False);
|
||||||
wxPyEndBlockThreads(blocked);
|
wxPyEndBlockThreads(blocked);
|
||||||
|
|
||||||
// Now call the real Add method if a valid item type was found
|
// Now call the real Add method if a valid item type was found
|
||||||
@@ -406,6 +416,7 @@ position, False if something was already there.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%disownarg( wxGBSizerItem *item );
|
||||||
DocDeclAStrName(
|
DocDeclAStrName(
|
||||||
wxGBSizerItem* , Add( wxGBSizerItem *item ),
|
wxGBSizerItem* , Add( wxGBSizerItem *item ),
|
||||||
"Add(self, GBSizerItem item) -> wx.GBSizerItem",
|
"Add(self, GBSizerItem item) -> wx.GBSizerItem",
|
||||||
@@ -413,6 +424,7 @@ position, False if something was already there.
|
|||||||
the item was successfully placed at its given cell position, False if
|
the item was successfully placed at its given cell position, False if
|
||||||
something was already there.", "",
|
something was already there.", "",
|
||||||
AddItem);
|
AddItem);
|
||||||
|
%cleardisown( wxGBSizerItem *item );
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
wxSize , GetCellSize(int row, int col) const,
|
wxSize , GetCellSize(int row, int col) const,
|
||||||
|
@@ -153,7 +153,7 @@ public:
|
|||||||
wxListItemAttr(const wxColour& colText = wxNullColour,
|
wxListItemAttr(const wxColour& colText = wxNullColour,
|
||||||
const wxColour& colBack = wxNullColour,
|
const wxColour& colBack = wxNullColour,
|
||||||
const wxFont& font = wxNullFont);
|
const wxFont& font = wxNullFont);
|
||||||
|
~wxListItemAttr();
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
void SetTextColour(const wxColour& colText);
|
void SetTextColour(const wxColour& colText);
|
||||||
@@ -169,6 +169,9 @@ public:
|
|||||||
wxColour GetBackgroundColour();
|
wxColour GetBackgroundColour();
|
||||||
wxFont GetFont();
|
wxFont GetFont();
|
||||||
|
|
||||||
|
void AssignFrom(const wxListItemAttr& source);
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
%extend { void Destroy() { delete self; } }
|
%extend { void Destroy() { delete self; } }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -592,11 +595,9 @@ public:
|
|||||||
// Sets the image list
|
// Sets the image list
|
||||||
void SetImageList(wxImageList *imageList, int which);
|
void SetImageList(wxImageList *imageList, int which);
|
||||||
|
|
||||||
// is there a way to tell SWIG to disown this???
|
%disownarg( wxImageList *imageList );
|
||||||
|
|
||||||
%apply SWIGTYPE *DISOWN { wxImageList *imageList };
|
|
||||||
void AssignImageList(wxImageList *imageList, int which);
|
void AssignImageList(wxImageList *imageList, int which);
|
||||||
%clear wxImageList *imageList;
|
%cleardisown( wxImageList *imageList );
|
||||||
|
|
||||||
// are we in report mode?
|
// are we in report mode?
|
||||||
bool InReportView() const;
|
bool InReportView() const;
|
||||||
|
@@ -54,7 +54,7 @@ class wxLog
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxLog();
|
wxLog();
|
||||||
|
~wxLog();
|
||||||
|
|
||||||
// these functions allow to completely disable all log messages
|
// these functions allow to completely disable all log messages
|
||||||
// is logging disabled now?
|
// is logging disabled now?
|
||||||
@@ -80,8 +80,11 @@ public:
|
|||||||
// create one if none exists
|
// create one if none exists
|
||||||
static wxLog *GetActiveTarget();
|
static wxLog *GetActiveTarget();
|
||||||
|
|
||||||
|
%disownarg( wxLog* pLogger );
|
||||||
|
%newobject SetActiveTarget;
|
||||||
// change log target, pLogger may be NULL
|
// change log target, pLogger may be NULL
|
||||||
static wxLog *SetActiveTarget(wxLog *pLogger);
|
static wxLog *SetActiveTarget(wxLog *pLogger);
|
||||||
|
%cleardisown( wxLog* pLogger );
|
||||||
|
|
||||||
// suspend the message flushing of the main target until the next call
|
// suspend the message flushing of the main target until the next call
|
||||||
// to Resume() - this is mainly for internal use (to prevent wxYield()
|
// to Resume() - this is mainly for internal use (to prevent wxYield()
|
||||||
@@ -149,6 +152,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0";
|
||||||
%extend { void Destroy() { delete self; } }
|
%extend { void Destroy() { delete self; } }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -222,7 +226,7 @@ public:
|
|||||||
unsigned long wxSysErrorCode();
|
unsigned long wxSysErrorCode();
|
||||||
const wxString wxSysErrorMsg(unsigned long nErrCode = 0);
|
const wxString wxSysErrorMsg(unsigned long nErrCode = 0);
|
||||||
|
|
||||||
%{// Make somce wrappers that double any % signs so they are 'escaped'
|
%{// Make some wrappers that double any % signs so they are 'escaped'
|
||||||
void wxPyLogFatalError(const wxString& msg)
|
void wxPyLogFatalError(const wxString& msg)
|
||||||
{
|
{
|
||||||
wxString m(msg);
|
wxString m(msg);
|
||||||
|
@@ -133,8 +133,10 @@ public:
|
|||||||
bool Delete(int id);
|
bool Delete(int id);
|
||||||
%Rename(DeleteItem, bool, Delete(wxMenuItem *item));
|
%Rename(DeleteItem, bool, Delete(wxMenuItem *item));
|
||||||
|
|
||||||
// delete the item from menu and destroy it (if it's a submenu)
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
%extend { void Destroy() { delete self; } }
|
%extend { void Destroy() { delete self; } }
|
||||||
|
|
||||||
|
// delete the item from menu and destroy it (if it's a submenu)
|
||||||
%Rename(DestroyId, bool, Destroy(int id));
|
%Rename(DestroyId, bool, Destroy(int id));
|
||||||
%Rename(DestroyItem, bool, Destroy(wxMenuItem *item));
|
%Rename(DestroyItem, bool, Destroy(wxMenuItem *item));
|
||||||
|
|
||||||
|
@@ -24,7 +24,12 @@ MustHaveApp(wxToolTip);
|
|||||||
|
|
||||||
class wxToolTip : public wxObject {
|
class wxToolTip : public wxObject {
|
||||||
public:
|
public:
|
||||||
|
%typemap(out) wxToolTip*; // turn off this typemap
|
||||||
wxToolTip(const wxString &tip);
|
wxToolTip(const wxString &tip);
|
||||||
|
// Turn it back on again
|
||||||
|
%typemap(out) wxToolTip* { $result = wxPyMake_wxObject($1, $owner); }
|
||||||
|
|
||||||
|
~wxToolTip();
|
||||||
|
|
||||||
void SetTip(const wxString& tip);
|
void SetTip(const wxString& tip);
|
||||||
wxString GetTip();
|
wxString GetTip();
|
||||||
@@ -43,9 +48,10 @@ MustHaveApp(wxCaret);
|
|||||||
class wxCaret {
|
class wxCaret {
|
||||||
public:
|
public:
|
||||||
wxCaret(wxWindow* window, const wxSize& size);
|
wxCaret(wxWindow* window, const wxSize& size);
|
||||||
// ~wxCaret(); Window takes ownership
|
~wxCaret();
|
||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
DocStr(Destroy,
|
DocStr(Destroy,
|
||||||
"Deletes the C++ object this Python object is a proxy for.", "");
|
"Deletes the C++ object this Python object is a proxy for.", "");
|
||||||
void Destroy() {
|
void Destroy() {
|
||||||
@@ -308,5 +314,55 @@ bool wxDrawWindowOnDC(wxWindow* window, const wxDC& dc
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
%{
|
||||||
|
void t_output_tester1(int* a, int* b, int* c, int* d)
|
||||||
|
{
|
||||||
|
*a = 1234;
|
||||||
|
*b = 2345;
|
||||||
|
*c = 3456;
|
||||||
|
*d = 4567;
|
||||||
|
}
|
||||||
|
PyObject* t_output_tester2(int* a, int* b, int* c, int* d)
|
||||||
|
{
|
||||||
|
*a = 1234;
|
||||||
|
*b = 2345;
|
||||||
|
*c = 3456;
|
||||||
|
*d = 4567;
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
PyObject* t_output_tester3(int* a, int* b, int* c, int* d)
|
||||||
|
{
|
||||||
|
*a = 1234;
|
||||||
|
*b = 2345;
|
||||||
|
*c = 3456;
|
||||||
|
*d = 4567;
|
||||||
|
PyObject* res = PyTuple_New(2);
|
||||||
|
PyTuple_SetItem(res, 0, PyInt_FromLong(1));
|
||||||
|
PyTuple_SetItem(res, 1, PyInt_FromLong(2));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
PyObject* t_output_tester4()
|
||||||
|
{
|
||||||
|
PyObject* res = PyTuple_New(2);
|
||||||
|
PyTuple_SetItem(res, 0, PyInt_FromLong(132));
|
||||||
|
PyTuple_SetItem(res, 1, PyInt_FromLong(244));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
|
%newobject t_output_tester2;
|
||||||
|
%newobject t_output_tester3;
|
||||||
|
%newobject t_output_tester4;
|
||||||
|
|
||||||
|
void t_output_tester1(int* OUTPUT, int* OUTPUT, int* OUTPUT, int* OUTPUT);
|
||||||
|
PyObject* t_output_tester2(int* OUTPUT, int* OUTPUT, int* OUTPUT, int* OUTPUT);
|
||||||
|
PyObject* t_output_tester3(int* OUTPUT, int* OUTPUT, int* OUTPUT, int* OUTPUT);
|
||||||
|
PyObject* t_output_tester4();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -69,9 +69,9 @@ public:
|
|||||||
virtual void SetImageList(wxImageList *imageList);
|
virtual void SetImageList(wxImageList *imageList);
|
||||||
|
|
||||||
// as SetImageList() but we will delete the image list ourselves
|
// as SetImageList() but we will delete the image list ourselves
|
||||||
%apply SWIGTYPE *DISOWN { wxImageList *imageList };
|
%disownarg( wxImageList *imageList );
|
||||||
void AssignImageList(wxImageList *imageList);
|
void AssignImageList(wxImageList *imageList);
|
||||||
%clear wxImageList *imageList;
|
%cleardisown( wxImageList *imageList );
|
||||||
|
|
||||||
// get pointer (may be NULL) to the associated image list
|
// get pointer (may be NULL) to the associated image list
|
||||||
wxImageList* GetImageList() const;
|
wxImageList* GetImageList() const;
|
||||||
|
@@ -30,6 +30,7 @@ public:
|
|||||||
return self->GetClassInfo()->GetClassName();
|
return self->GetClassInfo()->GetClassName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
DocStr(Destroy,
|
DocStr(Destroy,
|
||||||
"Deletes the C++ object this Python object is a proxy for.", "");
|
"Deletes the C++ object this Python object is a proxy for.", "");
|
||||||
void Destroy() {
|
void Destroy() {
|
||||||
|
@@ -187,7 +187,11 @@ long wxExecute(const wxString& command,
|
|||||||
{
|
{
|
||||||
PyObject* o;
|
PyObject* o;
|
||||||
o = PyInt_FromLong((long) (*$1));
|
o = PyInt_FromLong((long) (*$1));
|
||||||
|
#if SWIG_VERSION < 0x010328
|
||||||
$result = t_output_helper($result, o);
|
$result = t_output_helper($result, o);
|
||||||
|
#else
|
||||||
|
$result = SWIG_Python_AppendOutput($result, o);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxKill(long pid, wxSignal sig = wxSIGTERM, wxKillError* rc, int flags = wxKILL_NOCHILDREN);
|
int wxKill(long pid, wxSignal sig = wxSIGTERM, wxKillError* rc, int flags = wxKILL_NOCHILDREN);
|
||||||
|
@@ -44,6 +44,8 @@ methods are called.
|
|||||||
:see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`", "");
|
:see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`", "");
|
||||||
|
|
||||||
|
|
||||||
|
~wxSizerItem();
|
||||||
|
|
||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
DocStr(
|
DocStr(
|
||||||
@@ -86,6 +88,7 @@ methods are called.
|
|||||||
int border, PyObject* userData=NULL ),
|
int border, PyObject* userData=NULL ),
|
||||||
"Constructs a `wx.SizerItem` for tracking a subsizer", "");
|
"Constructs a `wx.SizerItem` for tracking a subsizer", "");
|
||||||
|
|
||||||
|
%disownarg( wxSizer *sizer );
|
||||||
%RenameCtor(SizerItemSizer, wxSizerItem( wxSizer *sizer, int proportion, int flag,
|
%RenameCtor(SizerItemSizer, wxSizerItem( wxSizer *sizer, int proportion, int flag,
|
||||||
int border, PyObject* userData=NULL ))
|
int border, PyObject* userData=NULL ))
|
||||||
{
|
{
|
||||||
@@ -97,6 +100,7 @@ methods are called.
|
|||||||
}
|
}
|
||||||
return new wxSizerItem(sizer, proportion, flag, border, data);
|
return new wxSizerItem(sizer, proportion, flag, border, data);
|
||||||
}
|
}
|
||||||
|
%cleardisown( wxSizer *sizer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -214,9 +218,11 @@ added, if needed.", "");
|
|||||||
wxSizer *, GetSizer(),
|
wxSizer *, GetSizer(),
|
||||||
"Get the subsizer (if any) that is managed by this sizer item.", "");
|
"Get the subsizer (if any) that is managed by this sizer item.", "");
|
||||||
|
|
||||||
|
%disownarg( wxSizer *sizer );
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
void , SetSizer( wxSizer *sizer ),
|
void , SetSizer( wxSizer *sizer ),
|
||||||
"Set the subsizer to be managed by this sizer item.", "");
|
"Set the subsizer to be managed by this sizer item.", "");
|
||||||
|
%cleardisown( wxSizer *sizer );
|
||||||
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
@@ -395,7 +401,8 @@ method to determine where the drawing operations should take place.
|
|||||||
class wxSizer : public wxObject {
|
class wxSizer : public wxObject {
|
||||||
public:
|
public:
|
||||||
// wxSizer(); **** abstract, can't instantiate
|
// wxSizer(); **** abstract, can't instantiate
|
||||||
// ~wxSizer();
|
|
||||||
|
~wxSizer();
|
||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
void _setOORInfo(PyObject* _self) {
|
void _setOORInfo(PyObject* _self) {
|
||||||
@@ -512,6 +519,8 @@ public:
|
|||||||
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
||||||
if ( userData && (info.window || info.sizer || info.gotSize) )
|
if ( userData && (info.window || info.sizer || info.gotSize) )
|
||||||
data = new wxPyUserData(userData);
|
data = new wxPyUserData(userData);
|
||||||
|
if ( info.sizer )
|
||||||
|
PyObject_SetAttrString(item,"thisown",Py_False);
|
||||||
wxPyEndBlockThreads(blocked);
|
wxPyEndBlockThreads(blocked);
|
||||||
|
|
||||||
// Now call the real Add method if a valid item type was found
|
// Now call the real Add method if a valid item type was found
|
||||||
@@ -543,6 +552,8 @@ the item at index *before*. See `Add` for a description of the parameters.", ""
|
|||||||
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
||||||
if ( userData && (info.window || info.sizer || info.gotSize) )
|
if ( userData && (info.window || info.sizer || info.gotSize) )
|
||||||
data = new wxPyUserData(userData);
|
data = new wxPyUserData(userData);
|
||||||
|
if ( info.sizer )
|
||||||
|
PyObject_SetAttrString(item,"thisown",Py_False);
|
||||||
wxPyEndBlockThreads(blocked);
|
wxPyEndBlockThreads(blocked);
|
||||||
|
|
||||||
// Now call the real Insert method if a valid item type was found
|
// Now call the real Insert method if a valid item type was found
|
||||||
@@ -575,6 +586,8 @@ this sizer. See `Add` for a description of the parameters.", "");
|
|||||||
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
||||||
if ( userData && (info.window || info.sizer || info.gotSize) )
|
if ( userData && (info.window || info.sizer || info.gotSize) )
|
||||||
data = new wxPyUserData(userData);
|
data = new wxPyUserData(userData);
|
||||||
|
if ( info.sizer )
|
||||||
|
PyObject_SetAttrString(item,"thisown",Py_False);
|
||||||
wxPyEndBlockThreads(blocked);
|
wxPyEndBlockThreads(blocked);
|
||||||
|
|
||||||
// Now call the real Prepend method if a valid item type was found
|
// Now call the real Prepend method if a valid item type was found
|
||||||
@@ -693,6 +706,9 @@ the item to be found.", "");
|
|||||||
return self._SetItemMinSize(item, args[0])
|
return self._SetItemMinSize(item, args[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%disownarg( wxSizerItem *item );
|
||||||
|
|
||||||
DocDeclAStrName(
|
DocDeclAStrName(
|
||||||
wxSizerItem* , Add( wxSizerItem *item ),
|
wxSizerItem* , Add( wxSizerItem *item ),
|
||||||
"AddItem(self, SizerItem item)",
|
"AddItem(self, SizerItem item)",
|
||||||
@@ -711,6 +727,7 @@ the item to be found.", "");
|
|||||||
"Prepends a `wx.SizerItem` to the sizer.", "",
|
"Prepends a `wx.SizerItem` to the sizer.", "",
|
||||||
PrependItem);
|
PrependItem);
|
||||||
|
|
||||||
|
%cleardisown( wxSizerItem *item );
|
||||||
|
|
||||||
|
|
||||||
%pythoncode {
|
%pythoncode {
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
// See also wxPy_ReinitStockObjects in helpers.cpp
|
// See also wxPy_ReinitStockObjects in helpers.cpp
|
||||||
%immutable;
|
%immutable;
|
||||||
|
%threadWrapperOff;
|
||||||
|
|
||||||
wxFont* const wxNORMAL_FONT;
|
wxFont* const wxNORMAL_FONT;
|
||||||
wxFont* const wxSMALL_FONT;
|
wxFont* const wxSMALL_FONT;
|
||||||
@@ -69,6 +70,7 @@ const wxPalette wxNullPalette;
|
|||||||
const wxFont wxNullFont;
|
const wxFont wxNullFont;
|
||||||
const wxColour wxNullColour;
|
const wxColour wxNullColour;
|
||||||
|
|
||||||
|
%threadWrapperOn;
|
||||||
%mutable;
|
%mutable;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -104,9 +104,11 @@ public:
|
|||||||
%pythonAppend wxPyTaskBarIcon "self._setCallbackInfo(self, TaskBarIcon, 0)"
|
%pythonAppend wxPyTaskBarIcon "self._setCallbackInfo(self, TaskBarIcon, 0)"
|
||||||
|
|
||||||
wxPyTaskBarIcon();
|
wxPyTaskBarIcon();
|
||||||
|
~wxPyTaskBarIcon();
|
||||||
|
|
||||||
void _setCallbackInfo(PyObject* self, PyObject* _class, int incref);
|
void _setCallbackInfo(PyObject* self, PyObject* _class, int incref);
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0";
|
||||||
%extend {
|
%extend {
|
||||||
void Destroy() {
|
void Destroy() {
|
||||||
self->RemoveIcon();
|
self->RemoveIcon();
|
||||||
|
@@ -341,11 +341,6 @@ public:
|
|||||||
|
|
||||||
static wxVisualAttributes
|
static wxVisualAttributes
|
||||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||||
|
|
||||||
%pythoncode {
|
|
||||||
def SendSizeEvent(self):
|
|
||||||
self.ProcessEvent(wx.SizeEvent((-1,-1)))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -121,6 +121,7 @@ public:
|
|||||||
class wxPyTreeItemData {
|
class wxPyTreeItemData {
|
||||||
public:
|
public:
|
||||||
wxPyTreeItemData(PyObject* obj = NULL);
|
wxPyTreeItemData(PyObject* obj = NULL);
|
||||||
|
~wxPyTreeItemData();
|
||||||
|
|
||||||
PyObject* GetData();
|
PyObject* GetData();
|
||||||
void SetData(PyObject* obj);
|
void SetData(PyObject* obj);
|
||||||
@@ -128,6 +129,7 @@ public:
|
|||||||
const wxTreeItemId& GetId();
|
const wxTreeItemId& GetId();
|
||||||
void SetId(const wxTreeItemId& id);
|
void SetId(const wxTreeItemId& id);
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
%extend { void Destroy() { delete self; } }
|
%extend { void Destroy() { delete self; } }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -144,6 +146,7 @@ public:
|
|||||||
wxTreeItemAttr(const wxColour& colText = wxNullColour,
|
wxTreeItemAttr(const wxColour& colText = wxNullColour,
|
||||||
const wxColour& colBack = wxNullColour,
|
const wxColour& colBack = wxNullColour,
|
||||||
const wxFont& font = wxNullFont);
|
const wxFont& font = wxNullFont);
|
||||||
|
~wxTreeItemAttr();
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
void SetTextColour(const wxColour& colText);
|
void SetTextColour(const wxColour& colText);
|
||||||
@@ -159,6 +162,7 @@ public:
|
|||||||
wxColour GetBackgroundColour();
|
wxColour GetBackgroundColour();
|
||||||
wxFont GetFont();
|
wxFont GetFont();
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
%extend { void Destroy() { delete self; } }
|
%extend { void Destroy() { delete self; } }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -372,10 +376,10 @@ public:
|
|||||||
void SetImageList(wxImageList *imageList);
|
void SetImageList(wxImageList *imageList);
|
||||||
void SetStateImageList(wxImageList *imageList);
|
void SetStateImageList(wxImageList *imageList);
|
||||||
|
|
||||||
%apply SWIGTYPE *DISOWN { wxImageList *imageList };
|
%disownarg( wxImageList *imageList );
|
||||||
void AssignImageList(wxImageList *imageList);
|
void AssignImageList(wxImageList *imageList);
|
||||||
void AssignStateImageList(wxImageList *imageList);
|
void AssignStateImageList(wxImageList *imageList);
|
||||||
%clear wxImageList *imageList;
|
%cleardisown( wxImageList *imageList );
|
||||||
|
|
||||||
|
|
||||||
// retrieve items label
|
// retrieve items label
|
||||||
@@ -430,10 +434,12 @@ public:
|
|||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
// associate a wxPyTreeItemData with the tree item
|
// associate a wxPyTreeItemData with the tree item
|
||||||
|
%disownarg( wxPyTreeItemData* data );
|
||||||
void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
|
void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
|
||||||
data->SetId(item); // set the id
|
data->SetId(item); // set the id
|
||||||
self->SetItemData(item, data);
|
self->SetItemData(item, data);
|
||||||
}
|
}
|
||||||
|
%cleardisown( wxPyTreeItemData* data );
|
||||||
|
|
||||||
// associate a Python object with the tree item
|
// associate a Python object with the tree item
|
||||||
void SetItemPyData(const wxTreeItemId& item, PyObject* obj) {
|
void SetItemPyData(const wxTreeItemId& item, PyObject* obj) {
|
||||||
@@ -582,6 +588,7 @@ public:
|
|||||||
wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
|
wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
|
||||||
|
|
||||||
|
|
||||||
|
%disownarg( wxPyTreeItemData* data );
|
||||||
|
|
||||||
// add the root node to the tree
|
// add the root node to the tree
|
||||||
wxTreeItemId AddRoot(const wxString& text,
|
wxTreeItemId AddRoot(const wxString& text,
|
||||||
@@ -616,6 +623,7 @@ public:
|
|||||||
wxPyTreeItemData *data = NULL);
|
wxPyTreeItemData *data = NULL);
|
||||||
|
|
||||||
|
|
||||||
|
%cleardisown( wxPyTreeItemData* data );
|
||||||
|
|
||||||
// delete this item and associated data if any
|
// delete this item and associated data if any
|
||||||
void Delete(const wxTreeItemId& item);
|
void Delete(const wxTreeItemId& item);
|
||||||
|
@@ -259,6 +259,7 @@ instead.");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
virtual bool , Destroy(),
|
virtual bool , Destroy(),
|
||||||
"Destroys the window safely. Frames and dialogs are not destroyed
|
"Destroys the window safely. Frames and dialogs are not destroyed
|
||||||
@@ -1454,9 +1455,11 @@ be reset back to default.", "");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%disownarg( wxCaret *caret );
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
void , SetCaret(wxCaret *caret),
|
void , SetCaret(wxCaret *caret),
|
||||||
"Sets the caret associated with the window.", "");
|
"Sets the caret associated with the window.", "");
|
||||||
|
%cleardisown( wxCaret *caret );
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
wxCaret *, GetCaret() const,
|
wxCaret *, GetCaret() const,
|
||||||
@@ -1767,7 +1770,10 @@ wxHelpProvider implementation, and not in the window object itself.", "");
|
|||||||
DocStr(SetToolTip,
|
DocStr(SetToolTip,
|
||||||
"Attach a tooltip to the window.", "");
|
"Attach a tooltip to the window.", "");
|
||||||
%Rename(SetToolTipString, void, SetToolTip( const wxString &tip ));
|
%Rename(SetToolTipString, void, SetToolTip( const wxString &tip ));
|
||||||
|
|
||||||
|
%disownarg( wxToolTip *tip );
|
||||||
void SetToolTip( wxToolTip *tip );
|
void SetToolTip( wxToolTip *tip );
|
||||||
|
%cleardisown( wxToolTip *tip );
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
wxToolTip* , GetToolTip() const,
|
wxToolTip* , GetToolTip() const,
|
||||||
@@ -1782,16 +1788,12 @@ wxHelpProvider implementation, and not in the window object itself.", "");
|
|||||||
// drag and drop
|
// drag and drop
|
||||||
// -------------
|
// -------------
|
||||||
|
|
||||||
// set/retrieve the drop target associated with this window (may be
|
%disownarg( wxPyDropTarget *dropTarget );
|
||||||
// NULL; it's owned by the window and will be deleted by it)
|
|
||||||
%apply SWIGTYPE *DISOWN { wxPyDropTarget *dropTarget };
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
virtual void , SetDropTarget( wxPyDropTarget *dropTarget ),
|
virtual void , SetDropTarget( wxPyDropTarget *dropTarget ),
|
||||||
"Associates a drop target with this window. If the window already has
|
"Associates a drop target with this window. If the window already has
|
||||||
a drop target, it is deleted.", "");
|
a drop target, it is deleted.", "");
|
||||||
|
%cleardisown( wxPyDropTarget *dropTarget );
|
||||||
%clear wxPyDropTarget *dropTarget;
|
|
||||||
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
@@ -1855,6 +1857,7 @@ this function gets called automatically by the default EVT_SIZE
|
|||||||
handler when the window is resized.", "");
|
handler when the window is resized.", "");
|
||||||
|
|
||||||
|
|
||||||
|
%disownarg( wxSizer *sizer );
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
void , SetSizer(wxSizer *sizer, bool deleteOld = true ),
|
void , SetSizer(wxSizer *sizer, bool deleteOld = true ),
|
||||||
"Sets the window to have the given layout sizer. The window will then
|
"Sets the window to have the given layout sizer. The window will then
|
||||||
@@ -1868,6 +1871,7 @@ non-None, and False otherwise.", "");
|
|||||||
void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = true ),
|
void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = true ),
|
||||||
"The same as SetSizer, except it also sets the size hints for the
|
"The same as SetSizer, except it also sets the size hints for the
|
||||||
window based on the sizer's minimum size.", "");
|
window based on the sizer's minimum size.", "");
|
||||||
|
%cleardisown( wxSizer *sizer );
|
||||||
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
@@ -1963,6 +1967,11 @@ wxControl where it returns true.", "");
|
|||||||
if hasattr(self, '_setCallbackInfo'):
|
if hasattr(self, '_setCallbackInfo'):
|
||||||
self._setCallbackInfo(self, self.__class__)
|
self._setCallbackInfo(self, self.__class__)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%pythoncode {
|
||||||
|
def SendSizeEvent(self):
|
||||||
|
self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -44,11 +44,11 @@ MAKE_CONST_WXSTRING_NOSWIG(DefaultDateTimeFormat);
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// OOR related typemaps and helper functions
|
// OOR related typemaps and helper functions
|
||||||
|
|
||||||
%typemap(out) wxGridCellRenderer* { $result = wxPyMake_wxGridCellRenderer($1, $owner); }
|
%typemap(out) wxGridCellRenderer* { $result = wxPyMake_wxGridCellRenderer($1, (bool)$owner); }
|
||||||
%typemap(out) wxGridCellEditor* { $result = wxPyMake_wxGridCellEditor($1, $owner); }
|
%typemap(out) wxGridCellEditor* { $result = wxPyMake_wxGridCellEditor($1, (bool)$owner); }
|
||||||
%typemap(out) wxGridCellAttr* { $result = wxPyMake_wxGridCellAttr($1, $owner); }
|
%typemap(out) wxGridCellAttr* { $result = wxPyMake_wxGridCellAttr($1, (bool)$owner); }
|
||||||
%typemap(out) wxGridCellAttrProvider* { $result = wxPyMake_wxGridCellAttrProvider($1, $owner); }
|
%typemap(out) wxGridCellAttrProvider* { $result = wxPyMake_wxGridCellAttrProvider($1, (bool)$owner); }
|
||||||
%typemap(out) wxGridTableBase* { $result = wxPyMake_wxGridTableBase($1, $owner); }
|
%typemap(out) wxGridTableBase* { $result = wxPyMake_wxGridTableBase($1, (bool)$owner); }
|
||||||
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
@@ -796,6 +796,8 @@ public:
|
|||||||
virtual void StartingKey(wxKeyEvent& event);
|
virtual void StartingKey(wxKeyEvent& event);
|
||||||
virtual void StartingClick();
|
virtual void StartingClick();
|
||||||
virtual void HandleReturn(wxKeyEvent& event);
|
virtual void HandleReturn(wxKeyEvent& event);
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
virtual void Destroy();
|
virtual void Destroy();
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -1362,6 +1364,7 @@ public:
|
|||||||
wxPyGridTableBase();
|
wxPyGridTableBase();
|
||||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||||
|
|
||||||
|
%pythonAppend Destroy "args[0].thisown = 0"
|
||||||
%extend { void Destroy() { delete self; } }
|
%extend { void Destroy() { delete self; } }
|
||||||
|
|
||||||
wxString base_GetTypeName( int row, int col );
|
wxString base_GetTypeName( int row, int col );
|
||||||
|
@@ -1255,7 +1255,10 @@ public:
|
|||||||
|
|
||||||
wxHtmlHelpData* GetData();
|
wxHtmlHelpData* GetData();
|
||||||
wxHtmlHelpController* GetController() const;
|
wxHtmlHelpController* GetController() const;
|
||||||
|
|
||||||
|
%disownarg( wxHtmlHelpController* controller );
|
||||||
void SetController(wxHtmlHelpController* controller);
|
void SetController(wxHtmlHelpController* controller);
|
||||||
|
%cleardisown( wxHtmlHelpController* controller );
|
||||||
|
|
||||||
// Displays page x. If not found it will offect the user a choice of
|
// Displays page x. If not found it will offect the user a choice of
|
||||||
// searching books.
|
// searching books.
|
||||||
@@ -1360,7 +1363,9 @@ public:
|
|||||||
wxHtmlHelpController* GetController() const;
|
wxHtmlHelpController* GetController() const;
|
||||||
|
|
||||||
/// Sets the help controller associated with the window.
|
/// Sets the help controller associated with the window.
|
||||||
|
%disownarg( wxHtmlHelpController* controller );
|
||||||
void SetController(wxHtmlHelpController* controller);
|
void SetController(wxHtmlHelpController* controller);
|
||||||
|
%cleardisown( wxHtmlHelpController* controller );
|
||||||
|
|
||||||
/// Returns the help window.
|
/// Returns the help window.
|
||||||
wxHtmlHelpWindow* GetHelpWindow() const;
|
wxHtmlHelpWindow* GetHelpWindow() const;
|
||||||
@@ -1417,7 +1422,9 @@ public:
|
|||||||
wxHtmlHelpController* GetController() const;
|
wxHtmlHelpController* GetController() const;
|
||||||
|
|
||||||
/// Sets the controller associated with this dialog.
|
/// Sets the controller associated with this dialog.
|
||||||
|
%disownarg( wxHtmlHelpController* controller );
|
||||||
void SetController(wxHtmlHelpController* controller);
|
void SetController(wxHtmlHelpController* controller);
|
||||||
|
%cleardisown( wxHtmlHelpController* controller );
|
||||||
|
|
||||||
/// Returns the help window.
|
/// Returns the help window.
|
||||||
wxHtmlHelpWindow* GetHelpWindow() const;
|
wxHtmlHelpWindow* GetHelpWindow() const;
|
||||||
@@ -1533,8 +1540,6 @@ public:
|
|||||||
|
|
||||||
void MakeModalIfNeeded();
|
void MakeModalIfNeeded();
|
||||||
wxWindow* FindTopLevelWindow();
|
wxWindow* FindTopLevelWindow();
|
||||||
|
|
||||||
%pythoncode { def Destroy(self): pass }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -325,52 +325,52 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field)
|
|||||||
// NOTE: For those classes that also call _setOORInfo these typemaps should be
|
// NOTE: For those classes that also call _setOORInfo these typemaps should be
|
||||||
// disabled for the constructor.
|
// disabled for the constructor.
|
||||||
|
|
||||||
%typemap(out) wxEvtHandler* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxEvtHandler* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxMenu* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxMenu* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxValidator* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxValidator* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
|
|
||||||
%typemap(out) wxApp* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxApp* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxPyApp* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxPyApp* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxDC* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxDC* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxFSFile* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxFSFile* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxFileSystem* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxFileSystem* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxImageList* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxImageList* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxImage* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxImage* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxListItem* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxListItem* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxMenuItem* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxMenuItem* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxMouseEvent* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxMouseEvent* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxObject* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxObject* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxPyPrintout* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxPyPrintout* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxToolBarToolBase* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxToolBarToolBase* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxToolTip* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxToolTip* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
|
|
||||||
|
|
||||||
%typemap(out) wxBitmapButton* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxBitmapButton* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxButton* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxButton* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxControl* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxControl* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxGrid* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxGrid* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
//%typemap(out) wxListCtrl* { $result = wxPyMake_wxObject($1, $owner); }
|
//%typemap(out) wxListCtrl* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxMDIChildFrame* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxMDIChildFrame* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxMenuBar* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxMenuBar* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxNotebook* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxNotebook* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxStaticBox* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxStaticBox* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxStatusBar* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxStatusBar* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxTextCtrl* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxTextCtrl* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxToolBarBase* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxToolBarBase* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
//%typemap(out) wxTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); }
|
//%typemap(out) wxTreeCtrl* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxPyTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxPyTreeCtrl* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxWindow* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxWindow* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxPyHtmlWindow* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxPyHtmlWindow* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxWizardPage* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxWizardPage* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxPyWizardPage* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxPyWizardPage* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxPanel* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxPanel* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
%typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
|
|
||||||
%typemap(out) wxSizer* { $result = wxPyMake_wxObject($1, $owner); }
|
%typemap(out) wxSizer* { $result = wxPyMake_wxObject($1, (bool)$owner); }
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -1,45 +1,54 @@
|
|||||||
|
|
||||||
|
|
||||||
// There standard t_output_helper has been changed to return a list rather
|
//----------------------------------------------------------------------
|
||||||
// than a tuple, we'll replace it with the old implementation here.
|
|
||||||
|
|
||||||
|
// The standard t_output_helper has been changed to return a list rather than
|
||||||
%fragment("t_output_helper","header") %{
|
// a tuple, we'll replace it with the old implementation here. In SWIG 1.3.27
|
||||||
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
// and earlier it is implemented as a $fragment, so it is only inserted in to
|
||||||
|
// the modules that need it. For SWIG 1.3.28 we just need to add a -D on the
|
||||||
|
// compile command line to turn on this version of the AppendOuput function.
|
||||||
|
#if SWIG_VERSION < 0x010328
|
||||||
|
%fragment("t_output_helper","header")
|
||||||
|
%{
|
||||||
|
static PyObject* t_output_helper(PyObject* result, PyObject* obj)
|
||||||
|
{
|
||||||
PyObject* o2;
|
PyObject* o2;
|
||||||
PyObject* o3;
|
PyObject* o3;
|
||||||
|
if (!result) {
|
||||||
if (!target) {
|
result = obj;
|
||||||
target = o;
|
} else if (result == Py_None) {
|
||||||
} else if (target == Py_None) {
|
Py_DECREF(result);
|
||||||
Py_DECREF(Py_None);
|
result = obj;
|
||||||
target = o;
|
|
||||||
} else {
|
} else {
|
||||||
if (!PyTuple_Check(target)) {
|
if (!PyTuple_Check(result)) {
|
||||||
o2 = target;
|
o2 = result;
|
||||||
target = PyTuple_New(1);
|
result = PyTuple_New(1);
|
||||||
PyTuple_SetItem(target, 0, o2);
|
PyTuple_SET_ITEM(result, 0, o2);
|
||||||
}
|
}
|
||||||
o3 = PyTuple_New(1);
|
o3 = PyTuple_New(1);
|
||||||
PyTuple_SetItem(o3, 0, o);
|
PyTuple_SetItem(o3, 0, obj);
|
||||||
|
o2 = result;
|
||||||
o2 = target;
|
result = PySequence_Concat(o2, o3);
|
||||||
target = PySequence_Concat(o2, o3);
|
|
||||||
Py_DECREF(o2);
|
Py_DECREF(o2);
|
||||||
Py_DECREF(o3);
|
Py_DECREF(o3);
|
||||||
}
|
}
|
||||||
return target;
|
return result;
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
// These fragments are inserted in modules that need to convert PyObjects to
|
// These fragments are inserted in modules that need to convert PyObjects to
|
||||||
// integer values, my versions allow any numeric type to be used, as long as
|
// integer values, my versions allow any numeric type to be used, as long as
|
||||||
// it can be converted to a PyInt. (Specifically, I allow floats where the
|
// it can be converted to a PyInt. (Specifically, I allow floats where the
|
||||||
// default SWIG_AsVal_long would just raise an exception.
|
// default SWIG_AsVal_long would just raise an exception.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if SWIG_VERSION < 0x010328
|
||||||
|
|
||||||
%fragment(SWIG_AsVal_frag(long), "header") {
|
%fragment(SWIG_AsVal_frag(long), "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
@@ -50,7 +59,7 @@ SWIG_AsVal(long)(PyObject* obj, long* val)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SWIG_type_error("number", obj);
|
SWIG_Python_TypeError("number", obj);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -64,7 +73,7 @@ SWIG_AsVal(unsigned long)(PyObject* obj, unsigned long* val)
|
|||||||
{
|
{
|
||||||
long v = 0;
|
long v = 0;
|
||||||
if (SWIG_AsVal_long(obj, &v) && v < 0) {
|
if (SWIG_AsVal_long(obj, &v) && v < 0) {
|
||||||
SWIG_type_error("unsigned number", obj);
|
SWIG_Python_TypeError("unsigned number", obj);
|
||||||
}
|
}
|
||||||
else if (val)
|
else if (val)
|
||||||
*val = (unsigned long)v;
|
*val = (unsigned long)v;
|
||||||
@@ -82,8 +91,55 @@ SWIG_AsVal(double)(PyObject *obj, double* val)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SWIG_type_error("number", obj);
|
SWIG_Python_TypeError("number", obj);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#else // SWIG_VERSION >= 1.3.28
|
||||||
|
|
||||||
|
%fragment(SWIG_AsVal_frag(long), "header") {
|
||||||
|
SWIGINTERN int
|
||||||
|
SWIG_AsVal(long)(PyObject* obj, long* val)
|
||||||
|
{
|
||||||
|
if (PyNumber_Check(obj)) {
|
||||||
|
if (val) *val = PyInt_AsLong(obj);
|
||||||
|
return SWIG_OK;
|
||||||
|
}
|
||||||
|
return SWIG_TypeError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%fragment(SWIG_AsVal_frag(unsigned long), "header",
|
||||||
|
fragment=SWIG_AsVal_frag(long)) {
|
||||||
|
SWIGINTERN int
|
||||||
|
SWIG_AsVal(unsigned long)(PyObject* obj, unsigned long* val)
|
||||||
|
{
|
||||||
|
long v = 0;
|
||||||
|
if (SWIG_AsVal_long(obj, &v) && v < 0) {
|
||||||
|
return SWIG_TypeError;
|
||||||
|
}
|
||||||
|
else if (val)
|
||||||
|
*val = (unsigned long)v;
|
||||||
|
return SWIG_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%fragment(SWIG_AsVal_frag(double), "header") {
|
||||||
|
SWIGINTERN int
|
||||||
|
SWIG_AsVal(double)(PyObject *obj, double* val)
|
||||||
|
{
|
||||||
|
if (PyNumber_Check(obj)) {
|
||||||
|
if (val) *val = PyFloat_AsDouble(obj);
|
||||||
|
return SWIG_OK;
|
||||||
|
}
|
||||||
|
return SWIG_TypeError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // SWIG_VERSION
|
||||||
|
Reference in New Issue
Block a user