events_init.c 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. Event callbacks initialization
  3. Copyright (C) 2011
  4. The Free Software Foundation, Inc.
  5. Written by:
  6. Slava Zanko <slavazanko@gmail.com>, 2011.
  7. This file is part of the Midnight Commander.
  8. The Midnight Commander is free software: you can redistribute it
  9. and/or modify it under the terms of the GNU General Public License as
  10. published by the Free Software Foundation, either version 3 of the License,
  11. or (at your option) any later version.
  12. The Midnight Commander 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. You should have received a copy of the GNU General Public License
  17. along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <config.h>
  20. #include "lib/global.h"
  21. #include "lib/event.h"
  22. #ifdef WITH_BACKGROUND
  23. #include "background.h" /* (background_parent_call), background_parent_call_string() */
  24. #endif /* WITH_BACKGROUND */
  25. #include "clipboard.h" /* clipboard events */
  26. #include "execute.h" /* execute_suspend() */
  27. #include "help.h" /* help_interactive_display() */
  28. #include "events_init.h"
  29. /*** global variables ****************************************************************************/
  30. /*** file scope macro definitions ****************************************************************/
  31. /*** file scope type declarations ****************************************************************/
  32. /*** file scope variables ************************************************************************/
  33. /*** file scope functions ************************************************************************/
  34. /* --------------------------------------------------------------------------------------------- */
  35. /* --------------------------------------------------------------------------------------------- */
  36. /*** public functions ****************************************************************************/
  37. /* --------------------------------------------------------------------------------------------- */
  38. gboolean
  39. events_init (GError ** error)
  40. {
  41. /* *INDENT-OFF* */
  42. event_init_t standard_events[] =
  43. {
  44. {MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", clipboard_file_to_ext_clip, NULL},
  45. {MCEVENT_GROUP_CORE, "clipboard_file_from_ext_clip", clipboard_file_from_ext_clip, NULL},
  46. {MCEVENT_GROUP_CORE, "clipboard_text_to_file", clipboard_text_to_file, NULL},
  47. {MCEVENT_GROUP_CORE, "clipboard_text_from_file", clipboard_text_from_file, NULL},
  48. {MCEVENT_GROUP_CORE, "help", help_interactive_display, NULL},
  49. {MCEVENT_GROUP_CORE, "suspend", execute_suspend, NULL},
  50. #ifdef WITH_BACKGROUND
  51. {MCEVENT_GROUP_CORE, "background_parent_call", background_parent_call, NULL},
  52. {MCEVENT_GROUP_CORE, "background_parent_call_string", background_parent_call_string, NULL},
  53. #endif /* WITH_BACKGROUND */
  54. {NULL, NULL, NULL, NULL}
  55. };
  56. /* *INDENT-ON* */
  57. if (!mc_event_init (error))
  58. return FALSE;
  59. return mc_event_mass_add (standard_events, error);
  60. }
  61. /* --------------------------------------------------------------------------------------------- */