00001 /* 00002 * This file is part of the MLV Library. 00003 * 00004 * Copyright (C) 2010 Adrien Boussicault, Marc Zipstein 00005 * 00006 * 00007 * This Library is free software: you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation, either version 3 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This 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 General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this Library. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00032 #ifndef __MLV_MOUSE_H__ 00033 #define __MLV_MOUSE_H__ 00034 00035 #ifndef MEMORY_DEBUG 00036 #include <SDL/SDL.h> 00037 #else 00038 #include "memory_debug.h" 00039 #endif 00040 00041 #include "MLV_event.h" 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00051 typedef enum{ 00052 MLV_BUTTON_LEFT = SDL_BUTTON_LEFT, 00053 MLV_BUTTON_MIDDLE = SDL_BUTTON_MIDDLE, 00054 MLV_BUTTON_RIGHT = SDL_BUTTON_RIGHT 00055 } MLV_Button; 00056 00068 void MLV_wait_mouse(int *x, int *y); 00069 00085 int MLV_wait_mouse_or_seconds(int *x, int *y, int seconds); 00086 00095 const char* MLV_convert_button_to_string( MLV_Button button_code ); 00096 00103 MLV_Button MLV_convert_string_to_button( const char* button_string ); 00104 00112 void MLV_get_mouse_position( int* x, int* y ); 00113 00121 MLV_State MLV_get_mouse_button_state( MLV_Button mouse_button ); 00122 00123 #ifdef __cplusplus 00124 } 00125 #endif 00126 00127 #endif