Rename mc_event_raise() to mc_event_dispatch()

This commit is contained in:
Slava Zanko 2015-04-06 17:08:37 +03:00
parent 47f0dfd636
commit 8e2ab3cadb
28 changed files with 143 additions and 136 deletions

View File

@ -61,7 +61,7 @@ gboolean mc_event_mass_add (event_init_t *, GError **);
/* raise.c: */
gboolean
mc_event_raise (const gchar * event_group_name, const gchar * event_name, gpointer event_data,
event_return_t * ret, GError ** error);
mc_event_dispatch (const gchar * event_group_name, const gchar * event_name, gpointer event_data,
event_return_t * ret, GError ** error);
/*** inline functions ****************************************************************************/
#endif /* MC__EVENT_H */

View File

@ -48,8 +48,8 @@
/* --------------------------------------------------------------------------------------------- */
gboolean
mc_event_raise (const gchar * event_group_name, const gchar * event_name, gpointer event_data,
event_return_t * ret, GError ** error)
mc_event_dispatch (const gchar * event_group_name, const gchar * event_name, gpointer event_data,
event_return_t * ret, GError ** error)
{
gboolean ret_value = FALSE;
GTree *event_group;

View File

@ -407,7 +407,7 @@ mc_keymap_process_group (const char *group, long pressed_keycode, void *data, ev
if (keymap_event->switch_group != NULL)
data = keymap_event->switch_group;
ret_value = mc_event_raise (keymap_event->group, keymap_event->name, data, ret, error);
ret_value = mc_event_dispatch (keymap_event->group, keymap_event->name, data, ret, error);
if (switch_group_cmd_was_called && switched_group == NULL)
{

View File

@ -202,7 +202,8 @@ vfs_stamp_create (struct vfs_class *vclass, vfsid id)
if (!(id == NULL || (path_element->class == vclass && nvfsid == id)))
{
mc_event_raise (MCEVENT_GROUP_CORE, "vfs_timestamp", (gpointer) & event_data, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "vfs_timestamp", (gpointer) & event_data, &ret,
NULL);
if (!ret.b && vclass != NULL && vclass->nothingisopen != NULL
&& vclass->nothingisopen (id) != 0)

View File

@ -516,7 +516,8 @@ vfs_print_message (const char *msg, ...)
va_start (event_data.ap, msg);
event_data.msg = msg;
mc_event_raise (MCEVENT_GROUP_CORE, "vfs_print_message", (gpointer) & event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "vfs_print_message", (gpointer) & event_data, NULL,
NULL);
va_end (event_data.ap);
}

View File

@ -299,7 +299,8 @@ dialog_switch_process_pending (void)
if (mc_global.mc_run_mode == MC_RUN_FULL)
{
mc_current = g_list_find (mc_dialogs, midnight_dlg);
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "update_panels", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "update_panels", NULL, NULL,
NULL);
}
}
}

View File

