event.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef MC__EVENT_H
  2. #define MC__EVENT_H
  3. #include "event-types.h"
  4. /*** typedefs(not structures) and defined constants **********************************************/
  5. typedef gboolean (*mc_event_callback_func_t) (const gchar *, const gchar *, gpointer, gpointer);
  6. /*** enums ***************************************************************************************/
  7. /*** structures declarations (and typedefs of structures)*****************************************/
  8. typedef struct
  9. {
  10. const char *event_group_name;
  11. const char *event_name;
  12. mc_event_callback_func_t cb;
  13. gpointer init_data;
  14. } event_init_t;
  15. /*** global variables defined in .c file *********************************************************/
  16. /*** declarations of public functions ************************************************************/
  17. /* event.c: */
  18. gboolean mc_event_init (GError ** mcerror);
  19. gboolean mc_event_deinit (GError ** mcerror);
  20. /* manage.c: */
  21. gboolean mc_event_add (const gchar * event_group_name, const gchar * event_name,
  22. mc_event_callback_func_t event_callback, gpointer event_init_data,
  23. GError ** mcerror);
  24. void mc_event_del (const gchar * event_group_name, const gchar * event_name,
  25. mc_event_callback_func_t event_callback, gpointer event_init_data);
  26. void mc_event_destroy (const gchar * event_group_name, const gchar * event_name);
  27. void mc_event_group_del (const gchar * event_group_name);
  28. gboolean mc_event_present (const gchar * event_group_name, const gchar * event_name);
  29. gboolean mc_event_mass_add (const event_init_t * events, GError ** mcerror);
  30. /* raise.c: */
  31. gboolean mc_event_raise (const gchar *, const gchar *, gpointer);
  32. /*** inline functions ****************************************************************************/
  33. #endif /* MC__EVENT_H */