summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-curses-bar-window.c3
-rw-r--r--src/gui/curses/gui-curses-bar-window.h32
-rw-r--r--src/gui/curses/gui-curses-chat.c2
-rw-r--r--src/gui/curses/gui-curses-chat.h27
-rw-r--r--src/gui/curses/gui-curses-color.c1
-rw-r--r--src/gui/curses/gui-curses-color.h44
-rw-r--r--src/gui/curses/gui-curses-key.h25
-rw-r--r--src/gui/curses/gui-curses-main.c3
-rw-r--r--src/gui/curses/gui-curses-main.h28
-rw-r--r--src/gui/curses/gui-curses-mouse.c7
-rw-r--r--src/gui/curses/gui-curses-mouse.h28
-rw-r--r--src/gui/curses/gui-curses-window.c4
-rw-r--r--src/gui/curses/gui-curses-window.h84
-rw-r--r--src/gui/curses/gui-curses.h113
-rw-r--r--src/gui/curses/headless/CMakeLists.txt14
-rw-r--r--src/gui/curses/headless/main.c1
-rw-r--r--src/gui/curses/normal/CMakeLists.txt14
-rw-r--r--src/gui/curses/normal/main.c1
18 files changed, 299 insertions, 132 deletions
diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c
index 0410f6ced..666bab33b 100644
--- a/src/gui/curses/gui-curses-bar-window.c
+++ b/src/gui/curses/gui-curses-bar-window.c
@@ -41,6 +41,9 @@
#include "../gui-cursor.h"
#include "../gui-window.h"
#include "gui-curses.h"
+#include "gui-curses-bar-window.h"
+#include "gui-curses-color.h"
+#include "gui-curses-window.h"
/*
diff --git a/src/gui/curses/gui-curses-bar-window.h b/src/gui/curses/gui-curses-bar-window.h
new file mode 100644
index 000000000..ca7be28aa
--- /dev/null
+++ b/src/gui/curses/gui-curses-bar-window.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2003-2023 Sébastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat 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.
+ *
+ * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef WEECHAT_GUI_CURSES_BAR_WINDOW_H
+#define WEECHAT_GUI_CURSES_BAR_WINDOW_H
+
+#define GUI_BAR_WINDOW_OBJECTS(bar_window) \
+ ((struct t_gui_bar_window_curses_objects *)(bar_window->gui_objects))
+
+struct t_gui_bar_window_curses_objects
+{
+ WINDOW *win_bar; /* bar Curses window */
+ WINDOW *win_separator; /* separator (optional) */
+};
+
+#endif /* WEECHAT_GUI_CURSES_BAR_WINDOW_H */
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index e55dee23c..28d3b8520 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -44,6 +44,8 @@
#include "../gui-main.h"
#include "../gui-window.h"
#include "gui-curses.h"
+#include "gui-curses-main.h"
+#include "gui-curses-window.h"
/*
diff --git a/src/gui/curses/gui-curses-chat.h b/src/gui/curses/gui-curses-chat.h
new file mode 100644
index 000000000..0ba338f7e
--- /dev/null
+++ b/src/gui/curses/gui-curses-chat.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2003-2023 Sébastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat 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.
+ *
+ * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef WEECHAT_GUI_CURSES_CHAT_H
+#define WEECHAT_GUI_CURSES_CHAT_H
+
+extern void gui_chat_calculate_line_diff (struct t_gui_window *window,
+ struct t_gui_line **line,
+ int *line_pos, int difference);
+
+#endif /* WEECHAT_GUI_CURSES_CHAT_H */
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index d08f46bfc..e01f1b483 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -41,6 +41,7 @@
#include "../gui-chat.h"
#include "../gui-window.h"
#include "gui-curses.h"
+#include "gui-curses-color.h"
#define GUI_COLOR_TIMER_TERM_COLORS 10
diff --git a/src/gui/curses/gui-curses-color.h b/src/gui/curses/gui-curses-color.h
new file mode 100644
index 000000000..defc43a13
--- /dev/null
+++ b/src/gui/curses/gui-curses-color.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2003-2023 Sébastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat 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.
+ *
+ * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef WEECHAT_GUI_CURSES_COLOR_H
+#define WEECHAT_GUI_CURSES_COLOR_H
+
+#define GUI_CURSES_NUM_WEECHAT_COLORS 17
+
+#ifndef A_ITALIC /* A_ITALIC is defined in ncurses >= 5.9 patch 20130831 */
+#define A_ITALIC 0
+#endif /* A_ITALIC */
+
+#define A_ALL_ATTR A_BLINK | A_DIM | A_BOLD | A_UNDERLINE | A_REVERSE | A_ITALIC
+
+extern struct t_gui_color *gui_weechat_colors;
+extern int gui_color_term_colors;
+extern int gui_color_num_pairs;
+extern int gui_color_pairs_auto_reset;
+extern int gui_color_pairs_auto_reset_pending;
+extern time_t gui_color_pairs_auto_reset_last;
+extern int gui_color_buffer_refresh_needed;
+
+extern int gui_color_get_gui_attrs (int color);
+extern int gui_color_get_pair (int fg, int bg);
+extern int gui_color_weechat_get_pair (int weechat_color);
+extern void gui_color_alloc ();
+
+#endif /* WEECHAT_GUI_CURSES_COLOR_H */
diff --git a/src/gui/curses/gui-curses-key.h b/src/gui/curses/gui-curses-key.h
new file mode 100644
index 000000000..f835d1477
--- /dev/null
+++ b/src/gui/curses/gui-curses-key.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2003-2023 Sébastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat 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.
+ *
+ * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef WEECHAT_GUI_CURSES_KEY_H
+#define WEECHAT_GUI_CURSES_KEY_H
+
+extern int gui_key_read_cb (const void *pointer, void *data, int fd);
+
+#endif /* WEECHAT_GUI_CURSES_KEY_H */
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 1a95f2e84..7b024717c 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -58,6 +58,9 @@
#include "../gui-nicklist.h"
#include "../gui-window.h"
#include "gui-curses.h"
+#include "gui-curses-color.h"
+#include "gui-curses-key.h"
+#include "gui-curses-window.h"
volatile sig_atomic_t gui_signal_sigwinch_received = 0; /* sigwinch signal */
diff --git a/src/gui/curses/gui-curses-main.h b/src/gui/curses/gui-curses-main.h
new file mode 100644
index 000000000..4520b0ece
--- /dev/null
+++ b/src/gui/curses/gui-curses-main.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2003-2023 Sébastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat 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.
+ *
+ * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef WEECHAT_GUI_CURSES_MAIN_H
+#define WEECHAT_GUI_CURSES_MAIN_H
+
+extern int gui_term_cols, gui_term_lines;
+
+extern void gui_main_init ();
+extern void gui_main_loop ();
+
+#endif /* WEECHAT_GUI_CURSES_MAIN_H */
diff --git a/src/gui/curses/gui-curses-mouse.c b/src/gui/curses/gui-curses-mouse.c
index 27dc5d923..33a2d894b 100644
--- a/src/gui/curses/gui-curses-mouse.c
+++ b/src/gui/curses/gui-curses-mouse.c
@@ -43,13 +43,9 @@
#include "../gui-key.h"
#include "../gui-mouse.h"
#include "../gui-window.h"
+#include "gui-curses-mouse.h"
-#define MOUSE_CODE_BUTTON(code) ((code >= 32) && (code < 64))
-#define MOUSE_CODE_MOTION(code) ((code >= 64) && (code < 96))
-#define MOUSE_CODE_END(code) ((code == '#') || (code == '3') \
- || (code == '+') || (code == ';'))
-
char *gui_mouse_wheel_codes[][2] =
{ { "`", "wheelup" },
{ "p", "ctrl-wheelup" },
@@ -60,6 +56,7 @@ char *gui_mouse_wheel_codes[][2] =
{ "i", "alt-wheeldown" },
{ "y", "ctrl-alt-wheeldown" },
{ NULL, NULL } };
+
char *gui_mouse_button_codes[][2] =
{ { " ", "button1" },
{ "\"", "button2" },
diff --git a/src/gui/curses/gui-curses-mouse.h b/src/gui/curses/gui-curses-mouse.h
new file mode 100644
index 000000000..910d77c75
--- /dev/null
+++ b/src/gui/curses/gui-curses-mouse.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2003-2023 Sébastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat 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.
+ *
+ * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef WEECHAT_GUI_CURSES_MOUSE_H
+#define WEECHAT_GUI_CURSES_MOUSE_H
+
+#define MOUSE_CODE_BUTTON(code) ((code >= 32) && (code < 64))
+#define MOUSE_CODE_MOTION(code) ((code >= 64) && (code < 96))
+#define MOUSE_CODE_END(code) ((code == '#') || (code == '3') \
+ || (code == '+') || (code == ';'))
+
+#endif /* WEECHAT_GUI_CURSES_MOUSE_H */
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index f2c36f8a4..d49c674d6 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -55,6 +55,10 @@
#include "../gui-mouse.h"
#include "../gui-nicklist.h"
#include "gui-curses.h"
+#include "gui-curses-chat.h"
+#include "gui-curses-color.h"
+#include "gui-curses-main.h"
+#include "gui-curses-window.h"
#define GUI_WINDOW_MAX_SAVED_STYLES 32
diff --git a/src/gui/curses/gui-curses-window.h b/src/gui/curses/gui-curses-window.h
new file mode 100644
index 000000000..c2e4017d4
--- /dev/null
+++ b/src/gui/curses/gui-curses-window.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2003-2023 Sébastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat 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.
+ *
+ * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef WEECHAT_GUI_CURSES_WINDOW_H
+#define WEECHAT_GUI_CURSES_WINDOW_H
+
+#define GUI_WINDOW_OBJECTS(window) \
+ ((struct t_gui_window_curses_objects *)(window->gui_objects))
+
+struct t_gui_window_saved_style
+{
+ int style_fg;
+ int style_bg;
+ int color_attr;
+ int emphasis;
+ attr_t attrs;
+ short pair;
+};
+
+struct t_gui_window_curses_objects
+{
+ WINDOW *win_chat; /* chat window (example: channel) */
+ WINDOW *win_separator_horiz; /* horizontal separator (optional) */
+ WINDOW *win_separator_vertic; /* vertical separator (optional) */
+};
+
+extern int gui_window_current_color_attr;
+extern int gui_window_current_emphasis;
+
+extern void gui_window_read_terminal_size ();
+extern void gui_window_clear (WINDOW *window, int fg, int bg);
+extern void gui_window_clrtoeol (WINDOW *window);
+extern void gui_window_save_style (WINDOW *window);
+extern void gui_window_restore_style (WINDOW *window);
+extern void gui_window_reset_style (WINDOW *window, int num_color);
+extern void gui_window_reset_color (WINDOW *window, int num_color);
+extern void gui_window_set_color_style (WINDOW *window, int style);
+extern void gui_window_remove_color_style (WINDOW *window, int style);
+extern void gui_window_set_color (WINDOW *window, int fg, int bg);
+extern void gui_window_set_weechat_color (WINDOW *window, int num_color);
+extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg,
+ int reset_attributes);
+extern void gui_window_set_custom_color_pair (WINDOW *window, int pair);
+extern void gui_window_set_custom_color_fg (WINDOW *window, int fg);
+extern void gui_window_set_custom_color_bg (WINDOW *window, int bg);
+extern void gui_window_toggle_emphasis ();
+extern void gui_window_emphasize (WINDOW *window, int x, int y, int count);
+extern void gui_window_string_apply_color_fg (unsigned char **str,
+ WINDOW *window);
+extern void gui_window_string_apply_color_bg (unsigned char **str,
+ WINDOW *window);
+extern void gui_window_string_apply_color_fg_bg (unsigned char **str,
+ WINDOW *window);
+extern void gui_window_string_apply_color_pair (unsigned char **str,
+ WINDOW *window);
+extern void gui_window_string_apply_color_weechat (unsigned char **str,
+ WINDOW *window);
+extern void gui_window_string_apply_color_set_attr (unsigned char **str,
+ WINDOW *window);
+extern void gui_window_string_apply_color_remove_attr (unsigned char **str,
+ WINDOW *window);
+extern void gui_window_hline (WINDOW *window, int x, int y, int width,
+ const char *string);
+extern void gui_window_vline (WINDOW *window, int x, int y, int height,
+ const char *string);
+extern void gui_window_set_title (const char *title);
+
+#endif /* WEECHAT_GUI_CURSES_WINDOW_H */
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index 086a59edd..2d7dde92d 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -20,8 +20,6 @@
#ifndef WEECHAT_GUI_CURSES_H
#define WEECHAT_GUI_CURSES_H
-#include <time.h>
-
#ifdef WEECHAT_HEADLESS
#include "ncurses-fake.h"
#else
@@ -35,115 +33,4 @@
#endif /* HAVE_NCURSESW_CURSES_H */
#endif /* WEECHAT_HEADLESS */
-struct t_gui_buffer;
-struct t_gui_line;
-struct t_gui_window;
-struct t_gui_bar_window;
-
-#define GUI_CURSES_NUM_WEECHAT_COLORS 17
-
-#ifndef A_ITALIC /* A_ITALIC is defined in ncurses >= 5.9 patch 20130831 */
-#define A_ITALIC 0
-#endif /* A_ITALIC */
-
-#define A_ALL_ATTR A_BLINK | A_DIM | A_BOLD | A_UNDERLINE | A_REVERSE | A_ITALIC
-
-#define GUI_WINDOW_OBJECTS(window) \
- ((struct t_gui_window_curses_objects *)(window->gui_objects))
-#define GUI_BAR_WINDOW_OBJECTS(bar_window) \
- ((struct t_gui_bar_window_curses_objects *)(bar_window->gui_objects))
-
-struct t_gui_window_saved_style
-{
- int style_fg;
- int style_bg;
- int color_attr;
- int emphasis;
- attr_t attrs;
- short pair;
-};
-
-struct t_gui_window_curses_objects
-{
- WINDOW *win_chat; /* chat window (example: channel) */
- WINDOW *win_separator_horiz; /* horizontal separator (optional) */
- WINDOW *win_separator_vertic; /* vertical separator (optional) */
-};
-
-struct t_gui_bar_window_curses_objects
-{
- WINDOW *win_bar; /* bar Curses window */
- WINDOW *win_separator; /* separator (optional) */
-};
-
-extern int gui_term_cols, gui_term_lines;
-extern struct t_gui_color *gui_weechat_colors;
-extern int gui_color_term_colors;
-extern int gui_color_num_pairs;
-extern int gui_color_pairs_auto_reset;
-extern int gui_color_pairs_auto_reset_pending;
-extern time_t gui_color_pairs_auto_reset_last;
-extern int gui_color_buffer_refresh_needed;
-extern int gui_window_current_color_attr;
-extern int gui_window_current_emphasis;
-
-/* main functions */
-extern void gui_main_init ();
-extern void gui_main_loop ();
-
-/* color functions */
-extern int gui_color_get_gui_attrs (int color);
-extern int gui_color_get_extended_flags (int attrs);
-extern int gui_color_get_pair (int fg, int bg);
-extern int gui_color_weechat_get_pair (int weechat_color);
-extern void gui_color_alloc ();
-
-/* chat functions */
-extern void gui_chat_calculate_line_diff (struct t_gui_window *window,
- struct t_gui_line **line,
- int *line_pos, int difference);
-
-/* key functions */
-extern void gui_key_default_bindings (int context, int create_option);
-extern int gui_key_read_cb (const void *pointer, void *data, int fd);
-
-/* window functions */
-extern void gui_window_read_terminal_size ();
-extern void gui_window_clear (WINDOW *window, int fg, int bg);
-extern void gui_window_clrtoeol (WINDOW *window);
-extern void gui_window_save_style (WINDOW *window);
-extern void gui_window_restore_style (WINDOW *window);
-extern void gui_window_reset_style (WINDOW *window, int num_color);
-extern void gui_window_reset_color (WINDOW *window, int num_color);
-extern void gui_window_set_color_style (WINDOW *window, int style);
-extern void gui_window_remove_color_style (WINDOW *window, int style);
-extern void gui_window_set_color (WINDOW *window, int fg, int bg);
-extern void gui_window_set_weechat_color (WINDOW *window, int num_color);
-extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg,
- int reset_attributes);
-extern void gui_window_set_custom_color_pair (WINDOW *window, int pair);
-extern void gui_window_set_custom_color_fg (WINDOW *window, int fg);
-extern void gui_window_set_custom_color_bg (WINDOW *window, int bg);
-extern void gui_window_toggle_emphasis ();
-extern void gui_window_emphasize (WINDOW *window, int x, int y, int count);
-extern void gui_window_string_apply_color_fg (unsigned char **str,
- WINDOW *window);
-extern void gui_window_string_apply_color_bg (unsigned char **str,
- WINDOW *window);
-extern void gui_window_string_apply_color_fg_bg (unsigned char **str,
- WINDOW *window);
-extern void gui_window_string_apply_color_pair (unsigned char **str,
- WINDOW *window);
-extern void gui_window_string_apply_color_weechat (unsigned char **str,
- WINDOW *window);
-extern void gui_window_string_apply_color_set_attr (unsigned char **str,
- WINDOW *window);
-extern void gui_window_string_apply_color_remove_attr (unsigned char **str,
- WINDOW *window);
-extern void gui_window_hline (WINDOW *window, int x, int y, int width,
- const char *string);
-extern void gui_window_vline (WINDOW *window, int x, int y, int height,
- const char *string);
-extern void gui_window_set_title (const char *title);
-
#endif /* WEECHAT_GUI_CURSES_H */
diff --git a/src/gui/curses/headless/CMakeLists.txt b/src/gui/curses/headless/CMakeLists.txt
index ccd99fc58..99a63f353 100644
--- a/src/gui/curses/headless/CMakeLists.txt
+++ b/src/gui/curses/headless/CMakeLists.txt
@@ -28,14 +28,14 @@ add_library(weechat_ncurses_fake STATIC ${LIB_WEECHAT_NCURSES_FAKE_SRC})
set(LIB_GUI_CURSES_SRC
../gui-curses.h
- ../gui-curses-bar-window.c
- ../gui-curses-chat.c
- ../gui-curses-color.c
- ../gui-curses-key.c
- ../gui-curses-main.c
- ../gui-curses-mouse.c
+ ../gui-curses-bar-window.c ../gui-curses-bar-window.h
+ ../gui-curses-chat.c ../gui-curses-chat.h
+ ../gui-curses-color.c ../gui-curses-color.h
+ ../gui-curses-key.c ../gui-curses-key.h
+ ../gui-curses-main.c ../gui-curses-main.h
+ ../gui-curses-mouse.c ../gui-curses-mouse.h
../gui-curses-term.c
- ../gui-curses-window.c
+ ../gui-curses-window.c ../gui-curses-window.h
)
include_directories(. .. ../../core ../../plugins)
diff --git a/src/gui/curses/headless/main.c b/src/gui/curses/headless/main.c
index 6b001a3a1..3d49c4109 100644
--- a/src/gui/curses/headless/main.c
+++ b/src/gui/curses/headless/main.c
@@ -34,6 +34,7 @@
#include "../../../core/weechat.h"
#include "../../gui-main.h"
#include "../gui-curses.h"
+#include "../gui-curses-main.h"
/*
diff --git a/src/gui/curses/normal/CMakeLists.txt b/src/gui/curses/normal/CMakeLists.txt
index ec408c116..661c72003 100644
--- a/src/gui/curses/normal/CMakeLists.txt
+++ b/src/gui/curses/normal/CMakeLists.txt
@@ -19,14 +19,14 @@
set(LIB_GUI_CURSES_SRC
../gui-curses.h
- ../gui-curses-bar-window.c
- ../gui-curses-chat.c
- ../gui-curses-color.c
- ../gui-curses-key.c
- ../gui-curses-main.c
- ../gui-curses-mouse.c
+ ../gui-curses-bar-window.c ../gui-curses-bar-window.h
+ ../gui-curses-chat.c ../gui-curses-chat.h
+ ../gui-curses-color.c ../gui-curses-color.h
+ ../gui-curses-key.c ../gui-curses-key.h
+ ../gui-curses-main.c ../gui-curses-main.h
+ ../gui-curses-mouse.c ../gui-curses-mouse.h
../gui-curses-term.c
- ../gui-curses-window.c
+ ../gui-curses-window.c ../gui-curses-window.h
)
find_package(Ncurses)
diff --git a/src/gui/curses/normal/main.c b/src/gui/curses/normal/main.c
index 7d536099a..4c82b20d2 100644
--- a/src/gui/curses/normal/main.c
+++ b/src/gui/curses/normal/main.c
@@ -28,6 +28,7 @@
#include "../../../core/weechat.h"
#include "../../gui-main.h"
#include "../gui-curses.h"
+#include "../gui-curses-main.h"
/*