Documentation de la bibliothèque MLV-2.0.2

MLV_event.h
Aller à la documentation de ce fichier.
1 /*
2  * This file is part of the MLV Library.
3  *
4  * Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
5  *
6  *
7  * This Library is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This Library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
31 #ifndef __MLV__MLV_EVENT_H__
32 #define __MLV__MLV_EVENT_H__
33 
35 #include "MLV_keyboard.h"
36 #include "MLV_mouse.h"
37 #include "MLV_input_box.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
46 typedef enum {
47  MLV_NONE = 0,
48  MLV_KEY = 1,
53 } MLV_Event;
54 
55 
138  MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
139  char** texte, MLV_Input_box** input_box,
140  int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
141  MLV_Button_state* state
142 );
143 
144 
145 
188  MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
189  char** texte, MLV_Input_box** input_box,
190  int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
191  MLV_Button_state* state
192 );
193 
194 
241  MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
242  char** texte, MLV_Input_box** input_box,
243  int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
244  MLV_Button_state* state, int seconds
245 );
246 
247 
248 
253 void MLV_flush_event_queue();
254 
287  MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
288  int* mouse_x, int* mouse_y
289 );
290 
291 
319  MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
320  int* mouse_x, int* mouse_y,
321  int seconds
322 );
323 
330 const char* MLV_convert_event_to_string( MLV_Event event_code );
331 
338 MLV_Event MLV_convert_string_to_event( const char* event_string );
339 
346 const char* MLV_convert_button_state_to_string( MLV_Button_state state_code );
347 
354 MLV_Button_state MLV_convert_string_to_button_state( const char* state_string );
355 
356 #ifdef __cplusplus
357 }
358 #endif
359 
360 #endif
361 
MLV_Event
Énumère les différents types d'évènement de la bibliothèque MLV.
Definition: MLV_event.h:46
const char * MLV_convert_button_state_to_string(MLV_Button_state state_code)
Convertit le code d'un état en une chaîne de caractères.
Definition: MLV_event.h:51
MLV_Mouse_button
Énumère les différents bouttons de la souris.
Definition: MLV_mouse.h:51
const char * MLV_convert_event_to_string(MLV_Event event_code)
Convertit le code d'un évènement en une chaîne de caractères.
Ce fichier définit les prototypes des fonctions qui permettent d'utiliser la souris.
void MLV_flush_event_queue()
Cette fonction vide la file d'évènements.
Definition: MLV_event.h:48
MLV_Keyboard_button
Énumère l'ensemble des codes des touches du clavier.
Definition: MLV_keyboard.h:50
Definition: MLV_event.h:49
MLV_Event MLV_convert_string_to_event(const char *event_string)
Convertit le nom d'un évènement en son code associé.
MLV_Button_state
Énumère les différents états possibles d'un bouton.
Definition: MLV_device_with_buttons.h:43
struct _MLV_Input_box MLV_Input_box
Définition du type des boîtes de saisies.
Definition: MLV_input_box.h:47
MLV_Event MLV_wait_event(MLV_Keyboard_button *key_sym, MLV_Keyboard_modifier *key_mod, int *unicode, char **texte, MLV_Input_box **input_box, int *mouse_x, int *mouse_y, MLV_Mouse_button *mouse_button, MLV_Button_state *state)
Cette fonction suspends l'éxecution du programme jusqu'à ce qu'un évènement apparaît dans la file d'a...
MLV_Event MLV_get_event(MLV_Keyboard_button *key_sym, MLV_Keyboard_modifier *key_mod, int *unicode, char **texte, MLV_Input_box **input_box, int *mouse_x, int *mouse_y, MLV_Mouse_button *mouse_button, MLV_Button_state *state)
Cette fonction récupère un évènement dans la file d'attente, remplit en fonction de l'évènement récup...
Ce fichier définit les prototypes des fonctions permettant d'utiliser le clavier. ...
Definition: MLV_event.h:52
Ce fichier définit des énumérations et des prototypes de fonctions pour manipuler des boutons de diff...
MLV_Button_state MLV_convert_string_to_button_state(const char *state_string)
Convertit le nom d'un état en son code associé.
MLV_Event MLV_wait_keyboard_or_mouse(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode, int *mouse_x, int *mouse_y)
Suspend l'exécution jusqu'à ce que l'utilisateur appuie sur une touche du clavier ou sur le bouton ga...
MLV_Event MLV_wait_keyboard_or_mouse_or_seconds(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode, int *mouse_x, int *mouse_y, int seconds)
Suspend l'exécution jusqu'à ce que l'utilisateur appuie sur une touche du clavier, sur le bouton gauche de la souris ou qu'un certain nombre de secondes passées en paramètres se soient écoulées.
Definition: MLV_event.h:47
MLV_Event MLV_wait_event_or_seconds(MLV_Keyboard_button *key_sym, MLV_Keyboard_modifier *key_mod, int *unicode, char **texte, MLV_Input_box **input_box, int *mouse_x, int *mouse_y, MLV_Mouse_button *mouse_button, MLV_Button_state *state, int seconds)
Cette fonction suspends l'éxecution du programme jusqu'à ce qu'un évènement apparaît dans la file d'a...
MLV_Keyboard_modifier
Énumère l'ensemble des codes associées aux différents modes du clavier.
Definition: MLV_keyboard.h:299
Ce fichier définit les prototypes des fonctions permettant de demander à l'utilisateur du texte par l...