mirror of
https://github.com/weechat/weechat.git
synced 2026-06-18 17:14:47 +02:00
Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e1f2ca5b8 | |||
| 8676230eef | |||
| bde34ecd57 | |||
| f245ec3759 | |||
| 5839cc6bfd | |||
| 476054fb4f | |||
| be8b44a2d7 | |||
| 8d33ef0168 | |||
| 2b16f8c0d5 | |||
| 273f4860fe | |||
| 6af18b3dbc | |||
| c488066e33 | |||
| 9746520a24 | |||
| fb7a6efb5a | |||
| dc8368815e | |||
| a81f58f3f1 | |||
| 338e460be9 | |||
| 324077c333 | |||
| 1ba27c760b | |||
| c60a693f42 | |||
| 65c9a79603 | |||
| cafd93dcdd | |||
| 6d6eafa82a | |||
| d2d14ffb8f | |||
| f966b6a829 | |||
| b837017ba6 | |||
| ee3bb0d14f | |||
| 13716a5228 | |||
| ecd92ae24d | |||
| 836d7a139a | |||
| c67cfeaa87 | |||
| d92955a533 | |||
| b12527cf90 | |||
| 509c5738ff | |||
| 7a8edd3cea | |||
| 737b422552 | |||
| 67428a1aaf | |||
| 384b8780b0 | |||
| c6a53ea8ee | |||
| d3fc2646a7 | |||
| 2b305f378f | |||
| 64acebf3b5 | |||
| f0ddea9313 | |||
| 954f1b98bf | |||
| 641e5cd05a | |||
| 6668e362c1 |
@@ -1,16 +1,17 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2003-10-05
|
||||
WeeChat known bugs, 2003-11-03
|
||||
|
||||
- ./configure does not check that Curses header is installed
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
- too much nicks in the channel (> height of window) => display bug
|
||||
- some IRC commands are marked as 'unknown' when received
|
||||
(IRC protocol is under dev!)
|
||||
- intercept Ctrl-C (do not quit immediately if Ctrl-C pressed!)
|
||||
- program is stopped when bad option in config file (it should not, only display
|
||||
warning)
|
||||
- too much opened channels => display bug
|
||||
- when kicked, channel is not prefixed by '(' and sufixed by ')'
|
||||
- when function key (non used by WeeChat) is pressed, prompt is deleted
|
||||
- when quitting WeeChat term title is not restored (if look_set_title is ON)
|
||||
- command name for /server can not contain spaces
|
||||
- wrong alias is not created and not saved when quitting WeeChat
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2003-10-05
|
||||
ChangeLog - 2003-11-03
|
||||
|
||||
|
||||
Version 0.0.3 (2003-11-03):
|
||||
* ./configure script to build WeeChat
|
||||
* nicks are now correctly sorted (op, halfop, voice, other)
|
||||
* fixed problem with '353' IRC message (nicklist)
|
||||
* fixed problem when nick is truncated by server
|
||||
* fixed crash when entering text without any server connection
|
||||
* fixed crash when /set command is executed
|
||||
* fixed display bug (text was blinking when scrolling)
|
||||
* french translation
|
||||
* new IRC command: /stats, /service, /squit, /motd, /lusers, /links, /time,
|
||||
/trace, /admin, /info, /servlist, /squery, /who, /whowas, /die, /summon,
|
||||
/users, /wallops, /userhost, /ison, /ctcp ping
|
||||
* code cleanup
|
||||
|
||||
Version 0.0.2 (2003-10-05):
|
||||
* added commands /rehash and /restart
|
||||
* command & auto-join channels when connected to server
|
||||
|
||||
@@ -1,6 +1,134 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat FAQ, 2003-09-19
|
||||
WeeChat FAQ, 2003-10-27
|
||||
|
||||
<<< TO DO ! >>>
|
||||
|
||||
1- Compiling
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
|
||||
2- Using WeeChat
|
||||
|
||||
2.1 Why using WeeChat ? Irssi and xchat are so good...
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
2.3 How can I customize key bindings?
|
||||
|
||||
3- Development
|
||||
|
||||
3.1 How should I report bugs?
|
||||
3.2 How should I submit patches?
|
||||
3.3 How should I submit new feature request?
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows?
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 1- Compiling |
|
||||
\------------------------------------------------------------------------------/
|
||||
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
|
||||
Curses GUI is built by default.
|
||||
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
|
||||
--enable-gtk to enable gtk GUI
|
||||
--enable-qt to enable Qt QUI
|
||||
Type ./configure --help to see available options.
|
||||
WARNING: only Curses GUI is ok today. Other GUI are under development!
|
||||
|
||||
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
|
||||
Check that you have latest version of autoconf and automake.
|
||||
WeeChat has been developed with autoconf version 2.56 and automake version 1.7.
|
||||
You should have at least these versions in order to compile WeeChat CVS.
|
||||
If you can't or don't want to install these versions, you can download and
|
||||
install "devel package", a package built almost every day, based on CVS.
|
||||
Note that this package may not correspond exactly to CVS base.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 2- Using WeeChat |
|
||||
\------------------------------------------------------------------------------/
|
||||
|
||||
|
||||
2.1 Why using WeeChat ? Irssi and xchat are so good...
|
||||
|
||||
Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest Irc client" ;)
|
||||
|
||||
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
|
||||
For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
|
||||
2.3 How can I customize key bindings?
|
||||
|
||||
Today you can't do that. This will be available in a future version.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 3- Development |
|
||||
\------------------------------------------------------------------------------/
|
||||
|
||||
|
||||
3.1 How should I report bugs?
|
||||
|
||||
There is 3 ways to report bugs:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your bug at this url:
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. you can mail your problem, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.2 How should I submit patches?
|
||||
|
||||
There is 3 ways to submit patches:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your patch at this url:
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. you can mail your patch, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.3 How should I submit new feature request?
|
||||
|
||||
There is 2 ways to submit your feature request:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can mail your feature request, look at support page for developer's
|
||||
mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
Yes. Future versions will be available for these OS.
|
||||
|
||||
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
|
||||
There's many tasks to do (code, documentation, ...)
|
||||
Please contact us with IRC or mail, look at support page:
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
|
||||
No.
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
WeeChat - Installation instructions
|
||||
===================================
|
||||
|
||||
1) Run 'make'
|
||||
1) Run './configure'
|
||||
options: --disable-curses : do not build Curses interface
|
||||
--enable-gtk : build Gtk+ interface (under development!)
|
||||
--enable-qt : build Qt interface (not developed!)
|
||||
|
||||
2) As root, run 'make install'
|
||||
2) Run 'make'
|
||||
|
||||
3) Enjoy ! :-)
|
||||
3) As root, run 'make install'
|
||||
|
||||
4) Enjoy ! :-)
|
||||
|
||||
See AUTHORS for any support, feel free to contact us for any problem ;)
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
SUBDIRS = po intl src
|
||||
|
||||
EXTRA_DIST = weechat.1 BUGS FAQ
|
||||
|
||||
man_MANS = weechat.1
|
||||
@@ -1,6 +1,10 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2003-11-03
|
||||
|
||||
WeeChat 0.0.3 released.
|
||||
|
||||
* FlashCode, 2003-10-05
|
||||
|
||||
WeeChat 0.0.2 released.
|
||||
|
||||
@@ -10,10 +10,11 @@ It is customizable and extensible with scripts.
|
||||
Features
|
||||
--------
|
||||
* IRC chat client with multi-server connection
|
||||
* many GUI (curses, text, Gtk, QT) (1)
|
||||
* many GUI (curses, Gtk, Qt) (1)
|
||||
* small, fast and very light
|
||||
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
|
||||
* compliant with RFC 1459,2810,2811,2812,2813
|
||||
* developed from scratch (not based on any other IRC client, except for look ;)
|
||||
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
|
||||
* 100% GPL & free
|
||||
|
||||
@@ -45,6 +46,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
---
|
||||
(1) only curses & text interfaces are available today
|
||||
(1) only curses interface is available today
|
||||
(2) plugin interfaces are not yet developed
|
||||
(3) only GNU/Linux version is available today
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2003-10-05
|
||||
TODO - 2003-11-03
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,33 +10,34 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.0.2:
|
||||
v0.0.3:
|
||||
------
|
||||
|
||||
* General:
|
||||
# use of ./configure script for building WeeChat
|
||||
|
||||
* IRC protocol:
|
||||
# "/rehash" command: tell the server to reload its config file
|
||||
# "/restart" command: tell the server to restart itself
|
||||
# implement RFC 2812
|
||||
+ "/mode" command: change the user/channels modes
|
||||
# "/wallops" command: write the same string to all the
|
||||
persons with the flag +w enable
|
||||
|
||||
* WeeChat commands:
|
||||
# "/connect" and "/disconnect" commands (for multiservers use)
|
||||
# "/server" command to add, remove or list servers
|
||||
# "/save" command: save configuration to disk
|
||||
# "/alias" and "/unalias" commands
|
||||
+ "/set" command: allow the user to set the WeeChat variables
|
||||
under WeeChat without editing the config file (colours, time
|
||||
format, etc)
|
||||
|
||||
* Interface:
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
|
||||
* Configuration:
|
||||
# write config file
|
||||
# add alias definition
|
||||
# add an option for each server in order to run commands on join
|
||||
(example: /msg nickserv identify password)
|
||||
# channel list for auto-join (for each server)
|
||||
# do not stop program if problem with options in config file
|
||||
|
||||
|
||||
Future versions:
|
||||
---------------
|
||||
|
||||
* IRC protocol:
|
||||
- implement RFC 2812
|
||||
+ "/mode" command: change the user/channels modes
|
||||
- "/dcc" command (for chat and sending/receiving files)
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
@@ -46,48 +47,41 @@ Future versions:
|
||||
When we come back from our away it should print it to the current window
|
||||
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
|
||||
nick/host connect to the given irc network
|
||||
- "/wallops" command: write the same string to all the
|
||||
persons with the flag +w enable
|
||||
|
||||
* WeeChat commands:
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
- "/completion" command: do shortcuts (for example when we type "u"
|
||||
in the text bar it send it to the server as "you")
|
||||
- "/exec" command: execute a command as if we was in shell
|
||||
and show us the output on the current window. An option to exec
|
||||
like -o could send the output to the server, on the current
|
||||
channel/private
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
+ "/set" command: allow the user to set the WeeChat variables
|
||||
under WeeChat without editing the config file (colours, time
|
||||
format, etc)
|
||||
|
||||
* Interface:
|
||||
+ Gtk GUI
|
||||
- display current channel modes (example : #weechat(+nt))
|
||||
- interpret special chars in messages (color & bold for example)
|
||||
- internationalization (traduce WeeChat in many languages)
|
||||
- many channel windows in one window/term (window split)
|
||||
- add lag indicator
|
||||
- log chats to file
|
||||
- forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
- improve completion (for example complete command parameters when possible)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- add clock (in status bar?)
|
||||
- Gtk GUI
|
||||
- log chats to file
|
||||
? Qt GUI
|
||||
|
||||
* TCP/IP communication:
|
||||
- connect to server with child process (background)
|
||||
- proxy support
|
||||
- SSL support
|
||||
- IPv6 protocol implementation
|
||||
|
||||
* Configuration:
|
||||
- add key bindings to config file
|
||||
- add missing options for config file
|
||||
- wrong alias is not created and not saved when quitting WeeChat
|
||||
- do not stop program if problem with options in config file
|
||||
- load config file after GUI (so init values by default (colors, ...) before
|
||||
loading config)
|
||||
|
||||
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
rm -f config.cache
|
||||
|
||||
### GETTEXT ###
|
||||
|
||||
echo searching for GNU gettext intl directory...
|
||||
|
||||
dirs="/usr/share /usr/local/share /opt/share /usr /usr/local /opt /usr/gnu/share"
|
||||
found=0
|
||||
for try in $dirs; do
|
||||
echo -n " -> $try/gettext/intl... "
|
||||
if test -d $try/gettext/intl; then
|
||||
echo found it
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
echo no
|
||||
done
|
||||
if test "$found" != 1; then
|
||||
echo ERROR: Cannot find gettext/intl directory.
|
||||
echo ERROR: Install GNU gettext in /usr or /usr/local prefix.
|
||||
exit 7
|
||||
fi;
|
||||
|
||||
echo copying gettext intl files...
|
||||
intldir="$try/gettext/intl"
|
||||
if test ! -d intl; then
|
||||
mkdir intl
|
||||
fi
|
||||
olddir=`pwd`
|
||||
cd $intldir
|
||||
for file in *; do
|
||||
if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
|
||||
rm -f $olddir/intl/$file
|
||||
cp $intldir/$file $olddir/intl/
|
||||
fi
|
||||
done
|
||||
cp -f $try/gettext/po/Makefile.in.in $olddir/po/
|
||||
cd $olddir
|
||||
if test -f intl/plural.c; then
|
||||
sleep 2
|
||||
touch intl/plural.c
|
||||
fi
|
||||
|
||||
### END GETTEXT ###
|
||||
|
||||
echo "running aclocal..."
|
||||
aclocal -I /usr/share/aclocal
|
||||
echo "running autoconf..."
|
||||
autoconf
|
||||
echo "running autoheader..."
|
||||
autoheader
|
||||
echo "running automake..."
|
||||
automake -a
|
||||
echo "autogen.sh ok, now run ./configure script"
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.56)
|
||||
AC_INIT(WeeChat, 0.0.3, flashcode@flashtux.org)
|
||||
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([weechat], [0.0.3])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
|
||||
# Gettext
|
||||
ALL_LINGUAS="fr"
|
||||
AM_GNU_GETTEXT
|
||||
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([curses], [initscr], LIBCURSES_FOUND=1, LIBCURSES_FOUND=0)
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
|
||||
|
||||
AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (default=auto)],,enable_curses=yes)
|
||||
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
|
||||
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
|
||||
|
||||
enable_plugins=no
|
||||
enable_perl=no
|
||||
PERL_CFLAGS=
|
||||
enable_python=no
|
||||
PYTHON_CFLAGS=
|
||||
enable_ruby=no
|
||||
RUBY_CFLAGS=
|
||||
enable_debug=no
|
||||
DEBUG_CFLAGS=
|
||||
|
||||
AM_CONDITIONAL(GUI_CURSES, test "$enable_curses" = "yes")
|
||||
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
|
||||
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
|
||||
|
||||
if test "x$enable_curses" = "xyes" ; then
|
||||
if test "$LIBCURSES_FOUND" = "0" ; then
|
||||
AC_MSG_ERROR([Curses library not found! Install Curses library or run ./configure with --disable-curses parameter.])
|
||||
fi
|
||||
CURSES_LIBS=-lcurses
|
||||
AC_SUBST(CURSES_LIBS)
|
||||
fi
|
||||
|
||||
if test "x$enable_gtk" = "xyes" ; then
|
||||
#if test "$LIBGTK_FOUND" = "0" ; then
|
||||
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library or run ./configure without --enable-gtk parameter.])
|
||||
#fi
|
||||
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
|
||||
GTK_LIBS=`pkg-config --libs gtk+-2.0`
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
fi
|
||||
|
||||
CFLAGS="-Wall -W -pipe -O2"
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/irc/Makefile
|
||||
src/gui/Makefile
|
||||
src/gui/curses/Makefile
|
||||
src/gui/gtk/Makefile
|
||||
src/gui/qt/Makefile
|
||||
intl/Makefile
|
||||
po/Makefile.in])
|
||||
|
||||
echo
|
||||
echo $PACKAGE $VERSION
|
||||
|
||||
listgui=
|
||||
if test "x$enable_curses" = "xyes" ; then
|
||||
listgui="$listgui Curses"
|
||||
fi
|
||||
if test "x$enable_gtk" = "xyes" ; then
|
||||
listgui="$listgui Gtk+"
|
||||
fi
|
||||
if test "x$enable_qt" = "xyes" ; then
|
||||
listgui="$listgui Qt"
|
||||
fi
|
||||
|
||||
if test "x$listgui" = "x" ; then
|
||||
AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.])
|
||||
fi
|
||||
|
||||
echo
|
||||
echo Interfaces.................... :$listgui
|
||||
echo
|
||||
echo Build with Plugin support..... : $enable_plugins
|
||||
echo Build with Perl support....... : $enable_perl
|
||||
echo Build with Python support..... : $enable_python
|
||||
echo Build with Ruby support....... : $enable_ruby
|
||||
echo
|
||||
echo Print debugging messages...... : $enable_debug
|
||||
echo
|
||||
eval eval echo WeeChat will be installed in $bindir.
|
||||
echo
|
||||
echo configure complete, now type \'make\' to build WeeChat
|
||||
echo
|
||||
Vendored
+6
@@ -1,3 +1,9 @@
|
||||
weechat (0.0.3-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.3, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Mon, 03 Nov 2003 23:15:00 +0200
|
||||
|
||||
weechat (0.0.2-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.2, see ChangeLog for detail.
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
4
|
||||
Vendored
+27
-3
@@ -2,13 +2,37 @@ Source: weechat
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: FlashCode <flashcode@flashtux.org>
|
||||
Build-Depends: debhelper (>> 4.0.0)
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7)
|
||||
Standards-Version: 3.5.8
|
||||
|
||||
Package: weechat
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Architecture: all
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-curses
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-gtk
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-common
|
||||
Architecture: all
|
||||
Replaces: weechat
|
||||
Recommends: weechat-curses | weechat-gtk
|
||||
Description: Common files for WeeChat
|
||||
Documentation, examples, and locale files for WeeChat - fast, light and
|
||||
extensible IRC client. It is useless without weechat-curses or weechat-gtk.
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
This package was debianized by FlashCode <flashcode@flashtux.org> on
|
||||
Sun, 05 Oct 2003 12:00:00 +0200.
|
||||
Mon, 03 Nov 2003 23:15:00 +0200.
|
||||
|
||||
It was downloaded from http://weechat.flashtux.org/download
|
||||
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
weechat_0.0.2-1_i386.deb net optional
|
||||
Vendored
+29
-46
@@ -3,12 +3,7 @@
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
|
||||
|
||||
|
||||
CFLAGS = -Wall -g
|
||||
export DH_VERBOSE=1
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
@@ -22,8 +17,7 @@ endif
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
# Add here commands to configure the package.
|
||||
|
||||
./configure --prefix=/usr --sysconfdir=/etc --enable-gtk
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
@@ -31,21 +25,14 @@ build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
$(MAKE)
|
||||
#/usr/bin/docbook-to-man debian/weechat.sgml > weechat.1
|
||||
|
||||
touch build-stamp
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
-$(MAKE) clean
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
@@ -53,45 +40,41 @@ install: build
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/weechat.
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# We have nothing to do by default.
|
||||
dh_testdir -pweechat-common
|
||||
dh_testroot -pweechat-common
|
||||
dh_installchangelogs -pweechat-common
|
||||
dh_installdocs -pweechat-common
|
||||
dh_installexamples -pweechat-common
|
||||
dh_installman weechat.1 -pweechat-common
|
||||
dh_compress -pweechat-common
|
||||
dh_fixperms -pweechat-common
|
||||
dh_installdeb -pweechat-common
|
||||
dh_shlibdeps -pweechat-common
|
||||
dh_gencontrol -pweechat-common
|
||||
dh_md5sums -pweechat-common
|
||||
dh_builddeb -pweechat-common
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
# dh_install
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman weechat.1
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_python
|
||||
# dh_makeshlibs
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
dh_testdir -a
|
||||
dh_testroot -a
|
||||
dh_link -a
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
dh_fixperms -a
|
||||
dh_installdeb -a
|
||||
dh_shlibdeps -a
|
||||
dh_gencontrol -a
|
||||
dh_md5sums -a
|
||||
dh_builddeb -a
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
usr/bin/weechat-curses
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
usr/bin/weechat-gtk
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
shlibs:Depends=libc6 (>= 2.3.2-1), libncurses5 (>= 5.3.20030510-1)
|
||||
@@ -0,0 +1,7 @@
|
||||
DOMAIN = $(PACKAGE)
|
||||
subdir = po
|
||||
top_builddir = ..
|
||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
|
||||
COPYRIGHT_HOLDER =
|
||||
EXTRA_LOCALE_CATEGORIES =
|
||||
MSGID_BUGS_ADDRESS = flashcode@flashtux.org
|
||||
@@ -0,0 +1,24 @@
|
||||
./src/irc/irc-nick.c
|
||||
./src/irc/irc-server.c
|
||||
./src/irc/irc-channel.c
|
||||
./src/irc/irc-commands.c
|
||||
./src/irc/irc-display.c
|
||||
./src/irc/irc-send.c
|
||||
./src/irc/irc-recv.c
|
||||
./src/gui/curses/gui-input.c
|
||||
./src/gui/curses/gui-display.c
|
||||
./src/gui/gtk/gui-display.c
|
||||
./src/gui/gtk/gui-input.c
|
||||
./src/gui/gui-common.c
|
||||
./src/common/command.c
|
||||
./src/common/completion.c
|
||||
./src/common/history.c
|
||||
./src/common/weechat.c
|
||||
./src/common/weeconfig.c
|
||||
./src/irc/irc.h
|
||||
./src/gui/gui.h
|
||||
./src/common/command.h
|
||||
./src/common/completion.h
|
||||
./src/common/history.h
|
||||
./src/common/weechat.h
|
||||
./src/common/weeconfig.h
|
||||
@@ -0,0 +1,19 @@
|
||||
# Sed script that remove the POT-Creation-Date line in the header entry
|
||||
# from a POT file.
|
||||
#
|
||||
# The distinction between the first and the following occurrences of the
|
||||
# pattern is achieved by looking at the hold space.
|
||||
/^"POT-Creation-Date: .*"$/{
|
||||
x
|
||||
# Test if the hold space is empty.
|
||||
s/P/P/
|
||||
ta
|
||||
# Yes it was empty. First occurrence. Remove the line.
|
||||
g
|
||||
d
|
||||
bb
|
||||
:a
|
||||
# The hold space was nonempty. Following occurrences. Do nothing.
|
||||
x
|
||||
:b
|
||||
}
|
||||
+2557
File diff suppressed because it is too large
Load Diff
@@ -1,91 +0,0 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
|
||||
OPTIONS=-Wall -W -pipe -O2
|
||||
|
||||
OUTPUT=weechat
|
||||
|
||||
OBJS=weechat.o config.o command.o completion.o history.o
|
||||
OBJS_IRC=irc/irc.a
|
||||
OBJS_GUI=gui/gui.a
|
||||
|
||||
|
||||
# WeeChat with Curses interface
|
||||
ifeq ($(GUI), curses)
|
||||
LIBS_CURSES=-lcurses
|
||||
DEFINES=WEE_CURSES
|
||||
|
||||
curses: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_CURSES)
|
||||
endif
|
||||
|
||||
# WeeChat with Gtk+ interface
|
||||
ifeq ($(GUI), gtk)
|
||||
OBJS_GTK=gui-gtk.o
|
||||
LIBS_GTK=
|
||||
DEFINES=WEE_GTK
|
||||
gtk: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_GTK)
|
||||
endif
|
||||
|
||||
# WeeChat with Qt interface
|
||||
ifeq ($(GUI), qt)
|
||||
OBJS_QT=gui-qt.o
|
||||
LIBS_QT=
|
||||
DEFINES=WEE_QT
|
||||
qt: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_QT)
|
||||
endif
|
||||
|
||||
# WeeChat with Text interface
|
||||
ifeq ($(GUI), text)
|
||||
OBJS_TEXT=gui-text.o
|
||||
LIBS_TEXT=
|
||||
DEFINES=WEE_TEXT
|
||||
text: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_TEXT)
|
||||
endif
|
||||
|
||||
|
||||
all:
|
||||
make curses GUI=curses
|
||||
|
||||
$(OBJS):
|
||||
$(CC) $(OPTIONS) -o $@ -c $< $(INCLUDES) -D$(DEFINES)
|
||||
|
||||
irc/irc.a:
|
||||
cd irc && make
|
||||
|
||||
gui/gui.a:
|
||||
cd gui && make $(GUI) GUI=$(GUI)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core $(OUTPUT)
|
||||
cd irc && make clean
|
||||
cd gui && make clean
|
||||
|
||||
command.o: command.c weechat.h command.h irc/irc.h gui/gui.h completion.h \
|
||||
history.h config.h
|
||||
completion.o: completion.c weechat.h completion.h irc/irc.h gui/gui.h \
|
||||
history.h command.h
|
||||
config.o: config.c weechat.h config.h command.h irc/irc.h gui/gui.h \
|
||||
completion.h history.h
|
||||
history.o: history.c weechat.h history.h gui/gui.h completion.h
|
||||
weechat.o: weechat.c weechat.h config.h command.h irc/irc.h gui/gui.h \
|
||||
completion.h history.h
|
||||
@@ -0,0 +1,18 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
SUBDIRS = common irc gui
|
||||
@@ -15,23 +15,17 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
OPTIONS=-Wall -W -pipe -O2
|
||||
noinst_LIBRARIES = lib_weechat_main.a
|
||||
|
||||
OUTPUT=../gui.a
|
||||
OBJS=gui-display.o gui-input.o
|
||||
DEFINES=WEE_GTK
|
||||
|
||||
all: $(OBJS)
|
||||
ar r $(OUTPUT) $(OBJS)
|
||||
|
||||
$(OBJS):
|
||||
$(CC) $(OPTIONS) -o $@ -c $< $(INCLUDES) -D$(DEFINES)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core
|
||||
|
||||
gui-display.o: gui-display.c ../../weechat.h ../gui.h ../../config.h \
|
||||
../../irc/irc.h ../../gui/gui.h
|
||||
gui-input.o: gui-input.c ../../weechat.h ../gui.h
|
||||
lib_weechat_main_a_SOURCES = weechat.c \
|
||||
weechat.h \
|
||||
command.c \
|
||||
command.h \
|
||||
completion.c \
|
||||
completion.h \
|
||||
weeconfig.c \
|
||||
weeconfig.h \
|
||||
history.c \
|
||||
history.h
|
||||
@@ -19,18 +19,21 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* command.c: WeeChat internal commands */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "command.h"
|
||||
#include "config.h"
|
||||
#include "irc/irc.h"
|
||||
#include "gui/gui.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
/* WeeChat internal commands */
|
||||
@@ -38,8 +41,8 @@
|
||||
t_weechat_command weechat_commands[] =
|
||||
{ { "alias", N_("create an alias for a command"),
|
||||
N_("[alias_name [command [arguments]]"),
|
||||
N_("alias_name: name of alias\ncommand: command name (" WEECHAT_NAME
|
||||
" or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
N_("alias_name: name of alias\ncommand: command name (WeeChat "
|
||||
"or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_alias },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
@@ -54,7 +57,7 @@ t_weechat_command weechat_commands[] =
|
||||
N_("servername: server name to disconnect"),
|
||||
1, 1, weechat_cmd_disconnect, NULL },
|
||||
{ "help", N_("display help about commands"),
|
||||
N_("[command]"), N_("command: name of a " WEECHAT_NAME " or IRC command"),
|
||||
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
|
||||
0, 1, weechat_cmd_help, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[list] | "
|
||||
@@ -526,18 +529,18 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
if (weechat_commands[i].min_arg ==
|
||||
weechat_commands[i].max_arg)
|
||||
gui_printf (NULL,
|
||||
_("%s wrong argument count for %s command '%s' "
|
||||
_("%s wrong argument count for %s command \"%s\" "
|
||||
"(expected: %d arg%s)\n"),
|
||||
WEECHAT_ERROR, WEECHAT_NAME,
|
||||
WEECHAT_ERROR, PACKAGE_NAME,
|
||||
command + 1,
|
||||
weechat_commands[i].max_arg,
|
||||
(weechat_commands[i].max_arg >
|
||||
1) ? "s" : "");
|
||||
else
|
||||
gui_printf (NULL,
|
||||
_("%s wrong argument count for %s command '%s' "
|
||||
_("%s wrong argument count for %s command \"%s\" "
|
||||
"(expected: between %d and %d arg%s)\n"),
|
||||
WEECHAT_ERROR, WEECHAT_NAME,
|
||||
WEECHAT_ERROR, PACKAGE_NAME,
|
||||
command + 1,
|
||||
weechat_commands[i].min_arg,
|
||||
weechat_commands[i].max_arg,
|
||||
@@ -555,7 +558,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
if (return_code < 0)
|
||||
gui_printf (NULL,
|
||||
_("%s %s command \"%s\" failed\n"),
|
||||
WEECHAT_ERROR, WEECHAT_NAME, command + 1);
|
||||
WEECHAT_ERROR, PACKAGE_NAME, command + 1);
|
||||
}
|
||||
if (argv)
|
||||
{
|
||||
@@ -578,7 +581,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
if (irc_commands[i].min_arg == irc_commands[i].max_arg)
|
||||
gui_printf
|
||||
(NULL,
|
||||
_("%s wrong argument count for IRC command '%s' "
|
||||
_("%s wrong argument count for IRC command \"%s\" "
|
||||
"(expected: %d arg%s)\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1,
|
||||
@@ -587,7 +590,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
else
|
||||
gui_printf
|
||||
(NULL,
|
||||
_("%s wrong argument count for IRC command '%s' "
|
||||
_("%s wrong argument count for IRC command \"%s\" "
|
||||
"(expected: between %d and %d arg%s)\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1,
|
||||
@@ -600,7 +603,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
((!server) || (!server->is_connected)))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s command '%s' needs a server connection!\n"),
|
||||
_("%s command \"%s\" needs a server connection!\n"),
|
||||
WEECHAT_ERROR, irc_commands[i].command_name);
|
||||
return 0;
|
||||
}
|
||||
@@ -653,7 +656,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
}
|
||||
}
|
||||
gui_printf (NULL,
|
||||
_("%s unknown command '%s' (type /help for help)\n"),
|
||||
_("%s unknown command \"%s\" (type /help for help)\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1);
|
||||
if (argv)
|
||||
@@ -675,7 +678,7 @@ user_command (t_irc_server *server, char *command)
|
||||
{
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
if ((!command) || (command[0] == '\r') || (command[0] == '\n'))
|
||||
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
|
||||
return;
|
||||
if ((command[0] == '/') && (command[1] != '/'))
|
||||
{
|
||||
@@ -686,7 +689,7 @@ user_command (t_irc_server *server, char *command)
|
||||
{
|
||||
if ((command[0] == '/') && (command[1] == '/'))
|
||||
command++;
|
||||
if (!WIN_IS_SERVER(gui_current_window))
|
||||
if (server && (!WIN_IS_SERVER(gui_current_window)))
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
@@ -725,7 +728,8 @@ user_command (t_irc_server *server, char *command)
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_printf (server->window, _("This window is not a channel!\n"));
|
||||
gui_printf ((server) ? server->window : NULL,
|
||||
_("This window is not a channel!\n"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -905,7 +909,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
if (argc == 0)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("> List of %s internal commands:\n"), WEECHAT_NAME);
|
||||
_("> List of %s internal commands:\n"), PACKAGE_NAME);
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
gui_printf (NULL, " %s - %s\n",
|
||||
weechat_commands[i].command_name,
|
||||
@@ -925,8 +929,8 @@ weechat_cmd_help (int argc, char **argv)
|
||||
{
|
||||
gui_printf
|
||||
(NULL,
|
||||
_("> Help on %s internal command '%s':\n"),
|
||||
WEECHAT_NAME, weechat_commands[i].command_name);
|
||||
_("> Help on %s internal command \"%s\":\n"),
|
||||
PACKAGE_NAME, weechat_commands[i].command_name);
|
||||
gui_printf (NULL,
|
||||
_("Syntax: /%s %s\n"),
|
||||
weechat_commands[i].command_name,
|
||||
@@ -947,7 +951,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
if (strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("> Help on IRC command '%s':\n"),
|
||||
_("> Help on IRC command \"%s\":\n"),
|
||||
irc_commands[i].command_name);
|
||||
gui_printf (NULL, _("Syntax: /%s %s\n"),
|
||||
irc_commands[i].command_name,
|
||||
@@ -1298,7 +1302,7 @@ weechat_cmd_set (int argc, char **argv)
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
section_displayed = 0;
|
||||
if (i != CONFIG_SECTION_SERVER)
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1354,7 +1358,7 @@ weechat_cmd_set (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_printf (NULL, "(TODO) \"/set\" command not developed!\n");
|
||||
gui_printf (NULL, "(TODO) \"/set\" command not fully developed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#ifndef __WEECHAT_COMMAND_H
|
||||
#define __WEECHAT_COMMAND_H 1
|
||||
|
||||
#include "irc/irc.h"
|
||||
#include "../irc/irc.h"
|
||||
|
||||
#define MAX_ARGS 8192
|
||||
|
||||
@@ -19,16 +19,19 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* completion.c: completes words according to context (cmd/nick) */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "completion.h"
|
||||
#include "irc/irc.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "command.h"
|
||||
|
||||
|
||||
@@ -43,6 +46,17 @@ completion_init (t_completion *completion)
|
||||
completion->base_word = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_free: free completion
|
||||
*/
|
||||
|
||||
void
|
||||
completion_free (t_completion *completion)
|
||||
{
|
||||
if (completion->base_word)
|
||||
free (completion->base_word);
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_command: complete a command
|
||||
*/
|
||||
@@ -36,6 +36,7 @@ struct t_completion
|
||||
};
|
||||
|
||||
extern void completion_init (t_completion *);
|
||||
extern void completion_free (t_completion *);
|
||||
extern void completion_search (t_completion *, void *, char *, int, int);
|
||||
|
||||
#endif /* completion.h */
|
||||
@@ -19,16 +19,19 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* history.c: memorize and call again commands or text */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "history.h"
|
||||
#include "gui/gui.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
t_history *history_general = NULL;
|
||||
@@ -36,10 +36,13 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* weechat.c: core functions for WeeChat */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -49,10 +52,10 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "config.h"
|
||||
#include "weeconfig.h"
|
||||
#include "command.h"
|
||||
#include "irc/irc.h"
|
||||
#include "gui/gui.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
/* char *display_name; */
|
||||
@@ -128,7 +131,7 @@ wee_parse_args (int argc, char *argv[])
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (WEECHAT_VERSION "\n");
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
exit (0);
|
||||
}
|
||||
else
|
||||
@@ -227,9 +230,14 @@ main (int argc, char *argv[])
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, "/usr/share/locale");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
#endif
|
||||
|
||||
/* pre-initiliaze interface */
|
||||
gui_pre_init (&argc, &argv);
|
||||
|
||||
/* initialize variables */
|
||||
wee_init_vars ();
|
||||
@@ -277,14 +285,14 @@ main (int argc, char *argv[])
|
||||
{
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT, _("%sWelcome to "),
|
||||
(cfg_look_startup_logo) ? " " : "");
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2, WEECHAT_NAME);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2, PACKAGE_NAME);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT,
|
||||
", %s\n", cfg_look_weechat_slogan);
|
||||
}
|
||||
if (cfg_look_startup_version)
|
||||
{
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2,
|
||||
"%s" WEECHAT_NAME_AND_VERSION,
|
||||
"%s" PACKAGE_STRING,
|
||||
(cfg_look_startup_logo) ? " " : "");
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT,
|
||||
", %s %s %s\n",
|
||||
@@ -23,23 +23,33 @@
|
||||
#ifndef __WEECHAT_H
|
||||
#define __WEECHAT_H 1
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
|
||||
#define PACKAGE "weechat"
|
||||
#define _(string) gettext(string)
|
||||
#define N_(string) (string)
|
||||
#if defined(ENABLE_NLS) && !defined(_)
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#define _(x) gettext(x)
|
||||
#ifdef gettext_noop
|
||||
#define N_(string) gettext_noop (string)
|
||||
#else
|
||||
#define N_(string) (string)
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(_)
|
||||
#define _(x) (x)
|
||||
#define N_(string) (string)
|
||||
#endif
|
||||
|
||||
#define WEECHAT_NAME "WeeChat"
|
||||
#define WEECHAT_VERSION "0.0.2"
|
||||
|
||||
#define WEECHAT_NAME_AND_VERSION WEECHAT_NAME " " WEECHAT_VERSION
|
||||
#define WEECHAT_COPYRIGHT WEECHAT_NAME " (c) 2003 by Wee Team"
|
||||
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2003 by Wee Team"
|
||||
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
|
||||
|
||||
#define WEECHAT_ERROR _(WEECHAT_NAME " Error:")
|
||||
#define WEECHAT_WARNING _(WEECHAT_NAME " Warning:")
|
||||
#define WEECHAT_ERROR _(PACKAGE_NAME " Error:")
|
||||
#define WEECHAT_WARNING _(PACKAGE_NAME " Warning:")
|
||||
|
||||
/* debug mode, 0=normal use, 1=some debug msg, 2=full debug (developers only) */
|
||||
#define DEBUG 0
|
||||
@@ -51,7 +61,7 @@
|
||||
/* license */
|
||||
|
||||
#define WEE_LICENSE \
|
||||
WEECHAT_NAME_AND_VERSION " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
|
||||
PACKAGE_STRING " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
|
||||
"Developed by FlashCode <flashcode@flashtux.org>\n" \
|
||||
" Bounga <bounga@altern.org>\n" \
|
||||
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
|
||||
@@ -71,7 +81,7 @@
|
||||
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
|
||||
|
||||
#define WEE_USAGE \
|
||||
WEECHAT_NAME_AND_VERSION " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
|
||||
PACKAGE_STRING " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
|
||||
"Developed by FlashCode <flashcode@flashtux.org>\n" \
|
||||
" Bounga <bounga@altern.org>\n" \
|
||||
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
|
||||
@@ -19,10 +19,13 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* config.c: WeeChat configuration */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -30,10 +33,10 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "config.h"
|
||||
#include "weeconfig.h"
|
||||
#include "command.h"
|
||||
#include "irc/irc.h"
|
||||
#include "gui/gui.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
/* config sections */
|
||||
@@ -353,12 +356,12 @@ t_config_option weechat_options_log[] =
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"~", NULL, NULL, &cfg_log_timestamp, NULL },
|
||||
{ "log_start_string", N_("start string for log files"),
|
||||
N_("text writed when starting new log file "
|
||||
N_("text written when starting new log file "
|
||||
"(see man strftime for date/time specifiers)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"--- Log started %a %b %d %Y %H:%M:%s", NULL, NULL, &cfg_log_start_string, NULL },
|
||||
{ "log_end_string", N_("end string for log files"),
|
||||
N_("text writed when ending log file "
|
||||
N_("text written when ending log file "
|
||||
"(see man strftime for date/time specifiers)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"--- Log ended %a %b %d %Y %H:%M:%s", NULL, NULL, &cfg_log_end_string, NULL },
|
||||
@@ -406,7 +409,7 @@ t_config_option weechat_options_dcc[] =
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_dcc_auto_rename, NULL, NULL },
|
||||
{ "dcc_auto_resume", N_("automatically resume aborted transfers"),
|
||||
N_("automatically resume dcc trsnafer if connection with remote host is loosed"),
|
||||
N_("automatically resume dcc transfer if connection with remote host is loosed"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_dcc_auto_resume, NULL, NULL },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
@@ -525,6 +528,80 @@ get_pos_array_values (char **array, char *string)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_set_value: set new value for an option
|
||||
* return: 0 if success
|
||||
* -1 if error (bad value)
|
||||
*/
|
||||
|
||||
int
|
||||
config_option_set_value (t_config_option *option, char *value)
|
||||
{
|
||||
int int_value;
|
||||
|
||||
switch (option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (strcasecmp (value, "on") == 0)
|
||||
*(option->ptr_int) = BOOL_TRUE;
|
||||
else if (strcasecmp (value, "off") == 0)
|
||||
*(option->ptr_int) = BOOL_FALSE;
|
||||
else
|
||||
return -1;
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
int_value = atoi (value);
|
||||
if ((int_value < option->min) || (int_value > option->max))
|
||||
return -1;
|
||||
*(option->ptr_int) = int_value;
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
int_value = get_pos_array_values (option->array_values, value);
|
||||
if (int_value < 0)
|
||||
return -1;
|
||||
*(option->ptr_int) = int_value;
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
if (!gui_assign_color (option->ptr_int, value))
|
||||
return -1;
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
if (*(option->ptr_string))
|
||||
free (*(option->ptr_string));
|
||||
*(option->ptr_string) = strdup (value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* config_set_value: set new value for an option (found by name)
|
||||
* return: 0 if success
|
||||
* -1 if bad value for option
|
||||
* -2 if option is not found
|
||||
*/
|
||||
|
||||
int
|
||||
config_set_value (char *option_name, char *value)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
/* if option found, assign value and exit */
|
||||
if (strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
|
||||
return config_option_set_value (&weechat_options[i][j], value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* option not found */
|
||||
return -2;
|
||||
}
|
||||
|
||||
/*
|
||||
* config_allocate_server: allocate a new server
|
||||
*/
|
||||
@@ -639,7 +716,7 @@ config_read ()
|
||||
{
|
||||
char *filename;
|
||||
FILE *file;
|
||||
int section, line_number, i, option_number, int_value;
|
||||
int section, line_number, i, option_number;
|
||||
int server_found;
|
||||
char line[1024], *ptr_line, *pos, *pos2;
|
||||
|
||||
@@ -679,58 +756,44 @@ config_read ()
|
||||
{
|
||||
pos = strchr (line, ']');
|
||||
if (pos == NULL)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid syntax, missing \"]\"\n"),
|
||||
WEECHAT_WARNING, filename, line_number);
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
pos[0] = '\0';
|
||||
pos = ptr_line + 1;
|
||||
section = CONFIG_SECTION_NONE;
|
||||
for (i = 0; config_sections[i].section_name; i++)
|
||||
else
|
||||
{
|
||||
if (strcmp (config_sections[i].section_name, pos) == 0)
|
||||
pos[0] = '\0';
|
||||
pos = ptr_line + 1;
|
||||
section = CONFIG_SECTION_NONE;
|
||||
for (i = 0; config_sections[i].section_name; i++)
|
||||
{
|
||||
section = i;
|
||||
break;
|
||||
if (strcmp (config_sections[i].section_name, pos) == 0)
|
||||
{
|
||||
section = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (section == CONFIG_SECTION_NONE)
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: unknown section identifier (\"%s\")\n"),
|
||||
WEECHAT_WARNING, filename, line_number, pos);
|
||||
else
|
||||
{
|
||||
if (server_found)
|
||||
{
|
||||
/* if server already started => create it */
|
||||
config_allocate_server (filename, line_number);
|
||||
}
|
||||
server_found = (section == CONFIG_SECTION_SERVER) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
if (section == CONFIG_SECTION_NONE)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: unknown section identifier (\"%s\")\n"),
|
||||
WEECHAT_WARNING, filename, line_number, pos);
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
if (server_found)
|
||||
{
|
||||
/* if server already started => create it */
|
||||
if (!config_allocate_server (filename, line_number))
|
||||
{
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
server_found = (section == CONFIG_SECTION_SERVER) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = strchr (line, '=');
|
||||
if (pos == NULL)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid syntax, missing \"=\"\n"),
|
||||
WEECHAT_WARNING, filename, line_number);
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
pos[0] = '\0';
|
||||
@@ -762,113 +825,62 @@ config_read ()
|
||||
}
|
||||
}
|
||||
if (option_number < 0)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid option \"%s\"\n"),
|
||||
WEECHAT_WARNING, filename, line_number, ptr_line);
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
switch (weechat_options[section]
|
||||
[option_number].option_type)
|
||||
else
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (strcasecmp (pos, "on") == 0)
|
||||
*weechat_options[section]
|
||||
[option_number].ptr_int = BOOL_TRUE;
|
||||
else if (strcasecmp (pos, "off") == 0)
|
||||
*weechat_options[section]
|
||||
[option_number].ptr_int = BOOL_FALSE;
|
||||
else
|
||||
if (config_option_set_value (&weechat_options[section][option_number], pos) < 0)
|
||||
{
|
||||
switch (weechat_options[section]
|
||||
[option_number].option_type)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for"
|
||||
"option '%s'\n"
|
||||
"Expected: boolean value: "
|
||||
"'off' or 'on'\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line);
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for"
|
||||
"option '%s'\n"
|
||||
"Expected: boolean value: "
|
||||
"'off' or 'on'\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line);
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for "
|
||||
"option '%s'\n"
|
||||
"Expected: integer between %d "
|
||||
"and %d\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line,
|
||||
weechat_options[section][option_number].min,
|
||||
weechat_options[section][option_number].max);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for "
|
||||
"option '%s'\n"
|
||||
"Expected: one of these strings: "),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line);
|
||||
i = 0;
|
||||
while (weechat_options[section][option_number].array_values[i])
|
||||
{
|
||||
gui_printf (NULL, "\"%s\" ",
|
||||
weechat_options[section][option_number].array_values[i]);
|
||||
i++;
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid color "
|
||||
"name for option '%s'\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number,
|
||||
ptr_line);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
int_value = atoi (pos);
|
||||
if ((int_value <
|
||||
weechat_options[section]
|
||||
[option_number].min)
|
||||
|| (int_value >
|
||||
weechat_options[section]
|
||||
[option_number].max))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for"
|
||||
"option '%s'\n"
|
||||
"Expected: integer between %d "
|
||||
"and %d\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line,
|
||||
weechat_options[section][option_number].min,
|
||||
weechat_options[section][option_number].max);
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
*weechat_options[section][option_number].ptr_int =
|
||||
int_value;
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
int_value = get_pos_array_values (
|
||||
weechat_options[section][option_number].array_values,
|
||||
pos);
|
||||
if (int_value < 0)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for"
|
||||
"option '%s'\n"
|
||||
"Expected: one of these strings: "),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line);
|
||||
i = 0;
|
||||
while (weechat_options[section][option_number].array_values[i])
|
||||
{
|
||||
gui_printf (NULL, "\"%s\" ",
|
||||
weechat_options[section][option_number].array_values[i]);
|
||||
i++;
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
*weechat_options[section][option_number].ptr_int =
|
||||
int_value;
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
if (!gui_assign_color (
|
||||
weechat_options[section][option_number].ptr_int,
|
||||
pos))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid color "
|
||||
"name for option '%s'\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number,
|
||||
ptr_line);
|
||||
fclose (file);
|
||||
free (filename);
|
||||
return -2;
|
||||
}
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
if (*weechat_options[section]
|
||||
[option_number].ptr_string)
|
||||
free (*weechat_options[section][option_number].ptr_string);
|
||||
*weechat_options[section][option_number].ptr_string =
|
||||
strdup (pos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -935,13 +947,13 @@ config_create_default ()
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf (_("%s: creating default config file...\n"), WEECHAT_NAME);
|
||||
printf (_("%s: creating default config file...\n"), PACKAGE_NAME);
|
||||
log_printf (_("creating default config file\n"));
|
||||
|
||||
current_time = time (NULL);
|
||||
sprintf (line, _("#\n# %s configuration file, created by "
|
||||
"%s v%s on %s#\n"),
|
||||
WEECHAT_NAME, WEECHAT_NAME, WEECHAT_VERSION,
|
||||
PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION,
|
||||
ctime (¤t_time));
|
||||
fputs (line, file);
|
||||
|
||||
@@ -1074,7 +1086,7 @@ config_write (char *config_name)
|
||||
current_time = time (NULL);
|
||||
sprintf (line, _("#\n# %s configuration file, created by "
|
||||
"%s v%s on %s#\n"),
|
||||
WEECHAT_NAME, WEECHAT_NAME, WEECHAT_VERSION,
|
||||
PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION,
|
||||
ctime (¤t_time));
|
||||
fputs (line, file);
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
# WeeChat with Curses interface
|
||||
ifeq ($(GUI), curses)
|
||||
curses: curses/gui.a
|
||||
curses/gui.a:
|
||||
cd curses && make
|
||||
endif
|
||||
|
||||
# WeeChat with Gtk+ interface
|
||||
ifeq ($(GUI), gtk)
|
||||
gtk: gtk/gui.a
|
||||
gtk/gui.a:
|
||||
cd gtk && make
|
||||
endif
|
||||
|
||||
# WeeChat with Qt interface
|
||||
ifeq ($(GUI), qt)
|
||||
qt: qt/gui.a
|
||||
qt/gui.a:
|
||||
cd qt && make
|
||||
endif
|
||||
|
||||
# WeeChat with Text interface
|
||||
ifeq ($(GUI), text)
|
||||
text: text/gui.a
|
||||
text/gui.a:
|
||||
cd text && make
|
||||
endif
|
||||
|
||||
|
||||
all:
|
||||
make curses GUI=curses
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core
|
||||
cd curses && make clean
|
||||
cd gtk && make clean
|
||||
cd qt && make clean
|
||||
cd text && make clean
|
||||
@@ -15,17 +15,16 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
OUTPUT=weechat
|
||||
if GUI_CURSES
|
||||
curses_dir=curses
|
||||
endif
|
||||
|
||||
all:
|
||||
cd src && make
|
||||
if GUI_GTK
|
||||
gtk_dir=gtk
|
||||
endif
|
||||
|
||||
install:
|
||||
@mkdir -v -p $(DESTDIR)/usr/$(LOCALRPM)/bin
|
||||
@cp -v src/$(OUTPUT) $(DESTDIR)/usr/$(LOCALRPM)/bin/
|
||||
@mkdir -v -p $(DESTDIR)/usr/share/man/man1
|
||||
@cp -v weechat.1 $(DESTDIR)/usr/share/man/man1/
|
||||
@echo -e "\n=== WeeChat installed!\n"
|
||||
if GUI_QT
|
||||
qt_dir=qt
|
||||
endif
|
||||
|
||||
clean:
|
||||
cd src && make clean
|
||||
SUBDIRS = $(curses_dir) $(gtk_dir) $(qt_dir)
|
||||
@@ -1,38 +0,0 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
|
||||
OPTIONS=-Wall -W -pipe -O2
|
||||
|
||||
OUTPUT=../gui.a
|
||||
OBJS=gui-display.o gui-input.o
|
||||
DEFINES=WEE_CURSES
|
||||
|
||||
all: $(OBJS)
|
||||
ar r $(OUTPUT) $(OBJS)
|
||||
|
||||
$(OBJS):
|
||||
$(CC) $(OPTIONS) -o $@ -c $< $(INCLUDES) -D$(DEFINES)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core
|
||||
|
||||
gui-display.o: gui-display.c ../../weechat.h ../gui.h ../../completion.h \
|
||||
../../history.h ../../config.h ../../irc/irc.h ../../gui/gui.h
|
||||
gui-input.o: gui-input.c ../../weechat.h ../gui.h ../../completion.h \
|
||||
../../history.h ../../command.h ../../irc/irc.h ../../gui/gui.h
|
||||
@@ -0,0 +1,27 @@
|
||||
# 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.h \
|
||||
../gui-common.c \
|
||||
gui-display.c \
|
||||
gui-input.c
|
||||
+67
-282
@@ -19,31 +19,27 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* gui-display.c: display functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#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 "../../common/weeconfig.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
|
||||
int gui_ready; /* = 1 if GUI is initialized */
|
||||
|
||||
t_gui_window *gui_windows = NULL; /* pointer to first window */
|
||||
t_gui_window *last_gui_window = NULL; /* pointer to last window */
|
||||
t_gui_window *gui_current_window = NULL; /* pointer to current window */
|
||||
|
||||
t_gui_color gui_colors[] =
|
||||
{ { "default", -1 | A_NORMAL },
|
||||
{ "black", COLOR_BLACK | A_NORMAL },
|
||||
@@ -158,6 +154,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
|
||||
*/
|
||||
@@ -298,7 +305,7 @@ gui_draw_window_title (t_gui_window *window)
|
||||
{
|
||||
/* TODO: change this copyright as title? */
|
||||
mvwprintw (window->win_title, 0, 0,
|
||||
"%s", WEECHAT_NAME_AND_VERSION " - " WEECHAT_WEBSITE);
|
||||
"%s", PACKAGE_STRING " - " WEECHAT_WEBSITE);
|
||||
mvwprintw (window->win_title, 0, COLS - strlen (WEECHAT_COPYRIGHT),
|
||||
"%s", WEECHAT_COPYRIGHT);
|
||||
}
|
||||
@@ -411,11 +418,13 @@ gui_display_end_of_line (t_gui_window *window, t_gui_line *line, int count)
|
||||
if (!ptr_message ||
|
||||
(window->win_chat_cursor_x > (window->win_chat_width - 1)))
|
||||
{
|
||||
window->win_chat_cursor_x = 0;
|
||||
if (lines_displayed >= num_lines - count)
|
||||
{
|
||||
if (window->win_chat_cursor_x <= window->win_chat_width - 1)
|
||||
wclrtoeol (window->win_chat);
|
||||
window->win_chat_cursor_y++;
|
||||
}
|
||||
window->win_chat_cursor_x = 0;
|
||||
lines_displayed++;
|
||||
}
|
||||
}
|
||||
@@ -503,7 +512,11 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int stop_at_end)
|
||||
if (!ptr_message ||
|
||||
((window->win_chat_cursor_y <= window->win_chat_height - 1) &&
|
||||
(window->win_chat_cursor_x > window->win_chat_width - 1)))
|
||||
{
|
||||
if (window->win_chat_cursor_x <= window->win_chat_width - 1)
|
||||
wclrtoeol (window->win_chat);
|
||||
window->win_chat_cursor_y++;
|
||||
}
|
||||
window->win_chat_cursor_x = 0;
|
||||
}
|
||||
}
|
||||
@@ -625,7 +638,7 @@ gui_draw_window_nick (t_gui_window *window)
|
||||
window->win_nick_width,
|
||||
window->win_nick_y,
|
||||
window->win_nick_x);
|
||||
gui_redraw_window_chat (window);
|
||||
gui_draw_window_chat (window);
|
||||
}
|
||||
sprintf (format, "%%-%ds", max_length);
|
||||
|
||||
@@ -857,7 +870,7 @@ gui_draw_window_status (t_gui_window *window)
|
||||
mvwprintw (window->win_status, 0, COLS - 7, _("-MORE-"));
|
||||
else
|
||||
{
|
||||
sprintf (format_more, "%%-%ds", strlen (_("-MORE")));
|
||||
sprintf (format_more, "%%-%ds", strlen (_("-MORE-")));
|
||||
mvwprintw (window->win_status, 0, COLS - 7, format_more, " ");
|
||||
}
|
||||
|
||||
@@ -1030,55 +1043,6 @@ gui_redraw_window (t_gui_window *window)
|
||||
gui_redraw_window_input (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_clear: clear window content
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_clear (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
t_gui_message *ptr_message;
|
||||
|
||||
while (window->lines)
|
||||
{
|
||||
ptr_line = window->lines->next_line;
|
||||
while (window->lines->messages)
|
||||
{
|
||||
ptr_message = window->lines->messages->next_message;
|
||||
if (window->lines->messages->message)
|
||||
free (window->lines->messages->message);
|
||||
free (window->lines->messages);
|
||||
window->lines->messages = ptr_message;
|
||||
}
|
||||
free (window->lines);
|
||||
window->lines = ptr_line;
|
||||
}
|
||||
|
||||
window->lines = NULL;
|
||||
window->last_line = NULL;
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
window->line_complete = 1;
|
||||
window->unread_data = 0;
|
||||
|
||||
if (window == gui_current_window)
|
||||
gui_redraw_window_chat (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_clear_all: clear all windows content
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_clear_all ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_window_clear (ptr_win);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_window: switch to another window
|
||||
*/
|
||||
@@ -1092,7 +1056,7 @@ gui_switch_to_window (t_gui_window *window)
|
||||
another_window = 0;
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (ptr_win->win_title)
|
||||
if (ptr_win->is_displayed)
|
||||
{
|
||||
/* TODO: manage splitted windows */
|
||||
another_window = 1;
|
||||
@@ -1106,6 +1070,7 @@ gui_switch_to_window (t_gui_window *window)
|
||||
ptr_win->win_nick = NULL;
|
||||
ptr_win->win_status = NULL;
|
||||
ptr_win->win_input = NULL;
|
||||
ptr_win->is_displayed = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1166,6 +1131,7 @@ gui_switch_to_window (t_gui_window *window)
|
||||
/* change current window to the new window */
|
||||
gui_current_window = window;
|
||||
|
||||
window->is_displayed = 1;
|
||||
window->unread_data = 0;
|
||||
}
|
||||
|
||||
@@ -1240,156 +1206,11 @@ gui_move_page_down ()
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_new: create a new window
|
||||
* (TODO: add coordinates and size, for splited windows)
|
||||
*/
|
||||
|
||||
t_gui_window *
|
||||
gui_window_new (void *server, void *channel
|
||||
/*int x, int y, int width, int height*/)
|
||||
{
|
||||
t_gui_window *new_window;
|
||||
|
||||
if (gui_windows)
|
||||
{
|
||||
if (!SERVER(gui_windows))
|
||||
{
|
||||
if (server)
|
||||
((t_irc_server *)(server))->window = gui_windows;
|
||||
if (channel)
|
||||
((t_irc_channel *)(channel))->window = gui_windows;
|
||||
SERVER(gui_windows) = server;
|
||||
CHANNEL(gui_windows) = channel;
|
||||
return gui_windows;
|
||||
}
|
||||
}
|
||||
|
||||
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
|
||||
{
|
||||
/* assign server and channel to window */
|
||||
SERVER(new_window) = server;
|
||||
CHANNEL(new_window) = channel;
|
||||
/* assign window to server and channel */
|
||||
if (server && !channel)
|
||||
SERVER(new_window)->window = new_window;
|
||||
if (channel)
|
||||
CHANNEL(new_window)->window = new_window;
|
||||
|
||||
gui_calculate_pos_size (new_window);
|
||||
|
||||
/* init windows */
|
||||
new_window->win_title = NULL;
|
||||
new_window->win_chat = NULL;
|
||||
new_window->win_nick = NULL;
|
||||
new_window->win_status = NULL;
|
||||
new_window->win_input = NULL;
|
||||
|
||||
/* init lines */
|
||||
new_window->lines = NULL;
|
||||
new_window->last_line = NULL;
|
||||
new_window->first_line_displayed = 1;
|
||||
new_window->sub_lines = 0;
|
||||
new_window->line_complete = 1;
|
||||
new_window->unread_data = 0;
|
||||
|
||||
/* init input buffer */
|
||||
new_window->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
|
||||
new_window->input_buffer = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
|
||||
new_window->input_buffer[0] = '\0';
|
||||
new_window->input_buffer_size = 0;
|
||||
new_window->input_buffer_pos = 0;
|
||||
new_window->input_buffer_1st_display = 0;
|
||||
|
||||
/* init completion */
|
||||
completion_init (&(new_window->completion));
|
||||
|
||||
/* init history */
|
||||
new_window->history = NULL;
|
||||
new_window->ptr_history = NULL;
|
||||
|
||||
/* switch to new window */
|
||||
gui_switch_to_window (new_window);
|
||||
|
||||
/* add window to windows queue */
|
||||
new_window->prev_window = last_gui_window;
|
||||
if (gui_windows)
|
||||
last_gui_window->next_window = new_window;
|
||||
else
|
||||
gui_windows = new_window;
|
||||
last_gui_window = new_window;
|
||||
new_window->next_window = NULL;
|
||||
|
||||
/* redraw whole screen */
|
||||
gui_redraw_window (new_window);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return new_window;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_free: delete a window
|
||||
* gui_curses_resize_handler: called when term size is modified
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_free (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
t_gui_message *ptr_message;
|
||||
int create_new;
|
||||
|
||||
create_new = (window->server || window->channel);
|
||||
|
||||
/* TODO: manage splitted windows! */
|
||||
if ((window == gui_current_window) &&
|
||||
((window->next_window) || (window->prev_window)))
|
||||
gui_switch_to_previous_window ();
|
||||
|
||||
/* free lines and messages */
|
||||
while (window->lines)
|
||||
{
|
||||
ptr_line = window->lines->next_line;
|
||||
while (window->lines->messages)
|
||||
{
|
||||
ptr_message = window->lines->messages->next_message;
|
||||
if (window->lines->messages->message)
|
||||
free (window->lines->messages->message);
|
||||
free (window->lines->messages);
|
||||
window->lines->messages = ptr_message;
|
||||
}
|
||||
free (window->lines);
|
||||
window->lines = ptr_line;
|
||||
}
|
||||
if (window->input_buffer)
|
||||
free (window->input_buffer);
|
||||
|
||||
/* TODO: free completion struct */
|
||||
/* there... */
|
||||
|
||||
/* remove window from windows list */
|
||||
if (window->prev_window)
|
||||
window->prev_window->next_window = window->next_window;
|
||||
if (window->next_window)
|
||||
window->next_window->prev_window = window->prev_window;
|
||||
if (gui_windows == window)
|
||||
gui_windows = window->next_window;
|
||||
if (last_gui_window == window)
|
||||
last_gui_window = window->prev_window;
|
||||
|
||||
free (window);
|
||||
|
||||
/* always at least one window */
|
||||
if (!gui_windows && create_new)
|
||||
gui_window_new (NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_resize_term_handler: called when term size is modified
|
||||
*/
|
||||
|
||||
void
|
||||
gui_resize_term_handler ()
|
||||
gui_curses_resize_handler ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
int width, height;
|
||||
@@ -1401,10 +1222,10 @@ gui_resize_term_handler ()
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
gui_calculate_pos_size (ptr_win);
|
||||
// TODO: manage splitted windows!
|
||||
if (ptr_win->win_title)
|
||||
{
|
||||
ptr_win->is_displayed = 0;
|
||||
if (ptr_win->win_title)
|
||||
delwin (ptr_win->win_title);
|
||||
if (ptr_win->win_chat)
|
||||
@@ -1425,6 +1246,32 @@ gui_resize_term_handler ()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_init_subwindows: init subwindows for a WeeChat window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_init_subwindows (t_gui_window *window)
|
||||
{
|
||||
window->win_title = NULL;
|
||||
window->win_chat = NULL;
|
||||
window->win_nick = NULL;
|
||||
window->win_status = NULL;
|
||||
window->win_input = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -1544,15 +1391,15 @@ gui_init ()
|
||||
|
||||
gui_init_colors ();
|
||||
|
||||
/* create windows */
|
||||
/* create a new window */
|
||||
gui_current_window = gui_window_new (NULL, NULL /*0, 0, COLS, LINES*/);
|
||||
|
||||
signal (SIGWINCH, gui_resize_term_handler);
|
||||
signal (SIGWINCH, gui_curses_resize_handler);
|
||||
|
||||
#ifdef __linux__
|
||||
/* set title for term window, not for console */
|
||||
if (cfg_look_set_title && (strcmp (getenv ("TERM"), "linux") != 0))
|
||||
printf ("\e]2;" WEECHAT_NAME " " WEECHAT_VERSION "\a\e]1;" WEECHAT_NAME " " WEECHAT_VERSION "\a");
|
||||
printf ("\e]2;" PACKAGE_NAME " " PACKAGE_VERSION "\a\e]1;" PACKAGE_NAME " " PACKAGE_VERSION "\a");
|
||||
#endif
|
||||
|
||||
gui_ready = 1;
|
||||
@@ -1588,67 +1435,6 @@ gui_end ()
|
||||
endwin ();
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_line: create new line for a window
|
||||
*/
|
||||
|
||||
t_gui_line *
|
||||
gui_new_line (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *new_line;
|
||||
|
||||
if ((new_line = (t_gui_line *) malloc (sizeof (struct t_gui_line))))
|
||||
{
|
||||
new_line->length = 0;
|
||||
new_line->length_align = 0;
|
||||
new_line->line_with_message = 0;
|
||||
new_line->messages = NULL;
|
||||
new_line->last_message = NULL;
|
||||
if (!window->lines)
|
||||
window->lines = new_line;
|
||||
else
|
||||
window->last_line->next_line = new_line;
|
||||
new_line->prev_line = window->last_line;
|
||||
new_line->next_line = NULL;
|
||||
window->last_line = new_line;
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintw (window->win_chat,
|
||||
_("%s not enough memory for new line!\n"),
|
||||
WEECHAT_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
return new_line;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_message: create a new message for last line of window
|
||||
*/
|
||||
|
||||
t_gui_message *
|
||||
gui_new_message (t_gui_window *window)
|
||||
{
|
||||
t_gui_message *new_message;
|
||||
|
||||
if ((new_message = (t_gui_message *) malloc (sizeof (struct t_gui_message))))
|
||||
{
|
||||
if (!window->last_line->messages)
|
||||
window->last_line->messages = new_message;
|
||||
else
|
||||
window->last_line->last_message->next_message = new_message;
|
||||
new_message->prev_message = window->last_line->last_message;
|
||||
new_message->next_message = NULL;
|
||||
window->last_line->last_message = new_message;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_printf (_("not enough memory!\n"));
|
||||
return NULL;
|
||||
}
|
||||
return new_message;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_add_message: add a message to a window
|
||||
*/
|
||||
@@ -1692,7 +1478,7 @@ gui_add_message (t_gui_window *window, int type, int color, char *message)
|
||||
if ((window->win_chat_cursor_y
|
||||
+ gui_get_line_num_splits (window, window->last_line)) >
|
||||
(window->win_chat_height - 1))
|
||||
gui_redraw_window_chat (window);
|
||||
gui_draw_window_chat (window);
|
||||
else
|
||||
gui_display_line (window, window->last_line, 1);
|
||||
}
|
||||
@@ -1764,11 +1550,10 @@ gui_printf_color_type (t_gui_window *window, int type, int color, char *message,
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
|
||||
}
|
||||
gui_add_message (window, type, color, pos+1);
|
||||
pos = strchr (pos+1, '\n');
|
||||
if (pos)
|
||||
if (pos[1] == '\0')
|
||||
pos = NULL;
|
||||
gui_add_message (window, type, color, pos + 1);
|
||||
pos = strchr (pos + 1, '\n');
|
||||
if (pos && !pos[1])
|
||||
pos = NULL;
|
||||
}
|
||||
|
||||
wrefresh (window->win_chat);
|
||||
|
||||
+8
-160
@@ -19,10 +19,13 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* gui-input: user input functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
@@ -32,168 +35,13 @@
|
||||
#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/weeconfig.h"
|
||||
#include "../../common/command.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
|
||||
/*
|
||||
* gui_optimize_input_buffer_size: optimize input buffer size by adding
|
||||
* or deleting data block (predefined size)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_optimize_input_buffer_size (t_gui_window *window)
|
||||
{
|
||||
int optimal_size;
|
||||
|
||||
optimal_size = ((window->input_buffer_size / INPUT_BUFFER_BLOCK_SIZE) *
|
||||
INPUT_BUFFER_BLOCK_SIZE) + INPUT_BUFFER_BLOCK_SIZE;
|
||||
if (window->input_buffer_alloc != optimal_size)
|
||||
{
|
||||
window->input_buffer_alloc = optimal_size;
|
||||
window->input_buffer = realloc (window->input_buffer, optimal_size);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_delete_previous_word: delete previous word
|
||||
*/
|
||||
|
||||
void
|
||||
gui_delete_previous_word ()
|
||||
{
|
||||
int i, j, num_char_deleted, num_char_end;
|
||||
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos - 1;
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i--;
|
||||
if (i >= 0)
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
i--;
|
||||
if (i >= 0)
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= 0)
|
||||
i++;
|
||||
i++;
|
||||
num_char_deleted = gui_current_window->input_buffer_pos - i;
|
||||
num_char_end = gui_current_window->input_buffer_size -
|
||||
gui_current_window->input_buffer_pos;
|
||||
|
||||
for (j = 0; j < num_char_end; j++)
|
||||
gui_current_window->input_buffer[i + j] =
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_pos + j];
|
||||
|
||||
gui_current_window->input_buffer_size -= num_char_deleted;
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
gui_current_window->input_buffer_pos = i;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_previous_word: move to beginning of previous word
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_previous_word ()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos - 1;
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i--;
|
||||
if (i < 0)
|
||||
gui_current_window->input_buffer_pos = 0;
|
||||
else
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
i--;
|
||||
gui_current_window->input_buffer_pos = i + 1;
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_next_word: move to the end of next
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_next_word ()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size + 1)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos;
|
||||
while ((i <= gui_current_window->input_buffer_size) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i++;
|
||||
if (i > gui_current_window->input_buffer_size)
|
||||
gui_current_window->input_buffer_pos = i - 1;
|
||||
else
|
||||
{
|
||||
while ((i <= gui_current_window->input_buffer_size) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
i++;
|
||||
if (i > gui_current_window->input_buffer_size)
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
else
|
||||
gui_current_window->input_buffer_pos = i;
|
||||
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_buffer_insert_string: insert a string into the input buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_buffer_insert_string (char *string, int pos)
|
||||
{
|
||||
int i, start, end, length;
|
||||
|
||||
length = strlen (string);
|
||||
|
||||
/* increase buffer size */
|
||||
gui_current_window->input_buffer_size += length;
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
|
||||
/* move end of string to the right */
|
||||
start = pos + length;
|
||||
end = gui_current_window->input_buffer_size - 1;
|
||||
for (i = end; i >= start; i--)
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i - length];
|
||||
|
||||
/* insert new string */
|
||||
strncpy (gui_current_window->input_buffer + pos, string, length);
|
||||
}
|
||||
#define KEY_ESCAPE 27
|
||||
|
||||
/*
|
||||
* gui_read_keyb: read keyboard line
|
||||
|
||||
@@ -15,23 +15,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
bin_PROGRAMS = weechat-gtk
|
||||
|
||||
OPTIONS=-Wall -W -pipe -O2
|
||||
INCLUDES = $(GTK_CFLAGS)
|
||||
|
||||
OUTPUT=../gui.a
|
||||
OBJS=gui-display.o gui-input.o
|
||||
DEFINES=WEE_QT
|
||||
weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
|
||||
../../irc/lib_weechat_irc.a \
|
||||
$(GTK_LIBS)
|
||||
|
||||
all: $(OBJS)
|
||||
ar r $(OUTPUT) $(OBJS)
|
||||
|
||||
$(OBJS):
|
||||
$(CC) $(OPTIONS) -o $@ -c $< $(INCLUDES) -D$(DEFINES)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core
|
||||
|
||||
gui-display.o: gui-display.c ../../weechat.h ../gui.h ../../config.h \
|
||||
../../irc/irc.h ../../gui/gui.h
|
||||
gui-input.o: gui-input.c ../../weechat.h ../gui.h
|
||||
weechat_gtk_SOURCES = ../gui.h \
|
||||
../gui-common.c \
|
||||
gui-display.c \
|
||||
gui-input.c
|
||||
@@ -0,0 +1,752 @@
|
||||
/*
|
||||
* Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
* Bounga <bounga@altern.org>
|
||||
* Xahlexx <xahlexx@tuxisland.org>
|
||||
* See README for License detail.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* gui-display.c: display functions for Gtk GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
|
||||
t_gui_color gui_colors[] =
|
||||
{ { "default", 0 },
|
||||
{ "black", 0 },
|
||||
{ "red", 0 },
|
||||
{ "lightred", 0 },
|
||||
{ "green", 0 },
|
||||
{ "lightgreen", 0 },
|
||||
{ "brown", 0 },
|
||||
{ "yellow", 0 },
|
||||
{ "blue", 0 },
|
||||
{ "lightblue", 0 },
|
||||
{ "magenta", 0L },
|
||||
{ "lightmagenta", 0 },
|
||||
{ "cyan", 0 },
|
||||
{ "lightcyan", 0 },
|
||||
{ "gray", 0 },
|
||||
{ "white", 0 },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
char *nicks_colors[COLOR_WIN_NICK_NUMBER] =
|
||||
{ "cyan", "magenta", "green", "brown", "lightblue", "gray",
|
||||
"lightcyan", "lightmagenta", "lightgreen", "blue" };
|
||||
|
||||
int color_attr[NUM_COLORS];
|
||||
|
||||
GtkWidget *gtk_main_window;
|
||||
GtkWidget *vbox1;
|
||||
GtkWidget *entry_topic;
|
||||
GtkWidget *notebook1;
|
||||
GtkWidget *vbox2;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *scrolledwindow_chat;
|
||||
GtkWidget *scrolledwindow_nick;
|
||||
GtkWidget *entry_input;
|
||||
GtkWidget *label1;
|
||||
|
||||
|
||||
/*
|
||||
* gui_assign_color: assign a color (read from config)
|
||||
*/
|
||||
|
||||
int
|
||||
gui_assign_color (int *color, char *color_name)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* look for Gtk colors in table */
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
{
|
||||
*color = gui_colors[i].color;
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
/* color not found */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_get_color_by_name: get color by name
|
||||
*/
|
||||
|
||||
int
|
||||
gui_get_color_by_name (char *color_name)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* look for Gtk in table */
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
return gui_colors[i].color;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* color not found */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_get_color_by_value: get color name by value
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_get_color_by_value (int color_value)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* look for Gtk colors in table */
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (gui_colors[i].color == color_value)
|
||||
return gui_colors[i].name;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* color not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
void
|
||||
gui_calculate_pos_size (t_gui_window *window)
|
||||
{
|
||||
/* TODO: write gui_calculate_pos_size for Gtk GUI */
|
||||
(void) window;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_title: draw title window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_window_title (t_gui_window *window)
|
||||
{
|
||||
char format[32];
|
||||
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
if (CHANNEL(window))
|
||||
{
|
||||
sprintf (format, "%%-%ds", window->win_width);
|
||||
/* TODO: display topic */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO: display title for server window */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window_title: redraw title window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window_title (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: first delete window content */
|
||||
gui_draw_window_title (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_get_line_num_splits: returns number of lines on window
|
||||
* (depending on window width and type (server/channel)
|
||||
* for alignment)
|
||||
*/
|
||||
|
||||
int
|
||||
gui_get_line_num_splits (t_gui_window *window, t_gui_line *line)
|
||||
{
|
||||
int length, width;
|
||||
|
||||
/* TODO: modify arbitraty value for non aligning messages on time/nick? */
|
||||
if (line->length_align >= window->win_chat_width - 5)
|
||||
{
|
||||
length = line->length;
|
||||
width = window->win_chat_width;
|
||||
}
|
||||
else
|
||||
{
|
||||
length = line->length - line->length_align;
|
||||
width = window->win_chat_width - line->length_align;
|
||||
}
|
||||
|
||||
return (length % width == 0) ? (length / width) : ((length / width) + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_display_end_of_line: display end of a line in the chat window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_display_end_of_line (t_gui_window *window, t_gui_line *line, int count)
|
||||
{
|
||||
/* TODO: display end of line! */
|
||||
(void) window;
|
||||
(void) line;
|
||||
(void) count;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_display_line: display a line in the chat window
|
||||
* if stop_at_end == 1, screen will not scroll and then we
|
||||
* exit since chat window is full
|
||||
* returns: 1 if stop_at_end == 0 or screen not full
|
||||
* 0 if screen is full and if stop_at_end == 1
|
||||
*/
|
||||
|
||||
int
|
||||
gui_display_line (t_gui_window *window, t_gui_line *line, int stop_at_end)
|
||||
{
|
||||
/* TODO: display line! */
|
||||
(void) window;
|
||||
(void) line;
|
||||
(void) stop_at_end;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_chat: draw chat window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_window_chat (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: draw chat window */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window_chat: redraw chat window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window_chat (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: first delete window content */
|
||||
gui_draw_window_chat (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_nick: draw nick window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_window_nick (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: display nicklist for Gtk GUI */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window_nick: redraw nick window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window_nick (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: first delete window content */
|
||||
gui_draw_window_nick (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_status: draw status window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_window_status (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: draw status window! */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window_status: redraw status window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window_status (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: first delete window content */
|
||||
gui_draw_window_status (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_input: draw input window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_window_input (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: draw input window */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window_input: redraw input window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window_input (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: first delete window content */
|
||||
gui_draw_window_input (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window: redraw a window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
gui_redraw_window_title (window);
|
||||
gui_redraw_window_chat (window);
|
||||
if (gui_window_has_nicklist (window))
|
||||
gui_redraw_window_nick (window);
|
||||
gui_redraw_window_status (window);
|
||||
gui_redraw_window_input (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_window: switch to another window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_window (t_gui_window *window)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
GtkTextIter start, end;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (ptr_win->is_displayed)
|
||||
{
|
||||
/* TODO: manage splitted windows */
|
||||
ptr_win->is_displayed = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gui_calculate_pos_size (window);
|
||||
|
||||
if (!window->textview_chat)
|
||||
{
|
||||
window->textview_chat = gtk_text_view_new ();
|
||||
gtk_widget_show (window->textview_chat);
|
||||
gtk_container_add (GTK_CONTAINER (scrolledwindow_chat), window->textview_chat);
|
||||
gtk_widget_set_size_request (window->textview_chat, 300, -1);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (window->textview_chat), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (window->textview_chat), FALSE);
|
||||
|
||||
window->textbuffer_chat = gtk_text_buffer_new (NULL);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (window->textview_chat), window->textbuffer_chat);
|
||||
|
||||
window->texttag_chat = gtk_text_buffer_create_tag(window->textbuffer_chat, "courier", "font_family", "lucida");
|
||||
gtk_text_buffer_get_bounds (window->textbuffer_chat, &start, &end);
|
||||
gtk_text_buffer_apply_tag (window->textbuffer_chat, window->texttag_chat, &start, &end);
|
||||
}
|
||||
if (WIN_IS_CHANNEL (window) && !window->textbuffer_nicklist)
|
||||
{
|
||||
|
||||
window->textview_nicklist = gtk_text_view_new ();
|
||||
gtk_widget_show (window->textview_nicklist);
|
||||
gtk_container_add (GTK_CONTAINER (scrolledwindow_nick), window->textview_nicklist);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (window->textview_nicklist), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (window->textview_nicklist), FALSE);
|
||||
|
||||
window->textbuffer_nicklist = gtk_text_buffer_new (NULL);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (window->textview_nicklist), window->textbuffer_nicklist);
|
||||
}
|
||||
|
||||
/* change current window to the new window */
|
||||
gui_current_window = window;
|
||||
|
||||
window->is_displayed = 1;
|
||||
window->unread_data = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_previous_window: switch to previous window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_previous_window ()
|
||||
{
|
||||
/* if only one windows then return */
|
||||
if (gui_windows == last_gui_window)
|
||||
return;
|
||||
|
||||
if (gui_current_window->prev_window)
|
||||
gui_switch_to_window (gui_current_window->prev_window);
|
||||
else
|
||||
gui_switch_to_window (last_gui_window);
|
||||
gui_redraw_window (gui_current_window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_next_window: switch to next window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_next_window ()
|
||||
{
|
||||
/* if only one windows then return */
|
||||
if (gui_windows == last_gui_window)
|
||||
return;
|
||||
|
||||
if (gui_current_window->next_window)
|
||||
gui_switch_to_window (gui_current_window->next_window);
|
||||
else
|
||||
gui_switch_to_window (gui_windows);
|
||||
gui_redraw_window (gui_current_window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_page_up: display previous page on window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_page_up ()
|
||||
{
|
||||
if (!gui_current_window->first_line_displayed)
|
||||
{
|
||||
gui_current_window->sub_lines += gui_current_window->win_chat_height - 1;
|
||||
gui_redraw_window_chat (gui_current_window);
|
||||
gui_redraw_window_status (gui_current_window);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_page_down: display next page on window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_page_down ()
|
||||
{
|
||||
if (gui_current_window->sub_lines > 0)
|
||||
{
|
||||
gui_current_window->sub_lines -= gui_current_window->win_chat_height - 1;
|
||||
if (gui_current_window->sub_lines < 0)
|
||||
gui_current_window->sub_lines = 0;
|
||||
if (gui_current_window->sub_lines == 0)
|
||||
gui_current_window->unread_data = 0;
|
||||
gui_redraw_window_chat (gui_current_window);
|
||||
gui_redraw_window_status (gui_current_window);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_gtk_resize_handler: called when term size is modified
|
||||
*/
|
||||
|
||||
void
|
||||
gui_gtk_resize_handler ()
|
||||
{
|
||||
/* TODO: write resize handler for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_init_subwindows: init subwindows for a WeeChat window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_init_subwindows (t_gui_window *window)
|
||||
{
|
||||
window->textview_chat = NULL;
|
||||
window->textbuffer_chat = NULL;
|
||||
window->texttag_chat = NULL;
|
||||
window->textview_nicklist = NULL;
|
||||
window->textbuffer_nicklist = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
void
|
||||
gui_init_colors ()
|
||||
{
|
||||
/* TODO: init colors for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_init: init GUI
|
||||
*/
|
||||
|
||||
void
|
||||
gui_init ()
|
||||
{
|
||||
gtk_main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (gtk_main_window), PACKAGE_STRING);
|
||||
|
||||
vbox1 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (vbox1);
|
||||
gtk_container_add (GTK_CONTAINER (gtk_main_window), vbox1);
|
||||
|
||||
entry_topic = gtk_entry_new ();
|
||||
gtk_widget_show (entry_topic);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), entry_topic, FALSE, FALSE, 0);
|
||||
|
||||
notebook1 = gtk_notebook_new ();
|
||||
gtk_widget_show (notebook1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
|
||||
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook1), GTK_POS_BOTTOM);
|
||||
|
||||
vbox2 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (vbox2);
|
||||
gtk_container_add (GTK_CONTAINER (notebook1), vbox2);
|
||||
|
||||
hbox1 = gtk_hbox_new (FALSE, 0);
|
||||
gtk_widget_show (hbox1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), hbox1, TRUE, TRUE, 0);
|
||||
|
||||
scrolledwindow_chat = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_show (scrolledwindow_chat);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow_chat, TRUE, TRUE, 0);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_chat), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
scrolledwindow_nick = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_show (scrolledwindow_nick);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow_nick, TRUE, TRUE, 0);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_nick), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
entry_input = gtk_entry_new ();
|
||||
gtk_widget_show (entry_input);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), entry_input, FALSE, FALSE, 0);
|
||||
|
||||
label1 = gtk_label_new (_("server"));
|
||||
gtk_widget_show (label1);
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);
|
||||
gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
|
||||
|
||||
gtk_widget_show_all (gtk_main_window);
|
||||
|
||||
/* create a new window */
|
||||
gui_current_window = gui_window_new (NULL, NULL /*0, 0, COLS, LINES*/);
|
||||
|
||||
/* TODO: set gui_ready to 1 when Gtk display functions will be ok */
|
||||
gui_ready = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_end: GUI end
|
||||
*/
|
||||
|
||||
void
|
||||
gui_end ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
/* delete all windows */
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
/* TODO: delete Gtk windows */
|
||||
/* TODO: free input buffer, lines, messages, completion */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_add_message: add a message to a window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_add_message (t_gui_window *window, int type, int color, char *message)
|
||||
{
|
||||
char *pos;
|
||||
int length;
|
||||
GtkTextIter start, end;
|
||||
|
||||
/* create new line if previous was ending by '\n' (or if 1st line) */
|
||||
if (window->line_complete)
|
||||
{
|
||||
gtk_text_buffer_insert_at_cursor (window->textbuffer_chat, "\n", -1);
|
||||
window->line_complete = 0;
|
||||
}
|
||||
|
||||
pos = strchr (message, '\n');
|
||||
if (pos)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
window->line_complete = 1;
|
||||
}
|
||||
|
||||
gtk_text_buffer_insert_at_cursor (window->textbuffer_chat, message, -1);
|
||||
gtk_text_buffer_get_bounds (window->textbuffer_chat, &start, &end);
|
||||
gtk_text_buffer_apply_tag (window->textbuffer_chat, window->texttag_chat, &start, &end);
|
||||
|
||||
if (pos)
|
||||
pos[0] = '\n';
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_printf_color_type: display a message in a window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_printf_color_type (t_gui_window *window, int type, int color, char *message, ...)
|
||||
{
|
||||
static char buffer[8192];
|
||||
char timestamp[16];
|
||||
char *pos;
|
||||
va_list argptr;
|
||||
static time_t seconds;
|
||||
struct tm *date_tmp;
|
||||
|
||||
if (gui_ready)
|
||||
{
|
||||
if (color == -1)
|
||||
color = COLOR_WIN_CHAT;
|
||||
|
||||
if (window == NULL)
|
||||
{
|
||||
if (SERVER(gui_current_window))
|
||||
window = SERVER(gui_current_window)->window;
|
||||
else
|
||||
window = gui_current_window;
|
||||
}
|
||||
|
||||
if (window == NULL)
|
||||
{
|
||||
log_printf ("gui_printf without window! this is a bug, please send to developers - thanks\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
va_start (argptr, message);
|
||||
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
if (gui_ready)
|
||||
{
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
|
||||
pos = buffer - 1;
|
||||
while (pos)
|
||||
{
|
||||
/* TODO: read timestamp format from config! */
|
||||
if (window->line_complete)
|
||||
{
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "[");
|
||||
sprintf (timestamp, "%02d", date_tmp->tm_hour);
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
|
||||
sprintf (timestamp, "%02d", date_tmp->tm_min);
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
|
||||
sprintf (timestamp, "%02d", date_tmp->tm_sec);
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (window, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
|
||||
}
|
||||
gui_add_message (window, type, color, pos + 1);
|
||||
pos = strchr (pos + 1, '\n');
|
||||
if (pos && !pos[1])
|
||||
pos = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
g_print ("%s", buffer);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
* Bounga <bounga@altern.org>
|
||||
* Xahlexx <xahlexx@tuxisland.org>
|
||||
* See README for License detail.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_GUI_GTK_H
|
||||
#define __WEECHAT_GUI_GTK_H 1
|
||||
|
||||
#endif /* gui-gtk.h */
|
||||
@@ -19,8 +19,46 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* gui-gtk.c: Gtk+ GUI for WeeChat */
|
||||
/* gui-input: user input functions for Gtk GUI */
|
||||
|
||||
|
||||
/* ***** Gtk+ GUI for WeeChat, NOT developed! ***** */
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "../../common/command.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
|
||||
/*
|
||||
* gui_read_keyb: read keyboard line
|
||||
*/
|
||||
|
||||
void
|
||||
gui_read_keyb ()
|
||||
{
|
||||
/* TODO: read keyboard for Gtk GUI */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_main_loop: main loop for WeeChat with Gtk GUI
|
||||
*/
|
||||
|
||||
void
|
||||
gui_main_loop ()
|
||||
{
|
||||
/* TODO: main loop function for Gtk GUI */
|
||||
gtk_main ();
|
||||
}
|
||||
@@ -0,0 +1,454 @@
|
||||
/*
|
||||
* Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
* Bounga <bounga@altern.org>
|
||||
* Xahlexx <xahlexx@tuxisland.org>
|
||||
* See README for License detail.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* gui-common.c: display functions, used by any GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <curses.h>
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "gui.h"
|
||||
#include "../irc/irc.h"
|
||||
|
||||
|
||||
int gui_ready; /* = 1 if GUI is initialized */
|
||||
|
||||
t_gui_window *gui_windows = NULL; /* pointer to first window */
|
||||
t_gui_window *last_gui_window = NULL; /* pointer to last window */
|
||||
t_gui_window *gui_current_window = NULL; /* pointer to current window */
|
||||
|
||||
|
||||
/*
|
||||
* gui_window_new: create a new window
|
||||
* (TODO: add coordinates and size, for splited windows)
|
||||
*/
|
||||
|
||||
t_gui_window *
|
||||
gui_window_new (void *server, void *channel
|
||||
/*int x, int y, int width, int height*/)
|
||||
{
|
||||
t_gui_window *new_window;
|
||||
|
||||
if (gui_windows)
|
||||
{
|
||||
/* use first window if no server was assigned to this window */
|
||||
if (!SERVER(gui_windows))
|
||||
{
|
||||
if (server)
|
||||
((t_irc_server *)(server))->window = gui_windows;
|
||||
if (channel)
|
||||
((t_irc_channel *)(channel))->window = gui_windows;
|
||||
SERVER(gui_windows) = server;
|
||||
CHANNEL(gui_windows) = channel;
|
||||
return gui_windows;
|
||||
}
|
||||
}
|
||||
|
||||
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
|
||||
{
|
||||
new_window->is_displayed = 0;
|
||||
|
||||
/* assign server and channel to window */
|
||||
SERVER(new_window) = server;
|
||||
CHANNEL(new_window) = channel;
|
||||
/* assign window to server and channel */
|
||||
if (server && !channel)
|
||||
SERVER(new_window)->window = new_window;
|
||||
if (channel)
|
||||
CHANNEL(new_window)->window = new_window;
|
||||
|
||||
gui_calculate_pos_size (new_window);
|
||||
|
||||
/* init windows */
|
||||
gui_window_init_subwindows(new_window);
|
||||
|
||||
/* init lines */
|
||||
new_window->lines = NULL;
|
||||
new_window->last_line = NULL;
|
||||
new_window->first_line_displayed = 1;
|
||||
new_window->sub_lines = 0;
|
||||
new_window->line_complete = 1;
|
||||
new_window->unread_data = 0;
|
||||
|
||||
/* init input buffer */
|
||||
new_window->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
|
||||
new_window->input_buffer = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
|
||||
new_window->input_buffer[0] = '\0';
|
||||
new_window->input_buffer_size = 0;
|
||||
new_window->input_buffer_pos = 0;
|
||||
new_window->input_buffer_1st_display = 0;
|
||||
|
||||
/* init completion */
|
||||
completion_init (&(new_window->completion));
|
||||
|
||||
/* init history */
|
||||
new_window->history = NULL;
|
||||
new_window->ptr_history = NULL;
|
||||
|
||||
/* switch to new window */
|
||||
gui_switch_to_window (new_window);
|
||||
|
||||
/* add window to windows queue */
|
||||
new_window->prev_window = last_gui_window;
|
||||
if (gui_windows)
|
||||
last_gui_window->next_window = new_window;
|
||||
else
|
||||
gui_windows = new_window;
|
||||
last_gui_window = new_window;
|
||||
new_window->next_window = NULL;
|
||||
|
||||
/* redraw whole screen */
|
||||
gui_redraw_window (new_window);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return new_window;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_clear: clear window content
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_clear (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
t_gui_message *ptr_message;
|
||||
|
||||
while (window->lines)
|
||||
{
|
||||
ptr_line = window->lines->next_line;
|
||||
while (window->lines->messages)
|
||||
{
|
||||
ptr_message = window->lines->messages->next_message;
|
||||
if (window->lines->messages->message)
|
||||
free (window->lines->messages->message);
|
||||
free (window->lines->messages);
|
||||
window->lines->messages = ptr_message;
|
||||
}
|
||||
free (window->lines);
|
||||
window->lines = ptr_line;
|
||||
}
|
||||
|
||||
window->lines = NULL;
|
||||
window->last_line = NULL;
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
window->line_complete = 1;
|
||||
window->unread_data = 0;
|
||||
|
||||
if (window == gui_current_window)
|
||||
gui_redraw_window_chat (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_clear_all: clear all windows content
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_clear_all ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_window_clear (ptr_win);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_free: delete a window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_free (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
t_gui_message *ptr_message;
|
||||
int create_new;
|
||||
|
||||
create_new = (window->server || window->channel);
|
||||
|
||||
/* TODO: manage splitted windows! */
|
||||
if ((window == gui_current_window) &&
|
||||
((window->next_window) || (window->prev_window)))
|
||||
gui_switch_to_previous_window ();
|
||||
|
||||
/* free lines and messages */
|
||||
while (window->lines)
|
||||
{
|
||||
ptr_line = window->lines->next_line;
|
||||
while (window->lines->messages)
|
||||
{
|
||||
ptr_message = window->lines->messages->next_message;
|
||||
if (window->lines->messages->message)
|
||||
free (window->lines->messages->message);
|
||||
free (window->lines->messages);
|
||||
window->lines->messages = ptr_message;
|
||||
}
|
||||
free (window->lines);
|
||||
window->lines = ptr_line;
|
||||
}
|
||||
if (window->input_buffer)
|
||||
free (window->input_buffer);
|
||||
|
||||
completion_free (&(window->completion));
|
||||
|
||||
/* remove window from windows list */
|
||||
if (window->prev_window)
|
||||
window->prev_window->next_window = window->next_window;
|
||||
if (window->next_window)
|
||||
window->next_window->prev_window = window->prev_window;
|
||||
if (gui_windows == window)
|
||||
gui_windows = window->next_window;
|
||||
if (last_gui_window == window)
|
||||
last_gui_window = window->prev_window;
|
||||
|
||||
free (window);
|
||||
|
||||
/* always at least one window */
|
||||
if (!gui_windows && create_new)
|
||||
gui_window_new (NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_line: create new line for a window
|
||||
*/
|
||||
|
||||
t_gui_line *
|
||||
gui_new_line (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *new_line;
|
||||
|
||||
if ((new_line = (t_gui_line *) malloc (sizeof (struct t_gui_line))))
|
||||
{
|
||||
new_line->length = 0;
|
||||
new_line->length_align = 0;
|
||||
new_line->line_with_message = 0;
|
||||
new_line->messages = NULL;
|
||||
new_line->last_message = NULL;
|
||||
if (!window->lines)
|
||||
window->lines = new_line;
|
||||
else
|
||||
window->last_line->next_line = new_line;
|
||||
new_line->prev_line = window->last_line;
|
||||
new_line->next_line = NULL;
|
||||
window->last_line = new_line;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_printf (_("%s not enough memory for new line!\n"));
|
||||
return NULL;
|
||||
}
|
||||
return new_line;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_message: create a new message for last line of window
|
||||
*/
|
||||
|
||||
t_gui_message *
|
||||
gui_new_message (t_gui_window *window)
|
||||
{
|
||||
t_gui_message *new_message;
|
||||
|
||||
if ((new_message = (t_gui_message *) malloc (sizeof (struct t_gui_message))))
|
||||
{
|
||||
if (!window->last_line->messages)
|
||||
window->last_line->messages = new_message;
|
||||
else
|
||||
window->last_line->last_message->next_message = new_message;
|
||||
new_message->prev_message = window->last_line->last_message;
|
||||
new_message->next_message = NULL;
|
||||
window->last_line->last_message = new_message;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_printf (_("not enough memory!\n"));
|
||||
return NULL;
|
||||
}
|
||||
return new_message;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_optimize_input_buffer_size: optimize input buffer size by adding
|
||||
* or deleting data block (predefined size)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_optimize_input_buffer_size (t_gui_window *window)
|
||||
{
|
||||
int optimal_size;
|
||||
|
||||
optimal_size = ((window->input_buffer_size / INPUT_BUFFER_BLOCK_SIZE) *
|
||||
INPUT_BUFFER_BLOCK_SIZE) + INPUT_BUFFER_BLOCK_SIZE;
|
||||
if (window->input_buffer_alloc != optimal_size)
|
||||
{
|
||||
window->input_buffer_alloc = optimal_size;
|
||||
window->input_buffer = realloc (window->input_buffer, optimal_size);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_delete_previous_word: delete previous word
|
||||
*/
|
||||
|
||||
void
|
||||
gui_delete_previous_word ()
|
||||
{
|
||||
int i, j, num_char_deleted, num_char_end;
|
||||
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos - 1;
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i--;
|
||||
if (i >= 0)
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
i--;
|
||||
if (i >= 0)
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= 0)
|
||||
i++;
|
||||
i++;
|
||||
num_char_deleted = gui_current_window->input_buffer_pos - i;
|
||||
num_char_end = gui_current_window->input_buffer_size -
|
||||
gui_current_window->input_buffer_pos;
|
||||
|
||||
for (j = 0; j < num_char_end; j++)
|
||||
gui_current_window->input_buffer[i + j] =
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_pos + j];
|
||||
|
||||
gui_current_window->input_buffer_size -= num_char_deleted;
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
gui_current_window->input_buffer_pos = i;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_previous_word: move to beginning of previous word
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_previous_word ()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos - 1;
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i--;
|
||||
if (i < 0)
|
||||
gui_current_window->input_buffer_pos = 0;
|
||||
else
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
i--;
|
||||
gui_current_window->input_buffer_pos = i + 1;
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_next_word: move to the end of next
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_next_word ()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size + 1)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos;
|
||||
while ((i <= gui_current_window->input_buffer_size) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i++;
|
||||
if (i > gui_current_window->input_buffer_size)
|
||||
gui_current_window->input_buffer_pos = i - 1;
|
||||
else
|
||||
{
|
||||
while ((i <= gui_current_window->input_buffer_size) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
i++;
|
||||
if (i > gui_current_window->input_buffer_size)
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
else
|
||||
gui_current_window->input_buffer_pos = i;
|
||||
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_buffer_insert_string: insert a string into the input buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_buffer_insert_string (char *string, int pos)
|
||||
{
|
||||
int i, start, end, length;
|
||||
|
||||
length = strlen (string);
|
||||
|
||||
/* increase buffer size */
|
||||
gui_current_window->input_buffer_size += length;
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
|
||||
/* move end of string to the right */
|
||||
start = pos + length;
|
||||
end = gui_current_window->input_buffer_size - 1;
|
||||
for (i = end; i >= start; i--)
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i - length];
|
||||
|
||||
/* insert new string */
|
||||
strncpy (gui_current_window->input_buffer + pos, string, length);
|
||||
}
|
||||
+37
-34
@@ -23,16 +23,8 @@
|
||||
#ifndef __WEECHAT_GUI_H
|
||||
#define __WEECHAT_GUI_H 1
|
||||
|
||||
#ifdef WEE_CURSES
|
||||
#include <curses.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
|
||||
|
||||
@@ -120,6 +112,8 @@ typedef struct t_gui_window t_gui_window;
|
||||
|
||||
struct t_gui_window
|
||||
{
|
||||
int is_displayed; /* = 1 if window is displayed */
|
||||
|
||||
/* server/channel */
|
||||
void *server; /* window's server */
|
||||
void *channel; /* window's channel */
|
||||
@@ -140,20 +134,22 @@ 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
|
||||
/* TODO: declare Gtk+ window */
|
||||
#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 */
|
||||
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 */
|
||||
@@ -186,14 +182,28 @@ struct t_gui_window
|
||||
|
||||
extern int gui_ready;
|
||||
extern t_gui_window *gui_windows;
|
||||
extern t_gui_window *last_gui_window;
|
||||
extern t_gui_window *gui_current_window;
|
||||
|
||||
/* prototypes */
|
||||
|
||||
/* GUI independent functions */
|
||||
extern t_gui_window *gui_window_new (void *, void * /*int, int, int, int*/); /* TODO: add coordinates and size */
|
||||
extern void gui_window_clear (t_gui_window *);
|
||||
extern void gui_window_clear_all ();
|
||||
extern t_gui_line *gui_new_line (t_gui_window *);
|
||||
extern t_gui_message *gui_new_message (t_gui_window *);
|
||||
extern void gui_optimize_input_buffer_size (t_gui_window *);
|
||||
extern void gui_delete_previous_word ();
|
||||
extern void gui_move_previous_word ();
|
||||
extern void gui_move_next_word ();
|
||||
extern void gui_buffer_insert_string (char *, int);
|
||||
/* GUI dependant functions */
|
||||
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 *);
|
||||
extern void gui_draw_window_chat (t_gui_window *);
|
||||
@@ -205,25 +215,18 @@ extern void gui_redraw_window_status (t_gui_window *);
|
||||
extern void gui_draw_window_input (t_gui_window *);
|
||||
extern void gui_redraw_window_input (t_gui_window *);
|
||||
extern void gui_redraw_window (t_gui_window *);
|
||||
|
||||
extern void gui_window_clear (t_gui_window *);
|
||||
extern void gui_window_clear_all ();
|
||||
|
||||
extern void gui_switch_to_window (t_gui_window *);
|
||||
extern void gui_switch_to_previous_window ();
|
||||
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_pre_init (int *, char **[]);
|
||||
//extern void gui_init_colors ();
|
||||
extern void gui_init ();
|
||||
/* TODO: add coordinates and size */
|
||||
extern t_gui_window *gui_window_new (void *, void * /*int, int, int, int*/);
|
||||
extern void gui_window_free (t_gui_window *);
|
||||
extern void gui_end ();
|
||||
extern void gui_printf_color_type (t_gui_window *, int, int, char *, ...);
|
||||
extern void gui_display_nick (t_gui_window *, void *, int, int, int, int);
|
||||
|
||||
extern void gui_main_loop ();
|
||||
|
||||
#endif /* gui.h */
|
||||
|
||||
@@ -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
|
||||
#
|
||||
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
* Bounga <bounga@altern.org>
|
||||
* Xahlexx <xahlexx@tuxisland.org>
|
||||
* See README for License detail.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
/* gui-text.c: text GUI - display functions */
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "gui-text.h"
|
||||
#include "command.h"
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
/*
|
||||
* gui_init: init GUI
|
||||
*/
|
||||
|
||||
void
|
||||
gui_init ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* gui_init_irc_window: allocates a window for a channel or server
|
||||
*/
|
||||
|
||||
void
|
||||
gui_init_irc_window (t_irc_window * window)
|
||||
{
|
||||
/* no window in text GUI */
|
||||
window->text = NULL;
|
||||
window->window = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* gui_free_irc_window: free a GUI window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_free_irc_window (t_irc_window * window)
|
||||
{
|
||||
/* no window in text GUI */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* gui_end: GUI end
|
||||
*/
|
||||
|
||||
void
|
||||
gui_end ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* read_keyb: read keyboard line
|
||||
*/
|
||||
|
||||
void
|
||||
read_keyb ()
|
||||
{
|
||||
int num_read;
|
||||
static char buffer[4096];
|
||||
static int pos_buffer = 0;
|
||||
char buffer_tmp[1024];
|
||||
int pos_buffer_tmp;
|
||||
|
||||
num_read = read (STDIN_FILENO, buffer_tmp, sizeof (buffer_tmp) - 1);
|
||||
pos_buffer_tmp = 0;
|
||||
while (pos_buffer_tmp < num_read)
|
||||
{
|
||||
switch (buffer_tmp[pos_buffer_tmp])
|
||||
{
|
||||
case '\r':
|
||||
break;
|
||||
case '\n':
|
||||
buffer[pos_buffer] = '\0';
|
||||
pos_buffer = 0;
|
||||
user_command (buffer);
|
||||
break;
|
||||
default:
|
||||
buffer[pos_buffer] = buffer_tmp[pos_buffer_tmp];
|
||||
if (pos_buffer < (int) (sizeof (buffer) - 2))
|
||||
pos_buffer++;
|
||||
}
|
||||
pos_buffer_tmp++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* gui_main_loop: main loop for WeeChat with text GUI
|
||||
*/
|
||||
|
||||
void
|
||||
gui_main_loop ()
|
||||
{
|
||||
struct timeval timeout;
|
||||
fd_set read_fd;
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
quit_weechat = 0;
|
||||
while (!quit_weechat)
|
||||
{
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 10000;
|
||||
FD_ZERO (&read_fd);
|
||||
FD_SET (STDIN_FILENO, &read_fd);
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
FD_SET (ptr_server->sock4, &read_fd);
|
||||
}
|
||||
select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout);
|
||||
if (FD_ISSET (STDIN_FILENO, &read_fd))
|
||||
{
|
||||
read_keyb ();
|
||||
}
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (FD_ISSET (ptr_server->sock4, &read_fd))
|
||||
recv_from_server (ptr_server);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* gui_display_message: display a message on the screen
|
||||
*/
|
||||
|
||||
void
|
||||
gui_display_message (char *message)
|
||||
{
|
||||
printf ("%s\n", message);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
* Bounga <bounga@altern.org>
|
||||
* Xahlexx <xahlexx@tuxisland.org>
|
||||
* See README for License detail.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_GUI_TEXT_H
|
||||
#define __WEECHAT_GUI_TEXT_H 1
|
||||
|
||||
#endif /* gui-text.h */
|
||||
@@ -1,44 +0,0 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
|
||||
OPTIONS=-Wall -W -pipe -O2
|
||||
|
||||
OUTPUT=irc.a
|
||||
OBJS=irc-commands.o irc-display.o irc-server.o irc-channel.o irc-nick.o
|
||||
DEFINES=WEE_CURSES
|
||||
|
||||
all: $(OBJS)
|
||||
ar r $(OUTPUT) $(OBJS)
|
||||
|
||||
$(OBJS):
|
||||
$(CC) $(OPTIONS) -o $@ -c $< $(INCLUDES) -D$(DEFINES)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core
|
||||
|
||||
irc-channel.o: irc-channel.c ../weechat.h irc.h ../gui/gui.h \
|
||||
../completion.h ../history.h
|
||||
irc-commands.o: irc-commands.c ../weechat.h irc.h ../gui/gui.h \
|
||||
../completion.h ../history.h ../command.h ../irc/irc.h ../config.h
|
||||
irc-display.o: irc-display.c ../weechat.h irc.h ../gui/gui.h \
|
||||
../completion.h ../history.h
|
||||
irc-nick.o: irc-nick.c ../weechat.h irc.h ../gui/gui.h ../completion.h \
|
||||
../history.h
|
||||
irc-server.o: irc-server.c ../weechat.h irc.h ../gui/gui.h \
|
||||
../completion.h ../history.h
|
||||
@@ -0,0 +1,27 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
noinst_LIBRARIES = lib_weechat_irc.a
|
||||
|
||||
lib_weechat_irc_a_SOURCES = irc.h \
|
||||
irc-commands.c \
|
||||
irc-send.c \
|
||||
irc-recv.c \
|
||||
irc-server.c \
|
||||
irc-channel.c \
|
||||
irc-nick.c \
|
||||
irc-display.c
|
||||
@@ -19,14 +19,17 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* irc-channel.c: manages a chat (channel or private chat) */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../weechat.h"
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
|
||||
+100
-2849
File diff suppressed because it is too large
Load Diff
@@ -19,18 +19,21 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* irc-display.c: display functions for IRC */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../weechat.h"
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../config.h"
|
||||
#include "../common/weeconfig.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
|
||||
+7
-4
@@ -19,15 +19,18 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* irc-nick.c: manages nick list for channels */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "../weechat.h"
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
@@ -79,8 +82,8 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2)
|
||||
{
|
||||
int score1, score2, comp;
|
||||
|
||||
score1 = - ( (nick1->is_op * 3) + (nick1->is_halfop * 2) + nick1->has_voice );
|
||||
score2 = - ( (nick2->is_op * 3) + (nick2->is_halfop * 2) + nick2->has_voice );
|
||||
score1 = - ( (nick1->is_op * 8) + (nick1->is_halfop * 4) + (nick1->has_voice * 2));
|
||||
score2 = - ( (nick2->is_op * 8) + (nick2->is_halfop * 4) + (nick2->has_voice * 2));
|
||||
|
||||
comp = strcasecmp(nick1->nick, nick2->nick);
|
||||
if (comp > 0)
|
||||
|
||||
+2483
File diff suppressed because it is too large
Load Diff
+1058
File diff suppressed because it is too large
Load Diff
@@ -19,10 +19,13 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* irc-server.c: (dis)connection and communication with irc server */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
@@ -34,7 +37,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "../weechat.h"
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -480,7 +483,7 @@ server_connect (t_irc_server *server)
|
||||
|
||||
gui_printf (server->window,
|
||||
_("%s: connecting to %s:%d...\n"),
|
||||
WEECHAT_NAME, server->address, server->port);
|
||||
PACKAGE_NAME, server->address, server->port);
|
||||
log_printf (_("connecting to server %s:%d...\n"),
|
||||
server->address, server->port);
|
||||
server->is_connected = 0;
|
||||
@@ -551,7 +554,7 @@ server_connect (t_irc_server *server)
|
||||
|
||||
/* connection to server */
|
||||
gui_printf (server->window,
|
||||
_("%s: server IP is: %s\n"), WEECHAT_NAME, ip_address);
|
||||
_("%s: server IP is: %s\n"), PACKAGE_NAME, ip_address);
|
||||
|
||||
error = connect (server->sock4, (struct sockaddr *) &addr, sizeof (addr));
|
||||
if (error != 0)
|
||||
|
||||
+28
-3
@@ -188,34 +188,54 @@ extern void irc_display_mode (t_gui_window *, char *, char, char *, char *,
|
||||
extern int irc_recv_command (t_irc_server *, char *, char *, char *);
|
||||
extern void irc_login (t_irc_server *);
|
||||
/* IRC commands issued by user */
|
||||
extern int irc_cmd_send_admin (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_away (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_deop (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_devoice (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_die (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_info (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_invite (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ison (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_join (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_kick (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_kill (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_links (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_list (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_lusers (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_me (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_mode (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_msg (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_motd (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_names (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_nick (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_notice (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_op (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_oper (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_oper (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_part (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ping (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_pong (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_ping (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_pong (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_quit (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_quote (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_rehash (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_restart (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_service (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_servlist (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_squery (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_squit (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_stats (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_summon (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_time (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_topic (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_trace (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_userhost (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_users (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_version (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_voice (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_wallops (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_who (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whois (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whowas (t_irc_server *, char *);
|
||||
/* IRC commands executed when received from server */
|
||||
extern int irc_cmd_recv_error (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_join (t_irc_server *, char *, char *);
|
||||
@@ -233,9 +253,12 @@ extern int irc_cmd_recv_topic (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_001 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_004 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_301 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_302 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_303 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_311 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_312 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_313 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_314 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_317 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_318 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_319 (t_irc_server *, char *, char *);
|
||||
@@ -247,7 +270,9 @@ extern int irc_cmd_recv_331 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_332 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_333 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_351 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_352 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_353 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_365 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_366 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_433 (t_irc_server *, char *, char *);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH WEECHAT 1 "October 2003" "FlashCode"
|
||||
.TH WEECHAT 1 "November 2003" "FlashCode"
|
||||
|
||||
.SH NAME
|
||||
weechat \- Wee Enhanced Environment for Chat
|
||||
|
||||
+9
-4
@@ -1,5 +1,5 @@
|
||||
%define name weechat
|
||||
%define version 0.0.2
|
||||
%define version 0.0.3
|
||||
%define release 1
|
||||
|
||||
Name: %{name}
|
||||
@@ -22,21 +22,26 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure
|
||||
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local"
|
||||
|
||||
%install
|
||||
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local" install
|
||||
|
||||
%find_lang %name
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%files -f %{name}.lang
|
||||
%defattr(-,root,root,0755)
|
||||
%doc AUTHORS BUGS ChangeLog COPYING FAQ INSTALL NEWS README TODO
|
||||
/usr/share/man/man1/weechat.1*
|
||||
/usr/local/bin/weechat
|
||||
/usr/local/man/man1/weechat.1*
|
||||
/usr/local/bin/weechat-curses
|
||||
|
||||
%changelog
|
||||
* Mon Nov 03 2003 FlashCode <flashcode@flashtux.org> 0.0.3-1
|
||||
- Released version 0.0.3
|
||||
* Sun Oct 05 2003 FlashCode <flashcode@flashtux.org> 0.0.2-1
|
||||
- Released version 0.0.2
|
||||
* Sat Sep 27 2003 FlashCode <flashcode@flashtux.org> 0.0.1-1
|
||||
|
||||
+4
-3
@@ -1,16 +1,17 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2003-10-05
|
||||
WeeChat known bugs, 2003-11-03
|
||||
|
||||
- ./configure does not check that Curses header is installed
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
- too much nicks in the channel (> height of window) => display bug
|
||||
- some IRC commands are marked as 'unknown' when received
|
||||
(IRC protocol is under dev!)
|
||||
- intercept Ctrl-C (do not quit immediately if Ctrl-C pressed!)
|
||||
- program is stopped when bad option in config file (it should not, only display
|
||||
warning)
|
||||
- too much opened channels => display bug
|
||||
- when kicked, channel is not prefixed by '(' and sufixed by ')'
|
||||
- when function key (non used by WeeChat) is pressed, prompt is deleted
|
||||
- when quitting WeeChat term title is not restored (if look_set_title is ON)
|
||||
- command name for /server can not contain spaces
|
||||
- wrong alias is not created and not saved when quitting WeeChat
|
||||
|
||||
+15
-1
@@ -1,9 +1,23 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2003-10-05
|
||||
ChangeLog - 2003-11-03
|
||||
|
||||
|
||||
Version 0.0.3 (2003-11-03):
|
||||
* ./configure script to build WeeChat
|
||||
* nicks are now correctly sorted (op, halfop, voice, other)
|
||||
* fixed problem with '353' IRC message (nicklist)
|
||||
* fixed problem when nick is truncated by server
|
||||
* fixed crash when entering text without any server connection
|
||||
* fixed crash when /set command is executed
|
||||
* fixed display bug (text was blinking when scrolling)
|
||||
* french translation
|
||||
* new IRC command: /stats, /service, /squit, /motd, /lusers, /links, /time,
|
||||
/trace, /admin, /info, /servlist, /squery, /who, /whowas, /die, /summon,
|
||||
/users, /wallops, /userhost, /ison, /ctcp ping
|
||||
* code cleanup
|
||||
|
||||
Version 0.0.2 (2003-10-05):
|
||||
* added commands /rehash and /restart
|
||||
* command & auto-join channels when connected to server
|
||||
|
||||
+130
-2
@@ -1,6 +1,134 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat FAQ, 2003-09-19
|
||||
WeeChat FAQ, 2003-10-27
|
||||
|
||||
<<< TO DO ! >>>
|
||||
|
||||
1- Compiling
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
|
||||
2- Using WeeChat
|
||||
|
||||
2.1 Why using WeeChat ? Irssi and xchat are so good...
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
2.3 How can I customize key bindings?
|
||||
|
||||
3- Development
|
||||
|
||||
3.1 How should I report bugs?
|
||||
3.2 How should I submit patches?
|
||||
3.3 How should I submit new feature request?
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows?
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 1- Compiling |
|
||||
\------------------------------------------------------------------------------/
|
||||
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
|
||||
Curses GUI is built by default.
|
||||
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
|
||||
--enable-gtk to enable gtk GUI
|
||||
--enable-qt to enable Qt QUI
|
||||
Type ./configure --help to see available options.
|
||||
WARNING: only Curses GUI is ok today. Other GUI are under development!
|
||||
|
||||
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
|
||||
Check that you have latest version of autoconf and automake.
|
||||
WeeChat has been developed with autoconf version 2.56 and automake version 1.7.
|
||||
You should have at least these versions in order to compile WeeChat CVS.
|
||||
If you can't or don't want to install these versions, you can download and
|
||||
install "devel package", a package built almost every day, based on CVS.
|
||||
Note that this package may not correspond exactly to CVS base.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 2- Using WeeChat |
|
||||
\------------------------------------------------------------------------------/
|
||||
|
||||
|
||||
2.1 Why using WeeChat ? Irssi and xchat are so good...
|
||||
|
||||
Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest Irc client" ;)
|
||||
|
||||
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
|
||||
For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
|
||||
2.3 How can I customize key bindings?
|
||||
|
||||
Today you can't do that. This will be available in a future version.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 3- Development |
|
||||
\------------------------------------------------------------------------------/
|
||||
|
||||
|
||||
3.1 How should I report bugs?
|
||||
|
||||
There is 3 ways to report bugs:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your bug at this url:
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. you can mail your problem, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.2 How should I submit patches?
|
||||
|
||||
There is 3 ways to submit patches:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your patch at this url:
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. you can mail your patch, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.3 How should I submit new feature request?
|
||||
|
||||
There is 2 ways to submit your feature request:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can mail your feature request, look at support page for developer's
|
||||
mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
Yes. Future versions will be available for these OS.
|
||||
|
||||
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
|
||||
There's many tasks to do (code, documentation, ...)
|
||||
Please contact us with IRC or mail, look at support page:
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
|
||||
No.
|
||||
|
||||
+8
-3
@@ -1,10 +1,15 @@
|
||||
WeeChat - Installation instructions
|
||||
===================================
|
||||
|
||||
1) Run 'make'
|
||||
1) Run './configure'
|
||||
options: --disable-curses : do not build Curses interface
|
||||
--enable-gtk : build Gtk+ interface (under development!)
|
||||
--enable-qt : build Qt interface (not developed!)
|
||||
|
||||
2) As root, run 'make install'
|
||||
2) Run 'make'
|
||||
|
||||
3) Enjoy ! :-)
|
||||
3) As root, run 'make install'
|
||||
|
||||
4) Enjoy ! :-)
|
||||
|
||||
See AUTHORS for any support, feel free to contact us for any problem ;)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
SUBDIRS = po intl src
|
||||
|
||||
EXTRA_DIST = weechat.1 BUGS FAQ
|
||||
|
||||
man_MANS = weechat.1
|
||||
@@ -1,6 +1,10 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2003-11-03
|
||||
|
||||
WeeChat 0.0.3 released.
|
||||
|
||||
* FlashCode, 2003-10-05
|
||||
|
||||
WeeChat 0.0.2 released.
|
||||
|
||||
+3
-2
@@ -10,10 +10,11 @@ It is customizable and extensible with scripts.
|
||||
Features
|
||||
--------
|
||||
* IRC chat client with multi-server connection
|
||||
* many GUI (curses, text, Gtk, QT) (1)
|
||||
* many GUI (curses, Gtk, Qt) (1)
|
||||
* small, fast and very light
|
||||
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
|
||||
* compliant with RFC 1459,2810,2811,2812,2813
|
||||
* developed from scratch (not based on any other IRC client, except for look ;)
|
||||
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
|
||||
* 100% GPL & free
|
||||
|
||||
@@ -45,6 +46,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
---
|
||||
(1) only curses & text interfaces are available today
|
||||
(1) only curses interface is available today
|
||||
(2) plugin interfaces are not yet developed
|
||||
(3) only GNU/Linux version is available today
|
||||
|
||||
+22
-28
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2003-10-05
|
||||
TODO - 2003-11-03
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,33 +10,34 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.0.2:
|
||||
v0.0.3:
|
||||
------
|
||||
|
||||
* General:
|
||||
# use of ./configure script for building WeeChat
|
||||
|
||||
* IRC protocol:
|
||||
# "/rehash" command: tell the server to reload its config file
|
||||
# "/restart" command: tell the server to restart itself
|
||||
# implement RFC 2812
|
||||
+ "/mode" command: change the user/channels modes
|
||||
# "/wallops" command: write the same string to all the
|
||||
persons with the flag +w enable
|
||||
|
||||
* WeeChat commands:
|
||||
# "/connect" and "/disconnect" commands (for multiservers use)
|
||||
# "/server" command to add, remove or list servers
|
||||
# "/save" command: save configuration to disk
|
||||
# "/alias" and "/unalias" commands
|
||||
+ "/set" command: allow the user to set the WeeChat variables
|
||||
under WeeChat without editing the config file (colours, time
|
||||
format, etc)
|
||||
|
||||
* Interface:
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
|
||||
* Configuration:
|
||||
# write config file
|
||||
# add alias definition
|
||||
# add an option for each server in order to run commands on join
|
||||
(example: /msg nickserv identify password)
|
||||
# channel list for auto-join (for each server)
|
||||
# do not stop program if problem with options in config file
|
||||
|
||||
|
||||
Future versions:
|
||||
---------------
|
||||
|
||||
* IRC protocol:
|
||||
- implement RFC 2812
|
||||
+ "/mode" command: change the user/channels modes
|
||||
- "/dcc" command (for chat and sending/receiving files)
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
@@ -46,48 +47,41 @@ Future versions:
|
||||
When we come back from our away it should print it to the current window
|
||||
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
|
||||
nick/host connect to the given irc network
|
||||
- "/wallops" command: write the same string to all the
|
||||
persons with the flag +w enable
|
||||
|
||||
* WeeChat commands:
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
- "/completion" command: do shortcuts (for example when we type "u"
|
||||
in the text bar it send it to the server as "you")
|
||||
- "/exec" command: execute a command as if we was in shell
|
||||
and show us the output on the current window. An option to exec
|
||||
like -o could send the output to the server, on the current
|
||||
channel/private
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
+ "/set" command: allow the user to set the WeeChat variables
|
||||
under WeeChat without editing the config file (colours, time
|
||||
format, etc)
|
||||
|
||||
* Interface:
|
||||
+ Gtk GUI
|
||||
- display current channel modes (example : #weechat(+nt))
|
||||
- interpret special chars in messages (color & bold for example)
|
||||
- internationalization (traduce WeeChat in many languages)
|
||||
- many channel windows in one window/term (window split)
|
||||
- add lag indicator
|
||||
- log chats to file
|
||||
- forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
- improve completion (for example complete command parameters when possible)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- add clock (in status bar?)
|
||||
- Gtk GUI
|
||||
- log chats to file
|
||||
? Qt GUI
|
||||
|
||||
* TCP/IP communication:
|
||||
- connect to server with child process (background)
|
||||
- proxy support
|
||||
- SSL support
|
||||
- IPv6 protocol implementation
|
||||
|
||||
* Configuration:
|
||||
- add key bindings to config file
|
||||
- add missing options for config file
|
||||
- wrong alias is not created and not saved when quitting WeeChat
|
||||
- do not stop program if problem with options in config file
|
||||
- load config file after GUI (so init values by default (colors, ...) before
|
||||
loading config)
|
||||
|
||||
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
rm -f config.cache
|
||||
|
||||
### GETTEXT ###
|
||||
|
||||
echo searching for GNU gettext intl directory...
|
||||
|
||||
dirs="/usr/share /usr/local/share /opt/share /usr /usr/local /opt /usr/gnu/share"
|
||||
found=0
|
||||
for try in $dirs; do
|
||||
echo -n " -> $try/gettext/intl... "
|
||||
if test -d $try/gettext/intl; then
|
||||
echo found it
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
echo no
|
||||
done
|
||||
if test "$found" != 1; then
|
||||
echo ERROR: Cannot find gettext/intl directory.
|
||||
echo ERROR: Install GNU gettext in /usr or /usr/local prefix.
|
||||
exit 7
|
||||
fi;
|
||||
|
||||
echo copying gettext intl files...
|
||||
intldir="$try/gettext/intl"
|
||||
if test ! -d intl; then
|
||||
mkdir intl
|
||||
fi
|
||||
olddir=`pwd`
|
||||
cd $intldir
|
||||
for file in *; do
|
||||
if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
|
||||
rm -f $olddir/intl/$file
|
||||
cp $intldir/$file $olddir/intl/
|
||||
fi
|
||||
done
|
||||
cp -f $try/gettext/po/Makefile.in.in $olddir/po/
|
||||
cd $olddir
|
||||
if test -f intl/plural.c; then
|
||||
sleep 2
|
||||
touch intl/plural.c
|
||||
fi
|
||||
|
||||
### END GETTEXT ###
|
||||
|
||||
echo "running aclocal..."
|
||||
aclocal -I /usr/share/aclocal
|
||||
echo "running autoconf..."
|
||||
autoconf
|
||||
echo "running autoheader..."
|
||||
autoheader
|
||||
echo "running automake..."
|
||||
automake -a
|
||||
echo "autogen.sh ok, now run ./configure script"
|
||||
@@ -0,0 +1,134 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.56)
|
||||
AC_INIT(WeeChat, 0.0.3, flashcode@flashtux.org)
|
||||
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([weechat], [0.0.3])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
|
||||
# Gettext
|
||||
ALL_LINGUAS="fr"
|
||||
AM_GNU_GETTEXT
|
||||
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([curses], [initscr], LIBCURSES_FOUND=1, LIBCURSES_FOUND=0)
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
|
||||
|
||||
AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (default=auto)],,enable_curses=yes)
|
||||
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
|
||||
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
|
||||
|
||||
enable_plugins=no
|
||||
enable_perl=no
|
||||
PERL_CFLAGS=
|
||||
enable_python=no
|
||||
PYTHON_CFLAGS=
|
||||
enable_ruby=no
|
||||
RUBY_CFLAGS=
|
||||
enable_debug=no
|
||||
DEBUG_CFLAGS=
|
||||
|
||||
AM_CONDITIONAL(GUI_CURSES, test "$enable_curses" = "yes")
|
||||
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
|
||||
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
|
||||
|
||||
if test "x$enable_curses" = "xyes" ; then
|
||||
if test "$LIBCURSES_FOUND" = "0" ; then
|
||||
AC_MSG_ERROR([Curses library not found! Install Curses library or run ./configure with --disable-curses parameter.])
|
||||
fi
|
||||
CURSES_LIBS=-lcurses
|
||||
AC_SUBST(CURSES_LIBS)
|
||||
fi
|
||||
|
||||
if test "x$enable_gtk" = "xyes" ; then
|
||||
#if test "$LIBGTK_FOUND" = "0" ; then
|
||||
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library or run ./configure without --enable-gtk parameter.])
|
||||
#fi
|
||||
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
|
||||
GTK_LIBS=`pkg-config --libs gtk+-2.0`
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
fi
|
||||
|
||||
CFLAGS="-Wall -W -pipe -O2"
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/irc/Makefile
|
||||
src/gui/Makefile
|
||||
src/gui/curses/Makefile
|
||||
src/gui/gtk/Makefile
|
||||
src/gui/qt/Makefile
|
||||
intl/Makefile
|
||||
po/Makefile.in])
|
||||
|
||||
echo
|
||||
echo $PACKAGE $VERSION
|
||||
|
||||
listgui=
|
||||
if test "x$enable_curses" = "xyes" ; then
|
||||
listgui="$listgui Curses"
|
||||
fi
|
||||
if test "x$enable_gtk" = "xyes" ; then
|
||||
listgui="$listgui Gtk+"
|
||||
fi
|
||||
if test "x$enable_qt" = "xyes" ; then
|
||||
listgui="$listgui Qt"
|
||||
fi
|
||||
|
||||
if test "x$listgui" = "x" ; then
|
||||
AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.])
|
||||
fi
|
||||
|
||||
echo
|
||||
echo Interfaces.................... :$listgui
|
||||
echo
|
||||
echo Build with Plugin support..... : $enable_plugins
|
||||
echo Build with Perl support....... : $enable_perl
|
||||
echo Build with Python support..... : $enable_python
|
||||
echo Build with Ruby support....... : $enable_ruby
|
||||
echo
|
||||
echo Print debugging messages...... : $enable_debug
|
||||
echo
|
||||
eval eval echo WeeChat will be installed in $bindir.
|
||||
echo
|
||||
echo configure complete, now type \'make\' to build WeeChat
|
||||
echo
|
||||
@@ -1,3 +1,9 @@
|
||||
weechat (0.0.3-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.3, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Mon, 03 Nov 2003 23:15:00 +0200
|
||||
|
||||
weechat (0.0.2-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.2, see ChangeLog for detail.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
4
|
||||
+27
-3
@@ -2,13 +2,37 @@ Source: weechat
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: FlashCode <flashcode@flashtux.org>
|
||||
Build-Depends: debhelper (>> 4.0.0)
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7)
|
||||
Standards-Version: 3.5.8
|
||||
|
||||
Package: weechat
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Architecture: all
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-curses
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-gtk
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-common
|
||||
Architecture: all
|
||||
Replaces: weechat
|
||||
Recommends: weechat-curses | weechat-gtk
|
||||
Description: Common files for WeeChat
|
||||
Documentation, examples, and locale files for WeeChat - fast, light and
|
||||
extensible IRC client. It is useless without weechat-curses or weechat-gtk.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
This package was debianized by FlashCode <flashcode@flashtux.org> on
|
||||
Sun, 05 Oct 2003 12:00:00 +0200.
|
||||
Mon, 03 Nov 2003 23:15:00 +0200.
|
||||
|
||||
It was downloaded from http://weechat.flashtux.org/download
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
weechat_0.0.2-1_i386.deb net optional
|
||||
+29
-46
@@ -3,12 +3,7 @@
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
|
||||
|
||||
|
||||
CFLAGS = -Wall -g
|
||||
export DH_VERBOSE=1
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
@@ -22,8 +17,7 @@ endif
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
# Add here commands to configure the package.
|
||||
|
||||
./configure --prefix=/usr --sysconfdir=/etc --enable-gtk
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
@@ -31,21 +25,14 @@ build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
$(MAKE)
|
||||
#/usr/bin/docbook-to-man debian/weechat.sgml > weechat.1
|
||||
|
||||
touch build-stamp
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
-$(MAKE) clean
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
@@ -53,45 +40,41 @@ install: build
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/weechat.
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# We have nothing to do by default.
|
||||
dh_testdir -pweechat-common
|
||||
dh_testroot -pweechat-common
|
||||
dh_installchangelogs -pweechat-common
|
||||
dh_installdocs -pweechat-common
|
||||
dh_installexamples -pweechat-common
|
||||
dh_installman weechat.1 -pweechat-common
|
||||
dh_compress -pweechat-common
|
||||
dh_fixperms -pweechat-common
|
||||
dh_installdeb -pweechat-common
|
||||
dh_shlibdeps -pweechat-common
|
||||
dh_gencontrol -pweechat-common
|
||||
dh_md5sums -pweechat-common
|
||||
dh_builddeb -pweechat-common
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
# dh_install
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman weechat.1
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_python
|
||||
# dh_makeshlibs
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
dh_testdir -a
|
||||
dh_testroot -a
|
||||
dh_link -a
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
dh_fixperms -a
|
||||
dh_installdeb -a
|
||||
dh_shlibdeps -a
|
||||
dh_gencontrol -a
|
||||
dh_md5sums -a
|
||||
dh_builddeb -a
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
usr/bin
|
||||
@@ -0,0 +1 @@
|
||||
usr/bin/weechat-curses
|
||||
@@ -0,0 +1 @@
|
||||
usr/bin
|
||||
@@ -0,0 +1 @@
|
||||
usr/bin/weechat-gtk
|
||||
@@ -1 +0,0 @@
|
||||
shlibs:Depends=libc6 (>= 2.3.2-1), libncurses5 (>= 5.3.20030510-1)
|
||||
@@ -0,0 +1,7 @@
|
||||
DOMAIN = $(PACKAGE)
|
||||
subdir = po
|
||||
top_builddir = ..
|
||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
|
||||
COPYRIGHT_HOLDER =
|
||||
EXTRA_LOCALE_CATEGORIES =
|
||||
MSGID_BUGS_ADDRESS = flashcode@flashtux.org
|
||||
@@ -0,0 +1,24 @@
|
||||
./src/irc/irc-nick.c
|
||||
./src/irc/irc-server.c
|
||||
./src/irc/irc-channel.c
|
||||
./src/irc/irc-commands.c
|
||||
./src/irc/irc-display.c
|
||||
./src/irc/irc-send.c
|
||||
./src/irc/irc-recv.c
|
||||
./src/gui/curses/gui-input.c
|
||||
./src/gui/curses/gui-display.c
|
||||
./src/gui/gtk/gui-display.c
|
||||
./src/gui/gtk/gui-input.c
|
||||
./src/gui/gui-common.c
|
||||
./src/common/command.c
|
||||
./src/common/completion.c
|
||||
./src/common/history.c
|
||||
./src/common/weechat.c
|
||||
./src/common/weeconfig.c
|
||||
./src/irc/irc.h
|
||||
./src/gui/gui.h
|
||||
./src/common/command.h
|
||||
./src/common/completion.h
|
||||
./src/common/history.h
|
||||
./src/common/weechat.h
|
||||
./src/common/weeconfig.h
|
||||
+2599
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
# Sed script that remove the POT-Creation-Date line in the header entry
|
||||
# from a POT file.
|
||||
#
|
||||
# The distinction between the first and the following occurrences of the
|
||||
# pattern is achieved by looking at the hold space.
|
||||
/^"POT-Creation-Date: .*"$/{
|
||||
x
|
||||
# Test if the hold space is empty.
|
||||
s/P/P/
|
||||
ta
|
||||
# Yes it was empty. First occurrence. Remove the line.
|
||||
g
|
||||
d
|
||||
bb
|
||||
:a
|
||||
# The hold space was nonempty. Following occurrences. Do nothing.
|
||||
x
|
||||
:b
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,91 +0,0 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
|
||||
OPTIONS=-Wall -W -pipe -O2
|
||||
|
||||
OUTPUT=weechat
|
||||
|
||||
OBJS=weechat.o config.o command.o completion.o history.o
|
||||
OBJS_IRC=irc/irc.a
|
||||
OBJS_GUI=gui/gui.a
|
||||
|
||||
|
||||
# WeeChat with Curses interface
|
||||
ifeq ($(GUI), curses)
|
||||
LIBS_CURSES=-lcurses
|
||||
DEFINES=WEE_CURSES
|
||||
|
||||
curses: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_CURSES)
|
||||
endif
|
||||
|
||||
# WeeChat with Gtk+ interface
|
||||
ifeq ($(GUI), gtk)
|
||||
OBJS_GTK=gui-gtk.o
|
||||
LIBS_GTK=
|
||||
DEFINES=WEE_GTK
|
||||
gtk: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_GTK)
|
||||
endif
|
||||
|
||||
# WeeChat with Qt interface
|
||||
ifeq ($(GUI), qt)
|
||||
OBJS_QT=gui-qt.o
|
||||
LIBS_QT=
|
||||
DEFINES=WEE_QT
|
||||
qt: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_QT)
|
||||
endif
|
||||
|
||||
# WeeChat with Text interface
|
||||
ifeq ($(GUI), text)
|
||||
OBJS_TEXT=gui-text.o
|
||||
LIBS_TEXT=
|
||||
DEFINES=WEE_TEXT
|
||||
text: $(OBJS) $(OBJS_IRC) $(OBJS_GUI)
|
||||
$(CC) $(OPTIONS) $(OBJS) $(OBJS_IRC) $(OBJS_GUI) -o $(OUTPUT) $(LIBS_TEXT)
|
||||
endif
|
||||
|
||||
|
||||
all:
|
||||
make curses GUI=curses
|
||||
|
||||
$(OBJS):
|
||||
$(CC) $(OPTIONS) -o $@ -c $< $(INCLUDES) -D$(DEFINES)
|
||||
|
||||
irc/irc.a:
|
||||
cd irc && make
|
||||
|
||||
gui/gui.a:
|
||||
cd gui && make $(GUI) GUI=$(GUI)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core $(OUTPUT)
|
||||
cd irc && make clean
|
||||
cd gui && make clean
|
||||
|
||||
command.o: command.c weechat.h command.h irc/irc.h gui/gui.h completion.h \
|
||||
history.h config.h
|
||||
completion.o: completion.c weechat.h completion.h irc/irc.h gui/gui.h \
|
||||
history.h command.h
|
||||
config.o: config.c weechat.h config.h command.h irc/irc.h gui/gui.h \
|
||||
completion.h history.h
|
||||
history.o: history.c weechat.h history.h gui/gui.h completion.h
|
||||
weechat.o: weechat.c weechat.h config.h command.h irc/irc.h gui/gui.h \
|
||||
completion.h history.h
|
||||
@@ -0,0 +1,18 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
SUBDIRS = common irc gui
|
||||
@@ -15,23 +15,17 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
OPTIONS=-Wall -W -pipe -O2
|
||||
noinst_LIBRARIES = lib_weechat_main.a
|
||||
|
||||
OUTPUT=../gui.a
|
||||
OBJS=gui-display.o gui-input.o
|
||||
DEFINES=WEE_TEXT
|
||||
|
||||
all: $(OBJS)
|
||||
ar r $(OUTPUT) $(OBJS)
|
||||
|
||||
$(OBJS):
|
||||
$(CC) $(OPTIONS) -o $@ -c $< $(INCLUDES) -D$(DEFINES)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *~ core
|
||||
|
||||
gui-display.o: gui-display.c ../../weechat.h ../gui.h ../../config.h \
|
||||
../../irc/irc.h ../../gui/gui.h
|
||||
gui-input.o: gui-input.c ../../weechat.h ../gui.h
|
||||
lib_weechat_main_a_SOURCES = weechat.c \
|
||||
weechat.h \
|
||||
command.c \
|
||||
command.h \
|
||||
completion.c \
|
||||
completion.h \
|
||||
weeconfig.c \
|
||||
weeconfig.h \
|
||||
history.c \
|
||||
history.h
|
||||
@@ -19,18 +19,21 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* command.c: WeeChat internal commands */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "command.h"
|
||||
#include "config.h"
|
||||
#include "irc/irc.h"
|
||||
#include "gui/gui.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
/* WeeChat internal commands */
|
||||
@@ -38,8 +41,8 @@
|
||||
t_weechat_command weechat_commands[] =
|
||||
{ { "alias", N_("create an alias for a command"),
|
||||
N_("[alias_name [command [arguments]]"),
|
||||
N_("alias_name: name of alias\ncommand: command name (" WEECHAT_NAME
|
||||
" or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
N_("alias_name: name of alias\ncommand: command name (WeeChat "
|
||||
"or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_alias },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
@@ -54,7 +57,7 @@ t_weechat_command weechat_commands[] =
|
||||
N_("servername: server name to disconnect"),
|
||||
1, 1, weechat_cmd_disconnect, NULL },
|
||||
{ "help", N_("display help about commands"),
|
||||
N_("[command]"), N_("command: name of a " WEECHAT_NAME " or IRC command"),
|
||||
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
|
||||
0, 1, weechat_cmd_help, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[list] | "
|
||||
@@ -526,18 +529,18 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
if (weechat_commands[i].min_arg ==
|
||||
weechat_commands[i].max_arg)
|
||||
gui_printf (NULL,
|
||||
_("%s wrong argument count for %s command '%s' "
|
||||
_("%s wrong argument count for %s command \"%s\" "
|
||||
"(expected: %d arg%s)\n"),
|
||||
WEECHAT_ERROR, WEECHAT_NAME,
|
||||
WEECHAT_ERROR, PACKAGE_NAME,
|
||||
command + 1,
|
||||
weechat_commands[i].max_arg,
|
||||
(weechat_commands[i].max_arg >
|
||||
1) ? "s" : "");
|
||||
else
|
||||
gui_printf (NULL,
|
||||
_("%s wrong argument count for %s command '%s' "
|
||||
_("%s wrong argument count for %s command \"%s\" "
|
||||
"(expected: between %d and %d arg%s)\n"),
|
||||
WEECHAT_ERROR, WEECHAT_NAME,
|
||||
WEECHAT_ERROR, PACKAGE_NAME,
|
||||
command + 1,
|
||||
weechat_commands[i].min_arg,
|
||||
weechat_commands[i].max_arg,
|
||||
@@ -555,7 +558,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
if (return_code < 0)
|
||||
gui_printf (NULL,
|
||||
_("%s %s command \"%s\" failed\n"),
|
||||
WEECHAT_ERROR, WEECHAT_NAME, command + 1);
|
||||
WEECHAT_ERROR, PACKAGE_NAME, command + 1);
|
||||
}
|
||||
if (argv)
|
||||
{
|
||||
@@ -578,7 +581,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
if (irc_commands[i].min_arg == irc_commands[i].max_arg)
|
||||
gui_printf
|
||||
(NULL,
|
||||
_("%s wrong argument count for IRC command '%s' "
|
||||
_("%s wrong argument count for IRC command \"%s\" "
|
||||
"(expected: %d arg%s)\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1,
|
||||
@@ -587,7 +590,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
else
|
||||
gui_printf
|
||||
(NULL,
|
||||
_("%s wrong argument count for IRC command '%s' "
|
||||
_("%s wrong argument count for IRC command \"%s\" "
|
||||
"(expected: between %d and %d arg%s)\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1,
|
||||
@@ -600,7 +603,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
((!server) || (!server->is_connected)))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s command '%s' needs a server connection!\n"),
|
||||
_("%s command \"%s\" needs a server connection!\n"),
|
||||
WEECHAT_ERROR, irc_commands[i].command_name);
|
||||
return 0;
|
||||
}
|
||||
@@ -653,7 +656,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
}
|
||||
}
|
||||
gui_printf (NULL,
|
||||
_("%s unknown command '%s' (type /help for help)\n"),
|
||||
_("%s unknown command \"%s\" (type /help for help)\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1);
|
||||
if (argv)
|
||||
@@ -675,7 +678,7 @@ user_command (t_irc_server *server, char *command)
|
||||
{
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
if ((!command) || (command[0] == '\r') || (command[0] == '\n'))
|
||||
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
|
||||
return;
|
||||
if ((command[0] == '/') && (command[1] != '/'))
|
||||
{
|
||||
@@ -686,7 +689,7 @@ user_command (t_irc_server *server, char *command)
|
||||
{
|
||||
if ((command[0] == '/') && (command[1] == '/'))
|
||||
command++;
|
||||
if (!WIN_IS_SERVER(gui_current_window))
|
||||
if (server && (!WIN_IS_SERVER(gui_current_window)))
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
@@ -725,7 +728,8 @@ user_command (t_irc_server *server, char *command)
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_printf (server->window, _("This window is not a channel!\n"));
|
||||
gui_printf ((server) ? server->window : NULL,
|
||||
_("This window is not a channel!\n"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -905,7 +909,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
if (argc == 0)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("> List of %s internal commands:\n"), WEECHAT_NAME);
|
||||
_("> List of %s internal commands:\n"), PACKAGE_NAME);
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
gui_printf (NULL, " %s - %s\n",
|
||||
weechat_commands[i].command_name,
|
||||
@@ -925,8 +929,8 @@ weechat_cmd_help (int argc, char **argv)
|
||||
{
|
||||
gui_printf
|
||||
(NULL,
|
||||
_("> Help on %s internal command '%s':\n"),
|
||||
WEECHAT_NAME, weechat_commands[i].command_name);
|
||||
_("> Help on %s internal command \"%s\":\n"),
|
||||
PACKAGE_NAME, weechat_commands[i].command_name);
|
||||
gui_printf (NULL,
|
||||
_("Syntax: /%s %s\n"),
|
||||
weechat_commands[i].command_name,
|
||||
@@ -947,7 +951,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
if (strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("> Help on IRC command '%s':\n"),
|
||||
_("> Help on IRC command \"%s\":\n"),
|
||||
irc_commands[i].command_name);
|
||||
gui_printf (NULL, _("Syntax: /%s %s\n"),
|
||||
irc_commands[i].command_name,
|
||||
@@ -1298,7 +1302,7 @@ weechat_cmd_set (int argc, char **argv)
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
section_displayed = 0;
|
||||
if (i != CONFIG_SECTION_SERVER)
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1354,7 +1358,7 @@ weechat_cmd_set (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_printf (NULL, "(TODO) \"/set\" command not developed!\n");
|
||||
gui_printf (NULL, "(TODO) \"/set\" command not fully developed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user