00001 /* 00002 * Copyright (C) 2003-2009 Olivier Boudeville 00003 * 00004 * This file is part of the OSDL library. 00005 * 00006 * The OSDL library is free software: you can redistribute it and/or modify 00007 * it under the terms of either the GNU Lesser General Public License or 00008 * the GNU General Public License, as they are published by the Free Software 00009 * Foundation, either version 3 of these Licenses, or (at your option) 00010 * any later version. 00011 * 00012 * The OSDL library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License and the GNU General Public License 00016 * for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License and of the GNU General Public License along with the OSDL library. 00020 * If not, see <http://www.gnu.org/licenses/>. 00021 * 00022 * Author: Olivier Boudeville (olivier.boudeville@esperide.com) 00023 * 00024 */ 00025 00026 00027 #ifndef OSDL_JOYSTICK_COMMON_H_ 00028 #define OSDL_JOYSTICK_COMMON_H_ 00029 00030 00031 #include "OSDLEvents.h" // for EventsException 00032 00033 #include "Ceylan.h" // for Uint8, etc. 00034 00035 00036 #include <string> 00037 #include <list> 00038 00039 00040 00041 00042 namespace OSDL 00043 { 00044 00045 00046 00047 namespace Events 00048 { 00049 00050 00051 00053 typedef Ceylan::Uint32 JoystickNumber ; 00054 00055 00057 typedef Ceylan::Uint32 JoystickAxesCount ; 00058 00059 00061 typedef Ceylan::Uint32 JoystickTrackballsCount ; 00062 00063 00065 typedef Ceylan::Uint32 JoystickHatsCount ; 00066 00067 00069 typedef Ceylan::Uint32 JoystickButtonsCount ; 00070 00071 00072 00077 typedef Ceylan::Sint16 AxisPosition ; 00078 00079 00080 00086 typedef Ceylan::Uint8 HatPosition ; 00087 00088 00089 00091 extern const HatPosition Centered ; 00092 00093 00095 extern const HatPosition Up ; 00096 00097 00099 extern const HatPosition Right ; 00100 00101 00103 extern const HatPosition Down ; 00104 00105 00107 extern const HatPosition Left ; 00108 00109 00111 extern const HatPosition RightUp ; 00112 00113 00115 extern const HatPosition RightDown ; 00116 00117 00119 extern const HatPosition LeftUp ; 00120 00121 00123 extern const HatPosition LeftDown ; 00124 00125 00126 00131 typedef Ceylan::Sint32 BallMotion ; 00132 00133 00134 00136 class OSDL_DLL JoystickException: public EventsException 00137 { 00138 public: 00139 00140 explicit JoystickException( const std::string & reason ) ; 00141 00142 virtual ~JoystickException() throw() ; 00143 00144 } ; 00145 00146 00147 } 00148 00149 } 00150 00151 00152 00153 #endif // OSDL_JOYSTICK_COMMON_H_ 00154