mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 02:03:13 +02:00
Remove infobar
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 ();
|
||||
}
|
||||
}
|
||||
@@ -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 */
|
||||
@@ -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)
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user