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
40extern "C" {
41#endif
42
46typedef enum {
48 MLV_KEY = 1,
49 MLV_INPUT_BOX = 2,
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
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
390MLV_Event MLV_wait_mouse_or_milliseconds(int *x, int *y, int milliseconds);
391
407MLV_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
502const char* MLV_convert_event_to_string( MLV_Event event_code );
503
510MLV_Event MLV_convert_string_to_event( const char* event_string );
511
519
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
Uint32 MLV_Color
Définit un type couleur pour la bibliothèque MLV.
Definition: MLV_color.h:54
MLV_Button_state
Énumère les différents états possibles d'un bouton.
Definition: MLV_device_with_buttons.h:43
Ce fichier définit des énumérations et des prototypes de fonctions pour manipuler des boutons de diff...
MLV_Event MLV_wait_particular_input_box_or_milliseconds(int milliseconds, MLV_Input_box *input_box, char **text)
Cette fonction suspend l'exécution du programme jusqu'à ce que l'utilisateur écrive une phrase dans l...
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 t...
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,...
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.
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_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_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_particular_input_box_or_seconds(MLV_Input_box *input_box, char **text, int seconds)
Cette fonction suspend l'exécution du programme jusqu'à ce que l'utilisateur écrive une phrase dans l...
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.
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'é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...
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_wait_mouse_or_seconds(int *x, int *y, int seconds)
Suspend l'exécution jusqu'à ce que l'utilisateur clique sur le bouton gauche de la souris où jusqu'à ...
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'exécution jusqu'à ce que l'utilisateur appuie sur une touche du clavier,...
MLV_Event MLV_wait_keyboard_or_milliseconds(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode, int milliseconds)
Suspend l'exécution jusqu'à ce que l'utilisateur appuie sur une touche du clavier ou jusq'à ce q'un n...
MLV_Event MLV_convert_string_to_event(const char *event_string)
Convertit le nom d'un évènement en son code associé.
MLV_Event MLV_wait_keyboard_or_seconds(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode, int seconds)
Suspend l'exécution jusqu'à ce que l'utilisateur appuie sur une touche du clavier ou jusq'à ce q'un n...
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'exécution du programme, affiche une boîte de saisie et attends que l'utilisa...
MLV_Event MLV_wait_mouse_or_milliseconds(int *x, int *y, int milliseconds)
Suspend l'exécution jusqu'à ce que l'utilisateur clique sur le bouton gauche de la souris.
MLV_Event
Énumère les différents types d'évènement de la bibliothèque MLV.
Definition: MLV_event.h:46
@ MLV_INPUT_BOX
Definition: MLV_event.h:49
@ MLV_MOUSE_MOTION
Definition: MLV_event.h:52
@ MLV_MOUSE_BUTTON
Definition: MLV_event.h:51
@ MLV_KEY
Definition: MLV_event.h:48
@ MLV_NONE
Definition: MLV_event.h:47
void MLV_flush_event_queue()
Cette fonction vide la file d'évènements.
Ce fichier définit les prototypes des fonctions permettant de demander à l'utilisateur du texte par l...
struct _MLV_Input_box MLV_Input_box
Définition du type des boîtes de saisies.
Definition: MLV_input_box.h:47
Ce fichier définit les prototypes des fonctions permettant d'utiliser le clavier.
MLV_Keyboard_button
Énumère l'ensemble des codes des touches du clavier.
Definition: MLV_keyboard.h:50
MLV_Keyboard_modifier
Énumère l'ensemble des codes associées aux différents modes du clavier.
Definition: MLV_keyboard.h:299
MLV_Mouse_button
Énumère les différents bouttons de la souris.
Definition: MLV_mouse.h:51
Ce fichier définit les prototypes des fonctions qui permettent d'utiliser la souris.
struct _MLV_Font MLV_Font
Definition: MLV_text.h:77