1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

core: add "_chat_line_x" in focus hashtable (for buffers with free content)

This commit is contained in:
Sebastien Helleu
2011-08-15 12:59:32 +02:00
parent eee81cfe9c
commit d89115d4db
7 changed files with 16 additions and 4 deletions
+3
View File
@@ -88,6 +88,7 @@ gui_focus_get_info (int x, int y)
x, y,
&focus_info->chat,
&focus_info->chat_line,
&focus_info->chat_line_x,
&focus_info->chat_word,
&focus_info->chat_bol,
&focus_info->chat_eol);
@@ -176,6 +177,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key)
str_tags = string_build_with_split_string ((const char **)((focus_info->chat_line)->data)->tags_array, ",");
str_message = gui_color_decode (((focus_info->chat_line)->data)->message, NULL);
nick = gui_line_get_nick_tag (focus_info->chat_line);
FOCUS_INT("_chat_line_x", focus_info->chat_line_x);
FOCUS_INT("_chat_line_y", ((focus_info->chat_line)->data)->y);
FOCUS_TIME("_chat_line_date", ((focus_info->chat_line)->data)->date);
FOCUS_TIME("_chat_line_date_printed", ((focus_info->chat_line)->data)->date_printed);
@@ -195,6 +197,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key)
}
else
{
FOCUS_STR("_chat_line_x", "-1");
FOCUS_STR("_chat_line_y", "-1");
FOCUS_STR("_chat_line_date", "-1");
FOCUS_STR("_chat_line_date_printed", "-1");
+1
View File
@@ -28,6 +28,7 @@ struct t_gui_focus_info
struct t_gui_window *window; /* window found */
int chat; /* 1 for chat area, otherwise 0 */
struct t_gui_line *chat_line; /* line in chat area */
int chat_line_x; /* x in line */
char *chat_word; /* word at (x,y) */
char *chat_bol; /* beginnong of line until (x,y) */
char *chat_eol; /* (x,y) until end of line */
+5
View File
@@ -124,6 +124,7 @@ gui_window_search_by_xy (int x, int y)
* gui_window_get_context_at_xy: return following info:
* - chat (0/1)
* - line
* - x in line
* - word at (x,y)
* - beginning of line until (x,y)
* - (x,y) until end of line
@@ -134,6 +135,7 @@ gui_window_get_context_at_xy (struct t_gui_window *window,
int x, int y,
int *chat,
struct t_gui_line **line,
int *line_x,
char **word,
char **beginning,
char **end)
@@ -144,6 +146,7 @@ gui_window_get_context_at_xy (struct t_gui_window *window,
*chat = 0;
*line = NULL;
*line_x = -1;
*word = NULL;
*beginning = NULL;
*end = NULL;
@@ -167,6 +170,8 @@ gui_window_get_context_at_xy (struct t_gui_window *window,
if (window->scroll->start_col > 0)
win_x += window->scroll->start_col;
*line_x = win_x;
/* we are in chat area */
*chat = 1;
+1
View File
@@ -141,6 +141,7 @@ extern void gui_window_get_context_at_xy (struct t_gui_window *window,
int x, int y,
int *chat,
struct t_gui_line **line,
int *line_x,
char **word,
char **beginning,
char **end);