@ -43,7 +43,7 @@
#include "lib/strutil.h"
#include "lib/widget.h"
#include "lib/fileloc.h" /* MC_HISTORY_FILE */
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
/*** global variables ****************************************************************************/
@ -169,7 +169,7 @@ dlg_read_history (WDialog * h)
event_data.receiver = NULL;
/* create all histories in dialog */
mc_event_raise (h->event_group, MCEVENT_HISTORY_LOAD, &event_data, NULL, NULL);
mc_event_dispatch (h->event_group, MCEVENT_HISTORY_LOAD, &event_data, NULL, NULL);
mc_config_deinit (event_data.cfg);
g_free (profile);
@ -305,12 +305,12 @@ dlg_execute_cmd (WDialog * h, unsigned long command)
case CK_Help:
{
ev_help_t help_event_data = { NULL, h->help_ctx };
mc_event_raise (MCEVENT_GROUP_CORE, "help", &help_event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "help", &help_event_data, NULL, NULL);
}
break;
case CK_Suspend:
mc_event_raise (MCEVENT_GROUP_CORE, "suspend", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "suspend", NULL, NULL, NULL);
refresh_cmd ();
break;
case CK_Refresh:
@ -337,7 +337,7 @@ dlg_execute_cmd (WDialog * h, unsigned long command)
ret = MSG_NOT_HANDLED;
}
if (mc_event_raise (event_group_name, event_name, event_data, &event_ret, NULL))
if (mc_event_dispatch (event_group_name, event_name, event_data, &event_ret, NULL))
{
return (event_ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}
@ -1323,7 +1323,7 @@ dlg_save_history (WDialog * h)
event_data.receiver = NULL;
/* get all histories in dialog */
mc_event_raise (h->event_group, MCEVENT_HISTORY_SAVE, &event_data, NULL, NULL);
mc_event_dispatch (h->event_group, MCEVENT_HISTORY_SAVE, &event_data, NULL, NULL);
mc_config_save_file (event_data.cfg, NULL);
mc_config_deinit (event_data.cfg);

View File

@ -50,9 +50,9 @@
#include "lib/util.h"
#include "lib/keybind.h" /* global_keymap_t */
#include "lib/widget.h"
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
#include "event.h" /* mc_event_raise() */
#include "event.h" /* mc_event_dispatch() */
#include "input_complete.h"
/*** global variables ****************************************************************************/
@ -502,10 +502,10 @@ copy_region (WInput * in, int x_first, int x_last)
if (last == first)
{
/* Copy selected files to clipboard */
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "save_current_file_to_clip_file", NULL,
NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "save_current_file_to_clip_file", NULL,
NULL, NULL);
/* try use external clipboard utility */
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
return;
}
@ -516,9 +516,9 @@ copy_region (WInput * in, int x_first, int x_last)
kill_buffer = g_strndup (in->buffer + first, last - first);
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_text_to_file", kill_buffer, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_text_to_file", kill_buffer, NULL, NULL);
/* try use external clipboard utility */
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
}
/* --------------------------------------------------------------------------------------------- */
@ -605,9 +605,9 @@ ins_from_clip (WInput * in)
event_return_t ret;
/* try use external clipboard utility */
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_file_from_ext_clip", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_file_from_ext_clip", NULL, NULL, NULL);
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_text_from_file", &p, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_text_from_file", &p, &ret, NULL);
if (ret.b)
{
char *pp;
@ -825,7 +825,7 @@ input_execute_cmd (WInput * in, unsigned long command)
res = MSG_NOT_HANDLED;
}
if (mc_event_raise (event_group_name, event_name, event_data, &event_ret, NULL))
if (mc_event_dispatch (event_group_name, event_name, event_data, &event_ret, NULL))
{
res = (event_ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}
@ -952,7 +952,7 @@ input_event (Gpm_Event * event, void *data)
dlg_select_widget (w);
if (local.x >= w->cols - HISTORY_BUTTON_WIDTH + 1 && should_show_history_button (in))
mc_event_raise (MCEVENT_GROUP_WIDGET_INPUT, "show_history", in, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_WIDGET_INPUT, "show_history", in, NULL, NULL);
else
{
if (local.x + in->term_first_shown - 1 < str_term_width1 (in->buffer))

View File

@ -42,7 +42,7 @@
#include "lib/tty/key.h" /* key macros */
#include "lib/strutil.h"
#include "lib/widget.h"
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
/*** global variables ****************************************************************************/
@ -471,7 +471,7 @@ menubar_handle_key (WMenuBar * menubar, int key)
else
event_data.node = "[Menu Bar]";
mc_event_raise (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
menubar_draw (menubar);
return 1;
}

View File

@ -42,7 +42,7 @@
#include "lib/strutil.h"
#include "lib/util.h" /* tilde_expand() */
#include "lib/widget.h"
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
/*** global variables ****************************************************************************/
@ -243,8 +243,8 @@ wtools_parent_call (void *routine, gpointer ctx, int argc, ...)
event_data.ctx = ctx;
event_data.argc = argc;
va_start (event_data.ap, argc);
mc_event_raise (MCEVENT_GROUP_CORE, "background_parent_call", (gpointer) & event_data, &ret,
NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "background_parent_call", (gpointer) & event_data, &ret,
NULL);
va_end (event_data.ap);
return ret.i;
}
@ -260,8 +260,8 @@ wtools_parent_call_string (void *routine, int argc, ...)
event_data.routine = routine;
event_data.argc = argc;
va_start (event_data.ap, argc);
mc_event_raise (MCEVENT_GROUP_CORE, "background_parent_call_string", (gpointer) & event_data,
&ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "background_parent_call_string", (gpointer) & event_data,
&ret, NULL);
va_end (event_data.ap);
return ret.s;
}

View File

@ -358,7 +358,7 @@ mc_diffviewer_cmd_edit (event_info_t * event_info, gpointer data, GError ** erro
vfs_path_free (tmp_vpath);
}
h->modal = h_modal;
mc_event_raise (MCEVENT_GROUP_DIFFVIEWER, "redo", dview, NULL, error);
mc_event_dispatch (MCEVENT_GROUP_DIFFVIEWER, "redo", dview, NULL, error);
mc_diffviewer_update (dview);
return TRUE;

View File

@ -1886,7 +1886,7 @@ mc_diffviewer_cmd_merge (event_info_t * event_info, gpointer data, GError ** err
vfs_path_free (merge_file_name_vpath);
}
mc_event_raise (MCEVENT_GROUP_DIFFVIEWER, "redo", dview, NULL, error);
mc_event_dispatch (MCEVENT_GROUP_DIFFVIEWER, "redo", dview, NULL, error);
return TRUE;
}

