summaryrefslogtreecommitdiff
path: root/src/gui/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gtk')
-rw-r--r--src/gui/gtk/CMakeLists.txt2
-rw-r--r--src/gui/gtk/gui-gtk-main.c1
-rw-r--r--src/gui/gtk/gui-gtk-nicklist.c6
-rw-r--r--src/gui/gtk/gui-gtk-window.c34
-rw-r--r--src/gui/gtk/gui-gtk.h5
5 files changed, 30 insertions, 18 deletions
diff --git a/src/gui/gtk/CMakeLists.txt b/src/gui/gtk/CMakeLists.txt
index 1045c4fa8..a95cb3376 100644
--- a/src/gui/gtk/CMakeLists.txt
+++ b/src/gui/gtk/CMakeLists.txt
@@ -36,6 +36,6 @@ ADD_EXECUTABLE(${EXECUTABLE} ${WEECHAT_GTK_SRC})
INCLUDE_DIRECTORIES(.. ../../core ../../plugins)
# Because of a linker bug, we have to link 2 times with libweechat_core.a
-TARGET_LINK_LIBRARIES(${EXECUTABLE} -lweechat_core ${STATIC_LIBS} ${EXTRA_LIBS})
+TARGET_LINK_LIBRARIES(${EXECUTABLE} ${STATIC_LIBS} ${EXTRA_LIBS} ${STATIC_LIBS})
INSTALL(TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin)
diff --git a/src/gui/gtk/gui-gtk-main.c b/src/gui/gtk/gui-gtk-main.c
index 1560c709c..4654434f9 100644
--- a/src/gui/gtk/gui-gtk-main.c
+++ b/src/gui/gtk/gui-gtk-main.c
@@ -180,7 +180,6 @@ gui_main_init ()
gui_buffer_set_title (ptr_buffer,
PACKAGE_STRING " " WEECHAT_COPYRIGHT_DATE
" - " WEECHAT_WEBSITE);
- gui_window_redraw_buffer (ptr_buffer);
}
else
gui_init_ok = 0;
diff --git a/src/gui/gtk/gui-gtk-nicklist.c b/src/gui/gtk/gui-gtk-nicklist.c
index 67b765ac7..16f4819d3 100644
--- a/src/gui/gtk/gui-gtk-nicklist.c
+++ b/src/gui/gtk/gui-gtk-nicklist.c
@@ -31,12 +31,16 @@
/*
* gui_nicklist_draw: draw nick window for a buffer
+ * return 1 if chat window has been refreshed, 0 if only
+ * nicklist has been refreshed
*/
-void
+int
gui_nicklist_draw (struct t_gui_buffer *buffer, int erase)
{
/* TODO: write this function for Gtk */
(void) buffer;
(void) erase;
+
+ return 0;
}
diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c
index 9c7cbd564..ede8ccf33 100644
--- a/src/gui/gtk/gui-gtk-window.c
+++ b/src/gui/gtk/gui-gtk-window.c
@@ -610,24 +610,27 @@ gui_window_refresh_windows ()
* gui_window_split_horiz: split a window horizontally
*/
-void
+struct t_gui_window *
gui_window_split_horiz (struct t_gui_window *window, int percentage)
{
struct t_gui_window *new_window;
int height1, height2;
if (!gui_ok)
- return;
+ return NULL;
+
+ new_window = NULL;
height1 = (window->win_height * percentage) / 100;
height2 = window->win_height - height1;
if ((percentage > 0) && (percentage <= 100))
{
- if ((new_window = gui_window_new (window,
- window->win_x, window->win_y,
- window->win_width, height1,
- 100, percentage)))
+ new_window = gui_window_new (window,
+ window->win_x, window->win_y,
+ window->win_width, height1,
+ 100, percentage);
+ if (new_window)
{
/* reduce old window height (bottom window) */
window->win_y = new_window->win_y + new_window->win_height;
@@ -645,30 +648,35 @@ gui_window_split_horiz (struct t_gui_window *window, int percentage)
gui_window_redraw_buffer (gui_current_window->buffer);
}
}
+
+ return new_window;
}
/*
* gui_window_split_vertic: split a window vertically
*/
-void
+struct t_gui_window *
gui_window_split_vertic (struct t_gui_window *window, int percentage)
{
struct t_gui_window *new_window;
int width1, width2;
if (!gui_ok)
- return;
+ return NULL;
+
+ new_window = NULL;
width1 = (window->win_width * percentage) / 100;
width2 = window->win_width - width1 - 1;
if ((percentage > 0) && (percentage <= 100))
{
- if ((new_window = gui_window_new (window,
- window->win_x + width1 + 1, window->win_y,
- width2, window->win_height,
- percentage, 100)))
+ new_window = gui_window_new (window,
+ window->win_x + width1 + 1, window->win_y,
+ width2, window->win_height,
+ percentage, 100);
+ if (new_window)
{
/* reduce old window height (left window) */
window->win_width = width1;
@@ -688,6 +696,8 @@ gui_window_split_vertic (struct t_gui_window *window, int percentage)
gui_window_draw_separator (gui_current_window);
}
}
+
+ return new_window;
}
/*
diff --git a/src/gui/gtk/gui-gtk.h b/src/gui/gtk/gui-gtk.h
index 53428daac..5513f29a5 100644
--- a/src/gui/gtk/gui-gtk.h
+++ b/src/gui/gtk/gui-gtk.h
@@ -23,6 +23,7 @@
#include <gtk/gtk.h>
struct t_gui_window;
+struct t_gui_buffer;
struct t_gui_line;
/* TODO: remove these temporary defines */
@@ -82,9 +83,6 @@ struct t_gui_gtk_objects
int current_color_attr; /* attr sum of last color(s) used */
};
-//extern t_gui_color gui_weechat_colors[];
-//extern int gui_irc_colors[GUI_NUM_IRC_COLORS][2];
-
extern GtkWidget *gui_gtk_main_window;
extern GtkWidget *gui_gtk_vbox1;
extern GtkWidget *gui_gtk_entry_topic;
@@ -114,6 +112,7 @@ extern void gui_keyboard_read ();
extern void gui_keyboard_flush ();
/* window functions */
+extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer);
extern void gui_window_title_set ();
extern void gui_window_title_reset ();