diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-10-12 19:20:26 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-10-12 19:20:26 +0200 |
commit | c83eef6e82ab85fba79b2043282c6b185cbef9db (patch) | |
tree | c0d02282f6de0706bbc2fa6eaaef0b32db1a7da0 /src/gui/gtk | |
parent | f6073c80765cda45af6b4518fd3b3d4c3506b1d3 (diff) | |
download | weechat-c83eef6e82ab85fba79b2043282c6b185cbef9db.zip |
Remove old title/nicklist/status/input, use of new bars
Diffstat (limited to 'src/gui/gtk')
-rw-r--r-- | src/gui/gtk/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/gui/gtk/Makefile.am | 3 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-chat.c | 12 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-input.c | 100 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-nicklist.c | 46 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-status.c | 44 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-window.c | 159 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk.h | 4 |
8 files changed, 4 insertions, 367 deletions
diff --git a/src/gui/gtk/CMakeLists.txt b/src/gui/gtk/CMakeLists.txt index a95cb3376..bc255f51a 100644 --- a/src/gui/gtk/CMakeLists.txt +++ b/src/gui/gtk/CMakeLists.txt @@ -15,8 +15,7 @@ # SET(WEECHAT_GTK_SRC gui-gtk-bar.c gui-gtk-chat.c gui-gtk-color.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) +gui-gtk-keyboard.c gui-gtk-main.c gui-gtk-window.c gui-gtk.h) SET(EXECUTABLE weechat-gtk) diff --git a/src/gui/gtk/Makefile.am b/src/gui/gtk/Makefile.am index 80faac7e4..a6c1d9f9b 100644 --- a/src/gui/gtk/Makefile.am +++ b/src/gui/gtk/Makefile.am @@ -31,10 +31,7 @@ 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-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 diff --git a/src/gui/gtk/gui-gtk-chat.c b/src/gui/gtk/gui-gtk-chat.c index 5366d1ebc..6899fb2b5 100644 --- a/src/gui/gtk/gui-gtk-chat.c +++ b/src/gui/gtk/gui-gtk-chat.c @@ -176,18 +176,6 @@ gui_chat_set_weechat_color (struct t_gui_window *window, int weechat_color) } /* - * gui_chat_draw_title: draw title window for a buffer - */ - -void -gui_chat_draw_title (struct t_gui_buffer *buffer, int erase) -{ - /* TODO: write this function for Gtk */ - (void) buffer; - (void) erase; -} - -/* * gui_chat_string_next_char: returns next char of a word (for display) * special chars like colors, bold, .. are skipped * and optionaly applied diff --git a/src/gui/gtk/gui-gtk-input.c b/src/gui/gtk/gui-gtk-input.c deleted file mode 100644 index 3c4df768c..000000000 --- a/src/gui/gtk/gui-gtk-input.c +++ /dev/null @@ -1,100 +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-input: user input functions for Gtk GUI */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdlib.h> - -#include "../../core/weechat.h" -#include "../../core/wee-config.h" -#include "../../core/wee-utf8.h" -#include "../../plugins/plugin.h" -#include "../gui-input.h" -#include "../gui-window.h" -#include "gui-gtk.h" - - -/* - * gui_input_set_color: set color for an input window - */ - -void -gui_input_set_color (struct t_gui_window *window, int irc_color) -{ - /*int fg, bg;*/ - - /* TODO: write this function for Gtk */ - (void) window; - (void) irc_color; -} - -/* - * gui_input_draw_prompt: display input prompt - */ - -void -gui_input_draw_prompt (struct t_gui_window *window, const char *nick) -{ - /*char *pos, saved_char, *modes; - int char_size, mode_found;*/ - - /* TODO: write this function for Gtk */ - (void) window; - (void) nick; -} - -/* - * gui_input_draw_text: display text in input buffer, according to color mask - */ - -void -gui_input_draw_text (struct t_gui_window *window, int input_width) -{ - /*char *ptr_start, *ptr_next, saved_char; - int pos_mask, size, last_color, color;*/ - - /* TODO: write this function for Gtk */ - (void) window; - (void) input_width; -} - -/* - * gui_input_draw: draw input window for a buffer - */ - -void -gui_input_draw (struct t_gui_buffer *buffer, int erase) -{ - /*struct t_gui_window *ptr_win; - char format[32]; - char *ptr_nickname; - int input_width; - t_irc_dcc *dcc_selected;*/ - - if (!gui_ok) - return; - - /* TODO: write this function for Gtk */ - (void) buffer; - (void) erase; -} diff --git a/src/gui/gtk/gui-gtk-nicklist.c b/src/gui/gtk/gui-gtk-nicklist.c deleted file mode 100644 index 16f4819d3..000000000 --- a/src/gui/gtk/gui-gtk-nicklist.c +++ /dev/null @@ -1,46 +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-nicklist.c: nicklist display functions for Gtk GUI */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "../../core/weechat.h" -#include "../../core/wee-config.h" -#include "../gui-nicklist.h" -#include "gui-gtk.h" - - -/* - * gui_nicklist_draw: draw nick window for a buffer - * return 1 if chat window has been refreshed, 0 if only - * nicklist has been refreshed - */ - -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-status.c b/src/gui/gtk/gui-gtk-status.c deleted file mode 100644 index 88745be0b..000000000 --- a/src/gui/gtk/gui-gtk-status.c +++ /dev/null @@ -1,44 +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-status.c: status 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 "../gui-status.h" -#include "gui-gtk.h" - - -/* - * gui_status_draw: draw status window - */ - -void -gui_status_draw (int erase) -{ - /* TODO: write this function for Gtk */ - (void) erase; -} diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c index ede8ccf33..b7a683ea6 100644 --- a/src/gui/gtk/gui-gtk-window.c +++ b/src/gui/gtk/gui-gtk-window.c @@ -36,7 +36,6 @@ #include "../gui-hotlist.h" #include "../gui-nicklist.h" #include "../gui-main.h" -#include "../gui-status.h" #include "gui-gtk.h" @@ -75,8 +74,6 @@ gui_window_objects_init (struct t_gui_window *window) GUI_GTK(window)->textview_chat = NULL; GUI_GTK(window)->textbuffer_chat = NULL; GUI_GTK(window)->texttag_chat = NULL; - GUI_GTK(window)->textview_nicklist = NULL; - GUI_GTK(window)->textbuffer_nicklist = NULL; GUI_GTK(window)->bar_windows = NULL; GUI_GTK(window)->last_bar_window = NULL; return 1; @@ -118,14 +115,11 @@ gui_window_set_weechat_color (WINDOW *window, int num_color) * gui_window_calculate_pos_size: calculate position and size for a window & sub-win */ -int -gui_window_calculate_pos_size (struct t_gui_window *window, int force_calculate) +void +gui_window_calculate_pos_size (struct t_gui_window *window) { /* TODO: write this function for Gtk */ (void) window; - (void) force_calculate; - - return 0; } /* @@ -214,8 +208,7 @@ gui_window_switch_to_buffer (struct t_gui_window *window, struct t_gui_buffer *b } window->buffer = buffer; - window->win_nick_start = 0; - gui_window_calculate_pos_size (window, 1); + gui_window_calculate_pos_size (window); if (!GUI_GTK(window)->textview_chat) { @@ -233,17 +226,6 @@ gui_window_switch_to_buffer (struct t_gui_window *window, struct t_gui_buffer *b gtk_text_buffer_get_bounds (GUI_GTK(window)->textbuffer_chat, &start, &end); gtk_text_buffer_apply_tag (GUI_GTK(window)->textbuffer_chat, GUI_GTK(window)->texttag_chat, &start, &end); } - if (buffer->nicklist && !GUI_GTK(window)->textbuffer_nicklist) - { - GUI_GTK(window)->textview_nicklist = gtk_text_view_new (); - gtk_widget_show (GUI_GTK(window)->textview_nicklist); - gtk_container_add (GTK_CONTAINER (gui_gtk_scrolledwindow_nick), GUI_GTK(window)->textview_nicklist); - gtk_text_view_set_editable (GTK_TEXT_VIEW (GUI_GTK(window)->textview_nicklist), FALSE); - gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (GUI_GTK(window)->textview_nicklist), FALSE); - - GUI_GTK(window)->textbuffer_nicklist = gtk_text_buffer_new (NULL); - gtk_text_view_set_buffer (GTK_TEXT_VIEW (GUI_GTK(window)->textview_nicklist), GUI_GTK(window)->textbuffer_nicklist); - } window->start_line = NULL; window->start_line_pos = 0; @@ -271,7 +253,6 @@ gui_window_page_up (struct t_gui_window *window) (-1) * (window->win_chat_height - 1) : (-1) * ((window->win_chat_height - 1) * 2)); gui_chat_draw (window->buffer, 0); - gui_status_refresh_needed = 1; } } @@ -307,7 +288,6 @@ gui_window_page_down (struct t_gui_window *window) } gui_chat_draw (window->buffer, 0); - gui_status_refresh_needed = 1; } } @@ -330,7 +310,6 @@ gui_window_scroll_up (struct t_gui_window *window) (-1) * ( (window->win_chat_height - 1) + CONFIG_INTEGER(config_look_scroll_amount))); gui_chat_draw (window->buffer, 0); - gui_status_refresh_needed = 1; } } @@ -367,7 +346,6 @@ gui_window_scroll_down (struct t_gui_window *window) } gui_chat_draw (window->buffer, 0); - gui_status_refresh_needed = 1; } } @@ -386,7 +364,6 @@ gui_window_scroll_top (struct t_gui_window *window) window->start_line = window->buffer->lines; window->start_line_pos = 0; gui_chat_draw (window->buffer, 0); - gui_status_refresh_needed = 1; } } @@ -405,134 +382,6 @@ gui_window_scroll_bottom (struct t_gui_window *window) window->start_line = NULL; window->start_line_pos = 0; gui_chat_draw (window->buffer, 0); - gui_status_refresh_needed = 1; - } -} - -/* - * gui_window_scroll_topic_left: scroll left topic - */ - -void -gui_window_scroll_topic_left (struct t_gui_window *window) -{ - if (!gui_ok) - return; - - if (window->win_title_start > 0) - window->win_title_start -= (window->win_width * 3) / 4; - if (window->win_title_start < 0) - window->win_title_start = 0; - gui_chat_draw_title (window->buffer, 1); -} - -/* - * gui_window_scroll_topic_right: scroll right topic - */ - -void -gui_window_scroll_topic_right (struct t_gui_window *window) -{ - if (!gui_ok) - return; - - window->win_title_start += (window->win_width * 3) / 4; - gui_chat_draw_title (window->buffer, 1); -} - -/* - * gui_window_nicklist_page_up: scroll one page up in nicklist - */ - -void -gui_window_nicklist_page_up (struct t_gui_window *window) -{ - if (!gui_ok) - return; - - if (window->buffer->nicklist) - { - if (window->win_nick_start > 0) - { - window->win_nick_start -= (window->win_nick_height - 1); - if (window->win_nick_start <= 1) - window->win_nick_start = 0; - gui_nicklist_draw (window->buffer, 1); - } - } -} - -/* - * gui_window_nicklist_page_down: scroll one page down in nicklist - */ - -void -gui_window_nicklist_page_down (struct t_gui_window *window) -{ - if (!gui_ok) - return; - - if (window->buffer->nicklist) - { - if ((window->buffer->nicklist_visible_count > window->win_nick_height) - && (window->win_nick_start + window->win_nick_height - 1 - < window->buffer->nicklist_visible_count)) - { - if (window->win_nick_start == 0) - window->win_nick_start += (window->win_nick_height - 1); - else - window->win_nick_start += (window->win_nick_height - 2); - gui_nicklist_draw (window->buffer, 1); - } - } -} - -/* - * gui_window_nicklist_beginning: go to beginning of nicklist - */ - -void -gui_window_nicklist_beginning (struct t_gui_window *window) -{ - if (!gui_ok) - return; - - if (window->buffer->nicklist) - { - if (window->win_nick_start > 0) - { - window->win_nick_start = 0; - gui_nicklist_draw (window->buffer, 1); - } - } -} - -/* - * gui_window_nicklist_end: go to the end of nicklist - */ - -void -gui_window_nicklist_end (struct t_gui_window *window) -{ - int new_start; - - if (!gui_ok) - return; - - if (window->buffer->nicklist) - { - new_start = - window->buffer->nicklist_visible_count - window->win_nick_height; - if (new_start < 0) - new_start = 0; - else if (new_start >= 1) - new_start++; - - if (new_start != window->win_nick_start) - { - window->win_nick_start = new_start; - gui_nicklist_draw (window->buffer, 1); - } } } @@ -958,8 +807,6 @@ gui_window_objects_print_log (struct t_gui_window *window) log_printf (" textview_chat . . . : 0x%x", GUI_GTK(window)->textview_chat); log_printf (" textbuffer_chat . . : 0x%x", GUI_GTK(window)->textbuffer_chat); log_printf (" texttag_chat. . . . : 0x%x", GUI_GTK(window)->texttag_chat); - log_printf (" textview_nicklist . : 0x%x", GUI_GTK(window)->textview_nicklist); - log_printf (" textbuffer_nicklist : 0x%x", GUI_GTK(window)->textbuffer_nicklist); log_printf (" bar_windows . . . . : 0x%x", GUI_GTK(window)->bar_windows); log_printf (" last_bar_windows. . : 0x%x", GUI_GTK(window)->last_bar_window); log_printf (" current_style_fg. . : %d", GUI_GTK(window)->current_style_fg); diff --git a/src/gui/gtk/gui-gtk.h b/src/gui/gtk/gui-gtk.h index 5513f29a5..7665a725d 100644 --- a/src/gui/gtk/gui-gtk.h +++ b/src/gui/gtk/gui-gtk.h @@ -73,8 +73,6 @@ struct t_gui_gtk_objects GtkWidget *textview_chat; /* textview widget for chat */ GtkTextBuffer *textbuffer_chat; /* textbuffer widget for chat */ GtkTextTag *texttag_chat; /* texttag widget for chat */ - GtkWidget *textview_nicklist; /* textview widget for nicklist */ - GtkTextBuffer *textbuffer_nicklist; /* textbuffer widget for nicklist */ struct t_gui_bar_window *bar_windows; /* bar windows */ struct t_gui_bar_window *last_bar_window; /* last bar window */ int current_style_fg; /* current foreground color */ @@ -85,13 +83,11 @@ struct t_gui_gtk_objects extern GtkWidget *gui_gtk_main_window; extern GtkWidget *gui_gtk_vbox1; -extern GtkWidget *gui_gtk_entry_topic; extern GtkWidget *gui_gtk_notebook1; extern GtkWidget *gui_gtk_vbox2; extern GtkWidget *gui_gtk_hbox1; extern GtkWidget *gui_gtk_hpaned1; extern GtkWidget *gui_gtk_scrolledwindow_chat; -extern GtkWidget *gui_gtk_scrolledwindow_nick; extern GtkWidget *gui_gtk_entry_input; extern GtkWidget *gui_gtk_label1; |