View File

@ -43,7 +43,7 @@
#ifdef HAVE_CHARSET
#include "lib/charsets.h"
#endif
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
#include "lib/keymap.h"
#include "src/filemanager/cmd.h" /* edit_file_at_line(), view_other_cmd() */
@ -263,7 +263,7 @@ dview_ok_to_exit (WDiff * dview)
res = FALSE;
break;
case 0: /* Yes */
mc_event_raise (MCEVENT_GROUP_DIFFVIEWER, "save_changes", dview, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_DIFFVIEWER, "save_changes", dview, NULL, NULL);
res = TRUE;
break;
case 1: /* No */
@ -313,7 +313,7 @@ dview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
{
case MSG_INIT:
dview_labels (dview);
mc_event_raise (MCEVENT_GROUP_DIFFVIEWER, "options_load", dview, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_DIFFVIEWER, "options_load", dview, NULL, NULL);
mc_diffviewer_update (dview);
return MSG_HANDLED;
@ -326,7 +326,7 @@ dview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
return dview_handle_key (dview, parm, NULL);
case MSG_DESTROY:
mc_event_raise (MCEVENT_GROUP_DIFFVIEWER, "options_save", dview, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_DIFFVIEWER, "options_save", dview, NULL, NULL);
mc_diffviewer_deinit (dview);
return MSG_HANDLED;

View File

@ -1656,7 +1656,7 @@ mc_editor_call_event_user_menu (WEdit * edit, const char *menu_file, int selecte
.selected_entry = selected_entry
};
mc_event_raise (MCEVENT_GROUP_EDITOR, "user_menu", &event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "user_menu", &event_data, NULL, NULL);
}
/* --------------------------------------------------------------------------------------------- */
@ -3151,13 +3151,13 @@ edit_execute_key_command (WEdit * edit, unsigned long command, int char_for_inse
edit->force |= REDRAW_COMPLETELY;
if (command == CK_MacroStopRecord || command == CK_MacroStartStopRecord)
{
mc_event_raise (MCEVENT_GROUP_EDITOR, "macro_store", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "macro_store", edit, NULL, NULL);
macro_index = -1;
return;
}
if (command == CK_RepeatStopRecord || command == CK_RepeatStartStopRecord)
{
mc_event_raise (MCEVENT_GROUP_EDITOR, "macro_repeat", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "macro_repeat", edit, NULL, NULL);
macro_index = -1;
return;
}
@ -3743,7 +3743,7 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
}
if (event_name != NULL)
mc_event_raise (MCEVENT_GROUP_EDITOR, event_name, event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, event_name, event_data, NULL, NULL);
}
@ -3823,7 +3823,7 @@ mc_editor_cmd_backspace (event_info_t * event_info, gpointer data, GError ** err
else
edit_backspace (edit, FALSE);
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
return TRUE;
}
@ -3857,7 +3857,7 @@ mc_editor_cmd_delete (event_info_t * event_info, gpointer data, GError ** error)
edit_delete (edit, FALSE);
}
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
return TRUE;
}
@ -3895,7 +3895,7 @@ mc_editor_cmd_delete_word (event_info_t * event_info, gpointer data, GError ** e
break;
}
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
return TRUE;
}
@ -3916,12 +3916,12 @@ mc_editor_cmd_delete_line (event_info_t * event_info, gpointer data, GError ** e
case TO_LINE_BEGIN:
while (edit_buffer_get_previous_byte (&edit->buffer) != '\n' && edit->buffer.curs1 != 0)
edit_backspace (edit, TRUE);
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
break;
case TO_LINE_END:
while (edit_buffer_get_current_byte (&edit->buffer) != '\n' && edit->buffer.curs2 != 0)
edit_delete (edit, TRUE);
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
break;
default:
@ -3975,7 +3975,7 @@ mc_editor_cmd_enter (event_info_t * event_info, gpointer data, GError ** error)
if (option_return_does_auto_indent && !bracketed_pasting_in_progress)
edit_auto_indent (edit);
}
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
return TRUE;
}
@ -4057,7 +4057,7 @@ mc_editor_cmd_insert_char (event_info_t * event_info, gpointer data, GError ** e
#endif
edit_insert (edit, event_data->char_for_insertion);
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
if (!option_auto_para_formatting)
check_and_wrap_line (edit);
@ -4216,7 +4216,7 @@ mc_editor_cmd_tab (event_info_t * event_info, gpointer data, GError ** error)
{
if (edit->mark2 < 0)
edit_mark_cmd (edit, FALSE);
mc_event_raise (MCEVENT_GROUP_EDITOR, "block_move_to_right", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "block_move_to_right", edit, NULL, NULL);
}
else
@ -4224,7 +4224,7 @@ mc_editor_cmd_tab (event_info_t * event_info, gpointer data, GError ** error)
if (option_cursor_beyond_eol)
edit_insert_over (edit);
edit_tab_cmd (edit);
mc_event_raise (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "format_paragraph_auto", edit, NULL, NULL);
if (!option_auto_para_formatting)
check_and_wrap_line (edit);
@ -4576,7 +4576,7 @@ mc_editor_cmd_complete (event_info_t * event_info, gpointer data, GError ** erro
/* if text marked shift block */
if (!option_persistent_selections)
mc_event_raise (MCEVENT_GROUP_EDITOR, "block_move_to_left", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "block_move_to_left", edit, NULL, NULL);
else
edit_complete_word_cmd (edit);
edit->prev_col = edit_get_col (edit);

View File

@ -60,7 +60,7 @@
#include "lib/util.h" /* tilde_expand() */
#include "lib/vfs/vfs.h"
#include "lib/widget.h"
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
#ifdef HAVE_CHARSET
#include "lib/charsets.h"
#endif
@ -1529,7 +1529,7 @@ mc_editor_call_event_save_as (WEdit * edit)
{
event_return_t ret;
mc_event_raise (MCEVENT_GROUP_EDITOR, "save_as", edit, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "save_as", edit, &ret, NULL);
return ret.b;
}
@ -2452,7 +2452,7 @@ mc_editor_cmd_ext_clip_copy (event_info_t * event_info, gpointer data, GError **
return FALSE;
}
/* try use external clipboard utility */
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
if (option_drop_selection_on_copy)
edit_mark_cmd (edit, TRUE);
@ -2482,7 +2482,7 @@ mc_editor_cmd_ext_clip_cut (event_info_t * event_info, gpointer data, GError **
return TRUE;
}
/* try use external clipboard utility */
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL, NULL, NULL);
mc_editor_call_event_block_delete (edit);
edit_mark_cmd (edit, TRUE);
@ -2509,7 +2509,7 @@ mc_editor_cmd_ext_clip_paste (event_info_t * event_info, gpointer data, GError *
edit_insert_over (edit);
/* try use external clipboard utility */
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_file_from_ext_clip", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_file_from_ext_clip", NULL, NULL, NULL);
tmp = mc_config_get_full_vpath (EDIT_CLIP_FILE);
edit_insert_file (edit, tmp);
vfs_path_free (tmp);
@ -3117,7 +3117,7 @@ mc_editor_call_event_block_delete (WEdit * edit)
{
event_return_t ret;
mc_event_raise (MCEVENT_GROUP_EDITOR, "block_delete", edit, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "block_delete", edit, &ret, NULL);
return ret.b;
}
@ -3264,7 +3264,7 @@ mc_editor_cmd_block_delete (event_info_t * event_info, gpointer data, GError **
edit->force |= REDRAW_PAGE;
}
else
mc_event_raise (MCEVENT_GROUP_EDITOR, "delete_line", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "delete_line", edit, NULL, NULL);
event_info->ret->b = FALSE;

View File

@ -49,7 +49,7 @@
#include "lib/util.h" /* mc_build_filename() */
#include "lib/widget.h"
#include "lib/mcconfig.h"
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
#ifdef HAVE_CHARSET
#include "lib/charsets.h"
#endif
@ -174,7 +174,7 @@ static void
edit_help (void)
{
ev_help_t event_data = { NULL, "[Internal File Editor]" };
mc_event_raise (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
}
/* --------------------------------------------------------------------------------------------- */
@ -446,7 +446,7 @@ edit_event (Gpm_Event * event, void *data)
if (local.x == w->cols - dx - 4)
{
mc_event_raise (MCEVENT_GROUP_EDITOR, "toggle_fullscreen", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "toggle_fullscreen", edit, NULL, NULL);
return MOU_NORMAL;
}
@ -594,7 +594,7 @@ edit_event (Gpm_Event * event, void *data)
else if (y == w->y && (event->type & (GPM_DOUBLE | GPM_UP)) == (GPM_DOUBLE | GPM_UP))
{
/* double click on top line (toggle fullscreen) */
mc_event_raise (MCEVENT_GROUP_EDITOR, "toggle_fullscreen", edit, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "toggle_fullscreen", edit, NULL, NULL);
edit->drag_state = MCEDIT_DRAG_NORMAL;
edit->force |= REDRAW_COMPLETELY;
edit_update_screen (edit);
@ -692,7 +692,7 @@ edit_dialog_event (Gpm_Event * event, void *data)
/* Handle buttons */
if (x <= 2)
mc_event_raise (MCEVENT_GROUP_EDITOR, "toggle_fullscreen", e, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "toggle_fullscreen", e, NULL, NULL);
else
send_message (h, NULL, MSG_ACTION, CK_Close, NULL);
@ -814,7 +814,7 @@ edit_dialog_command_execute (WDialog * h, unsigned long command)
break;
}
if (mc_event_raise (event_group_name, event_name, event_data, &ret, NULL))
if (mc_event_dispatch (event_group_name, event_name, event_data, &ret, NULL))
{
return (ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}

View File

@ -550,11 +550,11 @@ format_paragraph (WEdit * edit, gboolean force)
.direction = TO_LINE_BEGIN
};
mc_event_raise (MCEVENT_GROUP_EDITOR, "move_cursor", &cursor_event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "move_cursor", &cursor_event_data, NULL, NULL);
cursor_event_data.direction = TO_DOWN;
do
{
mc_event_raise (MCEVENT_GROUP_EDITOR, "move_cursor", &cursor_event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_EDITOR, "move_cursor", &cursor_event_data, NULL, NULL);
}
while (edit->buffer.curs_line < edit->buffer.lines
&& edit_line_is_blank (edit, edit->buffer.curs_line));

View File

@ -518,7 +518,7 @@ toggle_panels (void)
event_return_t ret;
ret.b = FALSE;
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "quiet_quit", NULL, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER, "quiet_quit", NULL, &ret, NULL);
if (ret.b)
return;

View File

@ -64,7 +64,7 @@
#include "lib/util.h"
#include "lib/widget.h"
#include "lib/keybind.h" /* CK_Down, CK_History */
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
#include "src/viewer/mcviewer.h"
#include "src/setup.h"
@ -193,7 +193,7 @@ set_panel_filter_to (WPanel * p, char *allocated_filter_string)
p->filter = allocated_filter_string;
else
g_free (allocated_filter_string);
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "reread", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER, "reread", NULL, NULL, NULL);
}
/* --------------------------------------------------------------------------------------------- */
@ -1264,7 +1264,7 @@ mc_filemanager_cmd_hotlist (event_info_t * event_info, gpointer data, GError **
.tree = the_tree,
.dir = target
};
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "chdir", &chdir_info, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "chdir", &chdir_info, NULL, NULL);
}
else
{
@ -1369,7 +1369,7 @@ mc_filemanager_cmd_run_diffviewer (event_info_t * event_info, gpointer data, GEr
diffviewer_event_info.data.panel.first = current_panel;
diffviewer_event_info.data.panel.second = other_panel;
mc_event_raise (MCEVENT_GROUP_DIFFVIEWER, "run", &diffviewer_event_info, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_DIFFVIEWER, "run", &diffviewer_event_info, NULL, NULL);
if (mc_global.mc_run_mode == MC_RUN_FULL)
update_panels (UP_OPTIMIZE, UP_KEEPSEL);
@ -1565,7 +1565,7 @@ mc_filemanager_cmd_help (event_info_t * event_info, gpointer data, GError ** err
else
event_data.node = "[main]";
mc_event_raise (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
return TRUE;
}
@ -2038,7 +2038,8 @@ mc_filemanager_cmd_select_encoding (event_info_t * event_info, gpointer data, GE
(void) data;
if (SELECTED_IS_PANEL)
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "select_codepage", MENU_PANEL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "select_codepage", MENU_PANEL, NULL,
NULL);
return TRUE;
}

View File

@ -270,7 +270,7 @@ enter (WInput * lc_cmdline)
ret.b = FALSE;
input_assign_text (lc_cmdline, "");
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "quiet_quit", NULL, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER, "quiet_quit", NULL, &ret, NULL);
if (!ret.b)
return MSG_NOT_HANDLED;
}
@ -319,7 +319,7 @@ enter (WInput * lc_cmdline)
event_return_t ret;
ret.b = FALSE;
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "quiet_quit", NULL, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER, "quiet_quit", NULL, &ret, NULL);
if (ret.b)
return MSG_HANDLED;
@ -436,7 +436,7 @@ do_cd_command (char *orig_cmd)
chdir_info.dir = g_strdup (vfs_path_as_str (new_vpath));
vfs_path_free (new_vpath);
}
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "chdir", &chdir_info, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "chdir", &chdir_info, NULL, NULL);
g_free (chdir_info.dir);
}
else

