From da9e956384a0619a0ecaa0bd1e4ba26b133b60a9 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Tue, 29 Nov 2005 12:50:13 +0000 Subject: [PATCH] Make wxJoystick::GetNumberJoystick a static method, as the number of joysticks attached to the computer is a global property, not one of the specific instance. Patch from Lauri Nurmi. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/joystick.tex | 2 +- include/wx/mac/carbon/joystick.h | 2 +- include/wx/mac/classic/joystick.h | 2 +- include/wx/mac/corefoundation/joystick.h | 2 +- include/wx/os2/joystick.h | 2 +- include/wx/unix/joystick.h | 2 +- include/wx/x11/joystick.h | 2 +- samples/joytest/joytest.cpp | 2 +- src/mac/carbon/joystick.cpp | 2 +- src/mac/classic/joystick.cpp | 2 +- src/mac/corefoundation/hidjoystick.cpp | 2 +- src/os2/joystick.cpp | 2 +- src/unix/joystick.cpp | 2 +- src/x11/joystick.cpp | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/latex/wx/joystick.tex b/docs/latex/wx/joystick.tex index 4f92e49..155b2f0 100644 --- a/docs/latex/wx/joystick.tex +++ b/docs/latex/wx/joystick.tex @@ -66,7 +66,7 @@ Returns the number of buttons for this joystick. \membersection{wxJoystick::GetNumberJoysticks}\label{wxjoystickgetnumberjoysticks} -\constfunc{int}{GetNumberJoysticks}{\void} +\func{static int}{GetNumberJoysticks}{\void} Returns the number of joysticks currently attached to the computer. diff --git a/include/wx/mac/carbon/joystick.h b/include/wx/mac/carbon/joystick.h index 271db26..dce79f8 100644 --- a/include/wx/mac/carbon/joystick.h +++ b/include/wx/mac/carbon/joystick.h @@ -42,7 +42,7 @@ class WXDLLEXPORT wxJoystick: public wxObject //////////////////////////////////////////////////////////////////////////// bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; + static int GetNumberJoysticks() ; int GetManufacturerId() const ; int GetProductId() const ; wxString GetProductName() const ; diff --git a/include/wx/mac/classic/joystick.h b/include/wx/mac/classic/joystick.h index 271db26..dce79f8 100644 --- a/include/wx/mac/classic/joystick.h +++ b/include/wx/mac/classic/joystick.h @@ -42,7 +42,7 @@ class WXDLLEXPORT wxJoystick: public wxObject //////////////////////////////////////////////////////////////////////////// bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; + static int GetNumberJoysticks() ; int GetManufacturerId() const ; int GetProductId() const ; wxString GetProductName() const ; diff --git a/include/wx/mac/corefoundation/joystick.h b/include/wx/mac/corefoundation/joystick.h index a8f589a..13024b2 100644 --- a/include/wx/mac/corefoundation/joystick.h +++ b/include/wx/mac/corefoundation/joystick.h @@ -42,7 +42,7 @@ class WXDLLEXPORT wxJoystick: public wxObject //////////////////////////////////////////////////////////////////////////// bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; + static int GetNumberJoysticks() ; int GetManufacturerId() const ; int GetProductId() const ; wxString GetProductName() const ; diff --git a/include/wx/os2/joystick.h b/include/wx/os2/joystick.h index 6e5a4c9..0d1e113 100644 --- a/include/wx/os2/joystick.h +++ b/include/wx/os2/joystick.h @@ -42,7 +42,7 @@ class WXDLLEXPORT wxJoystick: public wxObject //////////////////////////////////////////////////////////////////////////// bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; + static int GetNumberJoysticks() ; int GetManufacturerId() const ; int GetProductId() const ; wxString GetProductName() const ; diff --git a/include/wx/unix/joystick.h b/include/wx/unix/joystick.h index 7359bfa..c52edff 100644 --- a/include/wx/unix/joystick.h +++ b/include/wx/unix/joystick.h @@ -46,7 +46,7 @@ class WXDLLEXPORT wxJoystick: public wxObject //////////////////////////////////////////////////////////////////////////// bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; + static int GetNumberJoysticks() ; int GetManufacturerId() const ; int GetProductId() const ; wxString GetProductName() const ; diff --git a/include/wx/x11/joystick.h b/include/wx/x11/joystick.h index 52c3c7f..81d3c55 100644 --- a/include/wx/x11/joystick.h +++ b/include/wx/x11/joystick.h @@ -42,7 +42,7 @@ public: //////////////////////////////////////////////////////////////////////////// bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; + static int GetNumberJoysticks() ; int GetManufacturerId() const ; int GetProductId() const ; wxString GetProductName() const ; diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index 0366659..65ca2e1 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -86,7 +86,7 @@ bool MyApp::OnInit() #if wxUSE_STATUSBAR frame->CreateStatusBar(); - frame->SetStatusText(wxString::Format(wxT("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]"), stick.GetProductName().c_str(), stick.GetProductId(), stick.GetManufacturerId(), stick.GetNumberJoysticks())); + frame->SetStatusText(wxString::Format(wxT("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]"), stick.GetProductName().c_str(), stick.GetProductId(), stick.GetManufacturerId(), wxJoystick::GetNumberJoysticks())); #endif // wxUSE_STATUSBAR frame->CenterOnScreen(); diff --git a/src/mac/carbon/joystick.cpp b/src/mac/carbon/joystick.cpp index facb42c..c56cf20 100644 --- a/src/mac/carbon/joystick.cpp +++ b/src/mac/carbon/joystick.cpp @@ -90,7 +90,7 @@ bool wxJoystick::IsOk() const return FALSE; } -int wxJoystick::GetNumberJoysticks() const +int wxJoystick::GetNumberJoysticks() { // TODO return 0; diff --git a/src/mac/classic/joystick.cpp b/src/mac/classic/joystick.cpp index 0d50a65..6dd6aef 100644 --- a/src/mac/classic/joystick.cpp +++ b/src/mac/classic/joystick.cpp @@ -88,7 +88,7 @@ bool wxJoystick::IsOk() const return FALSE; } -int wxJoystick::GetNumberJoysticks() const +int wxJoystick::GetNumberJoysticks() { // TODO return 0; diff --git a/src/mac/corefoundation/hidjoystick.cpp b/src/mac/corefoundation/hidjoystick.cpp index 4d104a4..bb24ddc 100644 --- a/src/mac/corefoundation/hidjoystick.cpp +++ b/src/mac/corefoundation/hidjoystick.cpp @@ -276,7 +276,7 @@ int wxJoystick::GetNumberAxes() const // is all devices with the kHIDUsage_GD_Joystick or kHIDUsage_GD_GamePad // identifiers. //--------------------------------------------------------------------------- -int wxJoystick::GetNumberJoysticks() const +int wxJoystick::GetNumberJoysticks() { return wxHIDDevice::GetCount(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick) + diff --git a/src/os2/joystick.cpp b/src/os2/joystick.cpp index 0b19280..7d9ec64 100644 --- a/src/os2/joystick.cpp +++ b/src/os2/joystick.cpp @@ -101,7 +101,7 @@ bool wxJoystick::IsOk() const return false; } -int wxJoystick::GetNumberJoysticks() const +int wxJoystick::GetNumberJoysticks() { // TODO return 0; diff --git a/src/unix/joystick.cpp b/src/unix/joystick.cpp index fcb266c..92e36ad 100644 --- a/src/unix/joystick.cpp +++ b/src/unix/joystick.cpp @@ -283,7 +283,7 @@ bool wxJoystick::IsOk() const return (m_device != -1); } -int wxJoystick::GetNumberJoysticks() const +int wxJoystick::GetNumberJoysticks() { wxString dev_name; int fd, j; diff --git a/src/x11/joystick.cpp b/src/x11/joystick.cpp index 8840ec8..dde21cc 100644 --- a/src/x11/joystick.cpp +++ b/src/x11/joystick.cpp @@ -87,7 +87,7 @@ bool wxJoystick::IsOk() const return FALSE; } -int wxJoystick::GetNumberJoysticks() const +int wxJoystick::GetNumberJoysticks() { // TODO return 0; -- 2.7.4