1 /*
2 Event callbacks initialization
3
4 Copyright (C) 2011-2025
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 <https://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
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 /*** file scope functions ************************************************************************/
50 /* --------------------------------------------------------------------------------------------- */
51
52 /* --------------------------------------------------------------------------------------------- */
53 /*** public functions ****************************************************************************/
54 /* --------------------------------------------------------------------------------------------- */
55
56 gboolean
57 events_init (GError **mcerror)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
58 {
59 static const event_init_t standard_events[] = {
60 { MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", clipboard_file_to_ext_clip, NULL },
61 { MCEVENT_GROUP_CORE, "clipboard_file_from_ext_clip", clipboard_file_from_ext_clip, NULL },
62 { MCEVENT_GROUP_CORE, "clipboard_text_to_file", clipboard_text_to_file, NULL },
63 { MCEVENT_GROUP_CORE, "clipboard_text_from_file", clipboard_text_from_file, NULL },
64
65 { MCEVENT_GROUP_CORE, "help", help_interactive_display, NULL },
66 { MCEVENT_GROUP_CORE, "suspend", execute_suspend, NULL },
67
68 #ifdef ENABLE_BACKGROUND
69 { MCEVENT_GROUP_CORE, "background_parent_call", background_parent_call, NULL },
70 { MCEVENT_GROUP_CORE, "background_parent_call_string", background_parent_call_string,
71 NULL },
72 #endif
73
74 { NULL, NULL, NULL, NULL },
75 };
76
77 if (!mc_event_init (mcerror))
78 return FALSE;
79
80 return mc_event_mass_add (standard_events, mcerror);
81 }
82
83 /* --------------------------------------------------------------------------------------------- */