/usr/include/wx-3.0/wx/wxPython/i_files/_joystick.i is in python-wxgtk3.0-dev 3.0.2.0+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | /////////////////////////////////////////////////////////////////////////////
// Name: _joystick.i
// Purpose: SWIG interface stuff for wxJoystick
//
// Author: Robin Dunn
//
// Created: 18-June-1999
// RCS-ID: $Id$
// Copyright: (c) 2003 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%newgroup
%{
#include <wx/joystick.h>
%}
//---------------------------------------------------------------------------
// Which joystick? Same as Windows ids so no conversion necessary.
enum
{
wxJOYSTICK1,
wxJOYSTICK2
};
// Which button is down?
enum
{
wxJOY_BUTTON_ANY,
wxJOY_BUTTON1,
wxJOY_BUTTON2,
wxJOY_BUTTON3,
wxJOY_BUTTON4,
};
%{
#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) {
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; }
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 wxEmptyString; }
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
%}
MustHaveApp(wxJoystick);
class wxJoystick /* : public wxObject */
{
public:
wxJoystick(int joystick = wxJOYSTICK1);
~wxJoystick();
wxPoint GetPosition();
int GetZPosition();
int GetButtonState();
int GetPOVPosition();
int GetPOVCTSPosition();
int GetRudderPosition();
int GetUPosition();
int GetVPosition();
int GetMovementThreshold();
void SetMovementThreshold(int threshold) ;
bool IsOk(void);
int GetNumberJoysticks();
int GetManufacturerId();
int GetProductId();
wxString GetProductName();
int GetXMin();
int GetYMin();
int GetZMin();
int GetXMax();
int GetYMax();
int GetZMax();
int GetNumberButtons();
int GetNumberAxes();
int GetMaxButtons();
int GetMaxAxes();
int GetPollingMin();
int GetPollingMax();
int GetRudderMin();
int GetRudderMax();
int GetUMin();
int GetUMax();
int GetVMin();
int GetVMax();
bool HasRudder();
bool HasZ();
bool HasU();
bool HasV();
bool HasPOV();
bool HasPOV4Dir();
bool HasPOVCTS();
bool SetCapture(wxWindow* win, int pollingFreq = 0);
bool ReleaseCapture();
%pythoncode { def __nonzero__(self): return self.IsOk() }
%property(ButtonState, GetButtonState, doc="See `GetButtonState`");
%property(ManufacturerId, GetManufacturerId, doc="See `GetManufacturerId`");
%property(MaxAxes, GetMaxAxes, doc="See `GetMaxAxes`");
%property(MaxButtons, GetMaxButtons, doc="See `GetMaxButtons`");
%property(MovementThreshold, GetMovementThreshold, SetMovementThreshold, doc="See `GetMovementThreshold` and `SetMovementThreshold`");
%property(NumberAxes, GetNumberAxes, doc="See `GetNumberAxes`");
%property(NumberButtons, GetNumberButtons, doc="See `GetNumberButtons`");
%property(NumberJoysticks, GetNumberJoysticks, doc="See `GetNumberJoysticks`");
%property(POVCTSPosition, GetPOVCTSPosition, doc="See `GetPOVCTSPosition`");
%property(POVPosition, GetPOVPosition, doc="See `GetPOVPosition`");
%property(PollingMax, GetPollingMax, doc="See `GetPollingMax`");
%property(PollingMin, GetPollingMin, doc="See `GetPollingMin`");
%property(Position, GetPosition, doc="See `GetPosition`");
%property(ProductId, GetProductId, doc="See `GetProductId`");
%property(ProductName, GetProductName, doc="See `GetProductName`");
%property(RudderMax, GetRudderMax, doc="See `GetRudderMax`");
%property(RudderMin, GetRudderMin, doc="See `GetRudderMin`");
%property(RudderPosition, GetRudderPosition, doc="See `GetRudderPosition`");
%property(UMax, GetUMax, doc="See `GetUMax`");
%property(UMin, GetUMin, doc="See `GetUMin`");
%property(UPosition, GetUPosition, doc="See `GetUPosition`");
%property(VMax, GetVMax, doc="See `GetVMax`");
%property(VMin, GetVMin, doc="See `GetVMin`");
%property(VPosition, GetVPosition, doc="See `GetVPosition`");
%property(XMax, GetXMax, doc="See `GetXMax`");
%property(XMin, GetXMin, doc="See `GetXMin`");
%property(YMax, GetYMax, doc="See `GetYMax`");
%property(YMin, GetYMin, doc="See `GetYMin`");
%property(ZMax, GetZMax, doc="See `GetZMax`");
%property(ZMin, GetZMin, doc="See `GetZMin`");
%property(ZPosition, GetZPosition, doc="See `GetZPosition`");
};
//---------------------------------------------------------------------------
%constant wxEventType wxEVT_JOY_BUTTON_DOWN;
%constant wxEventType wxEVT_JOY_BUTTON_UP;
%constant wxEventType wxEVT_JOY_MOVE;
%constant wxEventType wxEVT_JOY_ZMOVE;
class wxJoystickEvent : public wxEvent
{
public:
wxJoystickEvent(wxEventType type = wxEVT_NULL,
int state = 0,
int joystick = wxJOYSTICK1,
int change = 0);
wxPoint GetPosition() const;
int GetZPosition() const;
int GetButtonState() const;
int GetButtonChange() const;
int GetJoystick() const;
void SetJoystick(int stick);
void SetButtonState(int state);
void SetButtonChange(int change);
void SetPosition(const wxPoint& pos);
void SetZPosition(int zPos);
// Was it a button event? (*doesn't* mean: is any button *down*?)
bool IsButton() const;
// Was it a move event?
bool IsMove() const;
// Was it a zmove event?
bool IsZMove() const;
// Was it a down event from button 1, 2, 3, 4 or any?
bool ButtonDown(int but = wxJOY_BUTTON_ANY) const;
// Was it a up event from button 1, 2, 3 or any?
bool ButtonUp(int but = wxJOY_BUTTON_ANY) const;
// 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)
}
%property(ButtonChange, GetButtonChange, SetButtonChange, doc="See `GetButtonChange` and `SetButtonChange`");
%property(ButtonState, GetButtonState, SetButtonState, doc="See `GetButtonState` and `SetButtonState`");
%property(Joystick, GetJoystick, SetJoystick, doc="See `GetJoystick` and `SetJoystick`");
%property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
%property(ZPosition, GetZPosition, SetZPosition, doc="See `GetZPosition` and `SetZPosition`");
};
%pythoncode {
EVT_JOY_BUTTON_DOWN = wx.PyEventBinder( wxEVT_JOY_BUTTON_DOWN )
EVT_JOY_BUTTON_UP = wx.PyEventBinder( wxEVT_JOY_BUTTON_UP )
EVT_JOY_MOVE = wx.PyEventBinder( wxEVT_JOY_MOVE )
EVT_JOY_ZMOVE = wx.PyEventBinder( wxEVT_JOY_ZMOVE )
EVT_JOYSTICK_EVENTS = wx.PyEventBinder([ wxEVT_JOY_BUTTON_DOWN,
wxEVT_JOY_BUTTON_UP,
wxEVT_JOY_MOVE,
wxEVT_JOY_ZMOVE,
])
}
//---------------------------------------------------------------------------
|