diff options
-rw-r--r-- | src/core/wee-command.c | 105 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-keyboard.c | 55 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 60 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-window.c | 60 | ||||
-rw-r--r-- | src/gui/gui-action.c | 243 | ||||
-rw-r--r-- | src/gui/gui-keyboard.c | 30 | ||||
-rw-r--r-- | src/gui/gui-window.c | 72 | ||||
-rw-r--r-- | src/gui/gui-window.h | 10 |
8 files changed, 265 insertions, 370 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index a90fe99eb..bbbb977eb 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -2204,6 +2204,111 @@ command_window (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } + /* page up in current window */ + if (string_strcasecmp (argv[1], "page_up") == 0) + { + gui_window_page_up (gui_current_window); + return WEECHAT_RC_OK; + } + + /* page down in current window */ + if (string_strcasecmp (argv[1], "page_down") == 0) + { + gui_window_page_down (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll up current window */ + if (string_strcasecmp (argv[1], "scroll_up") == 0) + { + gui_window_scroll_up (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll down current window */ + if (string_strcasecmp (argv[1], "scroll_down") == 0) + { + gui_window_scroll_down (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll to top of current window */ + if (string_strcasecmp (argv[1], "scroll_top") == 0) + { + gui_window_scroll_top (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll to bottom of current window */ + if (string_strcasecmp (argv[1], "scroll_bottom") == 0) + { + gui_window_scroll_bottom (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll to previous highlight of current window */ + if (string_strcasecmp (argv[1], "scroll_previous_highlight") == 0) + { + gui_window_scroll_previous_highlight (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll to next highlight of current window */ + if (string_strcasecmp (argv[1], "scroll_next_highlight") == 0) + { + gui_window_scroll_next_highlight (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll topic left for current window */ + if (string_strcasecmp (argv[1], "scroll_topic_left") == 0) + { + gui_window_scroll_topic_left (gui_current_window); + return WEECHAT_RC_OK; + } + + /* scroll topic right for current window */ + if (string_strcasecmp (argv[1], "scroll_topic_right") == 0) + { + gui_window_scroll_topic_right (gui_current_window); + return WEECHAT_RC_OK; + } + + /* page up for nicklist in current window */ + if (string_strcasecmp (argv[1], "nicklist_page_up") == 0) + { + gui_window_nicklist_page_up (gui_current_window); + return WEECHAT_RC_OK; + } + + /* page down for nicklist in current window */ + if (string_strcasecmp (argv[1], "nicklist_page_down") == 0) + { + gui_window_nicklist_page_down (gui_current_window); + return WEECHAT_RC_OK; + } + + /* beginning of nicklist for current window */ + if (string_strcasecmp (argv[1], "nicklist_beginning") == 0) + { + gui_window_nicklist_beginning (gui_current_window); + return WEECHAT_RC_OK; + } + + /* end of nicklist for current window */ + if (string_strcasecmp (argv[1], "nicklist_end") == 0) + { + gui_window_nicklist_end (gui_current_window); + return WEECHAT_RC_OK; + } + + /* refresh screen */ + if (string_strcasecmp (argv[1], "refresh") == 0) + { + gui_window_refresh_screen (1); + return WEECHAT_RC_OK; + } + /* split window horizontally */ if (string_strcasecmp (argv[1], "splith") == 0) { diff --git a/src/gui/curses/gui-curses-keyboard.c b/src/gui/curses/gui-curses-keyboard.c index 73e8ca608..9bbec222e 100644 --- a/src/gui/curses/gui-curses-keyboard.c +++ b/src/gui/curses/gui-curses-keyboard.c @@ -81,21 +81,6 @@ gui_keyboard_default_bindings () gui_keyboard_bind (NULL, /* ^up */ "meta-Oa", "up_global"); gui_keyboard_bind (NULL, /* down */ "meta2-B", "down"); gui_keyboard_bind (NULL, /* ^down */ "meta-Ob", "down_global"); - gui_keyboard_bind (NULL, /* pgup */ "meta2-5~", "page_up"); - gui_keyboard_bind (NULL, /* pgup */ "meta2-I", "page_up"); - gui_keyboard_bind (NULL, /* pgdn */ "meta2-6~", "page_down"); - gui_keyboard_bind (NULL, /* pgdn */ "meta2-G", "page_down"); - gui_keyboard_bind (NULL, /* m-pgup */ "meta-meta2-5~", "scroll_up"); - gui_keyboard_bind (NULL, /* m-pgdn */ "meta-meta2-6~", "scroll_down"); - gui_keyboard_bind (NULL, /* m-home */ "meta-meta2-1~", "scroll_top"); - gui_keyboard_bind (NULL, /* m-end */ "meta-meta2-4~", "scroll_bottom"); - gui_keyboard_bind (NULL, /* F9 */ "meta2-20~", "scroll_topic_left"); - gui_keyboard_bind (NULL, /* F10 */ "meta2-21~", "scroll_topic_right"); - gui_keyboard_bind (NULL, /* F11 */ "meta2-23~", "nick_page_up"); - gui_keyboard_bind (NULL, /* F12 */ "meta2-24~", "nick_page_down"); - gui_keyboard_bind (NULL, /* m-F11 */ "meta-meta2-23~", "nick_beginning"); - gui_keyboard_bind (NULL, /* m-F12 */ "meta-meta2-24~", "nick_end"); - gui_keyboard_bind (NULL, /* ^L */ "ctrl-L", "refresh"); gui_keyboard_bind (NULL, /* m-a */ "meta-a", "jump_smart"); gui_keyboard_bind (NULL, /* m-b */ "meta-b", "previous_word"); gui_keyboard_bind (NULL, /* ^left */ "meta-Od", "previous_word"); @@ -110,8 +95,6 @@ gui_keyboard_default_bindings () gui_keyboard_bind (NULL, /* m-j,m-s */ "meta-jmeta-s", "jump_server"); gui_keyboard_bind (NULL, /* m-j,m-x */ "meta-jmeta-x", "jump_next_server"); gui_keyboard_bind (NULL, /* m-k */ "meta-k", "grab_key"); - gui_keyboard_bind (NULL, /* m-n */ "meta-n", "scroll_next_highlight"); - gui_keyboard_bind (NULL, /* m-p */ "meta-p", "scroll_previous_highlight"); gui_keyboard_bind (NULL, /* m-r */ "meta-r", "delete_line"); gui_keyboard_bind (NULL, /* m-s */ "meta-s", "switch_server"); gui_keyboard_bind (NULL, /* m-u */ "meta-u", "scroll_unread"); @@ -130,6 +113,23 @@ gui_keyboard_default_bindings () gui_keyboard_bind (NULL, /* m-right */ "meta-meta2-C", "/buffer +1"); gui_keyboard_bind (NULL, /* m-right (kde) */ "meta2-1;3C", "/buffer +1"); gui_keyboard_bind (NULL, /* F6 */ "meta2-17~", "/buffer +1"); + gui_keyboard_bind (NULL, /* pgup */ "meta2-5~", "/window page_up"); + gui_keyboard_bind (NULL, /* pgup */ "meta2-I", "/winfow page_up"); + gui_keyboard_bind (NULL, /* pgdn */ "meta2-6~", "/window page_down"); + gui_keyboard_bind (NULL, /* pgdn */ "meta2-G", "/window page_down"); + gui_keyboard_bind (NULL, /* m-pgup */ "meta-meta2-5~", "/window scroll_up"); + gui_keyboard_bind (NULL, /* m-pgdn */ "meta-meta2-6~", "/window scroll_down"); + gui_keyboard_bind (NULL, /* m-home */ "meta-meta2-1~", "/window scroll_top"); + gui_keyboard_bind (NULL, /* m-end */ "meta-meta2-4~", "/window scroll_bottom"); + gui_keyboard_bind (NULL, /* m-n */ "meta-n", "/window scroll_next_highlight"); + gui_keyboard_bind (NULL, /* m-p */ "meta-p", "/window scroll_previous_highlight"); + gui_keyboard_bind (NULL, /* F9 */ "meta2-20~", "/window scroll_topic_left"); + gui_keyboard_bind (NULL, /* F10 */ "meta2-21~", "/window scroll_topic_right"); + gui_keyboard_bind (NULL, /* F11 */ "meta2-23~", "/window nicklist_page_up"); + gui_keyboard_bind (NULL, /* F12 */ "meta2-24~", "/window nicklist_page_down"); + gui_keyboard_bind (NULL, /* m-F11 */ "meta-meta2-23~", "/window nicklist_beginning"); + gui_keyboard_bind (NULL, /* m-F12 */ "meta-meta2-24~", "/window nicklist_end"); + gui_keyboard_bind (NULL, /* ^L */ "ctrl-L", "/window refresh"); gui_keyboard_bind (NULL, /* F7 */ "meta2-18~", "/window -1"); gui_keyboard_bind (NULL, /* F8 */ "meta2-19~", "/window +1"); gui_keyboard_bind (NULL, /* m-w,m-up */ "meta-wmeta-meta2-A", "/window up"); @@ -295,22 +295,11 @@ gui_keyboard_flush () if (strcmp (key_str, "^^") == 0) key_str[1] = '\0'; - /*switch (gui_current_window->buffer->type) - { - case GUI_BUFFER_TYPE_STANDARD:*/ - gui_input_insert_string (gui_current_window->buffer, - key_str, -1); - if (gui_current_window->buffer->completion) - gui_current_window->buffer->completion->position = -1; - input_draw = 1; - //break; - /*case GUI_BUFFER_TYPE_DCC: - gui_exec_action_dcc (gui_current_window, key_str); - break; - case GUI_BUFFER_TYPE_RAW_DATA: - gui_exec_action_raw_data (gui_current_window, key_str); - break; - }*/ + gui_input_insert_string (gui_current_window->buffer, + key_str, -1); + if (gui_current_window->buffer->completion) + gui_current_window->buffer->completion->position = -1; + input_draw = 1; } /* incremental text search in buffer */ diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index bfd018190..8f6bfed97 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -969,11 +969,11 @@ gui_window_scroll_topic_right (struct t_gui_window *window) } /* - * gui_window_nick_beginning: go to beginning of nicklist + * gui_window_nicklist_page_up: scroll one page up in nicklist */ void -gui_window_nick_beginning (struct t_gui_window *window) +gui_window_nicklist_page_up (struct t_gui_window *window) { if (!gui_ok) return; @@ -982,47 +982,45 @@ gui_window_nick_beginning (struct t_gui_window *window) { if (window->win_nick_start > 0) { - window->win_nick_start = 0; + window->win_nick_start -= (window->win_nick_num_max - 1); + if (window->win_nick_start <= 1) + window->win_nick_start = 0; gui_buffer_ask_nicklist_refresh (window->buffer, 1); } } } /* - * gui_window_nick_end: go to the end of nicklist + * gui_window_nicklist_page_down: scroll one page down in nicklist */ void -gui_window_nick_end (struct t_gui_window *window) +gui_window_nicklist_page_down (struct t_gui_window *window) { - int new_start; - if (!gui_ok) return; if (window->buffer->nicklist) { - new_start = - window->buffer->nicklist_visible_count - window->win_nick_num_max; - if (new_start < 0) - new_start = 0; - else if (new_start >= 1) - new_start++; - - if (new_start != window->win_nick_start) + if ((window->buffer->nicklist_visible_count > window->win_nick_num_max) + && (window->win_nick_start + window->win_nick_num_max - 1 + < window->buffer->nicklist_visible_count)) { - window->win_nick_start = new_start; + if (window->win_nick_start == 0) + window->win_nick_start += (window->win_nick_num_max - 1); + else + window->win_nick_start += (window->win_nick_num_max - 2); gui_buffer_ask_nicklist_refresh (window->buffer, 1); } } } /* - * gui_window_nick_page_up: scroll one page up in nicklist + * gui_window_nicklist_beginning: go to beginning of nicklist */ void -gui_window_nick_page_up (struct t_gui_window *window) +gui_window_nicklist_beginning (struct t_gui_window *window) { if (!gui_ok) return; @@ -1031,34 +1029,36 @@ gui_window_nick_page_up (struct t_gui_window *window) { if (window->win_nick_start > 0) { - window->win_nick_start -= (window->win_nick_num_max - 1); - if (window->win_nick_start <= 1) - window->win_nick_start = 0; + window->win_nick_start = 0; gui_buffer_ask_nicklist_refresh (window->buffer, 1); } } } /* - * gui_window_nick_page_down: scroll one page down in nicklist + * gui_window_nicklist_end: go to the end of nicklist */ void -gui_window_nick_page_down (struct t_gui_window *window) +gui_window_nicklist_end (struct t_gui_window *window) { + int new_start; + if (!gui_ok) return; if (window->buffer->nicklist) { - if ((window->buffer->nicklist_visible_count > window->win_nick_num_max) - && (window->win_nick_start + window->win_nick_num_max - 1 - < window->buffer->nicklist_visible_count)) + new_start = + window->buffer->nicklist_visible_count - window->win_nick_num_max; + if (new_start < 0) + new_start = 0; + else if (new_start >= 1) + new_start++; + + if (new_start != window->win_nick_start) { - if (window->win_nick_start == 0) - window->win_nick_start += (window->win_nick_num_max - 1); - else - window->win_nick_start += (window->win_nick_num_max - 2); + window->win_nick_start = new_start; gui_buffer_ask_nicklist_refresh (window->buffer, 1); } } diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c index 5db023317..cecfa8ce7 100644 --- a/src/gui/gtk/gui-gtk-window.c +++ b/src/gui/gtk/gui-gtk-window.c @@ -441,11 +441,11 @@ gui_window_scroll_topic_right (struct t_gui_window *window) } /* - * gui_window_nick_beginning: go to beginning of nicklist + * gui_window_nicklist_page_up: scroll one page up in nicklist */ void -gui_window_nick_beginning (struct t_gui_window *window) +gui_window_nicklist_page_up (struct t_gui_window *window) { if (!gui_ok) return; @@ -454,47 +454,45 @@ gui_window_nick_beginning (struct t_gui_window *window) { if (window->win_nick_start > 0) { - window->win_nick_start = 0; + window->win_nick_start -= (window->win_nick_height - 1); + if (window->win_nick_start <= 1) + window->win_nick_start = 0; gui_nicklist_draw (window->buffer, 1); } } } /* - * gui_window_nick_end: go to the end of nicklist + * gui_window_nicklist_page_down: scroll one page down in nicklist */ void -gui_window_nick_end (struct t_gui_window *window) +gui_window_nicklist_page_down (struct t_gui_window *window) { - int new_start; - if (!gui_ok) return; if (window->buffer->nicklist) { - new_start = - window->buffer->nicklist_visible_count - window->win_nick_height; - if (new_start < 0) - new_start = 0; - else if (new_start >= 1) - new_start++; - - if (new_start != window->win_nick_start) + if ((window->buffer->nicklist_visible_count > window->win_nick_height) + && (window->win_nick_start + window->win_nick_height - 1 + < window->buffer->nicklist_visible_count)) { - window->win_nick_start = new_start; + if (window->win_nick_start == 0) + window->win_nick_start += (window->win_nick_height - 1); + else + window->win_nick_start += (window->win_nick_height - 2); gui_nicklist_draw (window->buffer, 1); } } } /* - * gui_window_nick_page_up: scroll one page up in nicklist + * gui_window_nicklist_beginning: go to beginning of nicklist */ void -gui_window_nick_page_up (struct t_gui_window *window) +gui_window_nicklist_beginning (struct t_gui_window *window) { if (!gui_ok) return; @@ -503,34 +501,36 @@ gui_window_nick_page_up (struct t_gui_window *window) { if (window->win_nick_start > 0) { - window->win_nick_start -= (window->win_nick_height - 1); - if (window->win_nick_start <= 1) - window->win_nick_start = 0; + window->win_nick_start = 0; gui_nicklist_draw (window->buffer, 1); } } } /* - * gui_window_nick_page_down: scroll one page down in nicklist + * gui_window_nicklist_end: go to the end of nicklist */ void -gui_window_nick_page_down (struct t_gui_window *window) +gui_window_nicklist_end (struct t_gui_window *window) { + int new_start; + if (!gui_ok) return; if (window->buffer->nicklist) { - if ((window->buffer->nicklist_visible_count > window->win_nick_height) - && (window->win_nick_start + window->win_nick_height - 1 - < window->buffer->nicklist_visible_count)) + new_start = + window->buffer->nicklist_visible_count - window->win_nick_height; + if (new_start < 0) + new_start = 0; + else if (new_start >= 1) + new_start++; + + if (new_start != window->win_nick_start) { - if (window->win_nick_start == 0) - window->win_nick_start += (window->win_nick_height - 1); - else - window->win_nick_start += (window->win_nick_height - 2); + window->win_nick_start = new_start; gui_nicklist_draw (window->buffer, 1); } } diff --git a/src/gui/gui-action.c b/src/gui/gui-action.c index 36bf593a3..b4eb9ff89 100644 --- a/src/gui/gui-action.c +++ b/src/gui/gui-action.c @@ -932,162 +932,6 @@ gui_action_down_global (char *args) } /* - * gui_action_page_up: display previous page on buffer - */ - -void -gui_action_page_up (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_page_up (gui_current_window); -} - -/* - * gui_action_page_down: display next page on buffer - */ - -void -gui_action_page_down (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_page_down (gui_current_window); -} - -/* - * gui_action_scroll_up: display previous few lines in buffer - */ - -void -gui_action_scroll_up (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_scroll_up (gui_current_window); -} - -/* - * gui_action_scroll_down: display next few lines in buffer - */ - -void -gui_action_scroll_down (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_scroll_down (gui_current_window); -} - -/* - * gui_action_scroll_top: scroll to top of buffer - */ - -void -gui_action_scroll_top (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_scroll_top (gui_current_window); -} - -/* - * gui_action_scroll_bottom: scroll to bottom of buffer - */ - -void -gui_action_scroll_bottom (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_scroll_bottom (gui_current_window); -} - -/* - * gui_action_scroll_topic_left: scroll left topic - */ - -void -gui_action_scroll_topic_left (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_scroll_topic_left (gui_current_window); -} - -/* - * gui_action_scroll_topic_right: scroll right topic - */ - -void -gui_action_scroll_topic_right (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_scroll_topic_right (gui_current_window); -} - -/* - * gui_action_nick_beginning: go to beginning of nicklist - */ - -void -gui_action_nick_beginning (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_nick_beginning (gui_current_window); -} - -/* - * gui_action_nick_end: go to the end of nicklist - */ - -void -gui_action_nick_end (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_nick_end (gui_current_window); -} - -/* - * gui_action_nick_page_up: scroll one page up in nicklist - */ - -void -gui_action_nick_page_up (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_nick_page_up (gui_current_window); -} - -/* - * gui_action_nick_page_down: scroll one page down in nicklist - */ - -void -gui_action_nick_page_down (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_nick_page_down (gui_current_window); -} - -/* * gui_action_jump_smart: jump to buffer with activity (alt-A by default) */ @@ -1274,80 +1118,6 @@ gui_action_switch_server (char *args) } /* - * gui_action_scroll_previous_highlight: scroll to previous highlight - */ - -void -gui_action_scroll_previous_highlight (char *args) -{ - //t_gui_line *ptr_line; - - /* make C compiler happy */ - (void) args; - - /*if ((gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) - && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) - { - if (gui_current_window->buffer->lines) - { - ptr_line = (window->start_line) ? - window->start_line->prev_line : gui_current_window->buffer->last_line; - while (ptr_line) - { - if (ptr_line->line_with_highlight) - { - window->start_line = ptr_line; - window->start_line_pos = 0; - window->first_line_displayed = - (window->start_line == gui_current_window->buffer->lines); - gui_buffer_ask_chat_refresh (gui_current_window->buffer, 1); - gui_buffer_ask_input_refresh (gui_current_window->buffer, 1); - return; - } - ptr_line = ptr_line->prev_line; - } - } - }*/ -} - -/* - * gui_action_scroll_next_highlight: scroll to next highlight - */ - -void -gui_action_scroll_next_highlight (char *args) -{ - //t_gui_line *ptr_line; - - /* make C compiler happy */ - (void) args; - - /*if ((gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) - && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) - { - if (gui_current_window->buffer->lines) - { - ptr_line = (window->start_line) ? - window->start_line->next_line : gui_current_window->buffer->lines->next_line; - while (ptr_line) - { - if (ptr_line->line_with_highlight) - { - window->start_line = ptr_line; - window->start_line_pos = 0; - window->first_line_displayed = - (window->start_line == gui_current_window->buffer->lines); - gui_buffer_ask_chat_refresh (gui_current_window->buffer, 1); - gui_buffer_ask_input_refresh (gui_current_window->buffer, 1); - return; - } - ptr_line = ptr_line->next_line; - } - } - }*/ -} - -/* * gui_action_scroll_unread: scroll to first unread line of buffer */ @@ -1433,19 +1203,6 @@ gui_action_infobar_clear (char *args) } /* - * gui_action_refresh: refresh screen - */ - -void -gui_action_refresh_screen (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_refresh_screen (1); -} - -/* * gui_action_grab_key: init "grab key mode" (next key will be inserted into input buffer) */ diff --git a/src/gui/gui-keyboard.c b/src/gui/gui-keyboard.c index c2ed6a1f3..a10a11416 100644 --- a/src/gui/gui-keyboard.c +++ b/src/gui/gui-keyboard.c @@ -102,30 +102,6 @@ struct t_gui_key_function gui_key_functions[] = N_("call next command in history") }, { "down_global", gui_action_down_global, N_("call next command in global history") }, - { "page_up", gui_action_page_up, - N_("scroll one page up") }, - { "page_down", gui_action_page_down, - N_("scroll one page down") }, - { "scroll_up", gui_action_scroll_up, - N_("scroll a few lines up") }, - { "scroll_down", gui_action_scroll_down, - N_("scroll a few lines down") }, - { "scroll_top", gui_action_scroll_top, - N_("scroll to top of buffer") }, - { "scroll_bottom", gui_action_scroll_bottom, - N_("scroll to bottom of buffer") }, - { "scroll_topic_left", gui_action_scroll_topic_left, - N_("scroll left topic") }, - { "scroll_topic_right", gui_action_scroll_topic_right, - N_("scroll right topic") }, - { "nick_beginning", gui_action_nick_beginning, - N_("display beginning of nicklist") }, - { "nick_end", gui_action_nick_end, - N_("display end of nicklist") }, - { "nick_page_up", gui_action_nick_page_up, - N_("scroll nicklist one page up") }, - { "nick_page_down", gui_action_nick_page_down, - N_("scroll nicklist one page down") }, { "jump_smart", gui_action_jump_smart, N_("jump to buffer with activity") }, { "jump_dcc", gui_action_jump_dcc, @@ -140,10 +116,6 @@ struct t_gui_key_function gui_key_functions[] = N_("jump to next server") }, { "switch_server", gui_action_switch_server, N_("switch active server on servers buffer") }, - { "scroll_previous_highlight", gui_action_scroll_previous_highlight, - N_("scroll to previous highlight in buffer") }, - { "scroll_next_highlight", gui_action_scroll_next_highlight, - N_("scroll to next highlight in buffer") }, { "scroll_unread", gui_action_scroll_unread, N_("scroll to first unread line in buffer") }, { "set_unread", gui_action_set_unread, @@ -152,8 +124,6 @@ struct t_gui_key_function gui_key_functions[] = N_("clear hotlist") }, { "infobar_clear", gui_action_infobar_clear, N_("clear infobar") }, - { "refresh", gui_action_refresh_screen, - N_("refresh screen") }, { "grab_key", gui_action_grab_key, N_("grab a key") }, { "insert", gui_action_insert_string, diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c index edc6c2f0a..78e8a461f 100644 --- a/src/gui/gui-window.c +++ b/src/gui/gui-window.c @@ -681,6 +681,78 @@ gui_window_scroll (struct t_gui_window *window, char *scroll) } /* + * gui_window_scroll_previous_highlight: scroll to previous highlight + */ + +void +gui_window_scroll_previous_highlight (struct t_gui_window *window) +{ + (void) window; + + /*t_gui_line *ptr_line; + + if ((gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) + && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) + { + if (gui_current_window->buffer->lines) + { + ptr_line = (window->start_line) ? + window->start_line->prev_line : gui_current_window->buffer->last_line; + while (ptr_line) + { + if (ptr_line->line_with_highlight) + { + window->start_line = ptr_line; + window->start_line_pos = 0; + window->first_line_displayed = + (window->start_line == gui_current_window->buffer->lines); + gui_buffer_ask_chat_refresh (gui_current_window->buffer, 1); + gui_buffer_ask_input_refresh (gui_current_window->buffer, 1); + return; + } + ptr_line = ptr_line->prev_line; + } + } + }*/ +} + +/* + * gui_window_scroll_next_highlight: scroll to next highlight + */ + +void +gui_window_scroll_next_highlight (struct t_gui_window *window) +{ + (void) window; + + /*t_gui_line *ptr_line; + + if ((gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) + && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) + { + if (gui_current_window->buffer->lines) + { + ptr_line = (window->start_line) ? + window->start_line->next_line : gui_current_window->buffer->lines->next_line; + while (ptr_line) + { + if (ptr_line->line_with_highlight) + { + window->start_line = ptr_line; + window->start_line_pos = 0; + window->first_line_displayed = + (window->start_line == gui_current_window->buffer->lines); + gui_buffer_ask_chat_refresh (gui_current_window->buffer, 1); + gui_buffer_ask_input_refresh (gui_current_window->buffer, 1); + return; + } + ptr_line = ptr_line->next_line; + } + } + }*/ +} + +/* * gui_window_search_text: search text in a buffer */ diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h index bf5352266..23dc4cebf 100644 --- a/src/gui/gui-window.h +++ b/src/gui/gui-window.h @@ -138,6 +138,8 @@ extern void gui_window_switch_next (struct t_gui_window *window); extern void gui_window_switch_by_buffer (struct t_gui_window *window, int buffer_number); extern void gui_window_scroll (struct t_gui_window *window, char *scroll); +extern void gui_window_scroll_previous_highlight (struct t_gui_window *window); +extern void gui_window_scroll_next_highlight (struct t_gui_window *window); extern void gui_window_search_start (struct t_gui_window *window); extern void gui_window_search_restart (struct t_gui_window *window); extern void gui_window_search_stop (struct t_gui_window *window); @@ -167,10 +169,10 @@ extern void gui_window_scroll_top (struct t_gui_window *window); extern void gui_window_scroll_bottom (struct t_gui_window *window); extern void gui_window_scroll_topic_left (struct t_gui_window *window); extern void gui_window_scroll_topic_right (struct t_gui_window *window); -extern void gui_window_nick_beginning (struct t_gui_window *window); -extern void gui_window_nick_end (struct t_gui_window *window); -extern void gui_window_nick_page_up (struct t_gui_window *window); -extern void gui_window_nick_page_down (struct t_gui_window *window); +extern void gui_window_nicklist_page_up (struct t_gui_window *window); +extern void gui_window_nicklist_page_down (struct t_gui_window *window); +extern void gui_window_nicklist_beginning (struct t_gui_window *window); +extern void gui_window_nicklist_end (struct t_gui_window *window); extern void gui_window_init_subwindows (struct t_gui_window *window); extern void gui_window_refresh_windows (); extern void gui_window_split_horiz (struct t_gui_window *window, |