xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Events::Joystick Class Reference

#include <joystick.h>

Inheritance diagram for Events::Joystick:
Inheritance graph
[legend]
Collaboration diagram for Events::Joystick:
Collaboration graph
[legend]

Public Member Functions

const Common::UStringgetName () const
 Return the joystick's name. More...
 
int getIndex () const
 Return the joystick's index within the available joysticks. More...
 
bool isEnabled () const
 Is the joystick currently enabled? More...
 
bool enable ()
 Enable the joystick. More...
 
void disable ()
 Disable the joystick. More...
 
int getAxisCount () const
 Return the number of axes the joystick has. More...
 
int getBallCount () const
 Return the number of balls the joystick has. More...
 
int getHatCount () const
 Return the number of hats the joystick has. More...
 
int getButtonCount () const
 Return the number of buttons the joystick has. More...
 

Private Member Functions

 Joystick (int index)
 
 ~Joystick ()
 

Private Attributes

int _index
 
Common::UString _name
 
SDL_Joystick * _sdlJoy
 

Friends

class EventsManager
 
template<typename T >
void Common::DeallocatorDefault::destroy (T *)
 

Detailed Description

Definition at line 40 of file joystick.h.

Constructor & Destructor Documentation

◆ Joystick()

Events::Joystick::Joystick ( int  index)
private

Definition at line 31 of file joystick.cpp.

References _index.

◆ ~Joystick()

Events::Joystick::~Joystick ( )
private

Definition at line 35 of file joystick.cpp.

References disable().

Here is the call graph for this function:

Member Function Documentation

◆ disable()

void Events::Joystick::disable ( )

Disable the joystick.

Definition at line 64 of file joystick.cpp.

References _sdlJoy.

Referenced by ~Joystick().

Here is the caller graph for this function:

◆ enable()

bool Events::Joystick::enable ( )

Enable the joystick.

Definition at line 51 of file joystick.cpp.

References _index, _name, _sdlJoy, and isEnabled().

Here is the call graph for this function:

◆ getAxisCount()

int Events::Joystick::getAxisCount ( ) const

Return the number of axes the joystick has.

Definition at line 69 of file joystick.cpp.

References _sdlJoy.

◆ getBallCount()

int Events::Joystick::getBallCount ( ) const

Return the number of balls the joystick has.

Definition at line 76 of file joystick.cpp.

References _sdlJoy.

◆ getButtonCount()

int Events::Joystick::getButtonCount ( ) const

Return the number of buttons the joystick has.

Definition at line 90 of file joystick.cpp.

References _sdlJoy.

◆ getHatCount()

int Events::Joystick::getHatCount ( ) const

Return the number of hats the joystick has.

Definition at line 83 of file joystick.cpp.

References _sdlJoy.

◆ getIndex()

int Events::Joystick::getIndex ( ) const

Return the joystick's index within the available joysticks.

Definition at line 39 of file joystick.cpp.

References _index.

◆ getName()

const Common::UString & Events::Joystick::getName ( ) const

Return the joystick's name.

Definition at line 43 of file joystick.cpp.

References _name.

◆ isEnabled()

bool Events::Joystick::isEnabled ( ) const

Is the joystick currently enabled?

Definition at line 47 of file joystick.cpp.

References _sdlJoy.

Referenced by enable().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Common::DeallocatorDefault::destroy

template<typename T >
void Common::DeallocatorDefault::destroy ( T *  )
friend

◆ EventsManager

friend class EventsManager
friend

Definition at line 76 of file joystick.h.

Member Data Documentation

◆ _index

int Events::Joystick::_index
private

Definition at line 68 of file joystick.h.

Referenced by enable(), getIndex(), and Joystick().

◆ _name

Common::UString Events::Joystick::_name
private

Definition at line 69 of file joystick.h.

Referenced by enable(), and getName().

◆ _sdlJoy

SDL_Joystick* Events::Joystick::_sdlJoy
private

The documentation for this class was generated from the following files: