summaryrefslogtreecommitdiff
path: root/src/gui/curses
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/curses')
-rw-r--r--src/gui/curses/gui-curses-main.c40
-rw-r--r--src/gui/curses/gui-curses-window.c6
-rw-r--r--src/gui/curses/gui-curses.h7
3 files changed, 24 insertions, 29 deletions
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 897511722..ba13a4ba8 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -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_init_ok = 0;
+
+ /* create core buffer */
+ ptr_buffer = gui_buffer_new (NULL, "weechat", NULL, NULL, NULL, NULL);
+ if (ptr_buffer)
{
- gui_current_window = gui_windows;
- 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_init_ok = 1;
- gui_buffer_set_title (ptr_buffer,
- "WeeChat " WEECHAT_COPYRIGHT_DATE
- " - " WEECHAT_WEBSITE);
+ gui_current_window = gui_windows;
+
+ if (CONFIG_BOOLEAN(config_look_set_title))
+ gui_window_title_set ();
}
- else
- gui_init_ok = 0;
- if (CONFIG_BOOLEAN(config_look_set_title))
- gui_window_title_set ();
- }
-
- if (gui_init_ok)
- {
/* 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)
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index ff26a9173..6c19c206b 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -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);
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index dfb76466c..91923f1b5 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -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,