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:
@@ -24,8 +24,13 @@ MustHaveApp(wxToolTip);
|
||||
|
||||
class wxToolTip : public wxObject {
|
||||
public:
|
||||
%typemap(out) wxToolTip*; // turn off this typemap
|
||||
wxToolTip(const wxString &tip);
|
||||
// Turn it back on again
|
||||
%typemap(out) wxToolTip* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
|
||||
~wxToolTip();
|
||||
|
||||
void SetTip(const wxString& tip);
|
||||
wxString GetTip();
|
||||
// *** Not in the "public" interface void SetWindow(wxWindow *win);
|
||||
@@ -43,9 +48,10 @@ MustHaveApp(wxCaret);
|
||||
class wxCaret {
|
||||
public:
|
||||
wxCaret(wxWindow* window, const wxSize& size);
|
||||
// ~wxCaret(); Window takes ownership
|
||||
~wxCaret();
|
||||
|
||||
%extend {
|
||||
%pythonAppend Destroy "args[0].thisown = 0"
|
||||
DocStr(Destroy,
|
||||
"Deletes the C++ object this Python object is a proxy for.", "");
|
||||
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
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user