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 #include "OSDLMouseCommon.h" 00028 00029 00030 using std::string ; 00031 00032 using namespace OSDL::Events ; 00033 00034 #ifdef OSDL_USES_CONFIG_H 00035 #include <OSDLConfig.h> // for OSDL_VERBOSE_JOYSTICK_HANDLER and al 00036 #endif // OSDL_USES_CONFIG_H 00037 00038 #if OSDL_ARCH_NINTENDO_DS 00039 #include "OSDLConfigForNintendoDS.h" // for SDL_BUTTON_* and al 00040 #endif // OSDL_ARCH_NINTENDO_DS 00041 00042 00043 00044 #if OSDL_USES_SDL 00045 00046 #include "SDL.h" // for SDL_JoystickEventState, etc. 00047 00048 // The mapping between SDL button number and actual buttons: 00049 00050 const MouseButtonNumber OSDL::Events::LeftButton = SDL_BUTTON_LEFT ; 00051 const MouseButtonNumber OSDL::Events::MiddleButton = SDL_BUTTON_MIDDLE ; 00052 const MouseButtonNumber OSDL::Events::RightButton = SDL_BUTTON_RIGHT ; 00053 00054 const MouseButtonNumber OSDL::Events::WheelUp = SDL_BUTTON_WHEELUP ; 00055 const MouseButtonNumber OSDL::Events::WheelDown = SDL_BUTTON_WHEELDOWN ; 00056 00057 #else // OSDL_USES_SDL 00058 00059 // Same mapping as SDL: 00060 00061 const MouseButtonNumber OSDL::Events::LeftButton = 1 ; 00062 const MouseButtonNumber OSDL::Events::MiddleButton = 2 ; 00063 const MouseButtonNumber OSDL::Events::RightButton = 3 ; 00064 00065 const MouseButtonNumber OSDL::Events::WheelUp = 4 ; 00066 const MouseButtonNumber OSDL::Events::WheelDown = 5 ; 00067 00068 #endif // OSDL_USES_SDL 00069 00070 00071 // Only one mouse managed for the moment: 00072 const MouseNumber OSDL::Events::DefaultMouse = 0 ; 00073 00074 00075 00076 00077 MouseException::MouseException( const std::string & reason ) : 00078 EventsException( "Mouse exception: " + reason ) 00079 { 00080 00081 } 00082 00083 00084 00085 MouseException::~MouseException() throw() 00086 { 00087 00088 } 00089