diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2003-10-25 14:49:18 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2003-10-25 14:49:18 +0000 |
commit | f966b6a8292996724961a7b653bbd4eec5224ced (patch) | |
tree | a968e421b3fd4b60a912b2f295eff9b64710c139 /src/gui | |
parent | b837017ba64fb3b095fd989b141cacac3ee2ab33 (diff) | |
download | weechat-f966b6a8292996724961a7b653bbd4eec5224ced.zip |
Added ./configure script to build WeeChat
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/Makefile.am | 30 | ||||
-rw-r--r-- | src/gui/curses/Makefile.am | 26 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 28 | ||||
-rw-r--r-- | src/gui/curses/gui-input.c | 8 | ||||
-rw-r--r-- | src/gui/gtk/Makefile.am | 28 | ||||
-rw-r--r-- | src/gui/gtk/gui-display.c | 28 | ||||
-rw-r--r-- | src/gui/gtk/gui-input.c | 7 | ||||
-rw-r--r-- | src/gui/gui-common.c | 2 | ||||
-rw-r--r-- | src/gui/gui.h | 60 | ||||
-rw-r--r-- | src/gui/qt/Makefile.am | 16 |
10 files changed, 188 insertions, 45 deletions
diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am new file mode 100644 index 000000000..797d3e624 --- /dev/null +++ b/src/gui/Makefile.am @@ -0,0 +1,30 @@ +# Copyright (c) 2003 FlashCode <flashcode@flashtux.org> +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +if GUI_CURSES +curses_dir=curses +endif + +if GUI_GTK +gtk_dir=gtk +endif + +if GUI_QT +qt_dir=qt +endif + +SUBDIRS = $(curses_dir) $(gtk_dir) $(qt_dir) diff --git a/src/gui/curses/Makefile.am b/src/gui/curses/Makefile.am new file mode 100644 index 000000000..7a8aaacc3 --- /dev/null +++ b/src/gui/curses/Makefile.am @@ -0,0 +1,26 @@ +# Copyright (c) 2003 FlashCode <flashcode@flashtux.org> +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +bin_PROGRAMS = weechat-curses + +weechat_curses_LDADD = ../../common/lib_weechat_main.a \ + ../../irc/lib_weechat_irc.a \ + $(CURSES_LIBS) + +weechat_curses_SOURCES = ../gui-common.c \ + gui-display.c \ + gui-input.c diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index f4a88e859..99ab1994c 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -29,10 +29,11 @@ #include <string.h> #include <signal.h> #include <time.h> +#include <curses.h> -#include "../../weechat.h" +#include "../../common/weechat.h" #include "../gui.h" -#include "../../config.h" +#include "../../common/config.h" #include "../../irc/irc.h" @@ -151,6 +152,17 @@ gui_window_set_color (WINDOW *window, int num_color) } /* + * gui_window_has_nicklist: returns 1 if window has nicklist + */ + +int +gui_window_has_nicklist (t_gui_window *window) +{ + return (window->win_nick != NULL); +} + + +/* * gui_calculate_pos_size: calculate position and size for a window & sub-win */ @@ -1246,6 +1258,18 @@ gui_window_init_subwindows (t_gui_window *window) } /* + * gui_pre_init: pre-initialize GUI (called before gui_init) + */ + +void +gui_pre_init (int *argc, char **argv[]) +{ + /* nothing for Curses interface */ + (void) argc; + (void) argv; +} + +/* * gui_init_colors: init GUI colors */ diff --git a/src/gui/curses/gui-input.c b/src/gui/curses/gui-input.c index 134ec8d20..61a5243d5 100644 --- a/src/gui/curses/gui-input.c +++ b/src/gui/curses/gui-input.c @@ -30,13 +30,15 @@ #include <signal.h> #include <time.h> #include <sys/socket.h> +#include <curses.h> -#include "../../weechat.h" +#include "../../common/weechat.h" #include "../gui.h" -#include "../../config.h" -#include "../../command.h" +#include "../../common/config.h" +#include "../../common/command.h" #include "../../irc/irc.h" +#define KEY_ESCAPE 27 /* * gui_read_keyb: read keyboard line diff --git a/src/gui/gtk/Makefile.am b/src/gui/gtk/Makefile.am new file mode 100644 index 000000000..8f2e52569 --- /dev/null +++ b/src/gui/gtk/Makefile.am @@ -0,0 +1,28 @@ +# Copyright (c) 2003 FlashCode <flashcode@flashtux.org> +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +bin_PROGRAMS = weechat-gtk + +INCLUDES = $(GTK_CFLAGS) + +weechat_gtk_LDADD = ../../common/lib_weechat_main.a \ + ../../irc/lib_weechat_irc.a \ + $(GTK_LIBS) + +weechat_gtk_SOURCES = ../gui-common.c \ + gui-display.c \ + gui-input.c diff --git a/src/gui/gtk/gui-display.c b/src/gui/gtk/gui-display.c index 673f414f3..d2d12fc39 100644 --- a/src/gui/gtk/gui-display.c +++ b/src/gui/gtk/gui-display.c @@ -29,10 +29,11 @@ #include <string.h> #include <signal.h> #include <time.h> +#include <gtk/gtk.h> -#include "../../weechat.h" +#include "../../common/weechat.h" #include "../gui.h" -#include "../../config.h" +#include "../../common/config.h" #include "../../irc/irc.h" @@ -144,6 +145,16 @@ gui_get_color_by_value (int color_value) } /* + * gui_window_has_nicklist: returns 1 if window has nicklist + */ + +int +gui_window_has_nicklist (t_gui_window *window) +{ + return (window->textbuffer_nicklist != NULL); +} + +/* * gui_calculate_pos_size: calculate position and size for a window & sub-win */ @@ -379,7 +390,7 @@ gui_redraw_window (t_gui_window *window) gui_redraw_window_title (window); gui_redraw_window_chat (window); - if (WIN_HAS_NICKLIST(window)) + if (gui_window_has_nicklist (window)) gui_redraw_window_nick (window); gui_redraw_window_status (window); gui_redraw_window_input (window); @@ -538,6 +549,17 @@ gui_window_init_subwindows (t_gui_window *window) } /* + * gui_pre_init: pre-initialize GUI (called before gui_init) + */ + +void +gui_pre_init (int *argc, char **argv[]) +{ + /* Initialise Gtk+ */ + gtk_init (argc, argv); +} + +/* * gui_init_colors: init GUI colors */ diff --git a/src/gui/gtk/gui-input.c b/src/gui/gtk/gui-input.c index 4ded0a91b..db30e6523 100644 --- a/src/gui/gtk/gui-input.c +++ b/src/gui/gtk/gui-input.c @@ -30,11 +30,12 @@ #include <signal.h> #include <time.h> #include <sys/socket.h> +#include <gtk/gtk.h> -#include "../../weechat.h" +#include "../../common/weechat.h" #include "../gui.h" -#include "../../config.h" -#include "../../command.h" +#include "../../common/config.h" +#include "../../common/command.h" #include "../../irc/irc.h" diff --git a/src/gui/gui-common.c b/src/gui/gui-common.c index b6e4c7b86..7d626024d 100644 --- a/src/gui/gui-common.c +++ b/src/gui/gui-common.c @@ -31,7 +31,7 @@ #include <time.h> #include <curses.h> -#include "../weechat.h" +#include "../common/weechat.h" #include "gui.h" #include "../irc/irc.h" diff --git a/src/gui/gui.h b/src/gui/gui.h index 11f326926..b1584f05e 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -23,19 +23,8 @@ #ifndef __WEECHAT_GUI_H #define __WEECHAT_GUI_H 1 -#ifdef WEE_CURSES -#include <curses.h> -#endif -#ifdef WEE_GTK -#include <gtk/gtk.h> -#endif - -#include "../completion.h" -#include "../history.h" - -#ifdef WEE_CURSES -#define KEY_ESCAPE 27 -#endif +#include "../common/completion.h" +#include "../common/history.h" #define INPUT_BUFFER_BLOCK_SIZE 256 @@ -77,10 +66,10 @@ #define WIN_IS_PRIVATE(window) (CHANNEL(window) && (CHANNEL(window)->type == CHAT_PRIVATE)) #ifdef WEE_CURSES - #define WIN_HAS_NICKLIST(window) (window->win_nick) + //#define WIN_HAS_NICKLIST(window) (window->win_nick) #endif #ifdef WEE_GTK - #define WIN_HAS_NICKLIST(window) (window->textbuffer_nicklist) + //#define WIN_HAS_NICKLIST(window) (window->textbuffer_nicklist) #endif #define MSG_TYPE_TIME 0 @@ -152,24 +141,27 @@ struct t_gui_window int win_nick_width; /* width of chat window */ int win_nick_height; /* height of chat window */ - /* windows */ - #ifdef WEE_CURSES - WINDOW *win_title; /* title window */ - WINDOW *win_chat; /* chat window (exemple: channel) */ - WINDOW *win_nick; /* nick window */ - WINDOW *win_status; /* status window */ - WINDOW *win_input; /* input window */ - #endif - #ifdef WEE_GTK - 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 */ - #endif - #ifdef WEE_QT + /* windows for Curses GUI */ + void *win_title; /* title window */ + void *win_chat; /* chat window (exemple: channel) */ + void *win_nick; /* nick window */ + void *win_status; /* status window */ + void *win_input; /* input window */ + + /* windows for Curses GUI */ + //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 */ + void *textview_chat; /* textview widget for chat */ + void *textbuffer_chat; /* textbuffer widget for chat */ + void *texttag_chat; /* texttag widget for chat */ + void *textview_nicklist; /* textview widget for nicklist */ + void *textbuffer_nicklist; /* textbuffer widget for nicklist */ + + /* windows for Curses GUI */ /* TODO: declare Qt window */ - #endif /* chat content (lines, line is composed by many messages) */ t_gui_line *lines; /* lines of chat window */ @@ -222,6 +214,7 @@ extern void gui_buffer_insert_string (char *, int); extern int gui_assign_color (int *, char *); extern int gui_get_color_by_name (char *); extern char *gui_get_color_by_value (int); +extern int gui_window_has_nicklist (t_gui_window *); extern void gui_calculate_pos_size (t_gui_window *); extern void gui_draw_window_title (t_gui_window *); extern void gui_redraw_window_title (t_gui_window *); @@ -240,7 +233,8 @@ extern void gui_switch_to_next_window (); extern void gui_move_page_up (); extern void gui_move_page_down (); extern void gui_window_init_subwindows (t_gui_window *); -extern void gui_init_colors (); +extern void gui_pre_init (int *, char **[]); +//extern void gui_init_colors (); extern void gui_init (); extern void gui_window_free (t_gui_window *); extern void gui_end (); diff --git a/src/gui/qt/Makefile.am b/src/gui/qt/Makefile.am new file mode 100644 index 000000000..a0d82e32a --- /dev/null +++ b/src/gui/qt/Makefile.am @@ -0,0 +1,16 @@ +# Copyright (c) 2003 FlashCode <flashcode@flashtux.org> +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# |