]> git.saurik.com Git - wxWidgets.git/commitdiff
Make wxJoystick::GetNumberJoystick a static method, as the number of
authorMart Raudsepp <leio@gentoo.org>
Tue, 29 Nov 2005 12:50:13 +0000 (12:50 +0000)
committerMart Raudsepp <leio@gentoo.org>
Tue, 29 Nov 2005 12:50:13 +0000 (12:50 +0000)
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

14 files changed:
docs/latex/wx/joystick.tex
include/wx/mac/carbon/joystick.h
include/wx/mac/classic/joystick.h
include/wx/mac/corefoundation/joystick.h
include/wx/os2/joystick.h
include/wx/unix/joystick.h
include/wx/x11/joystick.h
samples/joytest/joytest.cpp
src/mac/carbon/joystick.cpp
src/mac/classic/joystick.cpp
src/mac/corefoundation/hidjoystick.cpp
src/os2/joystick.cpp
src/unix/joystick.cpp
src/x11/joystick.cpp

index 4f92e49a410e915f2040f50986c4039e426539c0..155b2f05fbff0ada13efab70ac6aabeabef1117e 100644 (file)
@@ -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.
 
index 271db26b0a03d12296b912c32b3c716a180aab0c..dce79f8a374f7c5f7d2bb407b883a2920534851e 100644 (file)
@@ -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 ;
index 271db26b0a03d12296b912c32b3c716a180aab0c..dce79f8a374f7c5f7d2bb407b883a2920534851e 100644 (file)
@@ -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 ;
index a8f589a03190ff90de23a63cd13169957e135083..13024b27313c3e07f1063596428cda646e7fc704 100644 (file)
@@ -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 ;
index 6e5a4c92365d495d543fc647a541d4230b692d33..0d1e113d01972ca944e46fcca0cce5a974bff22d 100644 (file)
@@ -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 ;
index 7359bfa05e12c2a1e2c5f316afecbdeae0c7e553..c52edff09ac65a943bec837cca797234c8859158 100644 (file)
@@ -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 ;
index 52c3c7f56de9e888818304f6587df428637be240..81d3c553b5cd7f2d28864b0b46e7cc978b044ff0 100644 (file)
@@ -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 ;
index 0366659659d180520930305c063d7b06aeffc74e..65ca2e196c0b1e805f62bbc48ba77f8803f91d25 100644 (file)
@@ -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();
index facb42c95718fe27803ea3b25bd40855bf9fffaa..c56cf2001ac456c465ae792df6327c7c10f3b046 100644 (file)
@@ -90,7 +90,7 @@ bool wxJoystick::IsOk() const
     return FALSE;
 }
 
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
 {
     // TODO
     return 0;
index 0d50a653596281115833cbb5b4166ca70ac01015..6dd6aefd1baac4380991928d49868f462c5f83b6 100644 (file)
@@ -88,7 +88,7 @@ bool wxJoystick::IsOk() const
     return FALSE;
 }
 
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
 {
     // TODO
     return 0;
index 4d104a44f48ad0d6588f8834ce048e6df464b345..bb24ddc33d34659047a89854c6bc6b7f58d90937 100644 (file)
@@ -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) +
index 0b19280bc72bea8d59caf9b5a02670ec76061c43..7d9ec64512197a9fa4fe0b7316af68b6a64d7f20 100644 (file)
@@ -101,7 +101,7 @@ bool wxJoystick::IsOk() const
     return false;
 }
 
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
 {
     // TODO
     return 0;
index fcb266cc1d9cb9a82fff3aaa3f9c61a9cc2795ca..92e36ad5d795372fed3f81769b006cfda067bace 100644 (file)
@@ -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;
index 8840ec82e34d0989ff95d1023b0174e7bf89635c..dde21cc580d8f235119fdb929b8a1fee4fe44f01 100644 (file)
@@ -87,7 +87,7 @@ bool wxJoystick::IsOk() const
     return FALSE;
 }
 
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
 {
     // TODO
     return 0;