X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..6c75a4cf0f94cbe53bfde4fbcddff741158fbc7c:/wxPython/src/_joystick.i diff --git a/wxPython/src/_joystick.i b/wxPython/src/_joystick.i index 7a807edb27..252208e9e5 100644 --- a/wxPython/src/_joystick.i +++ b/wxPython/src/_joystick.i @@ -48,9 +48,10 @@ enum class wxJoystick : public wxObject { public: wxJoystick(int joystick = wxJOYSTICK1) { - wxPyBeginBlockThreads(); - PyErr_SetString(PyExc_NotImplementedError, "wxJoystick is not available on this platform."); - wxPyEndBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); + PyErr_SetString(PyExc_NotImplementedError, + "wxJoystick is not available on this platform."); + wxPyEndBlockThreads(blocked); } wxPoint GetPosition() { return wxPoint(-1,-1); } int GetZPosition() { return -1; } @@ -63,11 +64,11 @@ public: int GetMovementThreshold() { return -1; } void SetMovementThreshold(int threshold) {} - bool IsOk(void) { return FALSE; } + bool IsOk(void) { return false; } int GetNumberJoysticks() { return -1; } int GetManufacturerId() { return -1; } int GetProductId() { return -1; } - wxString GetProductName() { return ""; } + wxString GetProductName() { return wxEmptyString; } int GetXMin() { return -1; } int GetYMin() { return -1; } int GetZMin() { return -1; } @@ -87,21 +88,23 @@ public: 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 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; } + bool SetCapture(wxWindow* win, int pollingFreq = 0) { return false; } + bool ReleaseCapture() { return false; } }; #endif %} +MustHaveApp(wxJoystick); + class wxJoystick /* : public wxObject */ { public: @@ -169,12 +172,6 @@ public: class wxJoystickEvent : public wxEvent { public: - wxPoint m_pos; - int m_zPosition; - int m_buttonChange; // Which button changed? - int m_buttonState; // Which buttons are down? - int m_joyStick; // Which joystick? - wxJoystickEvent(wxEventType type = wxEVT_NULL, int state = 0, int joystick = wxJOYSTICK1, @@ -209,6 +206,14 @@ public: // Was the given button 1,2,3,4 or any in Down state? bool ButtonIsDown(int but = wxJOY_BUTTON_ANY) const; + + %pythoncode { + m_pos = property(GetPosition, SetPosition) + m_zPosition = property(GetZPosition, SetZPosition) + m_buttonChange = property(GetButtonChange, SetButtonChange) + m_buttonState = property(GetButtonState, SetButtonState) + m_joyStick = property(GetJoystick, SetJoystick) + } };