1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 00:03:12 +02:00

Add infolists for bars/bar items/bar windows, code cleanup for bars

This commit is contained in:
Sebastien Helleu
2008-12-13 19:43:11 +01:00
parent 6f74945a66
commit ec545c70b1
28 changed files with 968 additions and 322 deletions
+24 -20
View File
@@ -112,33 +112,37 @@ gui_main_init ()
/* init bar items */
gui_bar_item_init ();
/* create new window/buffer */
if (gui_window_new (NULL, 0, 0, COLS, LINES, 100, 100))
{
gui_current_window = gui_windows;
ptr_buffer = gui_buffer_new (NULL, "weechat", NULL, NULL, NULL, NULL);
if (ptr_buffer)
{
gui_init_ok = 1;
gui_buffer_set_title (ptr_buffer,
"WeeChat " WEECHAT_COPYRIGHT_DATE
" - " WEECHAT_WEBSITE);
}
else
gui_init_ok = 0;
if (CONFIG_BOOLEAN(config_look_set_title))
gui_window_title_set ();
}
gui_init_ok = 0;
if (gui_init_ok)
/* create core buffer */
ptr_buffer = gui_buffer_new (NULL, "weechat", NULL, NULL, NULL, NULL);
if (ptr_buffer)
{
gui_init_ok = 1;
/* set title for core buffer */
gui_buffer_set_title (ptr_buffer,
"WeeChat " WEECHAT_COPYRIGHT_DATE
" - " WEECHAT_WEBSITE);
/* create main window (using full space) */
if (gui_window_new (NULL, ptr_buffer, 0, 0, COLS, LINES, 100, 100))
{
gui_current_window = gui_windows;
if (CONFIG_BOOLEAN(config_look_set_title))
gui_window_title_set ();
}
/* create bar windows for root bars (they were read from config,
but no window was created (GUI was not initialized) */
for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
{
if ((CONFIG_INTEGER(ptr_bar->type) == GUI_BAR_TYPE_ROOT) && (!ptr_bar->bar_window))
if ((CONFIG_INTEGER(ptr_bar->type) == GUI_BAR_TYPE_ROOT)
&& (!ptr_bar->bar_window))
{
gui_bar_window_new (ptr_bar, NULL);
}
}
for (ptr_bar_win = gui_windows->bar_windows;
ptr_bar_win; ptr_bar_win = ptr_bar_win->next_bar_window)
+2 -4
View File
@@ -980,7 +980,7 @@ gui_window_split_horiz (struct t_gui_window *window, int percentage)
if ((height1 >= GUI_WINDOW_MIN_HEIGHT) && (height2 >= GUI_WINDOW_MIN_HEIGHT)
&& (percentage > 0) && (percentage <= 100))
{
new_window = gui_window_new (window,
new_window = gui_window_new (window, window->buffer,
window->win_x, window->win_y,
window->win_width, height1,
100, percentage);
@@ -992,7 +992,6 @@ gui_window_split_horiz (struct t_gui_window *window, int percentage)
window->win_height_pct = 100 - percentage;
/* assign same buffer for new window (top window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_window_switch_to_buffer (window, window->buffer, 1);
@@ -1025,7 +1024,7 @@ gui_window_split_vertic (struct t_gui_window *window, int percentage)
if ((width1 >= GUI_WINDOW_MIN_WIDTH) && (width2 >= GUI_WINDOW_MIN_WIDTH)
&& (percentage > 0) && (percentage <= 100))
{
new_window = gui_window_new (window,
new_window = gui_window_new (window, window->buffer,
window->win_x + width1 + 1, window->win_y,
width2, window->win_height,
percentage, 100);
@@ -1036,7 +1035,6 @@ gui_window_split_vertic (struct t_gui_window *window, int percentage)
window->win_width_pct = 100 - percentage;
/* assign same buffer for new window (right window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_window_switch_to_buffer (window, window->buffer, 1);
-7
View File
@@ -59,13 +59,6 @@ extern void gui_color_pre_init ();
extern void gui_color_init ();
extern void gui_color_end ();
/* bar functions */
extern void gui_bar_window_calculate_pos_size (struct t_gui_bar_window *bar_window,
struct t_gui_window *window);
extern void gui_bar_window_create_win (struct t_gui_bar_window *bar_window);
extern int gui_bar_window_remove_unused_bars (struct t_gui_window *window);
extern int gui_bar_window_add_missing_bars (struct t_gui_window *window);
/* chat functions */
extern void gui_chat_calculate_line_diff (struct t_gui_window *window,
struct t_gui_line **line,