View File

@ -708,7 +708,7 @@ find_parameters (char **start_dir, ssize_t * start_dir_len,
if (in_start_dir != INPUT_LAST_TEXT)
g_free (in_start_dir);
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "show_box", NULL, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "show_box", NULL, &ret, NULL);
if (ret.s == NULL)
{

View File

@ -425,7 +425,7 @@ hotlist_button_callback (WButton * button, int action)
return 0;
case B_ADD_CURRENT:
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "hotlist_add", NULL, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER, "hotlist_add", NULL, NULL, NULL);
return 0;
case B_NEW_ENTRY:

View File

@ -1085,8 +1085,8 @@ set_display_type (int num, panel_view_mode_t type)
{
ev_history_load_save_t event_data = { NULL, new_widget };
mc_event_raise (midnight_dlg->event_group, MCEVENT_HISTORY_LOAD, &event_data, NULL,
NULL);
mc_event_dispatch (midnight_dlg->event_group, MCEVENT_HISTORY_LOAD, &event_data, NULL,
NULL);
}
if (num == 0)

View File

@ -792,7 +792,7 @@ mc_maybe_editor_or_viewer (void)
event_info.data.file.first = mc_run_param0;
event_info.data.file.second = mc_run_param1;
mc_event_raise (MCEVENT_GROUP_DIFFVIEWER, "run", &event_info, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_DIFFVIEWER, "run", &event_info, NULL, NULL);
ret = event_info.ret_value;
}
break;
@ -861,7 +861,7 @@ midnight_execute_cmd (Widget * sender, unsigned long command)
ret.b = TRUE;
/* stop quick search before executing any command */
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", current_panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", current_panel, NULL, NULL);
switch (command)
{
@ -1155,7 +1155,7 @@ midnight_execute_cmd (Widget * sender, unsigned long command)
res = MSG_NOT_HANDLED;
}
if (mc_event_raise (event_group_name, event_name, event_data, &ret, NULL))
if (mc_event_dispatch (event_group_name, event_name, event_data, &ret, NULL))
{
return (ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}
@ -1223,7 +1223,7 @@ midnight_handle_raw_keys (int parm)
/* Ctrl-Shift-Enter */
if (parm == (KEY_M_CTRL | KEY_M_SHIFT | '\n'))
{
mc_event_raise (MCEVENT_GROUP_CORE, "put_path_to_cmdline", current_panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "put_path_to_cmdline", current_panel, NULL, NULL);
put_prog_name ();
return MSG_HANDLED;
}
@ -1734,7 +1734,7 @@ mc_filemanager_cmd_menu (event_info_t * event_info, gpointer data, GError ** err
else
the_menubar->selected = g_list_length (the_menubar->menu) - 1;
mc_event_raise (event_info->group_name, "menu_last_selected", NULL, event_info->ret, error);
mc_event_dispatch (event_info->group_name, "menu_last_selected", NULL, event_info->ret, error);
return TRUE;
}
@ -1830,7 +1830,7 @@ mc_filemanager_cmd_treebox (event_info_t * event_info, gpointer data, GError **
(void) event_info;
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "show_box", data, &ret, error);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "show_box", data, &ret, error);
if (ret.s != NULL)
{

View File

@ -2042,9 +2042,9 @@ do_mark_file (WPanel * panel, mark_act_t do_move)
{
do_file_mark (panel, panel->selected, selection (panel)->f.marked ? 0 : 1);
if ((panels_options.mark_moves_down && do_move == MARK_DOWN) || do_move == MARK_FORCE_DOWN)
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
else if (do_move == MARK_FORCE_UP)
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_up", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_up", panel, NULL, NULL);
}
/* --------------------------------------------------------------------------------------------- */
@ -2442,7 +2442,7 @@ panel_execute_cmd (WPanel * panel, unsigned long command)
const char *event_name = NULL;
if (command != CK_Search)
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", panel, NULL, NULL);
ret.b = TRUE;
@ -2611,7 +2611,7 @@ panel_execute_cmd (WPanel * panel, unsigned long command)
break;
}
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, event_name, panel, &ret, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, event_name, panel, &ret, NULL);
return (ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}
@ -2625,7 +2625,7 @@ panel_key (WPanel * panel, int key)
if (is_abort_char (key))
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", panel, NULL, NULL);
return MSG_HANDLED;
}
@ -2641,13 +2641,14 @@ panel_key (WPanel * panel, int key)
if (panels_options.torben_fj_mode && key == ALT ('h'))
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_middle_screen", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_middle_screen", panel, NULL,
NULL);
return MSG_HANDLED;
}
if (!command_prompt && ((key >= ' ' && key <= 255) || key == KEY_BACKSPACE))
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "search", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "search", panel, NULL, NULL);
do_search (panel, key);
return MSG_HANDLED;
}
@ -2711,7 +2712,7 @@ panel_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
case MSG_UNFOCUS:
/* Janne: look at this for the multiple panel options */
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "search_stop", panel, NULL, NULL);
panel->active = 0;
show_dir (panel);
unselect_item (panel);
@ -2864,24 +2865,24 @@ panel_event (Gpm_Event * event, void *data)
/* "<" button */
if (mouse_down && local.x == 2)
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "directory_history_prev", panel, NULL,
NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "directory_history_prev", panel,
NULL, NULL);
goto finish;
}
/* ">" button */
if (mouse_down && local.x == w->cols - 1)
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "directory_history_next", panel, NULL,
NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "directory_history_next", panel,
NULL, NULL);
goto finish;
}
/* "^" button */
if (mouse_down && local.x >= w->cols - 4 && local.x <= w->cols - 2)
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "directory_history_list", panel, NULL,
NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "directory_history_list", panel,
NULL, NULL);
goto finish;
}
@ -2909,9 +2910,10 @@ panel_event (Gpm_Event * event, void *data)
if (is_active)
{
if (panels_options.mouse_move_pages && (panel->top_file > 0))
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_page_up", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_page_up", panel, NULL,
NULL);
else /* We are in first page */
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_up", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_up", panel, NULL, NULL);
}
goto finish;
}
@ -2922,10 +2924,10 @@ panel_event (Gpm_Event * event, void *data)
{
if (panels_options.mouse_move_pages
&& (panel->top_file + ITEMS (panel) < panel->dir.len))
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_page_down", panel, NULL,
NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_page_down", panel, NULL,
NULL);
else /* We are in last page */
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
}
goto finish;
}
@ -2962,7 +2964,7 @@ panel_event (Gpm_Event * event, void *data)
}
else if ((local.type & (GPM_UP | GPM_DOUBLE)) == (GPM_UP | GPM_DOUBLE) &&
local.y > 0 && local.y <= lines)
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "enter", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "enter", panel, NULL, NULL);
finish:
if (panel->dirty)
@ -3998,7 +4000,7 @@ mc_panel_cmd_chdir_other (event_info_t * event_info, gpointer data, GError ** er
try_to_select (current_panel, sel_entry);
change_panel ();
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
return TRUE;
}
@ -4062,7 +4064,7 @@ mc_panel_cmd_chdir_other_if_link (event_info_t * event_info, gpointer data, GErr
vfs_path_free (new_dir_vpath);
change_panel ();
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
return TRUE;
}
@ -4252,8 +4254,8 @@ mc_panel_cmd_save_current_file_to_clip_file (event_info_t * event_info, gpointer
(void) error;
if (current_panel->marked == 0)
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_text_to_file",
(gpointer) selection (current_panel)->fname, NULL, error);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_text_to_file",
(gpointer) selection (current_panel)->fname, NULL, error);
else
{
int i;
@ -4280,8 +4282,8 @@ mc_panel_cmd_save_current_file_to_clip_file (event_info_t * event_info, gpointer
}
}
mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_text_to_file", (gpointer) flist, NULL,
error);
mc_event_dispatch (MCEVENT_GROUP_CORE, "clipboard_text_to_file", (gpointer) flist, NULL,
error);
g_free (flist);
}
return TRUE;
@ -4616,7 +4618,7 @@ mc_panel_cmd_mark_right (event_info_t * event_info, gpointer data, GError ** err
for (; lines != 0; lines--)
{
do_file_mark (panel, panel->selected, state_mark);
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
}
do_file_mark (panel, panel->selected, state_mark);
@ -4643,7 +4645,7 @@ mc_panel_cmd_mark_left (event_info_t * event_info, gpointer data, GError ** erro
for (; lines != 0; lines--)
{
do_file_mark (panel, panel->selected, state_mark);
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_up", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_up", panel, NULL, NULL);
}
do_file_mark (panel, panel->selected, state_mark);
@ -4789,13 +4791,14 @@ mc_panel_cmd_goto_home (event_info_t * event_info, gpointer data, GError ** erro
if (panel->selected > middle_pos)
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_middle_screen", panel, NULL,
NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_middle_screen", panel, NULL,
NULL);
return TRUE;
}
if (panel->selected != panel->top_file)
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_top_screen", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_top_screen", panel, NULL,
NULL);
return TRUE;
}
}
@ -4831,14 +4834,14 @@ mc_panel_cmd_goto_end (event_info_t * event_info, gpointer data, GError ** error
if (panel->selected < middle_pos)
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_middle_screen", panel, NULL,
NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_middle_screen", panel, NULL,
NULL);
return TRUE;
}
if (panel->selected != (panel->top_file + ITEMS (panel) - 1))
{
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_bottom_screen", panel, NULL,
NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_bottom_screen", panel, NULL,
NULL);
return TRUE;
}
}
@ -4993,7 +4996,7 @@ mc_panel_cmd_search (event_info_t * event_info, gpointer data, GError ** error)
if (panel->selected + 1 == panel->dir.len)
panel->selected = 0;
else
mc_event_raise (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_FILEMANAGER_PANEL, "goto_down", panel, NULL, NULL);
/* in case if there was no search string we need to recall
previous string, with which we ended previous searching */

