From 05311d6b77a23cb016e5c6ed5387198b945711ee Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 27 Dec 2010 19:04:08 +0000 Subject: [PATCH] regen sip files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- sip/gen/_core.sip | 48 ++++---- sip/gen/app.sip | 11 +- sip/gen/defs.sip | 3 + sip/gen/event.sip | 115 ++++++++++++------- sip/gen/geometry.sip | 35 ------ sip/gen/object.sip | 16 +++ sip/gen/process.sip | 111 ++++++++++++++++++ sip/gen/utils.sip | 263 +++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 500 insertions(+), 102 deletions(-) create mode 100644 sip/gen/process.sip create mode 100644 sip/gen/utils.sip diff --git a/sip/gen/_core.sip b/sip/gen/_core.sip index 48dd2040..769034dd 100644 --- a/sip/gen/_core.sip +++ b/sip/gen/_core.sip @@ -73,6 +73,9 @@ from _core import * %Include tooltip.sip %Include layout.sip %Include event.sip +%Include pyevent.sip +%Include process.sip +%Include utils.sip %Include evtloop.sip %Include apptrait.sip %Include app.sip @@ -202,7 +205,6 @@ def version(): return "%s %s" % (wx.VERSION_STRING, port) - def deprecated(func): def new_func(*args, **kwargs): import warnings @@ -275,32 +277,32 @@ def deprecated(func): ## return 0 -## #---------------------------------------------------------------------------- +#---------------------------------------------------------------------------- -## def CallAfter(callable, *args, **kw): -## """ -## Call the specified function after the current and pending event -## handlers have been completed. This is also good for making GUI -## method calls from non-GUI threads. Any extra positional or -## keyword args are passed on to the callable when it is called. +def CallAfter(callable, *args, **kw): + """ + Call the specified function after the current and pending event + handlers have been completed. This is also good for making GUI + method calls from non-GUI threads. Any extra positional or + keyword args are passed on to the callable when it is called. -## :see: `wx.CallLater` -## """ -## app = wx.GetApp() -## assert app is not None, 'No wx.App created yet' + :see: `wx.CallLater` + """ + app = wx.GetApp() + assert app is not None, 'No wx.App created yet' -## if not hasattr(app, "_CallAfterId"): -## app._CallAfterId = wx.NewEventType() -## app.Connect(-1, -1, app._CallAfterId, -## lambda event: event.callable(*event.args, **event.kw) ) -## evt = wx.PyEvent() -## evt.SetEventType(app._CallAfterId) -## evt.callable = callable -## evt.args = args -## evt.kw = kw -## wx.PostEvent(app, evt) + if not hasattr(app, "_CallAfterId"): + app._CallAfterId = wx.NewEventType() + app.Connect(-1, -1, app._CallAfterId, + lambda event: event.callable(*event.args, **event.kw) ) + evt = wx.PyEvent() + evt.SetEventType(app._CallAfterId) + evt.callable = callable + evt.args = args + evt.kw = kw + wx.PostEvent(app, evt) -## #---------------------------------------------------------------------------- +#---------------------------------------------------------------------------- ## class CallLater: diff --git a/sip/gen/app.sip b/sip/gen/app.sip index b381758e..607a0428 100644 --- a/sip/gen/app.sip +++ b/sip/gen/app.sip @@ -323,15 +323,15 @@ class wxPyApp : wxAppConsole #endif DeletePendingObjects(); } - bool initialized = wxTopLevelWindows.GetCount() != 0; - if (initialized) { + //bool initialized = wxTopLevelWindows.GetCount() != 0; + //if (initialized) { if ( m_exitOnFrameDelete == Later ) { m_exitOnFrameDelete = Yes; } retval = wxApp::MainLoop(); OnExit(); - } + //} return retval; } @@ -746,7 +746,7 @@ logged in on the main display of your Mac.""" def __del__(self): - self.RestoreStdio() # Just in case the MainLoop was overridden + self.RestoreStdio() # Just in case the MainLoop was overridden without calling RestoreStio def Destroy(self): @@ -762,8 +762,9 @@ logged in on the main display of your Mac.""" def MainLoop(self): """Execute the main GUI event loop""" - wx.PyApp.MainLoop(self) + rv = wx.PyApp.MainLoop(self) self.RestoreStdio() + return rv def RedirectStdio(self, filename=None): diff --git a/sip/gen/defs.sip b/sip/gen/defs.sip index 5fb1e204..4671805b 100644 --- a/sip/gen/defs.sip +++ b/sip/gen/defs.sip @@ -35,6 +35,9 @@ class wxStatusBar; class wxToolBar; class wxMenuBar; + class wxExecuteEnv; + class wxInputStream; + class wxOutputStream; typedef signed char wxInt8 /PyInt/; diff --git a/sip/gen/event.sip b/sip/gen/event.sip index ead65ff3..5998b14f 100644 --- a/sip/gen/event.sip +++ b/sip/gen/event.sip @@ -37,8 +37,6 @@ class wxEvtHandler : wxObject, wxTrackable PyObject* m_func; }; - - IMPLEMENT_ABSTRACT_CLASS(wxPyCallback, wxEvtHandler); wxPyCallback::wxPyCallback(PyObject* func) { @@ -449,7 +447,8 @@ public: %Property(name=Int, get=GetInt, set=SetInt) %Property(name=Selection, get=GetSelection) %Property(name=String, get=GetString, set=SetString) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -476,7 +475,8 @@ public: bool GetActive(); %Property(name=Active, get=GetActive) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -501,7 +501,8 @@ public: wxWindow * GetWindow(); %Property(name=Window, get=GetWindow) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -524,7 +525,8 @@ public: int id = 0 ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -563,7 +565,8 @@ public: bool veto = true ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -594,7 +597,8 @@ public: ); %Property(name=Position, get=GetPosition, set=SetPosition) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -614,7 +618,8 @@ class wxDisplayChangedEvent : wxEvent public: wxDisplayChangedEvent(); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -647,7 +652,8 @@ public: %Property(name=Files, get=GetFiles) %Property(name=NumberOfFiles, get=GetNumberOfFiles) %Property(name=Position, get=GetPosition) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -673,7 +679,8 @@ public: wxDC * GetDC(); %Property(name=DC, get=GetDC) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -703,7 +710,8 @@ public: ); %Property(name=Window, get=GetWindow, set=SetWindow) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -747,7 +755,8 @@ public: const wxPoint & pt ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -774,7 +783,8 @@ public: bool Iconized() /Deprecated/; - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -808,7 +818,8 @@ public: wxIdleMode mode ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -830,7 +841,8 @@ public: int id = 0 ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -883,7 +895,8 @@ public: bool IsZMove(); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -930,7 +943,8 @@ public: %Property(name=RawKeyCode, get=GetRawKeyCode) %Property(name=RawKeyFlags, get=GetRawKeyFlags) %Property(name=UnicodeKey, get=GetUnicodeKey) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -952,7 +966,8 @@ public: int id = 0 ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -984,7 +999,8 @@ public: %Property(name=Menu, get=GetMenu) %Property(name=MenuId, get=GetMenuId) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1010,7 +1026,8 @@ public: wxWindow * GetCapturedWindow(); %Property(name=CapturedWindow, get=GetCapturedWindow) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1032,7 +1049,8 @@ public: wxWindowID windowId = 0 ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1134,7 +1152,8 @@ public: %Property(name=LogicalPosition, get=GetLogicalPosition) %Property(name=WheelDelta, get=GetWheelDelta) %Property(name=WheelRotation, get=GetWheelRotation) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1171,7 +1190,8 @@ public: %Property(name=Rect, get=GetRect, set=SetRect) %Property(name=Position, get=GetPosition, set=SetPosition) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1233,7 +1253,8 @@ public: %Property(name=CurrentFocus, get=GetCurrentFocus, set=SetCurrentFocus) %Property(name=Direction, get=GetDirection, set=SetDirection) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1262,7 +1283,8 @@ public: void Veto(); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1284,7 +1306,8 @@ public: int id = 0 ); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1313,7 +1336,8 @@ public: wxWindow * GetChangedWindow(); %Property(name=ChangedWindow, get=GetChangedWindow, set=SetChangedWindow) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1342,7 +1366,8 @@ public: bool GetPaletteRealized(); %Property(name=PaletteRealized, get=GetPaletteRealized, set=SetPaletteRealized) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1381,7 +1406,8 @@ public: %Property(name=Orientation, get=GetOrientation, set=SetOrientation) %Property(name=Position, get=GetPosition, set=SetPosition) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1419,7 +1445,8 @@ public: %Property(name=Orientation, get=GetOrientation, set=SetOrientation) %Property(name=Position, get=GetPosition, set=SetPosition) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1457,7 +1484,8 @@ public: %Property(name=Cursor, get=GetCursor, set=SetCursor) %Property(name=X, get=GetX) %Property(name=Y, get=GetY) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1487,7 +1515,8 @@ public: bool IsShown(); %Property(name=Show, get=IsShown, set=SetShow) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1524,7 +1553,8 @@ public: %Property(name=Rect, get=GetRect, set=SetRect) %Property(name=Size, get=GetSize, set=SetSize) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1544,7 +1574,8 @@ class wxSysColourChangedEvent : wxEvent public: wxSysColourChangedEvent(); - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1626,7 +1657,8 @@ public: %Property(name=Enabled, get=GetEnabled, set=Enable) %Property(name=Shown, get=GetShown, set=Show) %Property(name=Text, get=GetText, set=SetText) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1651,7 +1683,8 @@ public: wxWindow * GetWindow(); %Property(name=Window, get=GetWindow) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -1676,7 +1709,8 @@ public: wxWindow * GetWindow(); %Property(name=Window, get=GetWindow) - virtual wxEvent* Clone(); + public: + virtual wxEvent* Clone() const /Factory/; private: @@ -2003,7 +2037,7 @@ class PyEventBinder(object): def Bind(self, target, id1, id2, function): - """Bind this set of event types to target using its COnnect() method.""" + """Bind this set of event types to target using its Connect() method.""" for et in self.evtType: target.Connect(id1, id2, et, function) @@ -2052,6 +2086,9 @@ def _EvtHandler_Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ :param id2: Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE. """ + assert isinstance(event, wx.PyEventBinder) + assert callable(handler) + assert source is None or hasattr(source, 'GetId') if source is not None: id = source.GetId() event.Bind(self, id, id2, handler) diff --git a/sip/gen/geometry.sip b/sip/gen/geometry.sip index 7ba913fe..cad01e24 100644 --- a/sip/gen/geometry.sip +++ b/sip/gen/geometry.sip @@ -566,41 +566,6 @@ enum wxOutCode wxOutBottom }; -wxPoint2DDouble operator+( - const wxPoint2DDouble & pt1, - const wxPoint2DDouble & pt2 -); - -wxPoint2DDouble operator-( - const wxPoint2DDouble & pt1, - const wxPoint2DDouble & pt2 -); - -wxPoint2DDouble operator*( - const wxPoint2DDouble & pt1, - const wxPoint2DDouble & pt2 -); - -wxPoint2DDouble operator*( - wxDouble n, - const wxPoint2DDouble & pt -); - -wxPoint2DDouble operator*( - const wxPoint2DDouble & pt, - wxDouble n -); - -wxPoint2DDouble operator/( - const wxPoint2DDouble & pt1, - const wxPoint2DDouble & pt2 -); - -wxPoint2DDouble operator/( - const wxPoint2DDouble & pt, - wxDouble n -); - //--------------------------------------------------------------------------- diff --git a/sip/gen/object.sip b/sip/gen/object.sip index 7a520287..2b9ddc50 100644 --- a/sip/gen/object.sip +++ b/sip/gen/object.sip @@ -95,6 +95,22 @@ public: _wxObject_Destroy(sipCpp, sipIsErr); %End + %ConvertToSubClassCode + const wxClassInfo* info = sipCpp->GetClassInfo(); + wxString name = info->GetClassName(); + bool exists = sipFindType(name) != NULL; + while (info && !exists) { + info = info->GetBaseClass1(); + name = info->GetClassName(); + exists = sipFindType(name) != NULL; + } + if (info) + sipType = sipFindType(name); + else + sipType = NULL; + %End + + }; // end of class wxObject diff --git a/sip/gen/process.sip b/sip/gen/process.sip new file mode 100644 index 00000000..c1850df4 --- /dev/null +++ b/sip/gen/process.sip @@ -0,0 +1,111 @@ +//--------------------------------------------------------------------------- +// This file is generated by wxPython's SIP generator. Do not edit by hand. +// +// Copyright: (c) 2010 by Total Control Software +// License: wxWindows License +// +// This file will be included by _core.sip +// +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- + +class wxProcess : wxEvtHandler +{ + %TypeHeaderCode + #include + %End + + +public: + wxProcess( + wxEvtHandler * parent = NULL, + int id = -1 + ); + + wxProcess( + int flags + ); + + virtual + ~wxProcess(); + + void CloseOutput(); + + void Detach(); + + wxInputStream * GetErrorStream(); + + wxInputStream * GetInputStream(); + + wxOutputStream * GetOutputStream(); + + long GetPid(); + + bool IsErrorAvailable(); + + bool IsInputAvailable(); + + bool IsInputOpened(); + + virtual + void OnTerminate( + int pid, + int status + ); + + void Redirect(); + + static + bool Exists( + int pid + ); + + static + wxKillError Kill( + int pid, + wxSignal sig = wxSIGTERM, + int flags = wxKILL_NOCHILDREN + ); + + static + wxProcess * Open( + const wxString & cmd, + int flags = wxEXEC_ASYNC + ); + +}; // end of class wxProcess + + +enum wxSignal +{ + wxSIGNONE, + wxSIGHUP, + wxSIGINT, + wxSIGQUIT, + wxSIGILL, + wxSIGTRAP, + wxSIGABRT, + wxSIGEMT, + wxSIGFPE, + wxSIGKILL, + wxSIGBUS, + wxSIGSEGV, + wxSIGSYS, + wxSIGPIPE, + wxSIGALRM, + wxSIGTERM +}; + +enum wxKillError +{ + wxKILL_OK, + wxKILL_BAD_SIGNAL, + wxKILL_ACCESS_DENIED, + wxKILL_NO_PROCESS, + wxKILL_ERROR +}; + + +//--------------------------------------------------------------------------- + diff --git a/sip/gen/utils.sip b/sip/gen/utils.sip new file mode 100644 index 00000000..62a069e4 --- /dev/null +++ b/sip/gen/utils.sip @@ -0,0 +1,263 @@ +//--------------------------------------------------------------------------- +// This file is generated by wxPython's SIP generator. Do not edit by hand. +// +// Copyright: (c) 2010 by Total Control Software +// License: wxWindows License +// +// This file will be included by _core.sip +// +//--------------------------------------------------------------------------- + +%ModuleHeaderCode +#include +#include +%End + + +//--------------------------------------------------------------------------- + +void wxBeginBusyCursor( + const wxCursor * cursor = wxHOURGLASS_CURSOR +); + +void wxEndBusyCursor(); + +bool wxIsBusy(); + +void wxBell(); + +void wxInfoMessageBox( + wxWindow * parent +); + +wxVersionInfo wxGetLibraryVersionInfo(); + +wxBatteryState wxGetBatteryState(); + +wxPowerType wxGetPowerType(); + +bool wxGetKeyState( + wxKeyCode key +); + +wxPoint wxGetMousePosition(); + +wxMouseState wxGetMouseState(); + +void wxEnableTopLevelWindows( + bool enable = true +); + +wxWindow * wxFindWindowAtPoint( + const wxPoint & pt +); + +wxWindow * wxFindWindowByLabel( + const wxString & label, + wxWindow * parent = NULL +); + +wxWindow * wxFindWindowByName( + const wxString & name, + wxWindow * parent = NULL +); + +int wxFindMenuItemId( + wxFrame * frame, + const wxString & menuString, + const wxString & itemString +); + +long wxNewId(); + +void wxRegisterId( + long id +); + +bool wxLaunchDefaultApplication( + const wxString & document, + int flags = 0 +); + +bool wxLaunchDefaultBrowser( + const wxString & url, + int flags = 0 +); + +wxString wxStripMenuCodes( + const wxString & str, + int flags = wxStrip_All +); + +wxString wxGetEmailAddress(); + + +wxString wxGetHomeDir(); + +wxString wxGetHostName(); + + +wxString wxGetFullHostName(); + +wxString wxGetUserHome( + const wxString & user = wxEmptyString +); + +wxString wxGetUserId(); + + +wxString wxGetUserName(); + + +wxString wxGetOsDescription(); + +wxOperatingSystemId wxGetOsVersion( + int * major = NULL, + int * minor = NULL +); + +bool wxIsPlatform64Bit(); + +bool wxIsPlatformLittleEndian(); + +long wxExecute( + const wxString & command, + int flags = wxEXEC_ASYNC, + wxProcess * callback = NULL, + const wxExecuteEnv * env = NULL +); + +unsigned long wxGetProcessId(); + +int wxKill( + long pid, + wxSignal sig = wxSIGTERM, + wxKillError * rc = NULL, + int flags = wxKILL_NOCHILDREN +); + +bool wxShell( + const wxString & command = wxEmptyString +); + +bool wxShutdown( + int flags = wxSHUTDOWN_POWEROFF +); + +void wxMicroSleep( + unsigned long microseconds +); + +void wxMilliSleep( + unsigned long milliseconds +); + +wxString wxNow(); + +void wxSleep( + int secs +); + +void wxUsleep( + unsigned long milliseconds +); + +enum wxPowerType +{ + wxPOWER_SOCKET, + wxPOWER_BATTERY, + wxPOWER_UNKNOWN +}; + +enum wxBatteryState +{ + wxBATTERY_NORMAL_STATE, + wxBATTERY_LOW_STATE, + wxBATTERY_CRITICAL_STATE, + wxBATTERY_SHUTDOWN_STATE, + wxBATTERY_UNKNOWN_STATE +}; + +class wxWindowDisabler +{ + %TypeHeaderCode + #include + %End + + +public: + wxWindowDisabler( + bool disable = true + ); + + wxWindowDisabler( + wxWindow * winToSkip + ); + + ~wxWindowDisabler(); + + private: + wxWindowDisabler(const wxWindowDisabler&); + + +}; // end of class wxWindowDisabler + + +class wxBusyCursor +{ + %TypeHeaderCode + #include + %End + + +public: + wxBusyCursor( + const wxCursor * cursor = wxHOURGLASS_CURSOR + ); + + ~wxBusyCursor(); + +}; // end of class wxBusyCursor + + +class wxVersionInfo +{ + %TypeHeaderCode + #include + %End + + +public: + wxVersionInfo( + const wxString & name, + int major, + int minor, + int micro = 0, + const wxString & description = wxString(), + const wxString & copyright = wxString() + ); + + const wxString & GetName(); + + int GetMajor(); + + int GetMinor(); + + int GetMicro(); + + wxString ToString(); + + wxString GetVersionString(); + + const wxString & GetDescription(); + + bool HasCopyright(); + + const wxString & GetCopyright(); + +}; // end of class wxVersionInfo + + + +//--------------------------------------------------------------------------- +