event-types.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef MC__EVENT_TYPES_H
  2. #define MC__EVENT_TYPES_H
  3. #include <stdarg.h>
  4. /*** typedefs(not structures) and defined constants **********************************************/
  5. /* Event groups for main modules */
  6. #define MCEVENT_GROUP_CORE "Core"
  7. #define MCEVENT_GROUP_DIALOG "Dialog"
  8. #define MCEVENT_GROUP_DIFFVIEWER "DiffViewer"
  9. #define MCEVENT_GROUP_EDITOR "Editor"
  10. #define MCEVENT_GROUP_FILEMANAGER "FileManager"
  11. #define MCEVENT_GROUP_VIEWER "Viewer"
  12. /* Events */
  13. #define MCEVENT_HISTORY_LOAD "history_load"
  14. #define MCEVENT_HISTORY_SAVE "history_save"
  15. /*** enums ***************************************************************************************/
  16. /*** structures declarations (and typedefs of structures)*****************************************/
  17. /* MCEVENT_GROUP_CORE:vfs_timestamp */
  18. struct vfs_class;
  19. typedef struct
  20. {
  21. struct vfs_class *vclass;
  22. gpointer id;
  23. gboolean ret;
  24. } ev_vfs_stamp_create_t;
  25. /* MCEVENT_GROUP_CORE:vfs_print_message */
  26. typedef struct
  27. {
  28. const char *msg;
  29. va_list ap;
  30. } ev_vfs_print_message_t;
  31. /* MCEVENT_GROUP_CORE:clipboard_text_from_file */
  32. typedef struct
  33. {
  34. char **text;
  35. gboolean ret;
  36. } ev_clipboard_text_from_file_t;
  37. /* MCEVENT_GROUP_CORE:help */
  38. typedef struct
  39. {
  40. const char *filename;
  41. const char *node;
  42. } ev_help_t;
  43. /* MCEVENT_GROUP_CORE:background_parent_call */
  44. /* MCEVENT_GROUP_CORE:background_parent_call_string */
  45. typedef struct
  46. {
  47. void *routine;
  48. gpointer *ctx;
  49. int argc;
  50. va_list ap;
  51. union
  52. {
  53. int i;
  54. char *s;
  55. } ret;
  56. } ev_background_parent_call_t;
  57. /* MCEVENT_GROUP_DIALOG:history_load */
  58. /* MCEVENT_GROUP_DIALOG:history_save */
  59. struct mc_config_t;
  60. struct Widget;
  61. typedef struct
  62. {
  63. struct mc_config_t *cfg;
  64. struct Widget *receiver; /* NULL means broadcast message */
  65. } ev_history_load_save_t;
  66. /*** global variables defined in .c file *********************************************************/
  67. /*** declarations of public functions ************************************************************/
  68. /*** inline functions ****************************************************************************/
  69. #endif /* MC__EVENT_TYPES_H */