View File

@ -54,7 +54,7 @@
#include "lib/strutil.h"
#include "lib/util.h"
#include "lib/widget.h"
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
#include "src/setup.h" /* confirm_delete, panels_options */
#include "src/keybind-defaults.h"
@ -219,7 +219,7 @@ load_tree (WTree * tree)
tree->selected_ptr = tree->store->tree_first;
chdir_info.dir = (char *) mc_config_get_home_dir ();
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "chdir", &chdir_info, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "chdir", &chdir_info, NULL, NULL);
}
/* --------------------------------------------------------------------------------------------- */
@ -519,7 +519,7 @@ tree_move_to_child (WTree * tree, GError ** error)
else
{
/* No -> rescan and try again */
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "rescan", tree, NULL, error);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "rescan", tree, NULL, error);
current = tree->selected_ptr->next;
if (current && current->sublevel > tree->selected_ptr->sublevel)
{
@ -579,7 +579,7 @@ static void
maybe_chdir (WTree * tree, GError ** error)
{
if (xtree_mode && tree->is_panel && is_idle ())
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "enter", tree, NULL, error);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "enter", tree, NULL, error);
}
/* --------------------------------------------------------------------------------------------- */
@ -629,7 +629,7 @@ tree_event (Gpm_Event * event, void *data)
tree->selected_ptr = tree->tree_shown[local.y];
tree->topdiff = local.y;
}
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "enter", tree, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "enter", tree, NULL, NULL);
}
return MOU_NORMAL;
@ -783,7 +783,7 @@ tree_execute_cmd (WTree * tree, unsigned long command)
if (command != CK_Quit /* ignore left-right ? */ )
show_tree (tree);
if (mc_event_raise (MCEVENT_GROUP_TREEVIEW, event_name, tree, &ret, NULL))
if (mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, event_name, tree, &ret, NULL))
{
return (ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}
@ -826,7 +826,7 @@ tree_key (WTree * tree, int key)
/* Do not eat characters not meant for the tree below ' ' (e.g. C-l). */
if (!command_prompt && ((key >= ' ' && key <= 255) || key == KEY_BACKSPACE))
{
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "search_begin", tree, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "search_begin", tree, NULL, NULL);
tree_do_search (tree, key);
return MSG_HANDLED;
}
@ -1022,7 +1022,7 @@ mc_tree_cmd_help (event_info_t * event_info, gpointer data, GError ** error)
(void) error;
(void) data;
mc_event_raise (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "help", &event_data, NULL, NULL);
return TRUE;
}
@ -1457,7 +1457,7 @@ mc_tree_cmd_rmdir (event_info_t * event_info, gpointer data, GError ** error)
file_op_context_create_ui (ctx, FALSE, FILEGUI_DIALOG_ONE_ITEM);
if (erase_dir (tctx, ctx, tree->selected_ptr->name) == FILE_CONT)
mc_event_raise (MCEVENT_GROUP_TREEVIEW, "forget", tree, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_TREEVIEW, "forget", tree, NULL, NULL);
file_op_total_context_destroy (tctx);
file_op_context_destroy (ctx);

