cmil::SDL::DefaultMouse Class Reference

#include <SDLTranslator.h>

Inheritance diagram for cmil::SDL::DefaultMouse:

Inheritance graph
[legend]
Collaboration diagram for cmil::SDL::DefaultMouse:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DefaultMouse (const std::string &name)
 SDL 1.2.11 provides 0-255 buttons and one coord0 event.
 DefaultMouse ()
virtual ~DefaultMouse ()
bool operator== (const Mouse &mouse)

Private Member Functions

void init ()

Detailed Description

This is a convenience class which represents SDL's notion of a mouse by setting some of the buttons to more userfriendly names.

Definition at line 42 of file SDLTranslator.h.


Constructor & Destructor Documentation

cmil::SDL::DefaultMouse::DefaultMouse ( const std::string &  name  ) 

SDL 1.2.11 provides 0-255 buttons and one coord0 event.

Definition at line 51 of file SDLTranslator.cpp.

References init().

00051 : Mouse(name, 256, 1) { init(); }; 

Here is the call graph for this function:

cmil::SDL::DefaultMouse::DefaultMouse (  ) 

Definition at line 52 of file SDLTranslator.cpp.

References init().

00052 : Mouse("Mouse", 256, 1) { init(); }; 

Here is the call graph for this function:

virtual cmil::SDL::DefaultMouse::~DefaultMouse (  )  [inline, virtual]

Definition at line 46 of file SDLTranslator.h.

00046 {}


Member Function Documentation

void cmil::SDL::DefaultMouse::init (  )  [private]

Definition at line 54 of file SDLTranslator.cpp.

References cmil::InputDevice::setInput().

Referenced by DefaultMouse().

00054                              {
00056         setInput( "button1", "LeftButton"  );
00057         setInput( "button2", "MiddleButton");
00058         setInput( "button3", "RightButton" );
00059         setInput( "button4", "WheelUp"     );
00060         setInput( "button5", "WheelDown"   );
00061 
00062         setInput( "coord0", "Motion"   );
00063      }

Here is the call graph for this function:

Here is the caller graph for this function:

bool cmil::SDL::DefaultMouse::operator== ( const Mouse mouse  ) 

this ignores the mouse name to allow for insertion into the SDLMice DeviceTranslator The DeviceTranslator isn't concerned with the mouse name so this operator is necessary in order for custom mouse devices to be added.

Definition at line 68 of file SDLTranslator.cpp.

References cmil::InputDevice::getInputs(), cmil::DeviceInputs::isEqual(), Logger::log_debug(), cmil::Mouse::m_buttons, cmil::Mouse::m_coords, and cmil::InputDevice::m_inputs.

00068                                                     { 
00069       log_debug("(DefaultMouse) operator== Mouse& ");
00070 
00071       if(!(m_buttons == mouse.m_buttons) && (m_coords == mouse.m_coords))
00072         return false;
00073 
00074       if( m_inputs.isEqual( false, mouse.getInputs()) ) {
00075         log_debug("operator== returning true");
00076         return true;
00077       }
00078       return false;
00079     }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
(c) 2006-2007 John P. Feltz
Generated on Wed Jul 25 16:08:03 2007 for Common Media Input Layer by doxygen 1.4.7

SourceForge.net Logo