]> git.saurik.com Git - wxWidgets.git/blob - include/wx/unix/joystick.h
Build/distrib updates
[wxWidgets.git] / include / wx / unix / joystick.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: joystick.h
3 // Purpose: wxJoystick class
4 // Author: Guilhem Lavaux
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright:
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __JOYSTICKH__
13 #define __JOYSTICKH__
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "joystick.h"
17 #endif
18
19 #include "wx/event.h"
20 #include "wx/thread.h"
21
22 class WXDLLEXPORT wxJoystickThread;
23
24 class WXDLLEXPORT wxJoystick: public wxObject
25 {
26 DECLARE_DYNAMIC_CLASS(wxJoystick)
27 public:
28 /*
29 * Public interface
30 */
31
32 wxJoystick(int joystick = wxJOYSTICK1);
33 ~wxJoystick();
34
35 // Attributes
36 ////////////////////////////////////////////////////////////////////////////
37
38 wxPoint GetPosition() const;
39 int GetZPosition() const;
40 int GetButtonState() const;
41 int GetPOVPosition() const;
42 int GetPOVCTSPosition() const;
43 int GetRudderPosition() const;
44 int GetUPosition() const;
45 int GetVPosition() const;
46 int GetMovementThreshold() const;
47 void SetMovementThreshold(int threshold) ;
48
49 // Capabilities
50 ////////////////////////////////////////////////////////////////////////////
51
52 bool IsOk() const; // Checks that the joystick is functioning
53 int GetNumberJoysticks() const ;
54 int GetManufacturerId() const ;
55 int GetProductId() const ;
56 wxString GetProductName() const ;
57 int GetXMin() const;
58 int GetYMin() const;
59 int GetZMin() const;
60 int GetXMax() const;
61 int GetYMax() const;
62 int GetZMax() const;
63 int GetNumberButtons() const;
64 int GetNumberAxes() const;
65 int GetMaxButtons() const;
66 int GetMaxAxes() const;
67 int GetPollingMin() const;
68 int GetPollingMax() const;
69 int GetRudderMin() const;
70 int GetRudderMax() const;
71 int GetUMin() const;
72 int GetUMax() const;
73 int GetVMin() const;
74 int GetVMax() const;
75
76 bool HasRudder() const;
77 bool HasZ() const;
78 bool HasU() const;
79 bool HasV() const;
80 bool HasPOV() const;
81 bool HasPOV4Dir() const;
82 bool HasPOVCTS() const;
83
84 // Operations
85 ////////////////////////////////////////////////////////////////////////////
86
87 // pollingFreq = 0 means that movement events are sent when above the threshold.
88 // If pollingFreq > 0, events are received every this many milliseconds.
89 bool SetCapture(wxWindow* win, int pollingFreq = 0);
90 bool ReleaseCapture();
91
92 protected:
93 int m_device;
94 int m_joystick;
95 wxJoystickThread* m_thread;
96 };
97
98 #endif
99 // __JOYSTICKH__
100