Documentation de la bibliothèque MLV-0.5

MLV_event.h

Aller à la documentation de ce fichier.
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 
00031 #ifndef __MLV_EVENT_H__
00032 #define __MLV_EVENT_H__
00033 
00034 #include "MLV_prompt.h"
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00043 typedef enum {
00044         MLV_NONE = 0, 
00045         MLV_KEY = 1, 
00046         MLV_PROMPT = 2, 
00048         MLV_MOUSE_BUTTON = 3, 
00049         MLV_MOUSE_MOTION = 4 
00050 } MLV_Event;
00051 
00052 
00056 typedef enum {
00057         MLV_PRESSED, 
00058         MLV_RELEASED 
00059 } MLV_State;
00060 
00141 MLV_Event MLV_get_event( 
00142         int* key_sym, int* key_mod, int* unicode, 
00143         char** texte, MLV_Prompt** prompt,
00144         int* mouse_x, int* mouse_y, int* mouse_button,
00145         int* state
00146 );
00147 
00148 
00149 
00225 MLV_Event MLV_wait_event( 
00226         int* key_sym, int* key_mod, int* unicode,
00227         char** texte, MLV_Prompt** prompt,
00228         int* mouse_x, int* mouse_y, int* mouse_button,
00229         int* state
00230 );
00231 
00232 
00311 MLV_Event MLV_wait_event_or_seconds( 
00312         int* key_sym, int* key_mod, int* unicode,
00313         char** texte, MLV_Prompt** prompt,
00314         int* mouse_x, int* mouse_y, int* mouse_button,
00315         int* state, int seconds
00316 );
00317 
00318 
00319 
00324 void MLV_flush_event_queue();
00325 
00354 MLV_Event MLV_wait_keyboard_or_mouse(
00355         int * sym, int * mod, int* unicode,
00356         int* mouse_x, int* mouse_y
00357 );
00358 
00359 
00390 MLV_Event MLV_wait_keyboard_or_mouse_or_seconds(
00391         int * sym, int * mod, int* unicode,
00392         int* mouse_x, int* mouse_y,
00393         int seconds
00394 );
00395 
00402 const char* MLV_convert_event_to_string( MLV_Event event_code );
00403 
00410 MLV_Event MLV_convert_string_to_event( const char* event_string );
00411 
00418 const char* MLV_convert_state_to_string( MLV_State state_code );
00419 
00426 MLV_State MLV_convert_string_to_state( const char* state_string );
00427 
00428 #ifdef __cplusplus
00429 }
00430 #endif
00431 
00432 #endif
00433