1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 08:43:13 +02:00

Remove infobar

This commit is contained in:
Sebastien Helleu
2008-06-21 11:49:11 +02:00
parent 2c04e97523
commit 9d05dcf175
45 changed files with 267 additions and 1505 deletions
+4 -6
View File
@@ -1127,8 +1127,6 @@ command_input (void *data, struct t_gui_buffer *buffer,
gui_input_jump_previous_buffer ();
else if (string_strcasecmp (argv[1], "hotlist_clear") == 0)
gui_input_hotlist_clear ();
else if (string_strcasecmp (argv[1], "infobar_clear") == 0)
gui_input_infobar_clear ();
else if (string_strcasecmp (argv[1], "grab_key") == 0)
gui_input_grab_key ();
else if (string_strcasecmp (argv[1], "scroll_unread") == 0)
@@ -2658,8 +2656,8 @@ command_init ()
"move_next_word | history_previous | history_next | "
"history_global_previous | history_global_next | "
"jump_smart | jump_last_buffer | jump_previous_buffer | "
"hotlist_clear | infobar_clear | grab_key | scroll_unread | "
"set_unread | set_unread_current_buffer | insert [args]",
"hotlist_clear | grab_key | scroll_unread | set_unread | "
"set_unread_current_buffer | insert [args]",
_("This command is used by key bindings or plugins."),
"return|complete_next|complete_previous|search_next|"
"delete_previous_char|delete_next_char|"
@@ -2671,8 +2669,8 @@ command_init ()
"move_next_word|history_previous|history_next|"
"history_global_previous|history_global_next|"
"jump_smart|jump_last_buffer|jump_previous_buffer|"
"hotlist_clear|infobar_clear|grab_key|scroll_unread|"
"set_unread|set_unread_current_buffer|insert",
"hotlist_clear|grab_key|scroll_unread|set_unread|"
"set_unread_current_buffer|insert",
&command_input, NULL);
hook_command (NULL, "key",
N_("bind/unbind keys"),
+1 -103
View File
@@ -47,7 +47,6 @@
#include "../gui/gui-color.h"
#include "../gui/gui-filter.h"
#include "../gui/gui-hotlist.h"
#include "../gui/gui-infobar.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-nicklist.h"
#include "../gui/gui-status.h"
@@ -79,10 +78,6 @@ struct t_config_option *config_look_hotlist_names_count;
struct t_config_option *config_look_hotlist_names_length;
struct t_config_option *config_look_hotlist_names_level;
struct t_config_option *config_look_hotlist_sort;
struct t_config_option *config_look_infobar;
struct t_config_option *config_look_infobar_delay_highlight;
struct t_config_option *config_look_infobar_seconds;
struct t_config_option *config_look_infobar_time_format;
struct t_config_option *config_look_input_format;
struct t_config_option *config_look_item_time_format;
struct t_config_option *config_look_nicklist;
@@ -139,11 +134,6 @@ struct t_config_option *config_color_status_data_private;
struct t_config_option *config_color_status_data_highlight;
struct t_config_option *config_color_status_data_other;
struct t_config_option *config_color_status_more;
struct t_config_option *config_color_infobar;
struct t_config_option *config_color_infobar_bg;
struct t_config_option *config_color_infobar_delimiters;
struct t_config_option *config_color_infobar_highlight;
struct t_config_option *config_color_infobar_bg;
struct t_config_option *config_color_input;
struct t_config_option *config_color_input_bg;
struct t_config_option *config_color_input_server;
@@ -379,50 +369,6 @@ config_change_nicks_colors (void *data, struct t_config_option *option)
*/
}
/*
* config_change_infobar_seconds: called when display of seconds in infobar changed
*/
void
config_change_infobar_seconds (void *data, struct t_config_option *option)
{
/* make C compiler happy */
(void) data;
(void) option;
int seconds;
if (gui_infobar_refresh_timer)
unhook (gui_infobar_refresh_timer);
seconds = (CONFIG_BOOLEAN(config_look_infobar_seconds)) ? 1 : 60;
gui_infobar_refresh_timer = hook_timer (NULL, seconds * 1000, seconds, 0,
gui_infobar_refresh_timer_cb, NULL);
(void) gui_infobar_refresh_timer_cb ("force");
}
/*
* config_change_item_time_format: called when time format for time item changed
*/
void
config_change_item_time_format (void *data, struct t_config_option *option)
{
/* make C compiler happy */
(void) data;
(void) option;
int seconds;
if (gui_infobar_refresh_timer)
unhook (gui_infobar_refresh_timer);
seconds = (CONFIG_BOOLEAN(config_look_infobar_seconds)) ? 1 : 60;
gui_infobar_refresh_timer = hook_timer (NULL, seconds * 1000, seconds, 0,
gui_infobar_refresh_timer_cb, NULL);
(void) gui_infobar_refresh_timer_cb ("force");
}
/*
* config_day_change_timer_cb: timer callback for displaying
* "Day changed to xxx" message
@@ -860,28 +806,6 @@ config_weechat_init ()
"group_time_asc|group_time_desc|group_number_asc|"
"group_number_desc|number_asc|number_desc",
0, 0, "group_time_asc", NULL, NULL, &config_change_hotlist, NULL, NULL, NULL);
config_look_infobar = config_file_new_option (
weechat_config_file, ptr_section,
"infobar", "boolean",
N_("enable info bar"),
NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
config_look_infobar_delay_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"infobar_delay_highlight", "integer",
N_("delay (in seconds) for highlight messages in "
"infobar (0 = disable highlight notifications in "
"infobar)"),
NULL, 0, INT_MAX, "7", NULL, NULL, NULL, NULL, NULL, NULL);
config_look_infobar_seconds = config_file_new_option (
weechat_config_file, ptr_section,
"infobar_seconds", "boolean",
N_("display seconds in infobar time"),
NULL, 0, 0, "on", NULL, NULL, &config_change_infobar_seconds, NULL, NULL, NULL);
config_look_infobar_time_format = config_file_new_option (
weechat_config_file, ptr_section,
"infobar_time_format", "string",
N_("time format for time in infobar"),
NULL, 0, 0, "%B, %A %d %Y", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_input_format = config_file_new_option (
weechat_config_file, ptr_section,
"input_format", "string",
@@ -892,7 +816,7 @@ config_weechat_init ()
weechat_config_file, ptr_section,
"item_time_format", "string",
N_("time format for \"time\" bar item"),
NULL, 0, 0, "%H:%M", NULL, NULL, &config_change_item_time_format, NULL, NULL, NULL);
NULL, 0, 0, "%H:%M", NULL, NULL, NULL, NULL, NULL, NULL);
config_look_nicklist = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist", "boolean",
@@ -1306,31 +1230,6 @@ config_weechat_init ()
N_("text color for buffer with new data (status bar)"),
NULL, GUI_COLOR_STATUS_MORE, 0, "yellow",
NULL, NULL, &config_change_color, NULL, NULL, NULL);
/* infobar window */
config_color_infobar = config_file_new_option (
weechat_config_file, ptr_section,
"infobar", "color",
N_("text color for infobar"),
NULL, GUI_COLOR_INFOBAR, 0, "black",
NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_color_infobar_bg = config_file_new_option (
weechat_config_file, ptr_section,
"infobar_bg", "color",
N_("background color for infobar"),
NULL, -1, 0, "cyan",
NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_color_infobar_delimiters = config_file_new_option (
weechat_config_file, ptr_section,
"infobar_delimiters", "color",
N_("text color for infobar delimiters"),
NULL, GUI_COLOR_INFOBAR_DELIMITERS, 0, "blue",
NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_color_infobar_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"infobar_highlight", "color",
N_("text color for infobar highlight notification"),
NULL, GUI_COLOR_INFOBAR_HIGHLIGHT, 0, "white",
NULL, NULL, &config_change_color, NULL, NULL, NULL);
/* input window */
config_color_input = config_file_new_option (
weechat_config_file, ptr_section,
@@ -1689,7 +1588,6 @@ config_weechat_read ()
rc = config_file_read (weechat_config_file);
if (rc == WEECHAT_CONFIG_READ_OK)
{
config_change_infobar_seconds (NULL, NULL);
config_change_day_change (NULL, NULL);
gui_bar_use_temp_bars ();
}
-9
View File
@@ -65,10 +65,6 @@ extern struct t_config_option *config_look_hotlist_names_count;
extern struct t_config_option *config_look_hotlist_names_length;
extern struct t_config_option *config_look_hotlist_names_level;
extern struct t_config_option *config_look_hotlist_sort;
extern struct t_config_option *config_look_infobar;
extern struct t_config_option *config_look_infobar_delay_highlight;
extern struct t_config_option *config_look_infobar_seconds;
extern struct t_config_option *config_look_infobar_time_format;
extern struct t_config_option *config_look_input_format;
extern struct t_config_option *config_look_item_time_format;
extern struct t_config_option *config_look_nicklist;
@@ -123,11 +119,6 @@ extern struct t_config_option *config_color_status_data_private;
extern struct t_config_option *config_color_status_data_highlight;
extern struct t_config_option *config_color_status_data_other;
extern struct t_config_option *config_color_status_more;
extern struct t_config_option *config_color_infobar;
extern struct t_config_option *config_color_infobar_bg;
extern struct t_config_option *config_color_infobar_delimiters;
extern struct t_config_option *config_color_infobar_highlight;
extern struct t_config_option *config_color_infobar_bg;
extern struct t_config_option *config_color_input;
extern struct t_config_option *config_color_input_bg;
extern struct t_config_option *config_color_input_server;
-1
View File
@@ -28,7 +28,6 @@ gui-filter.c gui-filter.h
gui-completion.c gui-completion.h
gui-history.c gui-history.h
gui-hotlist.c gui-hotlist.h
gui-infobar.c gui-infobar.h
gui-input.c gui-input.h
gui-keyboard.c gui-keyboard.h
gui-main.h
-2
View File
@@ -36,8 +36,6 @@ lib_weechat_gui_common_a_SOURCES = gui-bar.c \
gui-history.h \
gui-hotlist.c \
gui-hotlist.h \
gui-infobar.c \
gui-infobar.h \
gui-input.c \
gui-input.h \
gui-keyboard.c \
+1 -1
View File
@@ -15,7 +15,7 @@
#
SET(WEECHAT_CURSES_SRC gui-curses-bar.c gui-curses-chat.c gui-curses-color.c
gui-curses-infobar.c gui-curses-input.c gui-curses-keyboard.c gui-curses-main.c
gui-curses-input.c gui-curses-keyboard.c gui-curses-main.c
gui-curses-nicklist.c gui-curses-status.c gui-curses-window.c gui-curses.h)
SET(EXECUTABLE weechat-curses)
-1
View File
@@ -31,7 +31,6 @@ weechat_curses_LDADD = ./../../core/lib_weechat_core.a \
weechat_curses_SOURCES = gui-curses-bar.c \
gui-curses-chat.c \
gui-curses-color.c \
gui-curses-infobar.c \
gui-curses-input.c \
gui-curses-keyboard.c \
gui-curses-main.c \
-4
View File
@@ -395,10 +395,6 @@ gui_color_init_weechat ()
gui_color_build (GUI_COLOR_STATUS_DATA_OTHER, CONFIG_COLOR(config_color_status_data_other), CONFIG_COLOR(config_color_status_bg));
gui_color_build (GUI_COLOR_STATUS_MORE, CONFIG_COLOR(config_color_status_more), CONFIG_COLOR(config_color_status_bg));
gui_color_build (GUI_COLOR_INFOBAR, CONFIG_COLOR(config_color_infobar), CONFIG_COLOR(config_color_infobar_bg));
gui_color_build (GUI_COLOR_INFOBAR_DELIMITERS, CONFIG_COLOR(config_color_infobar_delimiters), CONFIG_COLOR(config_color_infobar_bg));
gui_color_build (GUI_COLOR_INFOBAR_HIGHLIGHT, CONFIG_COLOR(config_color_infobar_highlight), CONFIG_COLOR(config_color_infobar_bg));
gui_color_build (GUI_COLOR_INPUT, CONFIG_COLOR(config_color_input), CONFIG_COLOR(config_color_input_bg));
gui_color_build (GUI_COLOR_INPUT_SERVER, CONFIG_COLOR(config_color_input_server), CONFIG_COLOR(config_color_input_bg));
gui_color_build (GUI_COLOR_INPUT_CHANNEL, CONFIG_COLOR(config_color_input_channel), CONFIG_COLOR(config_color_input_bg));
-207
View File
@@ -1,207 +0,0 @@
/*
* Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* gui-curses-infobar.c: infobar display functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
#include "../../core/wee-hook.h"
#include "../../core/wee-string.h"
#include "../../plugins/plugin.h"
#include "../gui-infobar.h"
#include "../gui-color.h"
#include "../gui-main.h"
#include "../gui-window.h"
#include "gui-curses.h"
/*
* gui_infobar_draw_time: draw time in infobar window
*/
void
gui_infobar_draw_time (struct t_gui_buffer *buffer)
{
struct t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
/* make C compiler happy */
(void) buffer;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
if (local_time)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR);
mvwprintw (GUI_CURSES(ptr_win)->win_infobar,
0, 1,
"%02d:%02d",
local_time->tm_hour, local_time->tm_min);
if (CONFIG_BOOLEAN(config_look_infobar_seconds))
wprintw (GUI_CURSES(ptr_win)->win_infobar,
":%02d",
local_time->tm_sec);
}
wnoutrefresh (GUI_CURSES(ptr_win)->win_infobar);
}
}
/*
* gui_infobar_draw: draw infobar window for a buffer
*/
void
gui_infobar_draw (struct t_gui_buffer *buffer, int erase)
{
struct t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
char text_time[1024], *buf;
/* make C compiler happy */
(void) buffer;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (erase)
gui_window_clear_weechat (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR);
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
if (local_time)
{
strftime (text_time, sizeof (text_time),
CONFIG_STRING(config_look_infobar_time_format),
local_time);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR);
wprintw (GUI_CURSES(ptr_win)->win_infobar,
"%02d:%02d",
local_time->tm_hour, local_time->tm_min);
if (CONFIG_BOOLEAN(config_look_infobar_seconds))
wprintw (GUI_CURSES(ptr_win)->win_infobar,
":%02d",
local_time->tm_sec);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "]");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR);
wprintw (GUI_CURSES(ptr_win)->win_infobar,
" %s", text_time);
}
if (gui_infobar)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
GUI_COLOR_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, " | ");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar,
gui_infobar->color);
buf = string_iconv_from_internal (NULL, gui_infobar->text);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "%s",
(buf) ? buf : gui_infobar->text);
if (buf)
free (buf);
}
wnoutrefresh (GUI_CURSES(ptr_win)->win_infobar);
refresh ();
}
}
/*
* gui_infobar_refresh_timer_cb: timer callback for refresh of infobar
*/
int
gui_infobar_refresh_timer_cb (void *data)
{
/* make C compiler happy */
(void) data;
if (gui_ok)
{
if (data)
gui_infobar_draw (gui_current_window->buffer, 1);
else
gui_infobar_draw_time (gui_current_window->buffer);
wmove (GUI_CURSES(gui_current_window)->win_input,
0, gui_current_window->win_input_cursor_x);
wrefresh (GUI_CURSES(gui_current_window)->win_input);
}
return WEECHAT_RC_OK;
}
/*
* gui_infobar_highlight_timer_cb: timer callback for highlights in infobar
*/
int
gui_infobar_highlight_timer_cb (void *data)
{
/* make C compiler happy */
(void) data;
if (gui_ok)
{
if (gui_infobar && (gui_infobar->remaining_time > 0))
{
gui_infobar->remaining_time--;
if (gui_infobar->remaining_time == 0)
{
gui_infobar_remove ();
gui_infobar_draw (gui_current_window->buffer, 1);
}
}
/* remove this timer if there's no more data for infobar */
if (!gui_infobar)
{
unhook (gui_infobar_highlight_timer);
gui_infobar_highlight_timer = NULL;
}
}
return WEECHAT_RC_OK;
}
-1
View File
@@ -94,7 +94,6 @@ gui_keyboard_default_bindings ()
gui_keyboard_bind (NULL, /* m-j,m-l */ "meta-jmeta-l", "/input jump_last_buffer");
gui_keyboard_bind (NULL, /* m-j,m-p */ "meta-jmeta-p", "/input jump_previous_buffer");
gui_keyboard_bind (NULL, /* m-h */ "meta-h", "/input hotlist_clear");
gui_keyboard_bind (NULL, /* m-i */ "meta-i", "/input infobar_clear");
gui_keyboard_bind (NULL, /* m-k */ "meta-k", "/input grab_key");
gui_keyboard_bind (NULL, /* m-u */ "meta-u", "/input scroll_unread");
gui_keyboard_bind (NULL, /* ^S^U */ "ctrl-Sctrl-U", "/input set_unread");
-7
View File
@@ -44,7 +44,6 @@
#include "../gui-buffer.h"
#include "../gui-chat.h"
#include "../gui-color.h"
#include "../gui-infobar.h"
#include "../gui-input.h"
#include "../gui-history.h"
#include "../gui-nicklist.h"
@@ -97,8 +96,6 @@ gui_main_init ()
/* build prefixes according to config */
gui_chat_prefix_build ();
gui_infobar = NULL;
gui_ok = ((COLS >= GUI_WINDOW_MIN_WIDTH)
&& (LINES >= GUI_WINDOW_MIN_HEIGHT));
@@ -342,10 +339,6 @@ gui_main_end (int clean_exit)
/* delete global history */
gui_history_global_free ();
/* delete infobar messages */
while (gui_infobar)
gui_infobar_remove ();
/* reset title */
if (CONFIG_BOOLEAN(config_look_set_title))
gui_window_title_reset ();
+15 -84
View File
@@ -39,7 +39,6 @@
#include "../gui-chat.h"
#include "../gui-color.h"
#include "../gui-hotlist.h"
#include "../gui-infobar.h"
#include "../gui-input.h"
#include "../gui-main.h"
#include "../gui-nicklist.h"
@@ -90,7 +89,6 @@ gui_window_objects_init (struct t_gui_window *window)
GUI_CURSES(window)->win_chat = NULL;
GUI_CURSES(window)->win_nick = NULL;
GUI_CURSES(window)->win_status = NULL;
GUI_CURSES(window)->win_infobar = NULL;
GUI_CURSES(window)->win_input = NULL;
GUI_CURSES(window)->win_separator = NULL;
GUI_CURSES(window)->bar_windows = NULL;
@@ -128,11 +126,6 @@ gui_window_objects_free (struct t_gui_window *window, int free_separator,
delwin (GUI_CURSES(window)->win_status);
GUI_CURSES(window)->win_status = NULL;
}
if (GUI_CURSES(window)->win_infobar)
{
delwin (GUI_CURSES(window)->win_infobar);
GUI_CURSES(window)->win_infobar = NULL;
}
if (GUI_CURSES(window)->win_input)
{
delwin (GUI_CURSES(window)->win_input);
@@ -447,9 +440,7 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
if ((CONFIG_INTEGER(config_look_nicklist_min_size) > 0)
&& (lines < CONFIG_INTEGER(config_look_nicklist_min_size)))
lines = CONFIG_INTEGER(config_look_nicklist_min_size);
max_height = (CONFIG_BOOLEAN(config_look_infobar)) ?
window->win_height - add_top - add_bottom - 3 - 4 :
window->win_height - add_top - add_bottom - 2 - 4;
max_height = window->win_height - add_top - add_bottom - 2 - 4;
if (lines > max_height)
lines = max_height;
if (!force_calculate
@@ -470,16 +461,8 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
window->win_nick_y = window->win_y + add_top + 1;
window->win_nick_width = max_length +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
if (CONFIG_BOOLEAN(config_look_infobar))
{
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
window->win_nick_height = window->win_height - add_top - add_bottom - 4;
}
else
{
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_height = window->win_height - add_top - add_bottom - 3;
}
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_num_max = window->win_nick_height;
break;
case CONFIG_LOOK_NICKLIST_RIGHT:
@@ -492,16 +475,8 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
window->win_nick_y = window->win_y + add_top + 1;
window->win_nick_width = max_length +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
if (CONFIG_BOOLEAN(config_look_infobar))
{
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
window->win_nick_height = window->win_height - add_top - add_bottom - 4;
}
else
{
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_height = window->win_height - add_top - add_bottom - 3;
}
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_num_max = window->win_nick_height;
break;
case CONFIG_LOOK_NICKLIST_TOP:
@@ -509,12 +484,8 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
window->win_chat_y = window->win_y + add_top + 1 + lines +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_chat_width = window->win_width - add_left - add_right;
if (CONFIG_BOOLEAN(config_look_infobar))
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0) - 1;
else
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_x = window->win_x + add_left;
window->win_nick_y = window->win_y + add_top + 1;
window->win_nick_width = window->win_width - add_left - add_right;
@@ -526,21 +497,12 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
window->win_chat_x = window->win_x + add_left;
window->win_chat_y = window->win_y + add_top + 1;
window->win_chat_width = window->win_width - add_left - add_right;
if (CONFIG_BOOLEAN(config_look_infobar))
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0) - 1;
else
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_x = window->win_x;
if (CONFIG_BOOLEAN(config_look_infobar))
window->win_nick_y = window->win_y + window->win_height - add_bottom -
2 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0) - 1;
else
window->win_nick_y = window->win_y + window->win_height - add_bottom -
2 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_y = window->win_y + window->win_height - add_bottom -
2 - lines -
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
window->win_nick_width = window->win_width;
window->win_nick_height = lines +
((CONFIG_BOOLEAN(config_look_nicklist_separator)) ? 1 : 0);
@@ -556,10 +518,7 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
window->win_chat_x = window->win_x + add_left;
window->win_chat_y = window->win_y + add_top + 1;
window->win_chat_width = window->win_width - add_left - add_right;
if (CONFIG_BOOLEAN(config_look_infobar))
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
else
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_chat_cursor_x = window->win_x + add_left;
window->win_chat_cursor_y = window->win_y + add_top;
window->win_nick_x = -1;
@@ -577,29 +536,10 @@ gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate)
/* status window */
window->win_status_x = window->win_x + add_left;
if (CONFIG_BOOLEAN(config_look_infobar))
window->win_status_y = window->win_y + window->win_height - add_bottom - 3;
else
window->win_status_y = window->win_y + window->win_height - add_bottom - 2;
window->win_status_y = window->win_y + window->win_height - add_bottom - 2;
window->win_status_width = window->win_width - add_left - add_right;
window->win_status_height = 1;
/* infobar window */
if (CONFIG_BOOLEAN(config_look_infobar))
{
window->win_infobar_x = window->win_x + add_left;
window->win_infobar_y = window->win_y + window->win_height - add_bottom - 2;
window->win_infobar_width = window->win_width - add_left - add_right;
window->win_infobar_height = 1;
}
else
{
window->win_infobar_x = -1;
window->win_infobar_y = -1;
window->win_infobar_width = -1;
window->win_infobar_height = -1;
}
/* input window */
window->win_input_x = window->win_x + add_left;
window->win_input_y = window->win_y + window->win_height - add_bottom - 1;
@@ -649,8 +589,6 @@ gui_window_redraw_buffer (struct t_gui_buffer *buffer)
if (buffer->nicklist)
gui_nicklist_draw (buffer, 1);
gui_status_draw (1);
if (CONFIG_BOOLEAN(config_look_infobar))
gui_infobar_draw (buffer, 1);
gui_input_draw (buffer, 1);
}
@@ -756,13 +694,7 @@ gui_window_switch_to_buffer (struct t_gui_window *window,
window->win_chat_x);
}
/* create status/infobar windows */
if (CONFIG_BOOLEAN(config_look_infobar))
GUI_CURSES(window)->win_infobar = newwin (window->win_infobar_height,
window->win_infobar_width,
window->win_infobar_y,
window->win_infobar_x);
/* create status window */
GUI_CURSES(window)->win_status = newwin (window->win_status_height,
window->win_status_width,
window->win_status_y,
@@ -1851,7 +1783,6 @@ gui_window_objects_print_log (struct t_gui_window *window)
log_printf (" win_chat. . . . . . : 0x%x", GUI_CURSES(window)->win_chat);
log_printf (" win_nick. . . . . . : 0x%x", GUI_CURSES(window)->win_nick);
log_printf (" win_status. . . . . : 0x%x", GUI_CURSES(window)->win_status);
log_printf (" win_infobar . . . . : 0x%x", GUI_CURSES(window)->win_infobar);
log_printf (" win_input . . . . . : 0x%x", GUI_CURSES(window)->win_input);
log_printf (" win_separator . . . : 0x%x", GUI_CURSES(window)->win_separator);
log_printf (" bar_windows . . . . : 0x%x", GUI_CURSES(window)->bar_windows);
-1
View File
@@ -58,7 +58,6 @@ struct t_gui_curses_objects
WINDOW *win_chat; /* chat window (example: channel) */
WINDOW *win_nick; /* nick window */
WINDOW *win_status; /* status window */
WINDOW *win_infobar; /* info bar window */
WINDOW *win_input; /* input window */
WINDOW *win_separator; /* separation between 2 splited (V) win */
struct t_gui_bar_window *bar_windows; /* bar windows */
+1 -1
View File
@@ -15,7 +15,7 @@
#
SET(WEECHAT_GTK_SRC gui-gtk-bar.c gui-gtk-chat.c gui-gtk-color.c
gui-gtk-infobar.c gui-gtk-input.c gui-gtk-keyboard.c gui-gtk-main.c
gui-gtk-input.c gui-gtk-keyboard.c gui-gtk-main.c
gui-gtk-nicklist.c gui-gtk-status.c gui-gtk-window.c gui-gtk.h)
SET(EXECUTABLE weechat-gtk)
-1
View File
@@ -31,7 +31,6 @@ weechat_gtk_LDADD = ./../../core/lib_weechat_core.a \
weechat_gtk_SOURCES = gui-gtk-bar.c \
gui-gtk-chat.c \
gui-gtk-color.c \
gui-gtk-infobar.c \
gui-gtk-input.c \
gui-gtk-keyboard.c \
gui-gtk-main.c \
-105
View File
@@ -1,105 +0,0 @@
/*
* Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* gui-gtk-infobar.c: infobar display functions for Gtk GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
#include "../../plugins/plugin.h"
#include "../gui-infobar.h"
#include "../gui-window.h"
#include "gui-gtk.h"
/*
* gui_infobar_draw_time: draw time in infobar window
*/
void
gui_infobar_draw_time (struct t_gui_buffer *buffer)
{
/*struct t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;*/
/* make C compiler happy */
(void) buffer;
if (!gui_ok)
return;
/* TODO: write this function for Gtk */
(void) buffer;
}
/*
* gui_infobar_draw: draw infobar window for a buffer
*/
void
gui_infobar_draw (struct t_gui_buffer *buffer, int erase)
{
/*struct t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
char text_time[1024 + 1];*/
/* make C compiler happy */
(void) buffer;
if (!gui_ok)
return;
/* TODO: write this function for Gtk */
(void) buffer;
(void) erase;
}
/*
* gui_infobar_refresh_timer_cb: timer callback for refresh of infobar
*/
int
gui_infobar_refresh_timer_cb (void *data)
{
/* make C compiler happy */
(void) data;
return WEECHAT_RC_OK;
}
/*
* gui_infobar_highlight_timer_cb: timer callback for highlights in infobar
*/
int
gui_infobar_highlight_timer_cb (void *data)
{
/* make C compiler happy */
(void) data;
return WEECHAT_RC_OK;
}
-7
View File
@@ -37,7 +37,6 @@
#include "../gui-main.h"
#include "../gui-buffer.h"
#include "../gui-history.h"
#include "../gui-infobar.h"
#include "../gui-input.h"
#include "../gui-window.h"
#include "gui-gtk.h"
@@ -85,8 +84,6 @@ gui_main_init ()
gui_color_init ();
gui_infobar = NULL;
gui_ok = 1;
/* build prefixes according to config */
@@ -238,10 +235,6 @@ gui_main_end (int clean_exit)
/* delete global history */
gui_history_global_free ();
/* delete infobar messages */
while (gui_infobar)
gui_infobar_remove ();
/* reset title */
if (CONFIG_BOOLEAN(config_look_set_title))
gui_window_title_reset ();
-4
View File
@@ -71,10 +71,6 @@ enum t_gui_color_enum
GUI_COLOR_STATUS_DATA_OTHER,
GUI_COLOR_STATUS_MORE,
GUI_COLOR_INFOBAR,
GUI_COLOR_INFOBAR_DELIMITERS,
GUI_COLOR_INFOBAR_HIGHLIGHT,
GUI_COLOR_INPUT,
GUI_COLOR_INPUT_SERVER,
GUI_COLOR_INPUT_CHANNEL,
-119
View File
@@ -1,119 +0,0 @@
/*
* Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* gui-infobar.c: infobar functions, used by all GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "../core/weechat.h"
#include "../core/wee-hook.h"
#include "../core/wee-log.h"
#include "gui-infobar.h"
#include "gui-color.h"
#include "gui-window.h"
struct t_gui_infobar *gui_infobar = NULL; /* infobar content */
struct t_hook *gui_infobar_refresh_timer = NULL; /* refresh timer */
struct t_hook *gui_infobar_highlight_timer = NULL; /* highlight timer */
/*
* gui_infobar_printf: display message in infobar
*/
void
gui_infobar_printf (int delay, int color, const char *message, ...)
{
static char buf[1024];
va_list argptr;
struct t_gui_infobar *ptr_infobar;
char *buf2, *ptr_buf, *pos;
if (!message)
return;
va_start (argptr, message);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
ptr_infobar = malloc (sizeof (*ptr_infobar));
if (ptr_infobar)
{
buf2 = (char *)gui_color_decode ((unsigned char *)buf);
ptr_buf = (buf2) ? buf2 : buf;
ptr_infobar->color = color;
ptr_infobar->text = strdup (ptr_buf);
pos = strchr (ptr_infobar->text, '\n');
if (pos)
pos[0] = '\0';
ptr_infobar->remaining_time = (delay <= 0) ? -1 : delay;
ptr_infobar->next_infobar = gui_infobar;
gui_infobar = ptr_infobar;
gui_infobar_draw (gui_current_window->buffer, 1);
if (buf2)
free (buf2);
if (!gui_infobar_highlight_timer)
gui_infobar_highlight_timer = hook_timer (NULL, 1 * 1000, 0, 0,
&gui_infobar_highlight_timer_cb,
NULL);
}
else
log_printf (_("Error: not enough memory for infobar message"));
}
/*
* gui_infobar_remove: remove last displayed message in infobar
*/
void
gui_infobar_remove ()
{
struct t_gui_infobar *new_infobar;
if (gui_infobar)
{
new_infobar = gui_infobar->next_infobar;
if (gui_infobar->text)
free (gui_infobar->text);
free (gui_infobar);
gui_infobar = new_infobar;
}
}
/*
* gui_infobar_remove_all: remove last displayed message in infobar
*/
void
gui_infobar_remove_all ()
{
while (gui_infobar)
{
gui_infobar_remove ();
}
}
-53
View File
@@ -1,53 +0,0 @@
/*
* Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WEECHAT_GUI_INFOBAR_H
#define __WEECHAT_GUI_INFOBAR_H 1
struct t_gui_infobar
{
int color; /* text color */
char *text; /* infobar text */
int remaining_time; /* delay (sec) before erasing this text */
/* if < 0, text is never erased (except */
/* by user action to erase it) */
struct t_gui_infobar *next_infobar; /* next message for infobar */
};
/* infobar variables */
extern struct t_gui_infobar *gui_infobar;
extern struct t_hook *gui_infobar_refresh_timer;
extern struct t_hook *gui_infobar_highlight_timer;
/* infobar functions */
extern void gui_infobar_printf (int delay, int color,
const char *message, ...);
extern void gui_infobar_remove ();
extern void gui_infobar_remove_all ();
/* infobar functions (GUI dependent) */
extern void gui_infobar_draw_time (struct t_gui_buffer *buffer);
extern void gui_infobar_draw (struct t_gui_buffer *buffer, int erase);
extern int gui_infobar_refresh_timer_cb (void *data);
extern int gui_infobar_highlight_timer_cb (void *data);
#endif /* gui-infobar.h */
-12
View File
@@ -38,7 +38,6 @@
#include "gui-completion.h"
#include "gui-history.h"
#include "gui-hotlist.h"
#include "gui-infobar.h"
#include "gui-keyboard.h"
#include "gui-status.h"
#include "gui-window.h"
@@ -1257,17 +1256,6 @@ gui_input_hotlist_clear ()
gui_hotlist_initial_buffer = gui_current_window->buffer;
}
/*
* gui_input_infobar_clear: clear infobar (default key: meta-i)
*/
void
gui_input_infobar_clear ()
{
gui_infobar_remove ();
gui_infobar_draw (gui_current_window->buffer, 1);
}
/*
* gui_input_grab_key: init "grab key mode" (next key will be inserted into
* input buffer) (default key: meta-k)
-1
View File
@@ -62,7 +62,6 @@ extern void gui_input_jump_smart ();
extern void gui_input_jump_last_buffer ();
extern void gui_input_jump_previous_buffer ();
extern void gui_input_hotlist_clear ();
extern void gui_input_infobar_clear ();
extern void gui_input_grab_key ();
extern void gui_input_scroll_unread ();
extern void gui_input_set_unread ();
-9
View File
@@ -236,11 +236,6 @@ gui_window_new (struct t_gui_window *parent, int x, int y, int width, int height
new_window->win_status_width = 0;
new_window->win_status_height = 0;
new_window->win_infobar_x = 0;
new_window->win_infobar_y = 0;
new_window->win_infobar_width = 0;
new_window->win_infobar_height = 0;
new_window->win_input_x = 0;
new_window->win_input_y = 0;
new_window->win_input_width = 0;
@@ -925,10 +920,6 @@ gui_window_print_log ()
log_printf (" win_status_y. . . . : %d", ptr_window->win_status_y);
log_printf (" win_status_width. . : %d", ptr_window->win_status_width);
log_printf (" win_status_height . : %d", ptr_window->win_status_height);
log_printf (" win_infobar_x . . . : %d", ptr_window->win_infobar_x);
log_printf (" win_infobar_y . . . : %d", ptr_window->win_infobar_y);
log_printf (" win_infobar_width . : %d", ptr_window->win_infobar_width);
log_printf (" win_infobar_height. : %d", ptr_window->win_infobar_height);
log_printf (" win_input_x . . . . : %d", ptr_window->win_input_x);
log_printf (" win_input_y . . . . : %d", ptr_window->win_input_y);
log_printf (" win_input_width . . : %d", ptr_window->win_input_width);
-6
View File
@@ -64,12 +64,6 @@ struct t_gui_window
int win_status_width; /* width of status window */
int win_status_height; /* height of status window */
/* infobar bar settings */
int win_infobar_x; /* infobar window position */
int win_infobar_y; /* infobar window position */
int win_infobar_width; /* width of infobar window */
int win_infobar_height; /* height of infobar window */
/* input window settings */
int win_input_x; /* input window position */
int win_input_y; /* input window position */
+1 -28
View File
@@ -106,26 +106,6 @@ demo_printf_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
return WEECHAT_RC_OK;
}
/*
* demo_infobar_command_cb: demo command for infobar
*/
int
demo_infobar_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
/* make C compiler happy */
(void) data;
(void) buffer;
(void) argv;
weechat_infobar_printf (10, NULL,
(argc > 1) ?
argv_eol[1] : _("test message in infobar"));
return WEECHAT_RC_OK;
}
/*
* demo_buffer_input_data_cb: callback for input data on buffer
*/
@@ -419,14 +399,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
_("text: write this text"),
"",
&demo_printf_command_cb, NULL);
weechat_hook_command ("demo_infobar",
_("print a message in infobar for 10 seconds"),
_("[text]"),
_("text: write this text"),
"",
&demo_infobar_command_cb, NULL);
weechat_hook_command ("demo_buffer",
_("open a new buffer"),
_("category name"),
-1
View File
@@ -55,7 +55,6 @@
#define IRC_COLOR_CHAT_NICK_SELF weechat_color("chat_nick_self")
#define IRC_COLOR_CHAT_NICK_OTHER weechat_color("chat_nick_other")
#define IRC_COLOR_CHAT_SERVER weechat_color("chat_server")
#define IRC_COLOR_INFOBAR_HIGHLIGHT weechat_color("infobar_highlight")
#define IRC_COLOR_NICKLIST_PREFIX1 weechat_color("nicklist_prefix1")
#define IRC_COLOR_NICKLIST_PREFIX2 weechat_color("nicklist_prefix2")
#define IRC_COLOR_NICKLIST_PREFIX3 weechat_color("nicklist_prefix3")
-66
View File
@@ -40,7 +40,6 @@
#include "../gui/gui-chat.h"
#include "../gui/gui-color.h"
#include "../gui/gui-filter.h"
#include "../gui/gui-infobar.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-nicklist.h"
#include "../gui/gui-window.h"
@@ -322,63 +321,6 @@ plugin_api_color (const char *color_name)
return color[index_color];
}
/*
* plugin_api_infobar_printf: print a message in infobar
*/
void
plugin_api_infobar_printf (struct t_weechat_plugin *plugin, int delay,
const char *color_name, const char *format, ...)
{
va_list argptr;
static char buf[1024];
char *buf2;
int num_color;
if (!plugin || !format)
return;
va_start (argptr, format);
vsnprintf (buf, sizeof (buf) - 1, format, argptr);
va_end (argptr);
buf2 = string_iconv_to_internal (plugin->charset, buf);
if (color_name && color_name[0])
{
num_color = gui_color_search_config_int (color_name);
if (num_color < 0)
num_color = GUI_COLOR_INFOBAR;
}
else
num_color = GUI_COLOR_INFOBAR;
gui_infobar_printf (delay, num_color,
"%s",
(buf2) ? buf2 : buf);
if (buf2)
free (buf2);
}
/*
* plugin_api_infobar_remove: remove message(s) in infobar
*/
void
plugin_api_infobar_remove (int how_many)
{
if (how_many <= 0)
gui_infobar_remove_all ();
else
{
while ((gui_infobar) && (how_many > 0))
{
gui_infobar_remove ();
how_many--;
}
}
gui_infobar_draw (gui_current_window->buffer, 1);
}
/*
* plugin_api_command: execute a command (simulate user entry)
*/
@@ -694,14 +636,6 @@ plugin_api_infolist_get_add_window (struct t_plugin_infolist *infolist,
return 0;
if (!plugin_infolist_new_var_integer (ptr_item, "status_height", window->win_status_height))
return 0;
if (!plugin_infolist_new_var_integer (ptr_item, "infobar_x", window->win_infobar_x))
return 0;
if (!plugin_infolist_new_var_integer (ptr_item, "infobar_y", window->win_infobar_y))
return 0;
if (!plugin_infolist_new_var_integer (ptr_item, "infobar_width", window->win_infobar_width))
return 0;
if (!plugin_infolist_new_var_integer (ptr_item, "infobar_height", window->win_infobar_height))
return 0;
if (!plugin_infolist_new_var_integer (ptr_item, "input_x", window->win_input_x))
return 0;
if (!plugin_infolist_new_var_integer (ptr_item, "input_y", window->win_input_y))
-4
View File
@@ -41,10 +41,6 @@ extern int plugin_api_config_set_plugin (struct t_weechat_plugin *plugin,
/* display */
extern char *plugin_api_prefix (const char *prefix);
extern char *plugin_api_color (const char *color_name);
extern void plugin_api_infobar_printf (struct t_weechat_plugin *plugin,
int delay, const char *color_name,
const char *format, ...);
extern void plugin_api_infobar_remove (int how_many);
/* command */
extern void plugin_api_command (struct t_weechat_plugin *plugin,
-2
View File
@@ -367,8 +367,6 @@ plugin_load (const char *filename)
new_plugin->color = &plugin_api_color;
new_plugin->printf_date_tags = &gui_chat_printf_date_tags;
new_plugin->printf_y = &gui_chat_printf_y;
new_plugin->infobar_printf = &plugin_api_infobar_printf;
new_plugin->infobar_remove = &plugin_api_infobar_remove;
new_plugin->log_printf = &log_printf;
new_plugin->hook_command = &hook_command;
-77
View File
@@ -2176,81 +2176,6 @@ weechat_lua_api_print_y (lua_State *L)
LUA_RETURN_OK;
}
/*
* weechat_lua_api_infobar_print: print message to infobar
*/
static int
weechat_lua_api_infobar_print (lua_State *L)
{
const char *color, *message;
int delay, n;
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print");
LUA_RETURN_ERROR;
}
delay = 1;
color = NULL;
message = NULL;
n = lua_gettop (lua_current_interpreter);
if (n < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print");
LUA_RETURN_ERROR;
}
delay = lua_tonumber (lua_current_interpreter, -3);
color = lua_tostring (lua_current_interpreter, -2);
message = lua_tostring (lua_current_interpreter, -1);
script_api_infobar_printf (weechat_lua_plugin,
lua_current_script,
delay,
color,
"%s",
message);
LUA_RETURN_OK;
}
/*
* weechat_lua_api_infobar_remove: remove message(s) in infobar
*/
static int
weechat_lua_api_infobar_remove (lua_State *L)
{
int n, how_many;
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove");
LUA_RETURN_ERROR;
}
how_many = 0;
n = lua_gettop (lua_current_interpreter);
if (n == 1)
how_many = lua_tonumber (lua_current_interpreter, -1);
weechat_infobar_remove (how_many);
LUA_RETURN_OK;
}
/*
* weechat_lua_api_log_print: print message in WeeChat log file
*/
@@ -5033,8 +4958,6 @@ const struct luaL_reg weechat_lua_api_funcs[] = {
{ "print", &weechat_lua_api_print },
{ "print_date_tags", &weechat_lua_api_print_date_tags },
{ "print_y", &weechat_lua_api_print_y },
{ "infobar_print", &weechat_lua_api_infobar_print },
{ "infobar_remove", &weechat_lua_api_infobar_remove },
{ "log_print", &weechat_lua_api_log_print },
{ "hook_command", &weechat_lua_api_hook_command },
{ "hook_timer", &weechat_lua_api_hook_timer },
@@ -1791,64 +1791,6 @@ static XS (XS_weechat_print_y)
PERL_RETURN_OK;
}
/*
* weechat::infobar_print: print message to infobar
*/
static XS (XS_weechat_infobar_print)
{
char *color, *message;
dXSARGS;
/* make C compiler happy */
(void) cv;
if (!perl_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print");
PERL_RETURN_ERROR;
}
if (items < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print");
PERL_RETURN_ERROR;
}
color = SvPV (ST (1), PL_na);
message = SvPV (ST (2), PL_na);
script_api_infobar_printf (weechat_perl_plugin,
perl_current_script,
SvIV (ST (0)), /* delay */
color,
"%s",
message);
PERL_RETURN_OK;
}
/*
* weechat::infobar_remove: remove message(s) from infobar
*/
static XS (XS_weechat_infobar_remove)
{
dXSARGS;
/* make C compiler happy */
(void) cv;
if (!perl_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove");
PERL_RETURN_ERROR;
}
weechat_infobar_remove ((items >= 1) ? SvIV (ST (0)) : 0); /* how_many */
PERL_RETURN_OK;
}
/*
* weechat::log_print: print message in WeeChat log file
*/
@@ -3947,8 +3889,6 @@ weechat_perl_api_init (pTHX)
newXS ("weechat::print", XS_weechat_print, "weechat");
newXS ("weechat::print_date_tags", XS_weechat_print_date_tags, "weechat");
newXS ("weechat::print_y", XS_weechat_print_y, "weechat");
newXS ("weechat::infobar_print", XS_weechat_infobar_print, "weechat");
newXS ("weechat::infobar_remove", XS_weechat_infobar_remove, "weechat");
newXS ("weechat::log_print", XS_weechat_log_print, "weechat");
newXS ("weechat::hook_command", XS_weechat_hook_command, "weechat");
newXS ("weechat::hook_timer", XS_weechat_hook_timer, "weechat");
@@ -1904,72 +1904,6 @@ weechat_python_api_prnt_y (PyObject *self, PyObject *args)
PYTHON_RETURN_OK;
}
/*
* weechat_python_api_infobar_print: print message to infobar
*/
static PyObject *
weechat_python_api_infobar_print (PyObject *self, PyObject *args)
{
int delay;
char *color, *message;
/* make C compiler happy */
(void) self;
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print");
PYTHON_RETURN_ERROR;
}
delay = 1;
message = NULL;
if (!PyArg_ParseTuple (args, "iss", &delay, &color, &message))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print");
PYTHON_RETURN_ERROR;
}
script_api_infobar_printf (weechat_python_plugin,
python_current_script,
delay, color, "%s", message);
PYTHON_RETURN_OK;
}
/*
* weechat_python_api_infobar_remove: remove message(s) from infobar
*/
static PyObject *
weechat_python_api_infobar_remove (PyObject *self, PyObject *args)
{
int how_many;
/* make C compiler happy */
(void) self;
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove");
PYTHON_RETURN_ERROR;
}
how_many = 0;
if (!PyArg_ParseTuple (args, "|i", &how_many))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_remove");
PYTHON_RETURN_ERROR;
}
weechat_infobar_remove (how_many);
PYTHON_RETURN_OK;
}
/*
* weechat_python_api_log_print: print message in WeeChat log file
*/
@@ -4197,8 +4131,6 @@ PyMethodDef weechat_python_funcs[] =
{ "prnt", &weechat_python_api_prnt, METH_VARARGS, "" },
{ "prnt_date_tags", &weechat_python_api_prnt_date_tags, METH_VARARGS, "" },
{ "prnt_y", &weechat_python_api_prnt_y, METH_VARARGS, "" },
{ "infobar_print", &weechat_python_api_infobar_print, METH_VARARGS, "" },
{ "infobar_remove", &weechat_python_api_infobar_remove, METH_VARARGS, "" },
{ "log_print", &weechat_python_api_log_print, METH_VARARGS, "" },
{ "hook_command", &weechat_python_api_hook_command, METH_VARARGS, "" },
{ "hook_timer", &weechat_python_api_hook_timer, METH_VARARGS, "" },
@@ -2199,87 +2199,6 @@ weechat_ruby_api_print_y (VALUE class, VALUE buffer, VALUE y, VALUE message)
RUBY_RETURN_OK;
}
/*
* weechat_ruby_api_infobar_print: print message to infobar
*/
static VALUE
weechat_ruby_api_infobar_print (VALUE class, VALUE delay, VALUE color,
VALUE message)
{
int c_delay;
char *c_color, *c_message;
/* make C compiler happy */
(void) class;
if (!ruby_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print");
RUBY_RETURN_ERROR;
}
c_delay = 1;
c_color = NULL;
c_message = NULL;
if (NIL_P (delay) || NIL_P (color) || NIL_P (message))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print");
RUBY_RETURN_ERROR;
}
Check_Type (delay, T_FIXNUM);
Check_Type (color, T_STRING);
Check_Type (message, T_STRING);
c_delay = FIX2INT (delay);
c_color = STR2CSTR (color);
c_message = STR2CSTR (message);
script_api_infobar_printf (weechat_ruby_plugin,
ruby_current_script,
c_delay, c_color, "%s", c_message);
RUBY_RETURN_OK;
}
/*
* weechat_ruby_api_infobar_remove: remove message(s) from infobar
*/
static VALUE
weechat_ruby_api_infobar_remove (int argc, VALUE *argv, VALUE class)
{
VALUE how_many;
int c_how_many;
/* make C compiler happy */
(void) class;
if (!ruby_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove");
RUBY_RETURN_ERROR;
}
how_many = Qnil;
rb_scan_args (argc, argv, "01", &how_many);
if (!NIL_P (how_many))
{
Check_Type (how_many, T_FIXNUM);
c_how_many = FIX2INT (how_many);
}
else
c_how_many = 0;
weechat_infobar_remove (c_how_many);
RUBY_RETURN_OK;
}
/*
* weechat_ruby_api_log_print: print message in WeeChat log file
*/
@@ -4840,8 +4759,6 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_module_function (ruby_mWeechat, "print", &weechat_ruby_api_print, 2);
rb_define_module_function (ruby_mWeechat, "print_date_tags", &weechat_ruby_api_print_date_tags, 4);
rb_define_module_function (ruby_mWeechat, "print_y", &weechat_ruby_api_print_y, 3);
rb_define_module_function (ruby_mWeechat, "infobar_print", &weechat_ruby_api_infobar_print, 3);
rb_define_module_function (ruby_mWeechat, "infobar_remove", &weechat_ruby_api_infobar_remove, -1);
rb_define_module_function (ruby_mWeechat, "log_print", &weechat_ruby_api_log_print, 1);
rb_define_module_function (ruby_mWeechat, "hook_command", &weechat_ruby_api_hook_command, 6);
rb_define_module_function (ruby_mWeechat, "hook_timer", &weechat_ruby_api_hook_timer, 4);
-25
View File
@@ -535,31 +535,6 @@ script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
free (buf2);
}
/*
* script_api_infobar_printf: print a message in infobar
*/
void
script_api_infobar_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int delay, const char *color_name,
const char *format, ...)
{
va_list argptr;
char buf[1024];
char *buf2;
va_start (argptr, format);
vsnprintf (buf, sizeof (buf) - 1, format, argptr);
va_end (argptr);
buf2 = (script->charset && script->charset[0]) ?
weechat_iconv_to_internal (script->charset, buf) : NULL;
weechat_infobar_printf (delay, color_name, "%s", (buf2) ? buf2 : buf);
if (buf2)
free (buf2);
}
/*
* script_api_log_printf: add a message in WeeChat log file
*/
-4
View File
@@ -80,10 +80,6 @@ extern void script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
int y, const char *format, ...);
extern void script_api_infobar_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int delay, const char *color_name,
const char *format, ...);
extern void script_api_log_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *format, ...);
-9
View File
@@ -294,9 +294,6 @@ struct t_weechat_plugin
const char *tags, const char *message, ...);
void (*printf_y) (struct t_gui_buffer *buffer, int y,
const char *message, ...);
void (*infobar_printf) (struct t_weechat_plugin *plugin, int delay,
const char *color_name, const char *format, ...);
void (*infobar_remove) (int how_many);
void (*log_printf) (const char *message, ...);
/* hooks */
@@ -736,12 +733,6 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
__argz...) \
weechat_plugin->printf_date_tags(__buffer, __date, __tags, \
__message, ##__argz)
#define weechat_infobar_printf(__delay, __color_name, __message, \
__argz...) \
weechat_plugin->infobar_printf(weechat_plugin, __delay, \
__color_name, __message, ##__argz)
#define weechat_infobar_remove(__how_many) \
weechat_plugin->infobar_remove(__how_many)
#define weechat_log_printf(__message, __argz...) \
weechat_plugin->log_printf(__message, ##__argz)