Cleanup up the demo a bit

Added wxWave

Added another patch for SWIG that optimizes the generated code some
and eliminates some unused type mappings in the type registry.
(Reduces it by about half!)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-05-18 21:59:59 +00:00
parent c20a12bd55
commit 493f1553fd
73 changed files with 3330 additions and 14483 deletions

View File

@@ -22,9 +22,14 @@
#include <wx/fontenum.h>
#include <wx/tipdlg.h>
#include <wx/process.h>
#ifdef __WXMSW__
#if wxUSE_JOYSTICK || defined(__WXMSW__)
#include <wx/joystick.h>
#endif
#if wxUSE_WAVE || defined(__WXMSW__)
#include <wx/wave.h>
#endif
%}
//----------------------------------------------------------------------
@@ -134,6 +139,9 @@ wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
wxWindow * wxGetActiveWindow();
wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
bool wxCheckForInterrupt(wxWindow *wnd);
//---------------------------------------------------------------------------
// Resource System
@@ -721,7 +729,66 @@ long wxExecute(const wxString& command,
//----------------------------------------------------------------------
#ifdef __WXMSW__
%{
#if !wxUSE_JOYSTICK && !defined(__WXMSW__)
// A C++ stub class for wxJoystick for platforms that don't have it.
class wxJoystick : public wxObject {
public:
wxJoystick(int joystick = wxJOYSTICK1) {
bool doSave = wxPyRestoreThread();
PyErr_SetString(PyExc_NotImplementedError, "wxJoystick is not available on this platform.");
wxPySaveThread(doSave);
}
wxPoint GetPosition() { return wxPoint(-1,-1); }
int GetZPosition() { return -1; }
int GetButtonState() { return -1; }
int GetPOVPosition() { return -1; }
int GetPOVCTSPosition() { return -1; }
int GetRudderPosition() { return -1; }
int GetUPosition() { return -1; }
int GetVPosition() { return -1; }
int GetMovementThreshold() { return -1; }
void SetMovementThreshold(int threshold) ;
bool IsOk(void) { return FALSE; }
int GetNumberJoysticks() { return -1; }
int GetManufacturerId() { return -1; }
int GetProductId() { return -1; }
wxString GetProductName() { return ""; }
int GetXMin() { return -1; }
int GetYMin() { return -1; }
int GetZMin() { return -1; }
int GetXMax() { return -1; }
int GetYMax() { return -1; }
int GetZMax() { return -1; }
int GetNumberButtons() { return -1; }
int GetNumberAxes() { return -1; }
int GetMaxButtons() { return -1; }
int GetMaxAxes() { return -1; }
int GetPollingMin() { return -1; }
int GetPollingMax() { return -1; }
int GetRudderMin() { return -1; }
int GetRudderMax() { return -1; }
int GetUMin() { return -1; }
int GetUMax() { return -1; }
int GetVMin() { return -1; }
int GetVMax() { return -1; }
bool HasRudder() { return FALSE; }
bool HasZ() { return FALSE; }
bool HasU() { return FALSE; }
bool HasV() { return FALSE; }
bool HasPOV() { return FALSE; }
bool HasPOV4Dir() { return FALSE; }
bool HasPOVCTS() { return FALSE; }
bool SetCapture(wxWindow* win, int pollingFreq = 0) { return FALSE; }
bool ReleaseCapture() { return FALSE; }
};
#endif
%}
class wxJoystick : public wxObject {
public:
wxJoystick(int joystick = wxJOYSTICK1);
@@ -771,10 +838,55 @@ public:
bool SetCapture(wxWindow* win, int pollingFreq = 0);
bool ReleaseCapture();
};
#endif
//----------------------------------------------------------------------
%{
#if !wxUSE_WAVE && !defined(__WXMSW__)
// A C++ stub class for wxWave for platforms that don't have it.
class wxWave : public wxObject
{
public:
wxWave(const wxString& fileName, bool isResource = FALSE) {
bool doSave = wxPyRestoreThread();
PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
wxPySaveThread(doSave);
}
wxWave(int size, const wxByte* data) {
bool doSave = wxPyRestoreThread();
PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
wxPySaveThread(doSave);
}
~wxWave() {}
bool IsOk() const { return FALSE; }
bool Play(bool async = TRUE, bool looped = FALSE) const { return FALSE; }
};
#endif
%}
class wxWave : public wxObject
{
public:
wxWave(const wxString& fileName, bool isResource = FALSE);
~wxWave();
bool IsOk() const;
bool Play(bool async = TRUE, bool looped = FALSE) const;
};
%new wxWave* wxWaveData(const wxString& data);
%{ // Implementations of some alternate "constructors"
wxWave* wxWaveData(const wxString& data) {
return new wxWave(data.Len(), (wxByte*)data.c_str());
}
%}
//----------------------------------------------------------------------
%init %{
wxPyPtrTypeMap_Add("wxFontEnumerator", "wxPyFontEnumerator");
wxPyPtrTypeMap_Add("wxDragImage", "wxGenericDragImage");