react.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef react_H_INCLUDED
  2. #define react_H_INCLUDED
  3. #include "eruta.h"
  4. typedef struct React_ React;
  5. /* This file was generated with:
  6. 'cfunctions -c -aoff -n -w react_proto src/react.c' */
  7. #ifndef CFH_REACT_PROTO
  8. #define CFH_REACT_PROTO
  9. /* From 'src/react.c': */
  10. React * react_initempty (React * self , void * data );
  11. React * react_react (React * self , ALLEGRO_EVENT * event );
  12. React * react_poll (React * self , void * state );
  13. #endif /* CFH_REACT_PROTO */
  14. typedef React * (Reactor)(React * self, ALLEGRO_EVENT event);
  15. /* Reactor function for joystick events. */
  16. typedef React * (ReactJoystick)
  17. (React * self, ALLEGRO_JOYSTICK_EVENT * event);
  18. /* Reactor function for keyboard events. */
  19. typedef React * (ReactKeyboard)
  20. (React * self, ALLEGRO_KEYBOARD_EVENT * event);
  21. /* Reactor function for individual key presses. */
  22. typedef React * (ReactKey)
  23. (React * self, int keycode);
  24. /* Reactor function for mouse events. */
  25. typedef React * (ReactMouse)
  26. (React * self, ALLEGRO_MOUSE_EVENT * event);
  27. /* Reactor function for timer events. */
  28. typedef React * (ReactTimer)
  29. (React * self, ALLEGRO_TIMER_EVENT * event);
  30. /* Reactor function for display events. */
  31. typedef React * (ReactDisplay)
  32. (React * self, ALLEGRO_DISPLAY_EVENT * event);
  33. /** React enables reaction handling to user input in ALLEGRO_EVENT events */
  34. struct React_ {
  35. void * data;
  36. ReactJoystick * joystick_axis;
  37. ReactJoystick * joystick_button_up;
  38. ReactJoystick * joystick_button_down;
  39. ReactJoystick * joystick_configuration;
  40. ReactKeyboard * keyboard_key_down;
  41. ReactKeyboard * keyboard_key_up;
  42. ReactKeyboard * keyboard_key_char;
  43. ReactMouse * mouse_axes;
  44. ReactMouse * mouse_button_up;
  45. ReactMouse * mouse_button_down;
  46. ReactMouse * mouse_enter_display;
  47. ReactMouse * mouse_leave_display;
  48. ReactMouse * mouse_warped;
  49. ReactTimer * timer;
  50. ReactDisplay * display_expose;
  51. ReactDisplay * display_resize;
  52. ReactDisplay * display_close;
  53. ReactDisplay * display_lost;
  54. ReactDisplay * display_found;
  55. ReactDisplay * display_switch_in;
  56. ReactDisplay * display_switch_out;
  57. ReactDisplay * display_orientation;
  58. ReactKey * key_down[ALLEGRO_KEY_MAX];
  59. ReactKey * key_up[ALLEGRO_KEY_MAX];
  60. };
  61. #endif