View File

@ -725,7 +725,7 @@ help_execute_cmd (unsigned long command)
res = MSG_NOT_HANDLED;
}
if (mc_event_raise (event_group_name, event_name, event_data, &ret, NULL))
if (mc_event_dispatch (event_group_name, event_name, event_data, &ret, NULL))
{
return (ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}

View File

@ -57,7 +57,7 @@
#ifdef HAVE_CHARSET
#include "lib/charsets.h"
#endif
#include "lib/event.h" /* mc_event_raise() */
#include "lib/event.h" /* mc_event_dispatch() */
#include "src/filemanager/layout.h"
#include "src/filemanager/cmd.h"
@ -397,7 +397,7 @@ mcview_execute_cmd (mcview_t * view, unsigned long command)
case CK_Help:
{
ev_help_t help_event_data = { NULL, "[Internal File Viewer]" };
mc_event_raise (MCEVENT_GROUP_CORE, "help", &help_event_data, NULL, NULL);
mc_event_dispatch (MCEVENT_GROUP_CORE, "help", &help_event_data, NULL, NULL);
}
break;
case CK_WrapMode:
@ -546,7 +546,7 @@ mcview_execute_cmd (mcview_t * view, unsigned long command)
res = MSG_NOT_HANDLED;
}
if (mc_event_raise (event_group_name, event_name, event_data, &ret, NULL))
if (mc_event_dispatch (event_group_name, event_name, event_data, &ret, NULL))
{
return (ret.b) ? MSG_HANDLED : MSG_NOT_HANDLED;
}