1 /* 2 Event callbacks initialization 3 4 Copyright (C) 2011-2024 5 Free Software Foundation, Inc. 6 7 Written by: 8 Slava Zanko <slavazanko@gmail.com>, 2011. 9 10 This file is part of the Midnight Commander. 11 12 The Midnight Commander is free software: you can redistribute it 13 and/or modify it under the terms of the GNU General Public License as 14 published by the Free Software Foundation, either version 3 of the License, 15 or (at your option) any later version. 16 17 The Midnight Commander is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU General Public License for more details. 21 22 You should have received a copy of the GNU General Public License 23 along with this program. If not, see <http://www.gnu.org/licenses/>. 24 */ 25 26 #include <config.h> 27 28 #include "lib/global.h" 29 30 #include "lib/event.h" 31 32 #ifdef ENABLE_BACKGROUND 33 #include "background.h" /* (background_parent_call), background_parent_call_string() */ 34 #endif /* ENABLE_BACKGROUND */ 35 #include "clipboard.h" /* clipboard events */ 36 #include "execute.h" /* execute_suspend() */ 37 #include "help.h" /* help_interactive_display() */ 38 39 #include "events_init.h" 40 41 /*** global variables ****************************************************************************/ 42 43 /*** file scope macro definitions ****************************************************************/ 44 45 /*** file scope type declarations ****************************************************************/ 46 47 /*** file scope variables ************************************************************************/ 48 49 50 /*** file scope functions ************************************************************************/ 51 /* --------------------------------------------------------------------------------------------- */ 52 53 /* --------------------------------------------------------------------------------------------- */ 54 /*** public functions ****************************************************************************/ 55 /* --------------------------------------------------------------------------------------------- */ 56 57 gboolean 58 events_init (GError **mcerror) /* */ 59 { 60 /* *INDENT-OFF* */ 61 static const event_init_t standard_events[] = 62 { 63 {MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", clipboard_file_to_ext_clip, NULL}, 64 {MCEVENT_GROUP_CORE, "clipboard_file_from_ext_clip", clipboard_file_from_ext_clip, NULL}, 65 {MCEVENT_GROUP_CORE, "clipboard_text_to_file", clipboard_text_to_file, NULL}, 66 {MCEVENT_GROUP_CORE, "clipboard_text_from_file", clipboard_text_from_file, NULL}, 67 68 {MCEVENT_GROUP_CORE, "help", help_interactive_display, NULL}, 69 {MCEVENT_GROUP_CORE, "suspend", execute_suspend, NULL}, 70 71 #ifdef ENABLE_BACKGROUND 72 {MCEVENT_GROUP_CORE, "background_parent_call", background_parent_call, NULL}, 73 {MCEVENT_GROUP_CORE, "background_parent_call_string", background_parent_call_string, NULL}, 74 #endif /* ENABLE_BACKGROUND */ 75 76 {NULL, NULL, NULL, NULL} 77 }; 78 /* *INDENT-ON* */ 79 80 if (!mc_event_init (mcerror)) 81 return FALSE; 82 83 return mc_event_mass_add (standard_events, mcerror); 84 } 85 86 /* --------------------------------------------------------------------------------------------- */