Documentation de la bibliothèque MLV-3.1.0

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 
293  MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
294  char** texte, MLV_Input_box** input_box,
295  int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
296  MLV_Button_state* state, int milliseconds
297 );
298 
299 
300 
305 void MLV_flush_event_queue();
306 
339  MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
340  int* mouse_x, int* mouse_y
341 );
342 
343 
371  MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
372  int* mouse_x, int* mouse_y,
373  int seconds
374 );
375 
390 MLV_Event MLV_wait_mouse_or_milliseconds(int *x, int *y, int milliseconds);
391 
407 MLV_Event MLV_wait_mouse_or_seconds(int *x, int *y, int seconds);
408 
432  MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
433  int seconds
434 );
435 
459  MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
460  int milliseconds
461 );
462 
491  MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
492  int* mouse_x, int* mouse_y,
493  int milliseconds
494 );
495 
502 const char* MLV_convert_event_to_string( MLV_Event event_code );
503 
510 MLV_Event MLV_convert_string_to_event( const char* event_string );
511 
518 const char* MLV_convert_button_state_to_string( MLV_Button_state state_code );
519 
526 MLV_Button_state MLV_convert_string_to_button_state( const char* state_string );
527 
566  int milliseconds,
567  int top_left_corner_X, int top_left_corner_Y,
568  int width, int height,
569  MLV_Color borderColor, MLV_Color textColor,
570  MLV_Color backgroundColor,
571  const char* informativeMessage,
572  char** text, ...
573 );
574 
603  int milliseconds,
604  int top_left_corner_X, int top_left_corner_Y,
605  int width, int height,
606  MLV_Color borderColor, MLV_Color textColor,
607  MLV_Color backgroundColor,
608  const char* informativeMessage,
609  char** text,
610  const MLV_Font* font, ...
611 );
612 
627  int milliseconds, MLV_Input_box* input_box, char** text
628 );
629 
644  MLV_Input_box* input_box, char** text, int seconds
645 );
646 
647 #ifdef __cplusplus
648 }
649 #endif
650 
651 #endif
652 
MLV_Event
Énumère les différents types d&#39;é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&#39;un état en une chaîne de caractères.
Definition: MLV_event.h:51
MLV_Event MLV_wait_keyboard_or_milliseconds(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode, int milliseconds)
Suspend l&#39;exécution jusqu&#39;à ce que l&#39;utilisateur appuie sur une touche du clavier ou jusq&#39;à ce q&#39;u...
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&#39;un évènement en une chaîne de caractères.
Ce fichier définit les prototypes des fonctions qui permettent d&#39;utiliser la souris.
void MLV_flush_event_queue()
Cette fonction vide la file d&#39;évènements.
Definition: MLV_event.h:48
MLV_Event MLV_wait_event_or_milliseconds(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 milliseconds)
Cette fonction suspends l&#39;éxecution du programme jusqu&#39;à ce qu&#39;un évènement apparaît dans la fil...
MLV_Keyboard_button
Énumère l&#39;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&#39;un évènement en son code associé.
MLV_Button_state
Énumère les différents états possibles d&#39;un bouton.
Definition: MLV_device_with_buttons.h:43
MLV_Event MLV_wait_mouse_or_seconds(int *x, int *y, int seconds)
Suspend l&#39;exécution jusqu&#39;à ce que l&#39;utilisateur clique sur le bouton gauche de la souris où jusqu...
MLV_Event MLV_wait_particular_input_box_or_seconds(MLV_Input_box *input_box, char **text, int seconds)
Cette fonction suspend l&#39;exécution du programme jusqu&#39;à ce que l&#39;utilisateur écrive une phrase dan...
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&#39;éxecution du programme jusqu&#39;à ce qu&#39;un évènement apparaît dans la fil...
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&#39;attente, remplit en fonction de l&#39;évènement...
Ce fichier définit les prototypes des fonctions permettant d&#39;utiliser le clavier.
struct _MLV_Font MLV_Font
Definition: MLV_text.h:77
Uint32 MLV_Color
Définit un type couleur pour la bibliothèque MLV.
Definition: MLV_color.h:54
Definition: MLV_event.h:52
Ce fichier définit des énumérations et des prototypes de fonctions pour manipuler des boutons de d...
MLV_Event MLV_wait_keyboard_or_mouse_or_milliseconds(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode, int *mouse_x, int *mouse_y, int milliseconds)
Suspend l&#39;exécution jusqu&#39;à ce que l&#39;utilisateur appuie sur une touche du clavier, sur le bouton gauche de la souris ou qu&#39;un certain nombre de millisecondes passées en paramètres se soient écoulées.
MLV_Button_state MLV_convert_string_to_button_state(const char *state_string)
Convertit le nom d&#39;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&#39;exécution jusqu&#39;à ce que l&#39;utilisateur appuie sur une touche du clavier ou sur le bouton ...
MLV_Event MLV_wait_keyboard_or_seconds(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode, int seconds)
Suspend l&#39;exécution jusqu&#39;à ce que l&#39;utilisateur appuie sur une touche du clavier ou jusq&#39;à ce q&#39;u...
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&#39;exécution jusqu&#39;à ce que l&#39;utilisateur appuie sur une touche du clavier, sur le bouton gauche de la souris ou qu&#39;un certain nombre de secondes passées en paramètres se soient écoulées.
Definition: MLV_event.h:47
MLV_Event MLV_wait_input_box_or_milliseconds(int milliseconds, int top_left_corner_X, int top_left_corner_Y, int width, int height, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, const char *informativeMessage, char **text,...)
Cette fonction suspend l&#39;exécution du programme, affiche une boîte de saisie et attends que l&#39;utili...
MLV_Event MLV_wait_input_box_with_font_or_milliseconds(int milliseconds, int top_left_corner_X, int top_left_corner_Y, int width, int height, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, const char *informativeMessage, char **text, const MLV_Font *font,...)
Même chose que MLV_wait_input_box_or_milliseconds(), mais il est possible de changer la fonte du du ...
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&#39;éxecution du programme jusqu&#39;à ce qu&#39;un évènement apparaît dans la fil...
MLV_Event MLV_wait_mouse_or_milliseconds(int *x, int *y, int milliseconds)
Suspend l&#39;exécution jusqu&#39;à ce que l&#39;utilisateur clique sur le bouton gauche de la souris...
MLV_Keyboard_modifier
Énumère l&#39;ensemble des codes associées aux différents modes du clavier.
Definition: MLV_keyboard.h:299
MLV_Event MLV_wait_particular_input_box_or_milliseconds(int milliseconds, MLV_Input_box *input_box, char **text)
Cette fonction suspend l&#39;exécution du programme jusqu&#39;à ce que l&#39;utilisateur écrive une phrase dan...
Ce fichier définit les prototypes des fonctions permettant de demander à l&#39;utilisateur du texte par...