1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-19 01:24:46 +02:00

Compare commits

...

40 Commits

Author SHA1 Message Date
Sebastien Helleu 5f46617b11 Version 0.1.2 2005-05-21 07:04:11 +00:00
Sebastien Helleu 68ec2acbb3 Empty sources added for wxWidgets GUI 2005-05-21 05:29:50 +00:00
Sebastien Helleu e7041a467b Added "++++" at bottom of nicklist if end of nicklist is not displayed 2005-05-18 19:03:34 +00:00
Julien Louis ee2121b917 Remove weechat-gtk dependency since GTK gui does not exist 2005-05-12 19:56:53 +00:00
Sebastien Helleu bff5f95056 Plugin message handler is now called for own messages (as "privmsg" IRC command, with "localhost" as host to differenciate from other messages) 2005-05-08 12:19:47 +00:00
Sebastien Helleu 2b178c73fa Updated doc with new Perl/Python script interface 2005-05-07 22:53:05 +00:00
Sebastien Helleu 13d8a4f093 Fixed buffer detection for Perl/Python "print" and "command" functions 2005-05-07 11:26:31 +00:00
Sebastien Helleu b935a02ceb Perl and Python libraries now cheked in configure script 2005-05-07 09:29:26 +00:00
Sebastien Helleu e7c899014c Fixed nicklist sort mode: now modes are not cumulated any more (so for example all op will be sorted together) 2005-05-07 06:56:01 +00:00
Sebastien Helleu f88b75b241 Allow only server (with blank channel) for buffer search (for print & command functions) 2005-05-05 16:41:22 +00:00
Sebastien Helleu c8ad30020b Improved Perl interface and some changes in Python:
- function "print_with_channel" was removed
- function "command" now runs weechat command or send text to channel
- Perl functions are now called with weechat::name (instead of IRC::name)
- IRC::xxx functions are still active for compatibility with old scripts
2005-05-05 16:26:34 +00:00
Sebastien Helleu c6fc8bd147 Added Python plugin support 2005-05-01 19:03:15 +00:00
Sebastien Helleu eda55fbdb4 Added Python plugin support 2005-05-01 18:53:23 +00:00
Sebastien Helleu dca4064502 Added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12) 2005-04-30 19:21:28 +00:00
Sebastien Helleu 8a3d30b03a Changes for Mac OS X platform (now ok) 2005-04-30 10:29:54 +00:00
Sebastien Helleu 40d02fdffd Added IRC command "671" 2005-04-28 18:34:12 +00:00
Sebastien Helleu 7cc2635652 wxWidgets CFLAGS & libs are used for wxWidgets GUI only 2005-04-24 18:33:26 +00:00
Sebastien Helleu df2f164ffc wxWidgets missing error is now displayed only if this frontend is selected with --enable-wxwidgets switch 2005-04-24 12:01:23 +00:00
Benoit Papillault eb0b722ee5 Added WxWidgets frontend (no source files) 2005-04-24 11:08:22 +00:00
Sebastien Helleu 04d6257224 Backup and restore Makefile.am before and after gettextize 2005-04-24 08:48:54 +00:00
Sebastien Helleu 73c69d2d71 Added transfer rate for DCC files 2005-04-23 18:13:25 +00:00
Sebastien Helleu 2f9f37bed6 Updated autogen.sh script 2005-04-23 15:03:27 +00:00
Sebastien Helleu d90587c443 Fixed call to "has_color" in gui_window_set_color function 2005-04-22 16:47:02 +00:00
Sebastien Helleu 992632857f Added "485" IRC command 2005-04-20 21:27:44 +00:00
Sebastien Helleu 5ebab583f6 Added "-all" option for /nick command, added "341" IRC command (for invitation) 2005-04-19 21:02:59 +00:00
Sebastien Helleu ca117dbb24 Added config.rpath in extra dist 2005-04-19 20:08:19 +00:00
Sebastien Helleu 40c348df7a Removed debian/files from extra dist (not used) 2005-04-17 21:58:03 +00:00
Sebastien Helleu 0b781f96f7 Improved gettext installation (now ok under BSD) 2005-04-17 19:01:18 +00:00
Sebastien Helleu 5090689a76 Buffers timestamp can now be changed (new option in config file) 2005-04-09 11:34:15 +00:00
Sebastien Helleu a92ca4961b Hotlist not changed when self away or nick change 2005-04-09 08:03:53 +00:00
Sebastien Helleu ae8a4633ef Allow nick completion in private buffer with /me command 2005-04-07 18:58:01 +00:00
Sebastien Helleu 38505d02dd Fixed display bug with "-MORE-" in private or server buffers 2005-04-05 18:21:01 +00:00
Sebastien Helleu 20dcc4f56e Fixed crash when purging old DCC 2005-04-03 17:12:12 +00:00
Sebastien Helleu 36b2e10497 Fixed crash with 64-bits arch (like AMD64) when converting UTF-8, added weechat version in log at startup 2005-03-24 16:42:24 +00:00
Sebastien Helleu cec88e0047 "FIFO pipe" chapter translated to spanish 2005-03-21 21:57:16 +00:00
Sebastien Helleu 3198879ff2 Added missing IRC command 307 2005-03-21 06:18:03 +00:00
Sebastien Helleu 88a6fc7f16 Updated file 2005-03-20 10:17:30 +00:00
Sebastien Helleu fbcd5b3673 Remove compilation in parent dir for gui dir 2005-03-20 10:09:42 +00:00
Sebastien Helleu 7fe5afe3cb Check return codes in autogen.sh, remove compilation in parent dir for gui dir 2005-03-20 10:04:51 +00:00
Sebastien Helleu 212ca071c6 Version 0.1.2-cvs 2005-03-20 09:52:24 +00:00
110 changed files with 13554 additions and 5244 deletions
+986
View File
@@ -0,0 +1,986 @@
1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
1.1 Quick configuration advice
==============================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
1.2 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the included GNU
`gettext' library will be used. This library is wholly contained
within this package, usually in the `intl/' subdirectory, so prior
installation of the GNU `gettext' package is _not_ required.
Installers may use special options at configuration time for changing
the default behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will, respectively, bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might not be desirable. You should use
the more recent version of the GNU `gettext' library. I.e. if the file
`intl/VERSION' shows that the library which comes with this package is
more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.3 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from `no' to `nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under `nb' and some older ones under `no', it's recommended
for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
older translations are used.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
1.4 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
1.5 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of April
2005. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB
+-------------------------------------------------+
GNUnet | |
a2ps | [] [] [] [] [] |
aegis | () |
ant-phone | () |
anubis | [] |
ap-utils | |
aspell | [] [] [] [] |
bash | [] [] |
batchelor | [] |
bfd | |
bibshelf | [] |
binutils | [] |
bison | [] [] |
bluez-pin | [] [] [] [] |
clisp | [] [] |
console-tools | [] [] |
coreutils | [] [] [] [] |
cpio | |
cpplib | [] [] [] |
darkstat | [] () [] |
dialog | [] [] [] [] [] [] |
diffutils | [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] |
fetchmail | [] () [] [] [] |
fileutils | [] [] |
findutils | [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | |
gawk | [] [] [] |
gbiff | [] |
gcal | [] |
gcc | [] |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] [] [] |
gip | |
gliv | [] |
glunarclock | |
gmult | [] [] |
gnubiff | () |
gnucash | [] () () [] |
gnucash-glossary | [] () |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] |
gpe-conf | [] [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] |
gpsdrive | () () |
gramadoir | [] [] |
grep | [] [] [] [] [] [] |
gretl | |
gsasl | [] |
gss | |
gst-plugins | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] () |
gtkspell | [] [] [] |
hello | [] [] [] [] |
id-utils | [] [] |
impost | |
indent | [] [] |
iso_3166 | |
iso_3166_1 | [] [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] |
iso_4217 | |
iso_639 | |
jpilot | [] |
jtag | |
jwhois | |
kbd | [] [] [] [] |
latrine | () |
ld | [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] |
libgsasl | |
libiconv | [] [] [] [] [] |
libidn | |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] |
make | [] [] |
man-db | [] () [] [] |
minicom | [] [] |
mysecretdiary | [] [] |
nano | [] () [] |
nano_1_0 | [] () [] [] |
opcodes | [] |
parted | [] [] [] [] |
psmisc | |
ptx | [] [] [] |
pwdutils | |
python | |
radius | [] |
recode | [] [] [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] [] |
sed | [] [] |
sh-utils | [] [] |
shared-mime-info | [] [] |
sharutils | [] [] [] [] [] |
silky | |
skencil | [] () |
sketch | [] () |
solfege | [] |
soundtracker | [] [] |
sp | [] |
stardict | [] |
tar | |
texinfo | [] [] |
textutils | [] [] [] |
tin | () () |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | [] [] [] [] [] [] |
xchat | [] [] [] [] |
xkeyboard-config | |
xpad | |
+-------------------------------------------------+
af am ar az be bg bs ca cs cy da de el en en_GB
10 0 0 2 7 4 0 41 43 3 52 90 20 1 15
eo es et eu fa fi fr ga gl he hr hu id is it
+-----------------------------------------------+
GNUnet | |
a2ps | [] [] [] () |
aegis | |
ant-phone | [] |
anubis | [] |
ap-utils | [] |
aspell | [] [] |
bash | [] [] [] [] |
batchelor | [] [] |
bfd | [] |
bibshelf | [] [] [] |
binutils | [] [] |
bison | [] [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] |
clisp | [] [] |
console-tools | |
coreutils | [] [] [] [] [] |
cpio | [] [] |
cpplib | [] [] |
darkstat | [] () [] [] [] |
dialog | [] [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] [] [] [] [] |
doodle | [] [] |
e2fsprogs | [] [] [] |
enscript | [] [] |
error | [] [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | [] [] |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] [] |
gcc | [] |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | () |
glunarclock | [] [] [] |
gmult | [] [] [] |
gnubiff | () () |
gnucash | [] () [] |
gnucash-glossary | [] [] |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] [] [] |
gpe-clock | [] [] [] |
gpe-conf | [] |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-go | [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] [] |
gpe-taskmanager | [] [] [] |
gpe-timesheet | [] [] [] [] |
gpe-today | [] [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] [] [] [] [] |
gprof | [] [] [] |
gpsdrive | () () [] () |
gramadoir | [] [] |
grep | [] [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] [] [] |
gsasl | [] [] [] |
gss | [] |
gst-plugins | [] [] [] |
gstreamer | [] |
gtick | [] [] [] [] [] |
gtkspell | [] [] [] [] [] [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
impost | [] [] |
indent | [] [] [] [] [] [] [] [] [] [] [] |
iso_3166 | [] [] [] |
iso_3166_1 | [] [] [] [] [] [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] [] |
jpilot | [] [] |
jtag | [] |
jwhois | [] [] [] [] [] |
kbd | [] [] |
latrine | [] [] [] |
ld | [] [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] [] [] |
libgsasl | [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] [] |
libidn | [] [] |
lifelines | () |
lilypond | [] |
lingoteach | [] [] [] |
lynx | [] [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] [] [] [] [] |
man-db | () |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] |
nano | [] [] () [] [] |
nano_1_0 | [] [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
psmisc | [] [] |
ptx | [] [] [] [] [] [] [] [] [] |
pwdutils | |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] [] [] |
rpm | [] |
screem | |
scrollkeeper | [] [] [] |
sed | [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] [] |
shared-mime-info | [] [] [] [] [] [] |
sharutils | [] [] [] [] [] [] [] |
silky | [] |
skencil | [] [] |
sketch | [] [] |
solfege | [] |
soundtracker | [] [] [] |
sp | [] |
stardict | [] |
tar | [] [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
tp-robot | [] [] |
tuxpaint | [] [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | [] [] |
util-linux | [] [] [] [] [] [] |
vorbis-tools | [] [] |
wastesedge | () |
wdiff | [] [] [] [] [] [] [] [] |
wget | [] [] [] [] [] [] [] [] [] [] |
xchat | [] [] [] [] [] |
xkeyboard-config | |
xpad | [] [] [] |
+-----------------------------------------------+
eo es et eu fa fi fr ga gl he hr hu id is it
13 85 21 15 2 35 115 45 17 8 6 40 27 1 45
ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
+-----------------------------------------------+
GNUnet | |
a2ps | () [] [] () |
aegis | () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | |
aspell | [] [] |
bash | [] |
batchelor | [] |
bfd | |
bibshelf | |
binutils | |
bison | [] [] [] |
bluez-pin | [] |
clisp | [] |
console-tools | |
coreutils | [] [] |
cpio | |
cpplib | |
darkstat | [] [] |
dialog | [] |
diffutils | [] [] [] |
doodle | |
e2fsprogs | |
enscript | [] |
error | [] |
fetchmail | [] [] |
fileutils | [] [] |
findutils | [] |
flex | [] [] |
fslint | [] |
gas | |
gawk | [] [] |
gbiff | [] |
gcal | |
gcc | |
gettext-examples | [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] |
gip | [] |
gliv | [] |
glunarclock | [] [] |
gmult | [] |
gnubiff | |
gnucash | () () [] |
gnucash-glossary | [] |
gpe-aerial | [] |
gpe-beam | [] |
gpe-calendar | [] |
gpe-clock | [] |
gpe-conf | [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] |
gpe-ownerinfo | [] |
gpe-sketchbook | [] |
gpe-su | [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] |
gpe-todo | [] |
gphoto2 | [] [] |
gprof | |
gpsdrive | () () () |
gramadoir | () |
grep | [] [] [] |
gretl | |
gsasl | [] |
gss | |
gst-plugins | [] |
gstreamer | [] |
gtick | [] |
gtkspell | [] [] |
hello | [] [] [] [] [] [] [] [] |
id-utils | [] |
impost | |
indent | [] [] |
iso_3166 | [] |
iso_3166_1 | [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] |
jpilot | () () () |
jtag | |
jwhois | [] |
kbd | [] |
latrine | [] |
ld | |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] |
libgsasl | [] |
libiconv | [] |
libidn | |
lifelines | [] |
lilypond | [] |
lingoteach | [] |
lynx | [] [] |
m4 | [] [] |
mailutils | |
make | [] [] [] |
man-db | () |
minicom | [] |
mysecretdiary | [] |
nano | [] [] |
nano_1_0 | [] [] [] |
opcodes | [] |
parted | [] [] |
psmisc | [] [] |
ptx | [] [] [] |
pwdutils | |
python | |
radius | |
recode | [] |
rpm | [] [] |
screem | [] |
scrollkeeper | [] [] [] |
sed | [] [] |
sh-utils | [] [] |
shared-mime-info | [] [] [] [] |
sharutils | [] [] |
silky | [] |
skencil | |
sketch | |
solfege | [] [] |
soundtracker | |
sp | () |
stardict | [] [] |
tar | [] [] |
texinfo | [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] |
vorbis-tools | [] |
wastesedge | [] |
wdiff | [] [] |
wget | [] [] |
xchat | [] [] [] [] |
xkeyboard-config | [] |
xpad | [] |
+-----------------------------------------------+
ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
33 11 1 1 1 2 2 3 11 0 15 96 7 5 0
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+-------------------------------------------------+
GNUnet | |
a2ps | () [] [] [] [] [] [] |
aegis | () () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | () |
aspell | [] [] |
bash | [] [] [] |
batchelor | [] |
bfd | |
bibshelf | |
binutils | [] [] |
bison | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] [] |
clisp | [] |
console-tools | [] |
coreutils | [] [] [] [] |
cpio | [] [] |
cpplib | |
darkstat | [] [] [] [] [] [] |
dialog | [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] |
fetchmail | [] () [] [] [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] [] |
fslint | [] [] [] |
gas | |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] |
gcc | |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | [] [] [] |
glunarclock | [] [] [] [] [] [] |
gmult | [] [] [] [] |
gnubiff | () [] |
gnucash | () [] [] [] [] |
gnucash-glossary | [] [] [] |
gpe-aerial | [] [] [] [] [] [] |
gpe-beam | [] [] [] [] [] [] |
gpe-calendar | [] [] [] [] [] [] [] |
gpe-clock | [] [] [] [] [] [] [] |
gpe-conf | [] [] [] [] [] [] |
gpe-contacts | [] [] [] |
gpe-edit | [] [] [] [] [] [] [] |
gpe-go | [] [] [] [] [] |
gpe-login | [] [] [] [] [] [] [] |
gpe-ownerinfo | [] [] [] [] [] [] [] |
gpe-sketchbook | [] [] [] [] [] [] [] |
gpe-su | [] [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] [] [] |
gpe-today | [] [] [] [] [] [] [] |
gpe-todo | [] [] [] [] [] [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | [] |
gramadoir | [] |
grep | [] [] [] [] [] [] [] |
gretl | [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] |
gst-plugins | [] [] [] [] |
gstreamer | [] [] [] [] |
gtick | [] [] [] |
gtkspell | [] [] [] [] [] [] |
hello | [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
impost | |
indent | [] [] [] [] [] [] |
iso_3166 | [] [] [] [] [] |
iso_3166_1 | [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] [] [] |
iso_4217 | [] [] |
iso_639 | [] [] [] |
jpilot | |
jtag | [] |
jwhois | [] [] [] () () |
kbd | [] [] [] |
latrine | [] [] |
ld | [] |
libc | [] [] [] [] [] |
libextractor | [] |
libgpewidget | [] [] [] [] [] [] |
libgsasl | [] [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] |
libidn | [] () |
lifelines | [] [] |
lilypond | [] |
lingoteach | [] |
lynx | [] [] [] |
m4 | [] [] [] [] [] |
mailutils | [] [] [] |
make | [] [] [] [] |
man-db | [] [] |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] [] |
nano | [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
psmisc | [] [] |
ptx | [] [] [] [] [] [] |
pwdutils | [] |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] |
rpm | [] [] [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] |
shared-mime-info | [] [] [] [] [] |
sharutils | [] [] [] |
silky | [] |
skencil | [] [] [] |
sketch | [] [] [] |
solfege | |
soundtracker | [] [] |
sp | |
stardict | [] [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] [] [] |
wget | [] [] [] [] [] [] [] [] [] |
xchat | [] [] [] [] [] [] |
xkeyboard-config | |
xpad | |
+-------------------------------------------------+
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
1 0 48 30 58 6 79 71 5 45 13 12 50 86 0
tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
+--------------------------------------------+
GNUnet | | 0
a2ps | [] [] [] | 19
aegis | | 0
ant-phone | [] | 4
anubis | [] | 9
ap-utils | () | 1
aspell | [] [] [] | 13
bash | | 10
batchelor | [] [] | 7
bfd | | 1
bibshelf | [] | 5
binutils | [] | 6
bison | [] | 17
bluez-pin | [] [] [] [] [] | 24
clisp | | 7
console-tools | [] | 4
coreutils | [] | 16
cpio | [] [] | 6
cpplib | [] [] | 7
darkstat | [] () () | 15
dialog | [] [] [] | 25
diffutils | [] [] [] [] | 28
doodle | [] | 5
e2fsprogs | [] | 8
enscript | [] | 12
error | [] [] [] | 16
fetchmail | [] | 12
fileutils | [] [] [] | 18
findutils | [] [] | 17
flex | [] [] | 15
fslint | [] | 7
gas | [] | 3
gawk | [] | 14
gbiff | | 4
gcal | [] | 5
gcc | [] | 3
gettext-examples | [] [] [] [] | 20
gettext-runtime | [] [] [] [] [] | 25
gettext-tools | [] [] [] | 17
gimp-print | [] | 11
gip | [] | 8
gliv | [] | 6
glunarclock | [] [] | 13
gmult | [] [] [] | 13
gnubiff | [] | 3
gnucash | () [] | 10
gnucash-glossary | [] | 8
gpe-aerial | [] [] | 13
gpe-beam | [] [] | 13
gpe-calendar | [] [] [] [] | 18
gpe-clock | [] [] [] [] | 17
gpe-conf | [] [] | 12
gpe-contacts | [] [] | 6
gpe-edit | [] [] [] [] | 15
gpe-go | [] [] | 11
gpe-login | [] [] [] [] [] | 18
gpe-ownerinfo | [] [] [] [] | 19
gpe-sketchbook | [] [] | 14
gpe-su | [] [] [] | 16
gpe-taskmanager | [] [] [] | 17
gpe-timesheet | [] [] [] [] | 17
gpe-today | [] [] [] [] [] | 19
gpe-todo | [] [] [] | 16
gphoto2 | [] [] | 17
gprof | [] [] | 10
gpsdrive | | 2
gramadoir | [] | 6
grep | [] [] [] [] | 32
gretl | | 4
gsasl | [] [] | 12
gss | [] | 5
gst-plugins | [] [] | 16
gstreamer | [] [] [] | 14
gtick | [] | 11
gtkspell | [] [] [] | 20
hello | [] [] [] [] | 37
id-utils | [] [] | 13
impost | [] | 3
indent | [] [] [] | 24
iso_3166 | [] [] [] | 12
iso_3166_1 | [] [] | 20
iso_3166_2 | | 2
iso_3166_3 | [] [] | 8
iso_4217 | [] [] | 10
iso_639 | [] [] | 12
jpilot | [] [] [] | 6
jtag | | 2
jwhois | [] [] [] | 12
kbd | [] [] | 12
latrine | [] [] | 8
ld | [] | 5
libc | [] [] | 22
libextractor | | 1
libgpewidget | [] [] | 17
libgsasl | [] | 7
libiconv | [] [] [] [] [] | 32
libidn | [] [] | 5
lifelines | | 4
lilypond | [] | 5
lingoteach | | 5
lynx | [] [] | 14
m4 | [] [] | 17
mailutils | [] | 7
make | [] [] | 18
man-db | | 5
minicom | | 11
mysecretdiary | [] [] | 12
nano | | 11
nano_1_0 | [] [] | 17
opcodes | [] | 7
parted | [] [] [] | 17
psmisc | [] | 7
ptx | [] [] | 23
pwdutils | | 1
python | | 0
radius | [] | 6
recode | [] [] | 22
rpm | [] [] | 11
screem | | 1
scrollkeeper | [] [] | 23
sed | [] [] | 19
sh-utils | [] | 15
shared-mime-info | [] [] | 19
sharutils | [] [] [] | 20
silky | | 3
skencil | | 6
sketch | | 6
solfege | | 4
soundtracker | [] | 8
sp | [] | 3
stardict | [] [] [] [] | 10
tar | [] [] | 13
texinfo | [] [] | 14
textutils | [] [] [] | 17
tin | | 1
tp-robot | [] [] | 7
tuxpaint | [] [] [] [] | 34
unicode-han-tra... | | 0
unicode-transla... | | 2
util-linux | [] [] | 17
vorbis-tools | [] | 10
wastesedge | | 1
wdiff | [] [] | 22
wget | [] [] [] [] | 31
xchat | [] [] [] | 22
xkeyboard-config | | 1
xpad | [] | 5
+--------------------------------------------+
72 teams tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
147 domains 0 0 1 78 29 0 71 16 0 41 20 0 1711
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If April 2005 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
1.6 Using `gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.
+1 -4
View File
@@ -1,12 +1,9 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-02-12
WeeChat known bugs, 2005-05-21
- ./configure does not check that Curses headers are installed
- ./configure does not check that Gtk 2.0 libraries are installed
- ./configure does not check that Perl headers & libraries are installed
- too much nicks in the channel (> height of window) => some nicks are hidden
- 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
+14 -1
View File
@@ -1,9 +1,22 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-03-20
ChangeLog - 2005-05-21
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
* added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12)
* added transfer rate for DCC files
* added "-all" option for /nick command
* buffers timestamp can now be changed (new option in config file)
* WeeChat now ok under *BSD and Mac OS X
* fixed nicklist sort
* fixed crash when purging old DCC
* fixed crash with 64-bits arch (like AMD64) when converting UTF-8
* added missing IRC commands (307, 341, 485, 671)
Version 0.1.1 (2005-03-20):
* added nicks count for channel buffers
* added FIFO pipe for remote control
+37 -13
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Intended audience:
@@ -22,8 +22,10 @@ finding a solution.
Q: I heard about many GUI for WeeChat. How can I compile/use them?
A: Curses GUI is built by default.
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
To build Gtk, wxWidgets or Qt GUI you've to specify extra options to
./configure script:
--enable-gtk to enable Gtk GUI
--enable-wxwidgets to enable wxWidgets 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!
@@ -34,8 +36,8 @@ A: Curses GUI is built by default.
Q: I can't compile WeeChat CVS.
A: Check that you have latest version of autoconf and automake.
WeeChat has been developed with autoconf version 2.56 and automake
version 1.7.
WeeChat has been developed with autoconf version 2.59 and automake
version 1.9.5.
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.
@@ -48,12 +50,14 @@ Q: Why using WeeChat ? X-Chat and Irssi are so good...
A: Because WeeChat is very light and has new features.
Some new features:
* many GUI (Curses, Gtk, Qt),
* many GUI (Curses, Gtk, wxWidgets, 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 ;)
More info on this page: http://weechat.flashtux.org/features.php
2.2
@@ -61,6 +65,7 @@ A: Because WeeChat is very light and has new features.
Q: I've launched WeeChat, but I'm lost, what can I do?
A: For help you can type /help. For help about a command, type /help command.
Keys and commands are listed in documentation.
2.3
@@ -86,19 +91,23 @@ A: Today you can't do that. This is planed for a future version.
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
A: You can use /perl command to load scripts
(default path is ~/.weechat/perl).
A: You can use /perl command to load scripts (default path is
~/.weechat/perl).
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
when WeeChat is starting up.
WeeChat perl scripts are compatible with X-Chat, but not with Irssi,
sorry ;)
WeeChat Perl scripts are 80% compatible with X-Chat, but not with Irssi.
2.6
================================================================================
Q: How can I load Python scripts?
Are Python scripts compatible with X-chat or/and Irssi ?
A: Today Python interface is not developed, so you can't load any Python script.
A: You can use /python command to load scripts (default path is
~/.weechat/python).
Note that scripts in ~/.weechat/python/autoload are automatically loaded
when WeeChat is starting up.
WeeChat Python scripts are 80% compatible with X-Chat, but not with Irssi.
2.7
@@ -148,13 +157,27 @@ A: There is 2 ways to submit your feature request:
3.4
================================================================================
Q: Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
Q: What is the list of supported platforms for WeeChat?
A: Yes. Future versions will be available for these OS.
A: Today WeeChat was succesfully tested on these platforms:
- GNU/Linux (any distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (with Cygwin and some code changes)
3.5
================================================================================
Q: Will WeeChat be ported to QNX or other operating systems?
A: Yes. Future versions will be available for these OS.
We need help for such systems, any help is welcome :)
3.6
================================================================================
Q: I want to help WeeChat developers. What can I do?
A: There's many tasks to do (code, documentation, ...)
@@ -162,8 +185,9 @@ A: There's many tasks to do (code, documentation, ...)
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
Q: Can I give money or other things to WeeChat developers?
A: Beer is welcome :)
Otherwise Paypal account is: flashcode@free.fr (no limit for gifts :)
+38 -15
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Public concerné :
@@ -23,9 +23,10 @@ Q: J'ai entendu parler de plusieurs interfaces pour WeeChat.
Comment puis-je les compiler/utiliser ?
R: L'interface Curses est construite par défaut.
Pour construire l'interface Gtk ou Qt, vous devez spécifier des options
pour le script ./configure :
Pour construire l'interface Gtk, wxWidgets ou Qt, vous devez spécifier des
options pour le script ./configure :
--enable-gtk pour activer l'interface Gtk
--enable-wxwidgets pour activer l'interface wxWidgets
--enable-qt pour activer l'interface Qt
Tapez ./configure --help pour voir les options disponibles.
ATTENTION : seule l'interface Curses est ok aujourd'hui.
@@ -37,8 +38,8 @@ R: L'interface Curses est construite par d
Q: Je ne peux pas compiler le CVS WeeChat.
R: Vérifiez que vous avez bien la dernière version d'autoconf et automake.
WeeChat a été développé avec autoconf version 2.56 et automake
version 1.7.
WeeChat a été développé avec autoconf version 2.59 et automake
version 1.9.5.
Vous devez avoir au moins ces versions pour compiler le CVS WeeChat.
Si vous n'avez pas ou ne souhaitez pas installer ces versions, vous
pouvez télécharger et installer le paquet "devel", un paquet construit
@@ -52,12 +53,14 @@ Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
Quelques nouvelles fonctionnalités :
* plusieurs interfaces (Curses, Gtk, Qt),
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt),
* extensible par des scripts (Perl, Python, Ruby),
* développé à partir de zéro (non basé sur un quelconque client IRC)
* multi-platformes
* 100% GPL et libre
C'est le client IRC le plus "geek" ;)
Plus d'infos sur cette page: http://weechat.flashtux.org/features.php
2.2
@@ -66,6 +69,7 @@ Q: J'ai lanc
R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
tapez /help commande.
Les touches et commandes sont listées dans la documentation.
2.3
@@ -92,20 +96,23 @@ R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
R: La commande /perl permet de charger les scripts Perl
(le chemin par défaut est ~/.weechat/perl).
R: La commande /perl permet de charger les scripts Perl (le chemin par défaut
est ~/.weechat/perl).
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Perl WeeChat sont compatibles avec X-Chat, mais pas Irssi,
désolé ;)
Les scripts Perl WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
Les scripts Python sont-ils compatibles avec X-chat et/ou Irssi ?
R: Aujourd'hui l'interface Python n'est pas déceloppée.
Vous ne pouvez donc charger aucun script Python.
R: La commande /python permet de charger les scripts Python (le chemin par
défaut est ~/.weechat/python).
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Python WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.7
@@ -161,13 +168,27 @@ R: Il y a 2 mani
3.4
================================================================================
Q: WeeChat sera-t-il porté sur *BSD, QNX, MacOS X, Microsoft Windows ?
Q: Quelle est la liste des plate-formes supportées par WeeChat ?
R: Oui. Les futures versions seront disponibles pour ces OS.
R: Aujourd'hui WeeChat a été testé avec succès sur ces plate-formes :
- GNU/Linux (toute distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (avec Cygwin et quelques modifications de code)
3.5
================================================================================
Q: WeeChat sera-t-il porté sur QNX ou d'autres systèmes d'exploitation ?
R: Oui. Les futures versions seront disponibles pour ces OS.
Nous avons besoin d'aide pour ces systèmes, toute aide est la bienvenue :)
3.6
================================================================================
Q: Je souhaiterai aider les développeurs WeeChat. Que puis-je faire ?
R: Il y a plusieurs choses Ă  faire (code, documentation, ...)
@@ -176,8 +197,10 @@ R: Il y a plusieurs choses
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
R: La bière est la bienvenue :)
Sinon le compte Paypal est: flashcode@free.fr (il n'y a pas de limite pour
les dons :)
+4 -2
View File
@@ -17,12 +17,14 @@
SUBDIRS = po intl src
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
debian/changelog debian/control \
debian/copyright debian/files \
debian/copyright \
debian/rules debian/weechat-common.docs \
debian/weechat-common.install debian/weechat-curses.dirs \
debian/weechat-curses.install debian/weechat-gtk.dirs \
debian/weechat-gtk.install
man_MANS = weechat-curses.1
ACLOCAL_AMFLAGS = -I m4
+4
View File
@@ -1,6 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-05-21
WeeChat 0.1.2 released.
* FlashCode, 2005-03-20
WeeChat 0.1.1 released.
+13 -12
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-03-20
TODO - 2005-05-21
Legend:
# done
@@ -10,25 +10,32 @@ Legend:
? is this really necessary?
v0.1.1:
v0.1.2:
------
* General:
+ Windows version
+ Solaris version
+ *BSD version
# *BSD version
# Mac OS X version
* IRC protocol:
# "/dcc send" command
# "/dcc chat" command (and incoming DCC chats)
- customizable CTCP version reply
* Interface:
# nicklist scroll keys
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
# connect to server with child process (background)
- SSL support
* Configuration:
- add key bindings to config file
* Plugins:
# Python plugin
# "/python load" and "/python unload" commands to (un)load Python scripts
Future versions:
@@ -64,14 +71,8 @@ Future versions:
* TCP/IP communication:
- proxy support
- SSL support
- IPv6 protocol implementation
* Plugins:
- Python plugin
- "/python load" and "/python unload" commands to (un)load Python scripts
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
* Configuration:
- add key bindings to config file
+13 -53
View File
@@ -1,55 +1,15 @@
#!/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"
# gettextize updates Makefile.am, configure.in
cp configure.in configure.in.old
cp Makefile.am Makefile.am.old
gettextize --copy --force --intl --no-changelog &&
mv Makefile.am.old Makefile.am
mv configure.in.old configure.in
aclocal &&
# autoheader creates config.h.in needed by autoconf
autoheader &&
# autoconf creates configure
autoconf &&
# automake creates Makefile.in
automake --add-missing --copy --gnu
+128 -9
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.1, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.2, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.1])
AM_INIT_AUTOMAKE([weechat], [0.1.2])
# Checks for programs.
AC_PROG_CC
@@ -36,6 +36,9 @@ AM_GNU_GETTEXT
# Checks for libraries.
AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
# 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 sys/types.h unistd.h pwd.h errno.h])
@@ -44,42 +47,82 @@ AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h s
AC_HEADER_TIME
AC_STRUCT_TM
AC_MSG_CHECKING([for socklen_t])
AC_CACHE_VAL(ac_cv_type_socklen_t,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t t;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no,
)])
if test $ac_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
fi
AC_MSG_RESULT($ac_cv_type_socklen_t)
# Checks for library functions.
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_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=yes,enable_wxwidgets=no)
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)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=yes,enable_python=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_python="no"
PYTHON_CFLAGS=
enable_ruby="no"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
# AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([ncurses library not found! Install ncurses library or run ./configure with --disable-ncurses parameter.])
AC_MSG_ERROR([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
NCURSES_LIBS="-lncurses"
AC_SUBST(NCURSES_LIBS)
fi
if test "x$enable_wxwidgets" = "xyes" ; then
if test "$wxWin" != 1; then
AC_MSG_ERROR([
*** wxWindows must be installed on your system
*** but wx-config script couldn't be found.
*** Please check that wx-config is in path, the directory
*** where wxWindows libraries are installed (returned by
*** 'wx-config --libs' command) is in LD_LIBRARY_PATH or
*** equivalent variable and wxWindows version is 2.3.4 or above.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LDFLAGS="$LDFLAGS $WX_LIBS"
WXWIDGETS_CFLAGS=""
WXWIDGETS_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.])
@@ -94,12 +137,77 @@ PLUGINS_LIBS=
if test "x$enable_perl" = "xyes" ; then
enable_plugins="yes"
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
AC_PATH_PROG(PERL, perl)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
*** but perl interpreter couldn't be found in path.
Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl library)
PERL_LIB=`$PERL -e 'use Config; print "$Config{installprefix}/lib/$Config{libperl}"'`
if test -r "$PERL_LIB"; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
else
AC_MSG_ERROR([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
AC_SUBST(PERL_CFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
if test "x$enable_python" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PYTHON, python)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
*** but python interpreter couldn't be found in path.
*** Please check that python is in path, or install
*** it with your software package manager.])
fi
PYTHON_INCLUDE=`$PYTHON -c 'import sys ; print "%s/include/python%s" % (sys.prefix, sys.version[[:3]])'`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print ' -I' + distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.])
fi
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c 'import sys; print "%s/lib/python%s/config" % (sys.prefix, sys.version[[:3]])'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[0:3]]'`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -a -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print string.join(distutils.sysconfig.get_config_vars('LINKFORSHARED', 'BLDLIBRARY', 'SHLIBS'))"`
else
AC_MSG_ERROR([
*** Python library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/python/lib_weechat_python.a $PYTHON_LFLAGS"
AC_SUBST(PYTHON_CFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE(PLUGINS)
fi
@@ -120,14 +228,20 @@ if test "x$debug" = "x2" ; then
AC_DEFINE(DEBUG)
fi
dnl For FreeBSD
LIBS="$LIBS $INTLLIBS"
CFLAGS="$CFLAGS $CPPFLAGS"
AC_OUTPUT([Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
src/plugins/Makefile
src/plugins/perl/Makefile
src/plugins/python/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
src/gui/gtk/Makefile
src/gui/qt/Makefile
intl/Makefile
@@ -140,6 +254,9 @@ listgui=
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
fi
@@ -148,7 +265,9 @@ if test "x$enable_qt" = "xyes" ; then
fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([No interface specified... Please specify at least ncurses, Gtk or Qt.])
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
fi
msg_debug_compiler="no"
+15 -1
View File
@@ -1,6 +1,20 @@
weechat (0.1.2-1) unstable; urgency=low
* WeeChat version 0.1.2, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 21 May 2005 08:00:00 +0200
weechat (0.1.1-2) unstable; urgency=low
* debian/control:
- Add myself to uploaders.
- Remove unecessary dependency on weechat-gtk (Closes: #308287).
-- Julien Louis <ptitlouis@sysif.net> Tue, 10 May 2005 22:38:52 +0200
weechat (0.1.1-1) unstable; urgency=low
* WeeChat version 0.1.1, see ChangeLog for detail.
* WeeChat version 0.1.1, see ChangeLog for detail (closes: #306492)
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 20 Mar 2005 08:00:00 +0200
+3 -2
View File
@@ -2,12 +2,13 @@ Source: weechat
Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev, python2.3 (>= 2.3), python-dev
Standards-Version: 3.6.1
Package: weechat
Architecture: all
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${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.
+1 -1
View File
@@ -1,5 +1,5 @@
This package was debianized by FlashCode <flashcode@flashtux.org> on
Sat, 20 Mar 2005 08:00:00 +0200.
Sat, 21 May 2005 08:00:00 +0200.
It was downloaded from http://weechat.flashtux.org/download
+1 -1
View File
@@ -15,7 +15,7 @@ configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
--enable-perl
--enable-perl --enable-python
touch configure-stamp
+230 -37
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
@subtitle Documentation for WeeChat v0.1.2 - May, 21 2005
@image{weechat_image}
@@ -270,6 +270,9 @@ Type: string (any string), default value: ''@*
@item look_charset_internal
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
Type: string (any string), default value: 'ISO-8859-1'@*
@item look_buffer_timestamp
Timestamp for buffers@*
Type: string (any string), default value: '[%H:%M:%S]'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -414,6 +417,9 @@ Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_voice
Color for voice symbol@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_sep
Color for nick separator@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@@ -498,6 +504,9 @@ Type: integer (values: between 0 and 2147483647), default value: 1@*
@item irc_lag_disconnect
Disconnect after important lag (in minutes, 0 = never disconnect)@*
Type: integer (values: between 0 and 2147483647), default value: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -668,6 +677,9 @@ Switch to previous / next window@*
@item F10
Remove last infobar message@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@@ -692,6 +704,9 @@ Switch to first channel of next server (or server buffer if no channel is opened
@item Alt + digit (1-9)
Switch to buffer by number@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node WeeChat commands, FIFO pipe, Key bindings, Usage
@@ -750,13 +765,20 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item perl [load filename] | [autoload] | [unload]
@item perl [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item python [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@@ -980,11 +1002,12 @@ list nicknames on channels@*
@*
channel: channel name@*
@*
@item nick nickname
@item nick [-all] nickname
@*
change current nickname@*
@*
nickname: new nickname for current IRC server@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice nickname text
@*
@@ -1251,7 +1274,7 @@ List all Perl scripts: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( name, version, shutdown_function, description );}@*
@command{weechat::register ( name, version, shutdown_function, description );}@*
@*
This is first function to call in Perl script.@*
All Perl scripts for WeeChat should call this function.@*
@@ -1267,42 +1290,29 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Print message in current window (channel or server).@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( channel, [server,] message );}@*
@command{weechat::print ( message, [channel, [server]] );}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@item @option{message}: message to display
@end itemize
@*
@emph{Examples:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( delay, message );}@*
@command{weechat::print_infobar ( delay, message );}@*
@*
Print message in infobar.@*
@@ -1314,11 +1324,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( name, function );}@*
@command{weechat::add_message_handler ( name, function );}@*
@*
Attach a Perl function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@@ -1333,18 +1343,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_message_handler ("privmsg", my_function);}@*
@code{weechat::add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( name, function );}@*
@command{weechat::add_command_handler ( name, function );}@*
@*
Create new WeeChat command, linked with Perl function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -1359,23 +1369,41 @@ available until your Perl script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_command_handler ("command", my_command);}@*
@code{weechat::add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [server,] name );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( name, [server] );}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{server}: internal name of server
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@@ -1388,7 +1416,7 @@ Get various info about WeeChat, server or user.@*
@*
@emph{Examples:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1396,7 +1424,172 @@ Get various info about WeeChat, server or user.@*
@node Python scripts, Ruby scripts, Perl scripts, Extensions
@section Python scripts
Not developed!
@subsection Load/unload Python scripts
Python scripts are loaded and unloaded with @command{/python} command.
(type @kbd{/help python} within WeeChat to get help about command).@*
@emph{Examples:}@*
@itemize @bullet
@item
Load a Python script: @kbd{/python load /tmp/sample.py}@*
@item
Unload all Python scripts: @kbd{/python unload}@*
@item
List all Python scripts: @kbd{/python}@*
@end itemize
@subsection WeeChat / Python API
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description );}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: unique name to identify script (each script must have
unique name)
@item @option{version}: script's version
@item @option{shutdown_function}: Python function called when script is
unloaded (optional parameter, empty string means nothing is called at the end)
@item @option{description}: short description of script.
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] );}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( delay, message );}@*
@*
Print message in infobar.@*
@emph{Arguments:}
@itemize @minus
@item @option{delay}: after this delay (in seconds), message will be erased
(if 0, message will not be erased).
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message");}@*
@*
@item
@command{weechat.add_message_handler ( name, function );}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of IRC message@*
To know list of IRC messages, please refer to RFC 1459 and/or 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{function}: Python function called when message is received
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ weechat.print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( name, function );}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of new command@*
This name may be existing command, so that the command is overrided by
Python function. Be careful when overriding WeeChat commands, they'll not be
available until your Python script will be unloaded.
@item @option{function}: Python function linked with command
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( name, [server] );}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@item @option{2 or channel}: get channel name
@item @option{3 or server}: get server name
@item @option{4 or weechatdir}: get WeeChat home directory
@item @option{5 or away}: get away flag for server
@end itemize
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Ruby scripts, , Python scripts, Extensions
@section Ruby scripts
+267 -75
View File
@@ -35,7 +35,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
@subtitle Documentaci@'on para WeeChat v0.1.2 - 21 de mayo de 2005
@image{weechat_image}
@@ -210,7 +210,7 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
* Ficheros de configuracion::
* Atajos de teclado::
* Comandos WeeChat::
* FIFO pipe::
* Canal FIFO::
@end menu
@node Iniciar WeeChat, Ficheros de configuracion, Uso, Uso
@@ -269,6 +269,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item look_charset_internal
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
@item look_buffer_timestamp
Fecha y hora para las bĂşfers@*
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
@item look_color_nicks
Mostrar nombres de usuario con colores diferentes@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -413,6 +416,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_voice
Color para el s@'imbolo de voz@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_sep
Color para el separador de alias@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@@ -498,7 +504,7 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 1@*
Desconexi@'on tras un lag importante (en minutos, 0 = no desconectar nunca)@*
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Crea una tuber@'ia FIFO para control remoto@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item dcc_auto_accept_files
Aceptar autom@'aticamente los ficheros dcc entrantes@*
@@ -671,6 +677,9 @@ Ir a la ventana anterior / siguiente@*
@item F10
Borrar el @'ultimo mensaje en la barra de informaciones@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Refrescar toda la ventana@*
@*
@@ -695,9 +704,12 @@ Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor
@item Alt + (1-9)
Saltar a la memoria temporal con ese n@'umero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node Comandos WeeChat, FIFO pipe, Atajos de teclado, Uso
@node Comandos WeeChat, Canal FIFO, Atajos de teclado, Uso
@section Comandos WeeChat
Comandos internos WeeChat:@*
@@ -743,9 +755,9 @@ nombre_del_servidor: nombre del servidor del que desconectarse@*
@*
@item debug dump
@*
print debug messages@*
imprime mensajes de depuraci@'on@*
@*
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@*
volcado: almacena un volcado de memoria en el archivo de registro de Weechat (se escribe el mismo volcado cuando Weechat se cuelga)@*
@*
@item help [comando]
@*
@@ -753,13 +765,20 @@ mostrar ayuda sobre los comandos@*
@*
comando: nombre de un comando de Weechat @'o de IRC@*
@*
@item perl [load fichero] | [autoload] | [unload]
@item perl [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Perl scripts@*
@*
fichero: Perl script (archivo) a cargar@*
Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@*
@*
@item python [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Python scripts@*
@*
fichero: Python script (archivo) a cargar@*
Sin argumentos, el comando /python lista todos los Python scripts cargados.@*
@*
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@*
lista, a@~nade o elimina servidores@*
@@ -824,10 +843,10 @@ mensaje: mensaje para el estado ausente (si no se da ning
@*
@item ban [canal] [usariio [usuario ...]]
@*
bans nicks or hosts@*
banea usuarios o m@'aquinas@*
@*
channel: channel for ban@*
nickname: user or host to ban@*
canal: canal en el que banear@*
usuario: nombre de usuario o m@'aquina a banear@*
@*
@item ctcp usuario tipo
@*
@@ -900,11 +919,11 @@ comentario: comentario para la expulsi@'on@*
@*
@item kickban [canal] usuario [comentario]
@*
kicks and bans a nick from a channel@*
expulsa y banea a un usuario de un canal@*
@*
channel: channel where user is@*
nickname: nickname to kick and ban@*
comment: comment for kick@*
canal: canal donde est@'a el usuario@*
usuario: nombre de usuario a expulsar y banear@*
comentario: comentario para la expulsi@'on@*
@*
@item kill usuario comentario
@*
@@ -983,11 +1002,12 @@ listar usuarios en canales@*
@*
canal: nombre del canal@*
@*
@item nick usuario
@item nick [-all] usuarios
@*
cambiar el nombre de usuario actual@*
@*
usuario: nuevo nombre de usuario para el servidor IRC actual@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice usuario texto
@*
@@ -1118,10 +1138,10 @@ target: servidor objetivo@*
@*
@item unban [canal] usuario [usuario ...]
@*
unbans nicks or hosts@*
desbanea usuarios o m@'aquinas@*
@*
channel: channel for unban@*
nickname: user or host to unban@*
canal: canal en el que desbanear (quitar la prohibici@'on)@*
usuario: usuario o m@'aquina a desbanear@*
@*
@item userhost usuario [usuario ...]
@*
@@ -1177,37 +1197,40 @@ destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@end table
@node FIFO pipe, , Comandos WeeChat, Uso
@section FIFO pipe
@node Canal FIFO, , Comandos WeeChat, Uso
@section Canal FIFO
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
Puedes controlar WeeChat a distantia, enviando comandos o texto a un canal FIFO
(debes activar la opci@'on "irc_fifo_pipe" que est@'a desactivada por defecto).@*
El canal FIFO est@'a dentro del directorio ~/.weechat/ y se llama
"weechat_fifo_xxxxx" (donde xxxxx es el ID del proceso (PID) de WeeChat).@*
Entonces si tienes varios WeeChat que se est@'an ejecutando, tendr@'as varios
canales FIFO, uno por cada sesi@'on.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
La sintaxis para enviar comandos o texto dentro del canal FIFO es la siguiente:@*
@command{servidor,canal *texto o comando aqu@'i}@*
donde el serviros y el canal son opcionales pero si precisa el canal, debes
precisar tambi@'en el servidor.@*
@*
Some examples:
Algunos ejemplos:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@item @bullet{} cambiar el seud@'onimo en freenode por "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@item @bullet{} escribir texto en el canal #weechat:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@command{echo "freenode,#weechat *@exclamdown{}Hola a todos!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} escribir texto en el canal corriente (el que se puede visualizar en WeeChat actualmente)
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@command{echo "*¡Hola!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
Puedes escribir un script que envia los comandos a todos los programas WeeChat
que se est@'an ejecutando de momento. Por ejemplo:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
@@ -1217,8 +1240,8 @@ You can write a script to send command to all running WeeChat at same time, for
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
Si el script se llama "auto_weechat_command", puedes ejecutarlo hac@'i:@*
@command{./auto_weechat_command "freenode,#weechat *Hola"}
@c ******************************* Extensions *********************************
@@ -1253,7 +1276,7 @@ Listar los programas Perl cargados: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@*
Es la primera funci@'on a la que llamar en el programa Perl.@*
Todos los programas en Perl para WeeChat deben llamar esta funci@'on.@*
@@ -1269,42 +1292,29 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@*
@item
@command{IRC::print ( mensaje );}@*
@*
Escribe un mensaje en la ventana actual (canal o servidor).@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print ("mensaje");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [servidor,] mensaje );}@*
@command{weechat::print ( mensaje, [canal, [servidor]] );}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@item @option{mensaje}: mensaje que debe escribir en el canal
@end itemize
@*
@emph{Ejemplos:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "mensaje");}@*
@code{IRC::print_with_channel ("#weechat", "mensaje");}@*
@emph{Ejemplo:}@*
@code{weechat::print ("mensaje");}@*
@code{weechat::print ("mensaje", "#weechat");}@*
@code{weechat::print ("mensaje", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( retraso, mensaje );}@*
@command{weechat::print_infobar ( retraso, mensaje );}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@@ -1316,11 +1326,11 @@ Escribir un mensaje en la barra de informaciones.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print_infobar (5, "mensaje");}@*
@code{weechat::print_infobar (5, "mensaje");}@*
@*
@item
@command{IRC::add_message_handler ( nombre, funci@'on );}@*
@command{weechat::add_message_handler ( nombre, funci@'on );}@*
@*
Adjunta una funci@'on Perl a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@@ -1336,18 +1346,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_message_handler ("privmsg", mi_funcion);}@*
@code{weechat::add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nombre, funci@'on );}@*
@command{weechat::add_command_handler ( nombre, funci@'on );}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Perl.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@@ -1362,23 +1372,41 @@ al antiguo comando si el script Perl est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_command_handler ("comando", mi_comando);}@*
@code{weechat::add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nombre );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nombre, [servidor] );}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{servidor}: nombre interno del servidor
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@@ -1390,8 +1418,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$version = weechat::get_info("version");}@*
@code{$nick = weechat::get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1399,7 +1427,171 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@node Programas Python, Programas Ruby, Programas Perl, Extensiones
@section Programas Python
¡No desarrollado!
@subsection Cargar/descargar programas Python
Los programas Python se cargan y descargan con el comando @command{/python}
(escribiendo @kbd{/help python} en WeeChat para obtener la ayuda acerca del comando).@*
@emph{Ejemplos:}@*
@itemize @bullet
@item
Cargar un programa Python: @kbd{/python load /tmp/ejemplo.py}@*
@item Descargar todos los programas Python: @kbd{/python unload}@*
@item
Listar los programas Python cargados: @kbd{/python}@*
@end itemize
@subsection Interfaz WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre @'unico para identificar el programa (cada programa debe
tener un nombre distinto)
@item @option{versi@'on}: versi@'on del programa
@item @option{funci@'on_final}: funci@'on Python llamada cuando el programa finaliza
(par@'ametro facultativo, una cadena llena significa que no hay ninguna funci@'on que llamar)
@item @option{descripci@'on}: descripci@'on breve del programa
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje");}@*
@code{weechat.prnt ("mensaje", "#weechat");}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje );}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{plazo}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{message}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje");}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on );}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del mensaje IRC que producir@'a la llamada a la funci@'on.@*
Para saber qu@'e tipo de mensajes IRC existen puede leer las
RFC 1459 y/o 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{funci@'on}: funci@'on en Python llamada cuando se reciba el mensaje.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on );}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del nuevo comando@*
Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a
el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder
al antiguo comando si el script Python est@'a cargado.
@item @option{funcion}: funci@'on Python assiciada al comando.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] );}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@item @option{2 o channel}: obtener el nombre del canal
@item @option{3 o server}: obtener el nombre del servidor
@item @option{4 o weechatdir}: obtener el directorio home de WeeChat
@item @option{5 o away}: obtener la informaci@'on "away" del servidor
@end itemize
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Programas Ruby, , Programas Python, Extensiones
@section Programas Ruby
+228 -38
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
@subtitle Documentation pour WeeChat v0.1.2 - 21 Mai 2005
@image{weechat_image}
@@ -270,6 +270,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item look_charset_internal
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
@item look_buffer_timestamp
Horodatage pour les tampons@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '[%H:%M:%S]'@*
@item look_color_nicks
Afficher les utilisateurs avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -414,6 +417,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_voice
Couleur pour le symbole voix@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_sep
Couleur pour le s@'eparateur de pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@@ -671,6 +677,9 @@ Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item F11 / F12
Faire d@'efiler la liste des pseudos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@@ -695,6 +704,9 @@ Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Faire d@'efiler la liste des pseudos@*
@*
@end table
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
@@ -753,13 +765,20 @@ afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item perl [load fichier] | [autoload] | [unload]
@item perl [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Perl@*
@*
fichier: script Perl (fichier) @`a charger@*
Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
@*
@item python [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Python@*
@*
fichier: script Python (fichier) @`a charger@*
Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@@ -983,11 +1002,12 @@ lister les utilisateurs sur des canaux@*
@*
canal: nom du canal@*
@*
@item nick pseudo
@item nick [-all] pseudo
@*
changer le pseudo courant@*
@*
pseudo: nouveau pseudo pour le serveur IRC courant@*
-all: d@'efinir le nouveau pseudo sur tous les serveurs connect@'es@*
pseudo: nouveau pseudo@*
@*
@item notice pseudo texte
@*
@@ -1254,7 +1274,7 @@ Lister les scripts Perl charg@'es : @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nom, version, fonction_de_fin, description );}@*
@command{weechat::register ( nom, version, fonction_de_fin, description );}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Perl.@*
Tout script Perl pour WeeChat doit appeler cette fonction.@*
@@ -1271,42 +1291,29 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Affiche un message dans la fen@^etre courante (canal ou serveur).@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [serveur,] message );}@*
@command{weechat::print ( message, [canal, [serveur]] );}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemples :}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@emph{Exemple :}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( d@'elai, message );}@*
@command{weechat::print_infobar ( d@'elai, message );}@*
@*
Affiche un message dans la barre d'infos.@*
@@ -1318,11 +1325,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( nom, fonction );}@*
@command{weechat::add_message_handler ( nom, fonction );}@*
@*
Attache une fonction Perl @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@@ -1338,18 +1345,18 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_message_handler ("privmsg", ma_fonction);}@*
@code{weechat::add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nom, fonction );}@*
@command{weechat::add_command_handler ( nom, fonction );}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Perl.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@@ -1364,23 +1371,41 @@ ne seront plus accessibles tant que le script Perl sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_command_handler ("commande", ma_commande);}@*
@code{weechat::add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [serveur,] nom );}@*
@command{weechat::command ( commande, [canal, [serveur]] );}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat::command ("bonjour tout le monde !");}@*
@code{weechat::command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nom, [serveur] );}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{serveur}: nom interne du serveur
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@@ -1393,7 +1418,7 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@*
@emph{Exemples :}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1401,7 +1426,172 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@node Scripts Python, Scripts Ruby, Scripts Perl, Extensions
@section Scripts Python
Non d@'evelopp@'e !
@subsection Charger/d@'echarger des scripts Python
Les scripts Python sont charg@'es et d@'echarg@'es avec la commande @command{/python}
(tapez @kbd{/help python} dans WeeChat pour obtenir de l'aide sur la commande).@*
@emph{Exemples :}@*
@itemize @bullet
@item
Charger un script Python : @kbd{/python load /tmp/essai.py}@*
@item D@'echarger tous les scripts Python : @kbd{/python unload}@*
@item
Lister les scripts Python charg@'es : @kbd{/python}@*
@end itemize
@subsection Interface WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description );}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom unique pour identifier le script (chaque script doit
avoir un nom diff@'erent)
@item @option{version}: version du script
@item @option{fonction_de_fin}: fonction Python appel@'ee quand le script est
d@'echarg@'e (param@`etre facultatif, une cha@^ine vide signifiant qu'il n'y a pas
de fonction @`a appeler)
@item @option{description}: description br@`eve du script.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] );}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message );}@*
@*
Affiche un message dans la barre d'infos.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e
(si 0, le message ne sera pas effac@'e).
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message");}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction );}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom du message IRC pour lequel la fonction est appel@'ee@*
Pour conna@^itre la liste des messages IRC disponibles, merci de consulter les
RFC 1459 et/ou 2812 :@*
RFC 1459 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{fonction}: fonction Python appel@'ee lorsque le message est re@,{c}u
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction );}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de la nouvelle commande@*
Il peut s'agir d'une commande existante, auquel cas celle-ci est @'ecras@'ee par
la fonction Python. Soyez prudent en @'ecrasant les commandes WeeChat, car elles
ne seront plus accessibles tant que le script Python sera charg@'e.
@item @option{fonction}: fonction Python associ@'ee @`a la commande
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] );}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !");}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] );}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@item @option{2 ou channel}: obtenir le nom du canal
@item @option{3 ou server}: obtenir le nom du serveur
@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat
@item @option{5 ou away}: obtenir le drapeau "away" du serveur
@end itemize
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Scripts Ruby, , Scripts Python, Extensions
@section Scripts Ruby
+204 -34
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.1 - 20 de Mar@,{c}o de 2005
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2 - 21 de Maio de 2005
@image{weechat_image}
@@ -284,6 +284,9 @@ Comute ao janela anterior / seguinte@*
@item F10
Apagar a @'ultima mensagem da barra do info@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Redesenhe a janela inteira@*
@*
@@ -308,6 +311,9 @@ Comute @`a primeira canaleta do servidor seguinte (ou do amortecedor do servidor
@item Alt + d@'igito (1-9)
Comute ao amortecedor pelo n@'umero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node Comandos do WeeChat, FIFO pipe, Recursos de teclado, Utilizacao
@@ -392,7 +398,7 @@ Listar todos os Scripts Perl: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@*
@command{weechat::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@*
@*
Esta @'e a primeira fun@,{c}@~ao a invocar num Script Perl.@*
Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@*
@@ -406,42 +412,29 @@ Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{IRC::print ( mensagem );}@*
@*
Imprimne uma mensagem na janela actual (canal ou servidor).@*
@emph{Argumentos:}
@itemize @minus
@item @option{mensagem}: mensagem a mostrar
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::print ("mensagem");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [servidor,] mensagem );}@*
@command{weechat::print ( mensagem, [canal, [servidor]] );}@*
@*
Imprimne uma mensagem na canal.@*
@emph{Argumentos:}
@itemize @minus
@item @option{mensagem}: mensagem a mostrar
@item @option{canal}: nome da canal
@item @option{servidor}: nome interno da servidor
@item @option{mensagem}: mensagem a mostrar
@end itemize
@*
@emph{Exemplos:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "mensagem");}@*
@code{IRC::print_with_channel ("#weechat", "mensagem");}@*
@emph{Exemplo:}@*
@code{weechat::print ("mensagem");}@*
@code{weechat::print ("mensagem", "#weechat");}@*
@code{weechat::print ("mensagem", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( atrasa, mensagem );}@*
@command{weechat::print_infobar ( atrasa, mensagem );}@*
@*
Imprimne uma mensagem na barra do info.@*
@@ -453,11 +446,11 @@ Imprimne uma mensagem na barra do info.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::print_infobar (5, "mensagem");}@*
@code{weechat::print_infobar (5, "mensagem");}@*
@*
@item
@command{IRC::add_message_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat::add_message_handler ( nome, fun@,{c}@~ao );}@*
@*
Anexa uma fun@,{c}@~ao Perl a uma mensagem de IRC.@*
A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@*
@@ -472,17 +465,17 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::add_message_handler ("privmsg", my_function);}@*
@code{weechat::add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat::add_command_handler ( nome, fun@,{c}@~ao );}@*
@*
Cria um novo comando do Weechat, ligado a uma fun@,{c}@~ao Perl.@*
A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@*
@@ -495,23 +488,41 @@ Este nome pode pertencer a um comando j
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::add_command_handler ("command", my_command);}@*
@code{weechat::add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ weechat::print("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nome );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nome, [servidor] );}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@emph{Argumentos:}
@itemize @minus
@item @option{servidor}: nome interno da servidor
@item @option{nome}: nome do info a recuperar:
@item @option{servidor}: nome interno da servidor
@itemize @minus
@item @option{0 ou version}: comece a vers@~ao de WeeChat
@item @option{1 ou nick}: comece o nickname
@@ -524,7 +535,7 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@*
@emph{Exemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -532,7 +543,166 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@node Scripts Python, Scripts Ruby, Scripts Perl, Extencoes
@section Scripts Python
N@~AO DESENVOLVIDO!
@subsection Carregar/Descarregar Scripts Python
Os Scripts Python s@~ao carregados e descarregados com o comando @command{/python}.
(escreve @kbd{/help python} dentro do WeeChat para obteres ajuda acerca do comando).@*
@emph{Exemplos:}@*
@itemize @bullet
@item
Carregar um Script Python: @kbd{/python load /tmp/sample.py}@*
@item
Descarregar todos os Scripts Python: @kbd{/python unload}@*
@item
Listar todos os Scripts Python: @kbd{/python}@*
@end itemize
@subsection Interface WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@*
@*
Esta @'e a primeira fun@,{c}@~ao a invocar num Script Python.@*
Todos os Scripts Python para o Weechat devem invocar esta fun@,{c}@~ao.@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome @'unico que indentifique o script (cada Script Python deve ter um @'unico nome)
@item @option{vers@~ao}: vers@~ao do script
@item @option{fun@,{c}@~ao_de_shutdown}: fun@,{c}@~ao Python invocada quando o script Ă© descarregado (par@^ametro opcional, se deixado em branco significa que nada deve ser chamado)
@item @option{descri@,{c}@~ao}: breve descri@,{c}@~ao do script.
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{weechat.prnt ( mensagem, [canal, [servidor]] );}@*
@*
Imprimne uma mensagem na canal.@*
@emph{Argumentos:}
@itemize @minus
@item @option{mensagem}: mensagem a mostrar
@item @option{canal}: nome da canal
@item @option{servidor}: nome interno da servidor
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.prnt ("mensagem");}@*
@code{weechat.prnt ("mensagem", "#weechat");}@*
@code{weechat.prnt ("mensagem", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( atrasa, mensagem );}@*
@*
Imprimne uma mensagem na barra do info.@*
@emph{Argumentos:}
@itemize @minus
@item @option{atrasa}: depois que isto atrasa (nos segundos), a mensagem estar@'a apagada
(se 0, mensagem n@~ao forem apagados).
@item @option{mensagem}: mensagem a mostrar
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.print_infobar (5, "mensagem");}@*
@*
@item
@command{weechat.add_message_handler ( nome, fun@,{c}@~ao );}@*
@*
Anexa uma fun@,{c}@~ao Python a uma mensagem de IRC.@*
A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome da mensagem IRC@*
Para conheceres uma lista de mensagens de IRC, por favor lĂŞ o RFC 1459 e/ou o 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python invocada quando a mensagem Ă© recebida
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( nome, fun@,{c}@~ao );}@*
@*
Cria um novo comando do Weechat, ligado a uma fun@,{c}@~ao Python.@*
A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome do novo comando@*
Este nome pode pertencer a um comando já existente, o qual ser@'a sobreposto pela fun@,{c}@~ao Python. Tem cuidado quando fizeres isto: os comandos originais não estar@~ao acessiveis antes de teres descarregado o Script Python.
@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python ligada ao comando
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( nome, [servidor] );}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome do info a recuperar:
@item @option{servidor}: nome interno da servidor
@itemize @minus
@item @option{0 ou version}: comece a vers@~ao de WeeChat
@item @option{1 ou nick}: comece o nickname
@item @option{2 ou channel}: comece o nome da canal
@item @option{3 ou server}: comece o nome do servidor
@item @option{4 ou weechatdir}: comece a WeeChat o diret@'orio home
@item @option{5 ou away}: comece a bandeira ausente para o servidor
@end itemize
@end itemize
@*
@emph{Exemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Scripts Ruby, , Scripts Python, Extencoes
@section Scripts Ruby
+2
View File
@@ -9,6 +9,8 @@
./src/irc/irc.h
./src/plugins/perl/wee-perl.c
./src/plugins/perl/wee-perl.h
./src/plugins/python/wee-python.c
./src/plugins/python/wee-python.h
./src/plugins/plugins.c
./src/plugins/plugins.h
./src/gui/curses/gui-input.c
+803 -701
View File
File diff suppressed because it is too large Load Diff
+809 -701
View File
File diff suppressed because it is too large Load Diff
+783 -685
View File
File diff suppressed because it is too large Load Diff
+180 -14
View File
@@ -73,10 +73,15 @@ t_weechat_command weechat_commands[] =
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
{ "perl", N_("list/load/unload Perl scripts"),
N_("[load filename] | [autoload] | [unload]"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Perl script (file) to load\n"
"Without argument, /perl command lists all loaded Perl scripts."),
0, 2, weechat_cmd_perl, NULL },
{ "python", N_("list/load/unload Python scripts"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Python script (file) to load\n"
"Without argument, /python command lists all loaded Python scripts."),
0, 2, weechat_cmd_python, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
@@ -652,6 +657,8 @@ void
user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
{
t_irc_nick *ptr_nick;
int plugin_args_length;
char *plugin_args;
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
return;
@@ -677,7 +684,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
else
server_sendf (server, "PRIVMSG %s :%s\r\n",
CHANNEL(buffer)->name, command);
if (CHANNEL(buffer)->type == CHAT_PRIVATE)
{
gui_printf_type_color (CHANNEL(buffer)->buffer,
@@ -712,6 +719,27 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
WEECHAT_ERROR);
}
}
/* sending a copy of the message as PRIVMSG to plugins because irc server doesn't */
plugin_args_length = strlen ("localhost PRIVMSG :") +
strlen (CHANNEL(buffer)->name) + strlen(command) + 16;
plugin_args = (char *) malloc (plugin_args_length * sizeof (*plugin_args));
if (plugin_args)
{
snprintf (plugin_args, plugin_args_length,
"localhost PRIVMSG %s :%s",
CHANNEL(buffer)->name, command);
plugin_event_msg ("privmsg", server->name, plugin_args);
free (plugin_args);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s unable to call handler for message (not enough memory)\n"),
WEECHAT_ERROR);
}
}
else
{
@@ -1286,19 +1314,18 @@ weechat_cmd_help (int argc, char **argv)
int
weechat_cmd_perl (int argc, char **argv)
{
#ifdef PLUGINS
#ifdef PLUGIN_PERL
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
#ifdef PLUGIN_PERL
switch (argc)
{
case 0:
/* list registered Perl scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered Perl scripts:\n"));
gui_printf (NULL, _("Registered %s scripts:\n"), "Perl");
if (perl_scripts)
{
for (ptr_plugin_script = perl_scripts; ptr_plugin_script;
@@ -1320,7 +1347,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl message handlers:\n"));
gui_printf (NULL, _("%s message handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1329,8 +1356,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => Perl(%s)\n"),
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1342,7 +1370,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl command handlers:\n"));
gui_printf (NULL, _("%s command handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1351,8 +1379,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => Perl(%s)\n"),
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1366,13 +1395,13 @@ weechat_cmd_perl (int argc, char **argv)
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
if (strcasecmp (argv[0], "unload") == 0)
else if (strcasecmp (argv[0], "reload") == 0)
{
/* unload all Perl scripts */
plugin_unload (PLUGIN_TYPE_PERL, NULL);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Perl scripts unloaded\n"));
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PERL, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
@@ -1418,11 +1447,148 @@ weechat_cmd_perl (int argc, char **argv)
(void) argv;
#endif /* PLUGIN_PERL */
return 0;
}
/*
* weechat_cmd_python: list/load/unload Python scripts
*/
int
weechat_cmd_python (int argc, char **argv)
{
#ifdef PLUGIN_PYTHON
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
switch (argc)
{
case 0:
/* list registered Python scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered %s scripts:\n"), "Python");
if (python_scripts)
{
for (ptr_plugin_script = python_scripts; ptr_plugin_script;
ptr_plugin_script = ptr_plugin_script->next_script)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, " %s v%s%s%s\n",
ptr_plugin_script->name,
ptr_plugin_script->version,
(ptr_plugin_script->description[0]) ? " - " : "",
ptr_plugin_script->description);
}
}
else
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Python message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s message handlers:\n"), "Python");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Python command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s command handlers:\n"), "Python");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
else if (strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
{
/* load Python script */
if (strstr(argv[1], DIR_SEPARATOR))
path_script = NULL;
else
{
path_length = strlen (weechat_home) + strlen (argv[1]) + 7;
path_script = (char *) malloc (path_length * sizeof (char));
snprintf (path_script, path_length, "%s%s%s%s%s",
weechat_home, DIR_SEPARATOR, "python",
DIR_SEPARATOR, argv[1]);
}
plugin_load (PLUGIN_TYPE_PYTHON,
(path_script) ? path_script : argv[1]);
if (path_script)
free (path_script);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
break;
default:
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Python support.\n"
"Please rebuild WeeChat with "
"\"--enable-python\" option for ./configure script\n"));
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGINS */
#endif /* PLUGIN_PYTHON */
return 0;
}
+1
View File
@@ -70,6 +70,7 @@ extern int weechat_cmd_debug (int, char **);
extern int weechat_cmd_disconnect (int, char **);
extern int weechat_cmd_help (int, char **);
extern int weechat_cmd_perl (int, char **);
extern int weechat_cmd_python (int, char **);
extern int weechat_cmd_save (int, char **);
extern int weechat_cmd_server (int, char **);
extern int weechat_cmd_set (char *);
+10 -1
View File
@@ -193,7 +193,8 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "perl") == 0)
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -202,6 +203,9 @@ completion_build_list (t_completion *completion, void *channel)
weelist_add (&completion->completion_list,
&completion->last_completion,
"autoload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"reload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"unload");
@@ -392,6 +396,11 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "me") == 0)
{
completion->context = COMPLETION_NICK;
return;
}
if (strcasecmp (completion->base_command, "notice") == 0)
{
if (completion->base_command_arg != 1)
+13 -4
View File
@@ -52,7 +52,9 @@
#include <iconv.h>
#endif
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
#include "weechat.h"
#include "weeconfig.h"
@@ -115,8 +117,10 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf, *ptr_inbuf, *ptr_outbuf;
int inbytesleft, outbytesleft;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (strcasecmp(from_code, to_code) != 0))
@@ -573,6 +577,9 @@ weechat_welcome_message ()
cfg_look_startup_version)
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX1,
"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
wee_log_printf ("%s (%s %s %s)\n",
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
}
/*
@@ -625,7 +632,7 @@ wee_dump (int crash)
if (crash)
{
sigsegv = 1;
wee_log_printf ("very bad, WeeChat is crashing (SIGSEGV received)...\n");
wee_log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
}
wee_log_printf ("\n");
@@ -734,7 +741,9 @@ main (int argc, char *argv[])
textdomain (PACKAGE);
#endif
#ifdef HAVE_LANGINFO_CODESET
local_charset = strdup (nl_langinfo (CODESET));
#endif
signal (SIGINT, my_sigint); /* ignore SIGINT signal */
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
@@ -761,8 +770,8 @@ main (int argc, char *argv[])
}
gui_init (); /* init WeeChat interface */
plugin_init (); /* init plugin interface(s) */
weechat_welcome_message (); /* display WeeChat welcome message */
plugin_init (); /* init plugin interface(s) */
/* auto-connect to servers */
server_auto_connect (server_cmd_line);
fifo_create (); /* create FIFO pipe for remote control */
+5 -1
View File
@@ -30,7 +30,11 @@
#if defined(ENABLE_NLS) && !defined(_)
#include <locale.h>
#include <libintl.h>
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#else
#include "../../intl/libintl.h"
#endif
#define _(x) gettext(x)
#ifdef gettext_noop
#define N_(string) gettext_noop (string)
+12 -2
View File
@@ -66,6 +66,7 @@ char *cfg_look_weechat_slogan;
char *cfg_look_charset_decode;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks;
int cfg_look_color_actions;
int cfg_look_remove_colors_from_msgs;
@@ -112,6 +113,10 @@ t_config_option weechat_options_look[] =
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
"[%H:%M:%S]", NULL, NULL, &cfg_look_buffer_timestamp, config_change_buffer_content },
{ "look_color_nicks", N_("display nick names with different colors"),
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -210,6 +215,7 @@ int cfg_col_nick_chanadmin;
int cfg_col_nick_op;
int cfg_col_nick_halfop;
int cfg_col_nick_voice;
int cfg_col_nick_more;
int cfg_col_nick_sep;
int cfg_col_nick_self;
int cfg_col_nick_private;
@@ -370,6 +376,10 @@ t_config_option weechat_options_colors[] =
N_("color for voice symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_nick_voice, NULL, &config_change_color },
{ "col_nick_more", N_("color for '+' when scrolling nicks"),
N_("color for '+' when scrolling nicks"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_more, NULL, &config_change_color },
{ "col_nick_sep", N_("color for nick separator"),
N_("color for nick separator"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -1379,7 +1389,7 @@ config_create_default ()
}
printf (_("%s: creating default config file...\n"), PACKAGE_NAME);
wee_log_printf (_("creating default config file\n"));
wee_log_printf (_("Creating default config file\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
@@ -1551,7 +1561,7 @@ config_write (char *config_name)
return -1;
}
wee_log_printf (_("saving config to disk\n"));
wee_log_printf (_("Saving config to disk\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
+2
View File
@@ -83,6 +83,7 @@ extern char *cfg_look_weechat_slogan;
extern char *cfg_look_charset_decode;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks;
extern int cfg_look_color_actions;
extern int cfg_look_remove_colors_from_msgs;
@@ -132,6 +133,7 @@ extern int cfg_col_nick_chanadmin;
extern int cfg_col_nick_op;
extern int cfg_col_nick_halfop;
extern int cfg_col_nick_voice;
extern int cfg_col_nick_more;
extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
extern int cfg_col_nick_private;
+12 -1
View File
@@ -15,10 +15,21 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
noinst_LIBRARIES = lib_weechat_gui_common.a
lib_weechat_gui_common_a_SOURCES = gui-common.c \
gui.h
if GUI_NCURSES
curses_dir=curses
endif
if GUI_WXWIDGETS
wxwidgets_dir=wxwidgets
endif
if GUI_GTK
gtk_dir=gtk
endif
@@ -27,4 +38,4 @@ if GUI_QT
qt_dir=qt
endif
SUBDIRS = $(curses_dir) $(gtk_dir) $(qt_dir)
SUBDIRS = . $(curses_dir) $(wxwidgets_dir) $(gtk_dir) $(qt_dir)
+3 -4
View File
@@ -19,12 +19,11 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = weechat-curses
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(NCURSES_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_curses_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_curses_SOURCES = gui-display.c \
gui-input.c
+272 -85
View File
@@ -30,6 +30,7 @@
#include <string.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#include <ncurses.h>
#include "../../common/weechat.h"
@@ -65,6 +66,7 @@ char *nicks_colors[COLOR_WIN_NICK_NUMBER] =
int color_attr[NUM_COLORS];
/*
* gui_assign_color: assign a color (read from config)
*/
@@ -141,7 +143,7 @@ gui_get_color_by_value (int color_value)
void
gui_window_set_color (WINDOW *window, int num_color)
{
if (has_colors)
if (has_colors ())
{
if (color_attr[num_color - 1] & A_BOLD)
wattron (window, COLOR_PAIR (num_color) | A_BOLD);
@@ -763,6 +765,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
wprintw (ptr_win->win_chat, ">");
for (j = 0; j < 10 - num_bars; j++)
wprintw (ptr_win->win_chat, " ");
if (ptr_dcc->size < 1024*10)
num_unit = 0;
else if (ptr_dcc->size < 1024*1024)
@@ -777,20 +780,31 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
unit_format[num_unit],
unit_format[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->pos) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->pos)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit],
((long double) ptr_dcc->size) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->size)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
if (ptr_dcc->bytes_per_sec < 1024*1024)
num_unit = 1;
else if (ptr_dcc->bytes_per_sec < 1024*1024*1024)
num_unit = 2;
else
num_unit = 3;
sprintf (format, " (%s %%s/s)", unit_format[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->bytes_per_sec) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
wclrtoeol (ptr_win->win_chat);
}
else
{
date_tmp = localtime (&(ptr_dcc->start_time));
strftime (date, sizeof (date) - 1, "%a, %d %b %Y %H:%M:%S", date_tmp);
wprintw (ptr_win->win_chat, " %s", date);
wclrtoeol (ptr_win->win_chat);
}
wclrtoeol (ptr_win->win_chat);
ptr_win->dcc_last_displayed = ptr_dcc;
i += 2;
}
@@ -860,7 +874,7 @@ void
gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
int i, x, y, column, max_length;
int i, j, x, y, column, max_length, nicks_displayed;
char format[32], format_empty[32];
t_irc_nick *ptr_nick;
@@ -943,71 +957,103 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
x = 0;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0;
column = 0;
for (ptr_nick = CHANNEL(buffer)->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_height - 1);
else
nicks_displayed = ptr_win->win_nick_height;
ptr_nick = CHANNEL(buffer)->nicks;
for (i = 0; i < ptr_win->win_nick_start; i++)
{
switch (cfg_look_nicklist_position)
if (!ptr_nick)
break;
ptr_nick = ptr_nick->next_nick;
}
if (ptr_nick)
{
for (i = 0; i < nicks_displayed; i++)
{
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
switch (cfg_look_nicklist_position)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if ( ((i == 0) && (ptr_win->win_nick_start > 0))
|| ((i == nicks_displayed - 1) && (ptr_nick->next_nick)) )
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_MORE);
j = (max_length + 1) >= 4 ? 4 : max_length + 1;
for (x = 1; x <= j; x++)
mvwprintw (ptr_win->win_nick, y, x, "+");
}
else
{
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
ptr_nick = ptr_nick->next_nick;
if (!ptr_nick)
break;
}
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
}
}
}
}
@@ -1269,7 +1315,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
x = ptr_win->win_width - strlen (str_nicks) - 4;
}
else
x = ptr_win->win_width;
x = ptr_win->win_width - 2;
string = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
@@ -1313,7 +1359,7 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
char text[1024 + 1];
char text_time[1024 + 1];
/* make gcc happy */
(void) buffer;
@@ -1338,9 +1384,9 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
local_time = localtime (&time_seconds);
if (local_time)
{
strftime (text, 1024, cfg_look_infobar_timestamp, local_time);
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
wprintw (ptr_win->win_infobar, "%s", text);
wprintw (ptr_win->win_infobar, "%s", text_time);
}
if (gui_infobar)
{
@@ -1552,6 +1598,7 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
gui_current_window->buffer->num_displayed--;
window->buffer = buffer;
window->win_nick_start = 0;
gui_calculate_pos_size (window);
/* destroy Curses windows */
@@ -1800,6 +1847,100 @@ gui_move_page_down (t_gui_window *window)
}
}
/*
* gui_nick_move_beginning: go to beginning of nicklist
*/
void
gui_nick_move_beginning (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_end: go to the end of nicklist
*/
void
gui_nick_move_end (t_gui_window *window)
{
int new_start;
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
new_start = CHANNEL(window->buffer)->nicks_count - window->win_nick_height;
if (new_start < 0)
new_start = 0;
else if (new_start >= 1)
new_start++;
if (new_start != window->win_nick_start)
{
window->win_nick_start = new_start;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_up: scroll one page up in nicklist
*/
void
gui_nick_move_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start -= (window->win_nick_height - 1);
if (window->win_nick_start <= 1)
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_down: scroll one page down in nicklist
*/
void
gui_nick_move_page_down (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
&& (window->win_nick_start + window->win_nick_height - 1 < CHANNEL(window->buffer)->nicks_count))
{
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_height - 1);
else
window->win_nick_start += (window->win_nick_height - 2);
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_window_init_subviews: init subviews for a WeeChat window
*/
@@ -2187,6 +2328,8 @@ gui_init_colors ()
cfg_col_nick_halfop & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_VOICE,
cfg_col_nick_voice & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_MORE,
cfg_col_nick_more & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SEP,
cfg_col_nick_sep & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SELF,
@@ -2246,6 +2389,7 @@ gui_init_colors ()
color_attr[COLOR_WIN_NICK_OP - 1] = (cfg_col_nick_op >= 0) ? cfg_col_nick_op & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_HALFOP - 1] = (cfg_col_nick_halfop >= 0) ? cfg_col_nick_halfop & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_VOICE - 1] = (cfg_col_nick_voice >= 0) ? cfg_col_nick_voice & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_MORE - 1] = (cfg_col_nick_more >= 0) ? cfg_col_nick_more & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_SEP - 1] = 0;
color_attr[COLOR_WIN_NICK_SELF - 1] = (cfg_col_nick_self >= 0) ? cfg_col_nick_self & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_PRIVATE - 1] = (cfg_col_nick_private >= 0) ? cfg_col_nick_private & A_BOLD : 0;
@@ -2398,7 +2542,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
pos[0] = '\n';
if (buffer->num_displayed > 0)
gui_draw_buffer_chat (buffer, 0);
if (buffer->num_displayed == 0)
if (gui_add_hotlist && (buffer->num_displayed == 0))
{
if (3 - buffer->last_line->line_with_message -
buffer->last_line->line_with_highlight <=
@@ -2423,7 +2567,11 @@ void
gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message, ...)
{
static char buf[8192];
char timestamp[16];
char text_time[1024 + 1];
char text_time_char[2];
time_t time_seconds;
struct tm *local_time;
int time_first_digit, time_last_digit;
char *pos, *buf2, *buf3;
int i, j;
va_list argptr;
@@ -2454,6 +2602,12 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
}
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
va_start (argptr, message);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
@@ -2502,19 +2656,52 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
pos = buf3 - 1;
while (pos)
{
/* TODO: read timestamp format from config! */
if ((!buffer->last_line) || (buffer->line_complete))
{
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "[");
snprintf (timestamp, 16, "%02d", date_tmp->tm_hour);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_min);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_sec);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
strftime (text_time, 1024, cfg_look_buffer_timestamp, local_time);
time_first_digit = -1;
time_last_digit = -1;
i = 0;
while (text_time[i])
{
if (isdigit (text_time[i]))
{
if (time_first_digit == -1)
time_first_digit = i;
time_last_digit = i;
}
i++;
}
text_time_char[1] = '\0';
i = 0;
while (text_time[i])
{
text_time_char[0] = text_time[i];
if (time_first_digit < 0)
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
{
if ((i < time_first_digit) || (i > time_last_digit))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK,
text_time_char);
else
{
if (isdigit (text_time[i]))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP,
text_time_char);
}
}
i++;
}
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, " ");
}
gui_add_message (buffer, type, color, pos + 1);
pos = strchr (pos + 1, '\n');
+39 -19
View File
@@ -53,7 +53,7 @@ gui_read_keyb ()
int key, i;
t_gui_buffer *ptr_buffer;
t_irc_server *ptr_server;
t_irc_dcc *ptr_dcc;
t_irc_dcc *ptr_dcc, *ptr_dcc_next;
char new_char[3], *decoded_string;
t_irc_dcc *dcc_selected;
@@ -72,8 +72,6 @@ gui_read_keyb ()
case KEY_F(3):
case KEY_F(4):
case KEY_F(9):
case KEY_F(11):
case KEY_F(12):
break;
/* previous buffer in window */
case KEY_F(5):
@@ -96,6 +94,12 @@ gui_read_keyb ()
gui_infobar_remove ();
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
break;
case KEY_F(11):
gui_nick_move_page_up (gui_current_window);
break;
case KEY_F(12):
gui_nick_move_page_down (gui_current_window);
break;
/* cursor up */
case KEY_UP:
if (gui_current_window->buffer->dcc)
@@ -416,25 +420,38 @@ gui_read_keyb ()
case KEY_RIGHT:
gui_switch_to_next_buffer (gui_current_window);
break;
/* Alt + home */
case KEY_HOME:
gui_nick_move_beginning (gui_current_window);
break;
/* Alt + end */
case KEY_END:
gui_nick_move_end (gui_current_window);
break;
/* Alt + page up */
case KEY_PPAGE:
gui_nick_move_page_up (gui_current_window);
break;
/* Alt + page down */
case KEY_NPAGE:
gui_nick_move_page_down (gui_current_window);
break;
case 79:
/* TODO: replace 79 by constant name! */
if (key == 79)
if ((key = getch()) != ERR)
{
if ((key = getch()) != ERR)
switch (key)
{
switch (key)
{
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
}
break;
@@ -591,10 +608,13 @@ gui_read_keyb ()
case 'p':
case 'P':
gui_current_window->dcc_selected = NULL;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
ptr_dcc = dcc_list;
while (ptr_dcc)
{
ptr_dcc_next = ptr_dcc->next_dcc;
if (DCC_ENDED(ptr_dcc->status))
dcc_free (ptr_dcc);
ptr_dcc = ptr_dcc_next;
}
gui_redraw_buffer (gui_current_window->buffer);
break;
+3 -4
View File
@@ -19,12 +19,11 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
bin_PROGRAMS = weechat-gtk
weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
weechat_gtk_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(GTK_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_gtk_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_gtk_SOURCES = gui-display.c \
gui-input.c
+9 -6
View File
@@ -43,6 +43,8 @@
int gui_init_ok = 0; /* = 1 if GUI is initialized */
int gui_ok = 0; /* = 1 if GUI is ok */
/* (0 when term size too small) */
int gui_add_hotlist = 1; /* 0 is for temporarly disable */
/* hotlist add for all buffers */
t_gui_window *gui_windows = NULL; /* pointer to first window */
t_gui_window *last_gui_window = NULL; /* pointer to last window */
@@ -64,7 +66,7 @@ gui_window_new (int x, int y, int width, int height)
t_gui_window *new_window;
#ifdef DEBUG
wee_log_printf ("creating new window (x:%d, y:%d, width:%d, height:%d)\n",
wee_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
x, y, width, height);
#endif
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
@@ -85,6 +87,7 @@ gui_window_new (int x, int y, int width, int height)
new_window->win_nick_y = 0;
new_window->win_nick_width = 0;
new_window->win_nick_height = 0;
new_window->win_nick_start = 0;
new_window->win_title = NULL;
new_window->win_chat = NULL;
@@ -135,7 +138,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
t_gui_buffer *new_buffer;
#ifdef DEBUG
wee_log_printf ("creating new buffer\n");
wee_log_printf ("Creating new buffer\n");
#endif
/* use first buffer if no server was assigned to this buffer */
@@ -324,8 +327,7 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
else
wee_log_printf (_("%s not enough memory for infobar message\n"),
WEECHAT_ERROR);
wee_log_printf (_("Not enough memory for infobar message\n"));
free (buf2);
}
@@ -500,7 +502,7 @@ gui_new_line (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("%s not enough memory for new line!\n"));
wee_log_printf (_("Not enough memory for new line\n"));
return NULL;
}
@@ -543,7 +545,7 @@ gui_new_message (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("not enough memory!\n"));
wee_log_printf (_("Not enough memory for new message\n"));
return NULL;
}
return new_message;
@@ -840,6 +842,7 @@ gui_window_print_log (t_gui_window *window)
wee_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y);
wee_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width);
wee_log_printf (" win_nick_height . . : %d\n", window->win_nick_height);
wee_log_printf (" win_nick_start. . . : %d\n", window->win_nick_start);
wee_log_printf (" win_title . . . . . : 0x%X\n", window->win_title);
wee_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat);
wee_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick);
+25 -18
View File
@@ -26,7 +26,7 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 49
#define NUM_COLORS 50
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
@@ -56,19 +56,20 @@
#define COLOR_WIN_NICK_OP 27
#define COLOR_WIN_NICK_HALFOP 28
#define COLOR_WIN_NICK_VOICE 29
#define COLOR_WIN_NICK_SEP 30
#define COLOR_WIN_NICK_SELF 31
#define COLOR_WIN_NICK_PRIVATE 32
#define COLOR_WIN_NICK_FIRST 33
#define COLOR_WIN_NICK_LAST 42
#define COLOR_WIN_NICK_MORE 30
#define COLOR_WIN_NICK_SEP 31
#define COLOR_WIN_NICK_SELF 32
#define COLOR_WIN_NICK_PRIVATE 33
#define COLOR_WIN_NICK_FIRST 34
#define COLOR_WIN_NICK_LAST 43
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 43
#define COLOR_DCC_WAITING 44
#define COLOR_DCC_CONNECTING 45
#define COLOR_DCC_ACTIVE 46
#define COLOR_DCC_DONE 47
#define COLOR_DCC_FAILED 48
#define COLOR_DCC_ABORTED 49
#define COLOR_DCC_SELECTED 44
#define COLOR_DCC_WAITING 45
#define COLOR_DCC_CONNECTING 46
#define COLOR_DCC_ACTIVE 47
#define COLOR_DCC_DONE 48
#define COLOR_DCC_FAILED 49
#define COLOR_DCC_ABORTED 50
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
@@ -209,9 +210,10 @@ struct t_gui_window
int win_chat_cursor_y; /* position of cursor in chat window */
/* nicklist window settings */
int win_nick_x, win_nick_y; /* chat window position */
int win_nick_width; /* width of chat window */
int win_nick_height; /* height of chat window */
int win_nick_x, win_nick_y; /* nick window position */
int win_nick_width; /* width of nick window */
int win_nick_height; /* height of nick window */
int win_nick_start; /* # of 1st nick for display (scroll) */
/* windows for Curses GUI */
void *win_title; /* title window */
@@ -250,6 +252,7 @@ struct t_gui_window
extern int gui_init_ok;
extern int gui_ok;
extern int gui_add_hotlist;
extern t_gui_window *gui_windows;
extern t_gui_window *last_gui_window;
extern t_gui_window *gui_current_window;
@@ -301,8 +304,12 @@ extern void gui_switch_to_previous_buffer (t_gui_window *);
extern void gui_switch_to_next_buffer (t_gui_window *);
extern void gui_switch_to_previous_window (t_gui_window *);
extern void gui_switch_to_next_window (t_gui_window *);
extern void gui_move_page_up ();
extern void gui_move_page_down ();
extern void gui_move_page_up (t_gui_window *);
extern void gui_move_page_down (t_gui_window *);
extern void gui_nick_move_beginning (t_gui_window *);
extern void gui_nick_move_end (t_gui_window *);
extern void gui_nick_move_page_up (t_gui_window *);
extern void gui_nick_move_page_down (t_gui_window *);
extern void gui_curses_resize_handler ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
+29
View File
@@ -0,0 +1,29 @@
# Copyright (c) 2003-2005 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
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = weechat-wxwidgets
weechat_wxwidgets_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(WXWIDGETS_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_wxwidgets_SOURCES = gui-display.c \
gui-input.c
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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 wxWidgets GUI */
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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-input: user input functions for wxWidgets GUI */
+9 -2
View File
@@ -152,8 +152,10 @@ t_irc_command irc_commands[] =
N_("[channel[,channel]]"), N_("channel: channel name"),
0, 1, 1, NULL, irc_cmd_send_names, NULL },
{ "nick", N_("change current nickname"),
N_("nickname"), N_("nickname: new nickname for current IRC server"),
1, 1, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
N_("[-all] nickname"),
N_("-all: set new nickname for all connected servers\n"
"nickname: new nickname"),
1, 2, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
{ "notice", N_("send notice message to user"),
N_("nickname text"), N_("nickname: user to send notice to\ntext: text to send"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
@@ -298,6 +300,7 @@ t_irc_command irc_commands[] =
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
@@ -320,6 +323,7 @@ t_irc_command irc_commands[] =
{ "333", N_("infos about topic (nick & date changed)"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
{ "353", N_("list of nicks on channel"),
@@ -431,11 +435,14 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "671", N_("whois (secure connection)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
};
+45 -2
View File
@@ -63,6 +63,38 @@ dcc_redraw (int highlight)
}
}
/*
* dcc_calculate_speed: calculate DCC speed (for files only)
*/
void
dcc_calculate_speed (t_irc_dcc *ptr_dcc, int ended)
{
time_t local_time, elapsed;
local_time = time (NULL);
if (ended || local_time > ptr_dcc->last_check_time)
{
if (ended)
{
elapsed = local_time - ptr_dcc->start_transfer;
if (elapsed == 0)
elapsed = 1;
ptr_dcc->bytes_per_sec = ptr_dcc->pos / elapsed;
}
else
{
elapsed = local_time - ptr_dcc->last_check_time;
if (elapsed == 0)
elapsed = 1;
ptr_dcc->bytes_per_sec = (ptr_dcc->pos - ptr_dcc->last_check_pos) / elapsed;
}
ptr_dcc->last_check_time = local_time;
ptr_dcc->last_check_pos = ptr_dcc->pos;
}
}
/*
* dcc_connect: connect to another host
*/
@@ -200,6 +232,9 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
if (DCC_IS_CHAT(ptr_dcc->type))
channel_remove_dcc (ptr_dcc);
if (DCC_IS_FILE(ptr_dcc->type))
dcc_calculate_speed (ptr_dcc, 1);
if (ptr_dcc->sock != -1)
{
close (ptr_dcc->sock);
@@ -327,6 +362,7 @@ dcc_accept (t_irc_dcc *ptr_dcc)
ptr_dcc->file = open (ptr_dcc->local_filename,
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
0644);
ptr_dcc->start_transfer = time (NULL);
}
else
{
@@ -363,6 +399,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
new_dcc->type = type;
new_dcc->status = DCC_WAITING;
new_dcc->start_time = time (NULL);
new_dcc->start_transfer = time (NULL);
new_dcc->addr = addr;
new_dcc->port = port;
new_dcc->nick = strdup (nick);
@@ -378,6 +415,9 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
new_dcc->size = size;
new_dcc->pos = 0;
new_dcc->ack = 0;
new_dcc->last_check_time = 0;
new_dcc->last_check_pos = 0;
new_dcc->bytes_per_sec = 0;
new_dcc->prev_dcc = NULL;
new_dcc->next_dcc = dcc_list;
if (dcc_list)
@@ -786,7 +826,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
}
/*
* dcc_handle: receive/send data for each active DCC (files only)
* dcc_handle: receive/send data for all active DCC
*/
void
@@ -838,6 +878,7 @@ dcc_handle ()
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
ptr_dcc->start_transfer = time (NULL);
dcc_redraw (1);
}
}
@@ -921,6 +962,7 @@ dcc_handle ()
ptr_dcc->pos += (unsigned long) num_read;
pos = htonl (ptr_dcc->pos);
send (ptr_dcc->sock, (char *) &pos, 4, 0);
dcc_calculate_speed (ptr_dcc, 0);
if (ptr_dcc->pos >= ptr_dcc->size)
{
dcc_close (ptr_dcc, DCC_DONE);
@@ -987,6 +1029,7 @@ dcc_handle ()
return;
}
ptr_dcc->pos += (unsigned long) num_sent;
dcc_calculate_speed (ptr_dcc, 0);
dcc_redraw (0);
}
}
@@ -1008,7 +1051,7 @@ dcc_end ()
if (ptr_dcc->sock != -1)
{
if (ptr_dcc->status == DCC_ACTIVE)
wee_log_printf (_("aborting active DCC: \"%s\" from %s\n"),
wee_log_printf (_("Aborting active DCC: \"%s\" from %s\n"),
ptr_dcc->filename, ptr_dcc->nick);
dcc_close (ptr_dcc, DCC_FAILED);
}
+22 -4
View File
@@ -51,6 +51,26 @@ nick_find_color (t_irc_nick *nick)
return COLOR_WIN_NICK_FIRST + color;
}
/*
* nick_score_for_sort: return score for sorting nick, according to privileges
*/
int
nick_score_for_sort (t_irc_nick *nick)
{
if (nick->is_chanowner)
return -32;
if (nick->is_chanadmin)
return -16;
if (nick->is_op)
return -8;
if (nick->is_halfop)
return -4;
if (nick->has_voice)
return -2;
return 0;
}
/*
* nick_compare: compare two nicks
* return: -1 is nick1 < nick2
@@ -64,10 +84,8 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2)
{
int score1, score2, comp;
score1 = - ( (nick1->is_chanowner * 32) + (nick1->is_chanadmin * 16) +
(nick1->is_op * 8) + (nick1->is_halfop * 4) + (nick1->has_voice * 2) );
score2 = - ( (nick2->is_chanowner * 32) + (nick2->is_chanadmin * 16) +
(nick2->is_op * 8) + (nick2->is_halfop * 4) + (nick2->has_voice * 2) );
score1 = nick_score_for_sort (nick1);
score2 = nick_score_for_sort (nick2);
comp = strcasecmp(nick1->nick, nick2->nick);
if (comp > 0)
+167 -20
View File
@@ -740,29 +740,30 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
if (pos)
pos[0] = '\0';
/* change nickname in any opened private window */
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer))
{
if ((CHANNEL(ptr_buffer)->name)
&& (strcasecmp (host, CHANNEL(ptr_buffer)->name) == 0))
{
free (CHANNEL(ptr_buffer)->name);
CHANNEL(ptr_buffer)->name = strdup (arguments);
}
}
}
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
ptr_nick = nick_search (ptr_channel, host);
if (ptr_nick)
{
/* change nickname in any opened private window */
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer))
{
if ((CHANNEL(ptr_buffer)->name)
&& (strcmp (ptr_nick->nick, CHANNEL(ptr_buffer)->name) == 0))
{
free (CHANNEL(ptr_buffer)->name);
CHANNEL(ptr_buffer)->name = strdup (arguments);
}
}
}
/* change nickname on channel */
nick_is_me = (strcmp (ptr_nick->nick, server->nick) == 0) ? 1 : 0;
if (nick_is_me)
gui_add_hotlist = 0;
nick_change (ptr_channel, ptr_nick, arguments);
irc_display_prefix (ptr_channel->buffer, PREFIX_INFO);
if (nick_is_me)
@@ -786,6 +787,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
arguments);
if (gui_buffer_has_nicklist (ptr_channel->buffer))
gui_draw_buffer_nick (ptr_channel->buffer, 1);
gui_add_hotlist = 1;
}
}
@@ -1994,6 +1996,48 @@ irc_cmd_recv_306 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_307: '307' command (whois, registered nick)
*/
int
irc_cmd_recv_307 (t_irc_server *server, char *host, char *arguments)
{
char *pos_nick, *pos_msg;
/* make gcc happy */
(void) host;
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
while (pos_nick[0] == ' ')
pos_nick++;
pos_msg = strchr (pos_nick, ' ');
if (pos_msg)
{
pos_msg[0] = '\0';
pos_msg++;
while (pos_msg[0] == ' ')
pos_msg++;
if (pos_msg[0] == ':')
pos_msg++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK, "%s", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "] ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT, "%s\n",
pos_msg);
}
}
return 0;
}
/*
* irc_cmd_recv_311: '311' command (whois, user)
*/
@@ -2847,6 +2891,68 @@ irc_cmd_recv_333 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_341: '341' command received (inviting)
*/
int
irc_cmd_recv_341 (t_irc_server *server, char *host, char *arguments)
{
char *pos, *pos_nick, *pos_channel;
pos = strchr (host, '!');
if (pos)
pos[0] = '\0';
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
pos_nick[0] = '\0';
pos_nick++;
while (pos_nick[0] == ' ')
pos_nick++;
pos_channel = strchr (pos_nick, ' ');
if (pos_channel)
{
pos_channel[0] = '\0';
pos_channel++;
while (pos_channel[0] == ' ')
pos_channel++;
if (pos_channel[0] == ':')
pos_channel++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
"%s ", arguments);
gui_printf (server->buffer, _("has invited"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
" %s ", pos_nick);
gui_printf (server->buffer, _("on"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL,
" %s\n", pos_channel);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify channel for \"%s\" command\n"),
WEECHAT_ERROR, "341");
return -1;
}
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify nickname for \"%s\" command\n"),
WEECHAT_ERROR, "341");
return -1;
}
return 0;
}
/*
* irc_cmd_recv_351: '351' command received (server version)
*/
@@ -2970,16 +3076,16 @@ irc_cmd_recv_352 (t_irc_server *server, char *host, char *arguments)
PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK,
"%s", pos_nick);
"%s ", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT,
_(" on "));
_("on"));
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_CHANNEL,
"%s ", pos_channel);
" %s", pos_channel);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT,
"%s %s ",
" %s %s ",
pos_attr, pos_hopcount);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_HOST,
@@ -3511,3 +3617,44 @@ irc_cmd_recv_438 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_671: '671' command (whois, secure connection)
*/
int
irc_cmd_recv_671 (t_irc_server *server, char *host, char *arguments)
{
char *pos_nick, *pos_message;
/* make gcc happy */
(void) host;
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
while (pos_nick[0] == ' ')
pos_nick++;
pos_message = strchr (pos_nick, ' ');
if (pos_message)
{
pos_message[0] = '\0';
pos_message++;
while (pos_message[0] == ' ')
pos_message++;
if (pos_message[0] == ':')
pos_message++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK, "%s", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "] ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT, "%s\n", pos_message);
}
}
return 0;
}
+24 -3
View File
@@ -94,6 +94,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
time_t elapsed;
char buffer[4096];
gui_add_hotlist = 0;
if (arguments && (strncmp (arguments, "-all", 4) == 0))
{
pos = arguments + 4;
@@ -184,6 +185,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
}
}
gui_draw_buffer_status (gui_current_window->buffer, 1);
gui_add_hotlist = 1;
return 0;
}
@@ -1031,9 +1033,28 @@ irc_cmd_send_names (t_irc_server *server, char *arguments)
int
irc_cmd_send_nick (t_irc_server *server, int argc, char **argv)
{
if (argc != 1)
return -1;
server_sendf (server, "NICK %s\r\n", argv[0]);
t_irc_server *ptr_server;
if (argc == 2)
{
if (strncmp (argv[0], "-all", 4) != 0)
return -1;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->is_connected)
server_sendf (ptr_server, "NICK %s\r\n", argv[1]);
}
}
else
{
if (argc == 1)
server_sendf (server, "NICK %s\r\n", argv[0]);
else
return -1;
}
return 0;
}
+2 -2
View File
@@ -323,7 +323,7 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
return NULL;
#ifdef DEBUG
wee_log_printf ("creating new server (name:%s, address:%s, port:%d, pwd:%s, "
wee_log_printf ("Creating new server (name:%s, address:%s, port:%d, pwd:%s, "
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
"command:%s, autojoin:%s, autorejoin:%s)\n",
name, address, port, (password) ? password : "",
@@ -843,7 +843,7 @@ server_connect (t_irc_server *server)
gui_printf (server->buffer,
_("%s: connecting to %s:%d...\n"),
PACKAGE_NAME, server->address, server->port);
wee_log_printf (_("connecting to server %s:%d...\n"),
wee_log_printf (_("Connecting to server %s:%d...\n"),
server->address, server->port);
/* close any opened connection and kill child process if running */
+7
View File
@@ -212,6 +212,7 @@ struct t_irc_dcc
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
time_t start_transfer; /* the time when DCC transfer started */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
@@ -224,6 +225,9 @@ struct t_irc_dcc
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
unsigned long ack; /* number of bytes received OK */
time_t last_check_time; /* last time we looked at bytes sent/rcv*/
unsigned long last_check_pos; /* bytes sent/recv at last check */
unsigned long bytes_per_sec; /* bytes per second */
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
};
@@ -397,6 +401,7 @@ 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_305 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_306 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_307 (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 *);
@@ -414,6 +419,7 @@ extern int irc_cmd_recv_329 (t_irc_server *, char *, char *);
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_341 (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 *);
@@ -423,5 +429,6 @@ extern int irc_cmd_recv_367 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_368 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_433 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_438 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_671 (t_irc_server *, char *, char *);
#endif /* irc.h */
+4 -4
View File
@@ -21,16 +21,16 @@ if PLUGIN_PERL
perl_dir = perl
endif
# if PLUGIN_PYTHON
# python_dir = python
# endif
if PLUGIN_PYTHON
python_dir = python
endif
# if PLUGIN_RUBY
# ruby_dir = ruby
# endif
# SUBDIRS = $(perl_dir) $(python_dir) $(ruby_dir)
SUBDIRS = $(perl_dir)
SUBDIRS = $(perl_dir) $(python_dir)
noinst_LIBRARIES = lib_weechat_plugins.a
+408 -23
View File
@@ -45,10 +45,14 @@ t_plugin_script *last_perl_script = NULL;
extern void boot_DynaLoader (pTHX_ CV* cv);
/******************************* Old interface ********************************/
/*
* IRC::register: startup function for all WeeChat Perl scripts
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_register)
{
char *name, *version, *shutdown_func, *description;
@@ -78,12 +82,12 @@ static XS (XS_IRC_register)
if (perl_script_found)
{
/* error: another scripts already exists with this name! */
/* error: another script already exists with this name! */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: unable to register Perl script \"%s\" (another script "
_("%s error: unable to register \"%s\" script (another script "
"already exists with this name)\n"),
name);
"Perl", name);
}
else
{
@@ -105,15 +109,15 @@ static XS (XS_IRC_register)
perl_scripts = new_perl_script;
last_perl_script = new_perl_script;
wee_log_printf (_("registered Perl script: \"%s\", version %s (%s)\n"),
name, version, description);
wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
"Perl", name, version, description);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to load Perl script \"%s\" (not enough memory)\n"),
WEECHAT_ERROR, name);
_("%s error: unable to load script \"%s\" (not enough memory)\n"),
"Perl", name);
}
}
XST_mPV (0, VERSION);
@@ -124,6 +128,8 @@ static XS (XS_IRC_register)
* IRC::print: print message to current buffer
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_print)
{
int i, integer;
@@ -148,6 +154,8 @@ static XS (XS_IRC_print)
* (server is optional)
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_print_with_channel)
{
int integer;
@@ -207,6 +215,8 @@ static XS (XS_IRC_print_with_channel)
* IRC::print_infobar: print message to infobar
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_print_infobar)
{
int integer;
@@ -221,7 +231,8 @@ static XS (XS_IRC_print_infobar)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: wrong parameters for IRC::print_infobar Perl function\n"));
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "print_infobar");
}
XSRETURN_EMPTY;
@@ -231,6 +242,8 @@ static XS (XS_IRC_print_infobar)
* IRC::command: send command to server
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_command)
{
int integer;
@@ -254,7 +267,8 @@ static XS (XS_IRC_command)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: server not found for IRC::command Perl function\n"));
_("%s error: server not found for \"%s\" function\n"),
"Perl", "command");
}
}
else
@@ -280,6 +294,8 @@ static XS (XS_IRC_command)
* IRC::add_message_handler: add handler for messages (privmsg, ...)
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_add_message_handler)
{
char *name, *function;
@@ -301,6 +317,8 @@ static XS (XS_IRC_add_message_handler)
* IRC::add_command_handler: add command handler (define/redefine commands)
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_add_command_handler)
{
char *name, *function;
@@ -332,6 +350,8 @@ static XS (XS_IRC_add_command_handler)
* IRC::get_info: get various infos
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_get_info)
{
char *arg, *info = NULL, *server;
@@ -355,7 +375,8 @@ static XS (XS_IRC_get_info)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: server not found for IRC::get_info Perl function\n"));
_("%s error: server not found for \"%s\" function\n"),
"Perl", "get_info");
}
}
else
@@ -406,6 +427,355 @@ static XS (XS_IRC_get_info)
XSRETURN (1);
}
/******************************* New interface ********************************/
/*
* weechat::register: startup function for all WeeChat Perl scripts
*/
static XS (XS_weechat_register)
{
char *name, *version, *shutdown_func, *description;
int integer;
t_plugin_script *ptr_perl_script, *perl_script_found, *new_perl_script;
dXSARGS;
/* make gcc happy */
(void) items;
(void) cv;
name = SvPV (ST (0), integer);
version = SvPV (ST (1), integer);
shutdown_func = SvPV (ST (2), integer);
description = SvPV (ST (3), integer);
perl_script_found = NULL;
for (ptr_perl_script = perl_scripts; ptr_perl_script;
ptr_perl_script = ptr_perl_script->next_script)
{
if (strcasecmp (ptr_perl_script->name, name) == 0)
{
perl_script_found = ptr_perl_script;
break;
}
}
if (perl_script_found)
{
/* error: another script already exists with this name! */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to register \"%s\" script (another script "
"already exists with this name)\n"),
"Perl", name);
}
else
{
/* registering script */
new_perl_script = (t_plugin_script *)malloc (sizeof (t_plugin_script));
if (new_perl_script)
{
new_perl_script->name = strdup (name);
new_perl_script->version = strdup (version);
new_perl_script->shutdown_func = strdup (shutdown_func);
new_perl_script->description = strdup (description);
/* add new script to list */
new_perl_script->prev_script = last_perl_script;
new_perl_script->next_script = NULL;
if (perl_scripts)
last_perl_script->next_script = new_perl_script;
else
perl_scripts = new_perl_script;
last_perl_script = new_perl_script;
wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
"Perl", name, version, description);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to load script \"%s\" (not enough memory)\n"),
"Perl", name);
}
}
XST_mPV (0, VERSION);
XSRETURN (1);
}
/*
* weechat::print: print message into a buffer (current or specified one)
*/
static XS (XS_weechat_print)
{
int integer;
char *message, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
dXSARGS;
/* make gcc happy */
(void) cv;
if ((items < 1) || (items > 3))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "print");
XSRETURN_NO;
return;
}
channel_name = NULL;
server_name = NULL;
if (items > 1)
{
channel_name = SvPV (ST (1), integer);
if (items > 2)
server_name = SvPV (ST (2), integer);
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
message = SvPV (ST (0), integer);
irc_display_prefix (ptr_buffer, PREFIX_PLUGIN);
gui_printf (ptr_buffer, "%s%s",
message,
((strlen (message) == 0) || (message[strlen (message) - 1] != '\n')) ? "\n" : "");
XSRETURN_YES;
}
/* buffer not found */
XSRETURN_NO;
}
/*
* weechat::print_infobar: print message to infobar
*/
static XS (XS_weechat_print_infobar)
{
int integer;
dXSARGS;
/* make gcc happy */
(void) cv;
if (items != 2)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "print_infobar");
XSRETURN_NO;
}
gui_infobar_printf (SvIV (ST (0)), COLOR_WIN_INFOBAR, SvPV (ST (1), integer));
XSRETURN_YES;
}
/*
* weechat::command: send command to server
*/
static XS (XS_weechat_command)
{
int integer;
char *command, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
dXSARGS;
/* make gcc happy */
(void) cv;
if ((items < 1) || (items > 3))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "command");
XSRETURN_NO;
return;
}
channel_name = NULL;
server_name = NULL;
if (items > 1)
{
channel_name = SvPV (ST (1), integer);
if (items > 2)
server_name = SvPV (ST (2), integer);
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
command = SvPV (ST (0), integer);
user_command (SERVER(ptr_buffer), ptr_buffer, command);
XSRETURN_YES;
}
/* buffer not found */
XSRETURN_NO;
}
/*
* weechat::add_message_handler: add handler for messages (privmsg, ...)
*/
static XS (XS_weechat_add_message_handler)
{
char *name, *function;
int integer;
dXSARGS;
/* make gcc happy */
(void) cv;
if (items != 2)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "add_message_handler");
XSRETURN_NO;
}
name = SvPV (ST (0), integer);
function = SvPV (ST (1), integer);
plugin_handler_add (&plugin_msg_handlers, &last_plugin_msg_handler,
PLUGIN_TYPE_PERL, name, function);
XSRETURN_YES;
}
/*
* weechat::add_command_handler: add command handler (define/redefine commands)
*/
static XS (XS_weechat_add_command_handler)
{
char *name, *function;
int integer;
t_plugin_handler *ptr_plugin_handler;
dXSARGS;
/* make gcc happy */
(void) cv;
if (items != 2)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "add_command_handler");
XSRETURN_NO;
}
name = SvPV (ST (0), integer);
function = SvPV (ST (1), integer);
if (!weelist_search (index_commands, name))
weelist_add (&index_commands, &last_index_command, name);
ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, name);
if (ptr_plugin_handler)
{
free (ptr_plugin_handler->function_name);
ptr_plugin_handler->function_name = strdup (function);
}
else
plugin_handler_add (&plugin_cmd_handlers, &last_plugin_cmd_handler,
PLUGIN_TYPE_PERL, name, function);
XSRETURN_YES;
}
/*
* weechat::get_info: get various infos
*/
static XS (XS_weechat_get_info)
{
char *arg, *info = NULL, *server_name;
t_irc_server *ptr_server;
int integer;
dXSARGS;
/* make gcc happy */
(void) cv;
if ((items < 1) || (items > 2))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "get_info");
XSRETURN_NO;
}
if (items == 2)
{
server_name = SvPV (ST (1), integer);
ptr_server = server_search (server_name);
}
else
ptr_server = SERVER(gui_current_window->buffer);
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: server not found for \"%s\" function\n"),
"Perl", "get_info");
XSRETURN_NO;
}
arg = SvPV (ST (0), integer);
if (arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
{
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
info = CHANNEL (gui_current_window->buffer)->name;
}
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
{
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
XSRETURN (1);
return;
}
if (info)
XST_mPV (0, info);
else
XST_mPV (0, "");
}
XSRETURN (1);
}
/*
* xs_init: initialize subroutines
*/
@@ -414,6 +784,8 @@ void
xs_init (pTHX)
{
newXS ("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__);
/* DEPRECATED & old interface (WeeChat <= 0.1.1), kept for compatibility */
newXS ("IRC::register", XS_IRC_register, "IRC");
newXS ("IRC::print", XS_IRC_print, "IRC");
newXS ("IRC::print_with_channel", XS_IRC_print_with_channel, "IRC");
@@ -422,6 +794,15 @@ xs_init (pTHX)
newXS ("IRC::add_message_handler", XS_IRC_add_message_handler, "IRC");
newXS ("IRC::add_command_handler", XS_IRC_add_command_handler, "IRC");
newXS ("IRC::get_info", XS_IRC_get_info, "IRC");
/* new interface (WeeChat >= 0.1.2) */
newXS ("weechat::register", XS_weechat_register, "weechat");
newXS ("weechat::print", XS_weechat_print, "weechat");
newXS ("weechat::print_infobar", XS_weechat_print_infobar, "weechat");
newXS ("weechat::command", XS_weechat_command, "weechat");
newXS ("weechat::add_message_handler", XS_weechat_add_message_handler, "weechat");
newXS ("weechat::add_command_handler", XS_weechat_add_command_handler, "weechat");
newXS ("weechat::get_info", XS_weechat_get_info, "weechat");
}
/*
@@ -433,7 +814,7 @@ wee_perl_init ()
{
char *perl_args[] = { "", "-e", "0" };
/* Following Perl code is extracted/modified from X-Chat IRC client */
/* X-Chat is (c) 1998-2002 Peter Zelezny */
/* X-Chat is (c) 1998-2005 Peter Zelezny */
char *weechat_perl_func =
{
"sub wee_perl_load_file"
@@ -451,21 +832,22 @@ wee_perl_init ()
" my $content = wee_perl_load_file ($filename);"
" if ($content eq \"__WEECHAT_ERROR__\")"
" {"
" IRC::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"
" weechat::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"
" return 1;"
" }"
" eval $content;"
" if ($@)"
" {"
" IRC::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"
" IRC::print \"$@\\n\";"
" weechat::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"
" weechat::print \"$@\\n\";"
" return 2;"
" }"
" return 0;"
"}"
"$SIG{__WARN__} = sub { IRC::print \"$_[0]\n\"; };"
"$SIG{__WARN__} = sub { weechat::print \"$_[0]\n\"; };"
};
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Perl");
my_perl = perl_alloc ();
perl_construct (my_perl);
perl_parse (my_perl, xs_init, 3, perl_args, NULL);
@@ -524,7 +906,7 @@ wee_perl_exec (char *function, char *server, char *arguments)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: %s\n"),
_("Perl error: %s"),
SvPV (sv, count));
POPs;
}
@@ -534,8 +916,8 @@ wee_perl_exec (char *function, char *server, char *arguments)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: too much values from \"%s\" (%d). Expected: 1.\n"),
function, count);
_("%s error: too much values from \"%s\" (%d). Expected: 1.\n"),
"Perl", function, count);
}
else
return_code = POPi;
@@ -556,9 +938,9 @@ int
wee_perl_load (char *filename)
{
/* execute Perl script */
wee_log_printf (_("loading Perl script \"%s\"\n"), filename);
wee_log_printf (_("Loading %s script \"%s\"\n"), "Perl", filename);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Loading Perl script \"%s\"\n"), filename);
gui_printf (NULL, _("Loading %s script \"%s\"\n"), "Perl", filename);
return wee_perl_exec ("wee_perl_load_eval_file", filename, "");
}
@@ -607,8 +989,8 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
{
if (ptr_perl_script)
{
wee_log_printf (_("unloading Perl script \"%s\"\n"),
ptr_perl_script->name);
wee_log_printf (_("Unloading %s script \"%s\"\n"),
"Perl", ptr_perl_script->name);
/* call shutdown callback function */
if (ptr_perl_script->shutdown_func[0])
@@ -624,9 +1006,12 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
void
wee_perl_unload_all ()
{
wee_log_printf (_("unloading all Perl scripts...\n"));
wee_log_printf (_("Unloading all %s scripts...\n"), "Perl");
while (perl_scripts)
wee_perl_unload (perl_scripts);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s scripts unloaded\n"), "Perl");
}
/*
+112 -7
View File
@@ -39,6 +39,10 @@
#include "perl/wee-perl.h"
#endif
#ifdef PLUGIN_PYTHON
#include "python/wee-python.h"
#endif
char *plugin_name[3] = { "Perl", "Python", "Ruby" };
@@ -86,7 +90,7 @@ plugin_auto_load (int plugin_type, char *directory)
lstat (entry->d_name, &statbuf);
if (! S_ISDIR(statbuf.st_mode))
{
wee_log_printf (_("auto-loading %s script: %s%s%s\n"),
wee_log_printf (_("Auto-loading %s script: %s%s%s\n"),
plugin_name[plugin_type],
dir_name, DIR_SEPARATOR, entry->d_name);
plugin_load (plugin_type, entry->d_name);
@@ -115,6 +119,11 @@ plugin_init ()
wee_perl_init();
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
#endif
#ifdef PLUGIN_PYTHON
wee_python_init();
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
#endif
}
/*
@@ -133,7 +142,9 @@ plugin_load (int plugin_type, char *filename)
#endif
break;
case PLUGIN_TYPE_PYTHON:
/* TODO: load Python script */
#ifdef PLUGIN_PYTHON
wee_python_load (filename);
#endif
break;
case PLUGIN_TYPE_RUBY:
/* TODO: load Ruby script */
@@ -183,6 +194,7 @@ plugin_handler_add (t_plugin_handler **plugin_handlers,
new_plugin_handler->plugin_type = plugin_type;
new_plugin_handler->name = strdup (name);
new_plugin_handler->function_name = strdup (function);
new_plugin_handler->running = 0;
/* add new handler to list */
new_plugin_handler->prev_handler = *last_plugin_handler;
@@ -278,7 +290,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
*/
void
plugin_event_msg (char *irc_command, char *arguments, char *server)
plugin_event_msg (char *irc_command, char *server, char *arguments)
{
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
@@ -290,7 +302,25 @@ plugin_event_msg (char *irc_command, char *arguments, char *server)
{
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_perl_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
#ifdef PLUGIN_PYTHON
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_python_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
}
}
@@ -307,7 +337,7 @@ plugin_event_msg (char *irc_command, char *arguments, char *server)
*/
int
plugin_exec_command (char *user_command, char *arguments, char *server)
plugin_exec_command (char *user_command, char *server, char *arguments)
{
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
@@ -319,7 +349,25 @@ plugin_exec_command (char *user_command, char *arguments, char *server)
{
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_perl_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
#ifdef PLUGIN_PYTHON
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_python_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
/* command executed */
@@ -337,6 +385,56 @@ plugin_exec_command (char *user_command, char *arguments, char *server)
return 0;
}
/*
* plugin_find_buffer: find a buffer for text display or command execution
*/
t_gui_buffer *
plugin_find_buffer (char *server, char *channel)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_gui_buffer *ptr_buffer;
ptr_server = NULL;
ptr_channel = NULL;
ptr_buffer = NULL;
if (server && server[0])
{
ptr_server = server_search (server);
if (!ptr_server)
return NULL;
}
else
{
ptr_server = SERVER(gui_current_window->buffer);
if (!ptr_server)
ptr_server = SERVER(gui_buffers);
}
if (channel && channel[0])
{
if (ptr_server)
{
ptr_channel = channel_search (ptr_server, channel);
if (ptr_channel)
ptr_buffer = ptr_channel->buffer;
}
}
else
{
ptr_buffer = gui_current_window->buffer;
if (ptr_buffer->dcc)
ptr_buffer = gui_buffers;
}
if (!ptr_buffer)
return NULL;
return (ptr_buffer->dcc) ? NULL : ptr_buffer;
}
/*
* plugin_unload: unload all scripts for a plugin type
*/
@@ -358,7 +456,10 @@ plugin_unload (int plugin_type, char *scriptname)
#endif
break;
case PLUGIN_TYPE_PYTHON:
/* TODO: unload Python scripts */
#ifdef PLUGIN_PYTHON
wee_python_end ();
wee_python_init ();
#endif
break;
case PLUGIN_TYPE_RUBY:
/* TODO: unload Ruby scripts */
@@ -383,4 +484,8 @@ plugin_end ()
#ifdef PLUGIN_PERL
wee_perl_end();
#endif
#ifdef PLUGIN_PYTHON
wee_python_end();
#endif
}
+11 -2
View File
@@ -21,6 +21,8 @@
#ifndef __WEECHAT_PLUGINS_H
#define __WEECHAT_PLUGINS_H 1
#include "../gui/gui.h"
#define PLUGIN_TYPE_PERL 0
#define PLUGIN_TYPE_PYTHON 1
#define PLUGIN_TYPE_RUBY 2
@@ -45,6 +47,8 @@ struct t_plugin_handler
char *name; /* name of IRC command (PRIVMSG, ..)
or command (without first '/') */
char *function_name; /* name of function (handler) */
int running; /* 1 if currently running */
/* (used to prevent circular call) */
t_plugin_handler *prev_handler; /* link to previous handler */
t_plugin_handler *next_handler; /* link to next handler */
};
@@ -59,17 +63,22 @@ extern t_plugin_handler *last_plugin_cmd_handler;
extern t_plugin_script *perl_scripts;
#endif
#ifdef PLUGIN_PYTHON
extern t_plugin_script *python_scripts;
#endif
extern void plugin_auto_load (int, char *);
extern void plugin_init ();
extern void plugin_load (int, char *);
extern void plugin_unload (int, /*@null@*/ char *);
extern void plugin_unload (int, char *);
extern t_plugin_handler *plugin_handler_search (t_plugin_handler *, char *);
extern void plugin_handler_add (t_plugin_handler **, t_plugin_handler **,
int, char *, char *);
extern void plugin_handler_free_all_type (t_plugin_handler **,
t_plugin_handler **, int);
extern void plugin_event_msg (char *, char *, char *);
extern int plugin_exec_command (char *, /*@null@*/ char *, char *);
extern int plugin_exec_command (char *, char *, char *);
extern t_gui_buffer *plugin_find_buffer (char *, char *);
extern void plugin_end ();
#endif /* plugins.h */
+23
View File
@@ -0,0 +1,23 @@
# Copyright (c) 2003-2005 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
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(PYTHON_CFLAGS)
noinst_LIBRARIES = lib_weechat_python.a
lib_weechat_python_a_SOURCES = wee-python.h \
wee-python.c
+663
View File
@@ -0,0 +1,663 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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
*/
/* wee-python.c: Python plugin support for WeeChat */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <Python.h>
#include <stdlib.h>
#include <string.h>
#undef _
#include "../../common/weechat.h"
#include "../plugins.h"
#include "wee-python.h"
#include "../../common/command.h"
#include "../../irc/irc.h"
#include "../../gui/gui.h"
t_plugin_script *python_scripts = NULL;
t_plugin_script *last_python_script = NULL;
/*
* weechat.register: startup function for all WeeChat Python scripts
*/
static PyObject *
wee_python_register (PyObject *self, PyObject *args)
{
char *name, *version, *shutdown_func, *description;
t_plugin_script *ptr_python_script, *python_script_found, *new_python_script;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "ssss", &name, &version, &shutdown_func, &description))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print_with_channel");
return NULL;
}
python_script_found = NULL;
for (ptr_python_script = python_scripts; ptr_python_script;
ptr_python_script = ptr_python_script->next_script)
{
if (strcasecmp (ptr_python_script->name, name) == 0)
{
python_script_found = ptr_python_script;
break;
}
}
if (python_script_found)
{
/* error: another scripts already exists with this name! */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to register \"%s\" script (another script "
"already exists with this name)\n"),
"Python", name);
}
else
{
/* registering script */
new_python_script = (t_plugin_script *)malloc (sizeof (t_plugin_script));
if (new_python_script)
{
new_python_script->name = strdup (name);
new_python_script->version = strdup (version);
new_python_script->shutdown_func = strdup (shutdown_func);
new_python_script->description = strdup (description);
/* add new script to list */
new_python_script->prev_script = last_python_script;
new_python_script->next_script = NULL;
if (python_scripts)
last_python_script->next_script = new_python_script;
else
python_scripts = new_python_script;
last_python_script = new_python_script;
wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
"Python", name, version, description);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to load script \"%s\" (not enough memory)\n"),
"Python", name);
}
}
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.print: print message into a buffer (current or specified one)
*/
static PyObject *
wee_python_print (PyObject *self, PyObject *args)
{
char *message, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
/* make gcc happy */
(void) self;
message = NULL;
channel_name = NULL;
server_name = NULL;
if (!PyArg_ParseTuple (args, "s|ss", &message, &channel_name, &server_name))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print");
return NULL;
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
irc_display_prefix (ptr_buffer, PREFIX_PLUGIN);
gui_printf (ptr_buffer, "%s\n", message);
return Py_BuildValue ("i", 1);
}
/* buffer not found */
return Py_BuildValue ("i", 0);
}
/*
* weechat.print_infobar: print message to infobar
*/
static PyObject *
wee_python_print_infobar (PyObject *self, PyObject *args)
{
int delay;
char *message;
/* make gcc happy */
(void) self;
delay = 1;
message = NULL;
if (!PyArg_ParseTuple (args, "is", &delay, &message))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print_infobar");
return NULL;
}
gui_infobar_printf (delay, COLOR_WIN_INFOBAR, message);
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.command: send command to server
*/
static PyObject *
wee_python_command (PyObject *self, PyObject *args)
{
char *command, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
/* make gcc happy */
(void) self;
command = NULL;
channel_name = NULL;
server_name = NULL;
if (!PyArg_ParseTuple (args, "s|ss", &command, &channel_name, &server_name))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "command");
return NULL;
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
user_command (SERVER(ptr_buffer), ptr_buffer, command);
return Py_BuildValue ("i", 1);
}
/* buffer not found */
return Py_BuildValue ("i", 0);
}
/*
* weechat.add_message_handler: add handler for messages
*/
static PyObject *
wee_python_add_message_handler (PyObject *self, PyObject *args)
{
char *message, *function;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "ss", &message, &function))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "add_message_handler");
return NULL;
}
plugin_handler_add (&plugin_msg_handlers, &last_plugin_msg_handler,
PLUGIN_TYPE_PYTHON, message, function);
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.add_command_handler: define/redefines commands
*/
static PyObject *
wee_python_add_command_handler(PyObject *self, PyObject *args)
{
char *name, *function;
t_plugin_handler *ptr_plugin_handler;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "ss", &name, &function))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "add_command_handler");
return NULL;
}
if (!weelist_search (index_commands, name))
weelist_add (&index_commands, &last_index_command, name);
ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, name);
if (ptr_plugin_handler)
{
free (ptr_plugin_handler->function_name);
ptr_plugin_handler->function_name = strdup (function);
}
else
plugin_handler_add (&plugin_cmd_handlers, &last_plugin_cmd_handler,
PLUGIN_TYPE_PYTHON, name, function);
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.get_info: get various infos
*/
static PyObject *
wee_python_get_info (PyObject *self, PyObject *args)
{
char *arg, *info = NULL, *server = NULL;
t_irc_server *ptr_server;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "s|s", &arg, &server))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "get_info");
return NULL;
}
if (server == NULL)
{
ptr_server = SERVER(gui_current_window->buffer);
}
else
{
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (strcasecmp (ptr_server->name, server) == 0)
break;
}
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: server not found for \"%s\" function\n"),
"Python", "get_info");
}
}
if (ptr_server && arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
{
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
info = CHANNEL (gui_current_window->buffer)->name;
}
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
{
return Py_BuildValue ("i", SERVER(gui_current_window->buffer)->is_away);
}
if (info)
return Py_BuildValue ("s", info);
else
return Py_BuildValue ("s", "");
}
return Py_BuildValue ("i", 1);
}
/*
* Python subroutines
*/
static
PyMethodDef weechat_funcs[] = {
{ "register", wee_python_register, METH_VARARGS, "" },
{ "prnt", wee_python_print, METH_VARARGS, "" },
{ "print_infobar", wee_python_print_infobar, METH_VARARGS, "" },
{ "command", wee_python_command, METH_VARARGS, "" },
{ "add_message_handler", wee_python_add_message_handler, METH_VARARGS, "" },
{ "add_command_handler", wee_python_add_command_handler, METH_VARARGS, "" },
{ "get_info", wee_python_get_info, METH_VARARGS, "" },
{ NULL, NULL, 0, NULL }
};
/*
* wee_python_init: initialize Python interface for WeeChat
*/
void
wee_python_init ()
{
Py_Initialize ();
if (Py_IsInitialized () == 0)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s error: error while launching interpreter\n"),
"Python");
}
else
{
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Python");
Py_InitModule ("weechat", weechat_funcs);
}
}
/*
* wee_python_search: search a (loaded) Python script by name
*/
t_plugin_script *
wee_python_search (char *name)
{
t_plugin_script *ptr_python_script;
for (ptr_python_script = python_scripts; ptr_python_script;
ptr_python_script = ptr_python_script->next_script)
{
if (strcmp (ptr_python_script->name, name) == 0)
return ptr_python_script;
}
/* script not found */
return NULL;
}
/*
* wee_python_exec: execute a Python script
*/
int
wee_python_exec (char *function, char *server, char *arguments)
{
int len, return_code, i, j, alen;
char *srv, *args, *runstring;
return_code = 1;
if (arguments == NULL)
{
alen = 0;
args = strdup ("");
}
else
{
alen = (int) strlen (arguments);
args = (char *) malloc ( 2 * alen * sizeof (*args));
}
if (!args)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to run function \"%s\" in script (not enough memory)\n"),
"Python", function);
return 0;
}
// copy arguments in args to escape double quotes
j = 0;
for (i=0; i < alen; ++i)
{
if (arguments[i] == '"' || arguments[i] == '\\')
{
args[j] = '\\';
++j;
}
args[j] = arguments[i];
++j;
}
args[j] = 0;
if (server == NULL)
srv = strdup ("");
else
srv = strdup (server);
if (!srv)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to run function \"%s\" in script (not enough memory)\n"),
"Python", function);
free (args);
return 0;
}
len = (int) strlen (function);
len += (int) strlen ("(\"\",\"\")");
len += (int) strlen (srv);
len += (int) strlen (args);
len += 1;
runstring = (char *) malloc ( len * sizeof (*runstring));
if (runstring)
{
sprintf (runstring, "%s(\"%s\",\"%s\")", function, srv, args);
if (PyRun_SimpleString (runstring) != 0)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while running function \"%s\"\n"),
"Python", function);
return_code = 0;
}
free (runstring);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to run function \"%s\" in script (not enough memory)\n"),
"Python", function);
return_code = 0;
}
free (args);
free (srv);
return return_code;
}
/*
* wee_python_load: load a Python script
*/
int
wee_python_load (char *filename)
{
FILE *fp;
/* execute Python script */
wee_log_printf (_("Loading %s script \"%s\"\n"), "Python", filename);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Loading %s script \"%s\"\n"), "Python", filename);
if ((fp = fopen (filename, "r")) == NULL)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while opening file \"%s\"\n"),
"Python", filename);
return 1;
}
if (PyRun_SimpleFile (fp, filename) != 0)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while parsing file \"%s\"\n"),
"Python", filename);
return 1;
}
fclose (fp);
return 0;
}
/*
* wee_python_script_free: free a Python script
*/
void
wee_python_script_free (t_plugin_script *ptr_python_script)
{
t_plugin_script *new_python_scripts;
/* remove script from list */
if (last_python_script == ptr_python_script)
last_python_script = ptr_python_script->prev_script;
if (ptr_python_script->prev_script)
{
(ptr_python_script->prev_script)->next_script = ptr_python_script->next_script;
new_python_scripts = python_scripts;
}
else
new_python_scripts = ptr_python_script->next_script;
if (ptr_python_script->next_script)
(ptr_python_script->next_script)->prev_script = ptr_python_script->prev_script;
/* free data */
if (ptr_python_script->name)
free (ptr_python_script->name);
if (ptr_python_script->version)
free (ptr_python_script->version);
if (ptr_python_script->shutdown_func)
free (ptr_python_script->shutdown_func);
if (ptr_python_script->description)
free (ptr_python_script->description);
free (ptr_python_script);
python_scripts = new_python_scripts;
}
/*
* wee_python_unload: unload a Python script
*/
void
wee_python_unload (t_plugin_script *ptr_python_script)
{
if (ptr_python_script)
{
wee_log_printf (_("Unloading %s script \"%s\"\n"),
"Python", ptr_python_script->name);
/* call shutdown callback function */
if (ptr_python_script->shutdown_func[0])
wee_python_exec (ptr_python_script->shutdown_func, "", "");
wee_python_script_free (ptr_python_script);
}
}
/*
* wee_python_unload_all: unload all Python scripts
*/
void
wee_python_unload_all ()
{
wee_log_printf (_("Unloading all %s scripts...\n"), "Python");
while (python_scripts)
wee_python_unload (python_scripts);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s scripts unloaded\n"), "Python");
}
/*
* wee_python_end: shutdown Python interface
*/
void
wee_python_end ()
{
/* unload all scripts */
wee_python_unload_all ();
/* free all handlers */
plugin_handler_free_all_type (&plugin_msg_handlers,
&last_plugin_msg_handler,
PLUGIN_TYPE_PYTHON);
plugin_handler_free_all_type (&plugin_cmd_handlers,
&last_plugin_cmd_handler,
PLUGIN_TYPE_PYTHON);
/* free Python interpreter */
Py_Finalize ();
if (Py_IsInitialized () != 0)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s error: error while freeing interpreter\n"),
"Python");
}
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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_PYTHON_H
#define __WEECHAT_PYTHON_H 1
#include "../plugins.h"
extern void wee_python_init ();
extern t_plugin_script *wee_python_search (char *);
extern int wee_python_exec (char *, char *, char *);
extern int wee_python_load (char *);
extern void wee_python_unload (t_plugin_script *);
extern void wee_python_unload_all ();
extern void wee_python_end ();
#endif /* wee-python.h */
+2 -6
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "February 2005" "FlashCode"
.TH WEECHAT 1 "May 2005" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -53,11 +53,7 @@ configuration file for WeeChat
WeeChat log file
.SH AUTHOR
WeeChat is written by:
.br
- FlashCode <flashcode@flashtux.org>
- Bounga <bounga@altern.org>
- Xahlexx <xahlexx@weeland.org>
WeeChat is written by FlashCode <flashcode@flashtux.org>
.br
WeeChat on the web:
.UR
+5 -3
View File
@@ -1,5 +1,5 @@
%define name weechat
%define version 0.1.1
%define version 0.1.2
%define release 1
Name: %{name}
@@ -10,7 +10,7 @@ Source: http://weechat.flashtux.org/download/%{name}-%{version}.tar.gz
URL: http://weechat.flashtux.org
Group: Networking/IRC
BuildRoot: %{_tmppath}/%{name}-buildroot
Requires: perl
Requires: perl, python
License: GPL
%description
@@ -23,7 +23,7 @@ rm -rf $RPM_BUILD_ROOT
%setup
%build
./configure --enable-perl
./configure --enable-perl --enable-python
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local"
%install
@@ -41,6 +41,8 @@ rm -rf $RPM_BUILD_ROOT
/usr/local/bin/weechat-curses
%changelog
* Sat May 21 2005 FlashCode <flashcode@flashtux.org> 0.1.2-1
- Released version 0.1.2
* Sat Mar 20 2005 FlashCode <flashcode@flashtux.org> 0.1.1-1
- Released version 0.1.1
* Sat Feb 12 2005 FlashCode <flashcode@flashtux.org> 0.1.0-1
+986
View File
@@ -0,0 +1,986 @@
1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
1.1 Quick configuration advice
==============================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
1.2 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the included GNU
`gettext' library will be used. This library is wholly contained
within this package, usually in the `intl/' subdirectory, so prior
installation of the GNU `gettext' package is _not_ required.
Installers may use special options at configuration time for changing
the default behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will, respectively, bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might not be desirable. You should use
the more recent version of the GNU `gettext' library. I.e. if the file
`intl/VERSION' shows that the library which comes with this package is
more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.3 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from `no' to `nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under `nb' and some older ones under `no', it's recommended
for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
older translations are used.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
1.4 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
1.5 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of April
2005. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB
+-------------------------------------------------+
GNUnet | |
a2ps | [] [] [] [] [] |
aegis | () |
ant-phone | () |
anubis | [] |
ap-utils | |
aspell | [] [] [] [] |
bash | [] [] |
batchelor | [] |
bfd | |
bibshelf | [] |
binutils | [] |
bison | [] [] |
bluez-pin | [] [] [] [] |
clisp | [] [] |
console-tools | [] [] |
coreutils | [] [] [] [] |
cpio | |
cpplib | [] [] [] |
darkstat | [] () [] |
dialog | [] [] [] [] [] [] |
diffutils | [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] |
fetchmail | [] () [] [] [] |
fileutils | [] [] |
findutils | [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | |
gawk | [] [] [] |
gbiff | [] |
gcal | [] |
gcc | [] |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] [] [] |
gip | |
gliv | [] |
glunarclock | |
gmult | [] [] |
gnubiff | () |
gnucash | [] () () [] |
gnucash-glossary | [] () |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] |
gpe-conf | [] [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] |
gpsdrive | () () |
gramadoir | [] [] |
grep | [] [] [] [] [] [] |
gretl | |
gsasl | [] |
gss | |
gst-plugins | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] () |
gtkspell | [] [] [] |
hello | [] [] [] [] |
id-utils | [] [] |
impost | |
indent | [] [] |
iso_3166 | |
iso_3166_1 | [] [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] |
iso_4217 | |
iso_639 | |
jpilot | [] |
jtag | |
jwhois | |
kbd | [] [] [] [] |
latrine | () |
ld | [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] |
libgsasl | |
libiconv | [] [] [] [] [] |
libidn | |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] |
make | [] [] |
man-db | [] () [] [] |
minicom | [] [] |
mysecretdiary | [] [] |
nano | [] () [] |
nano_1_0 | [] () [] [] |
opcodes | [] |
parted | [] [] [] [] |
psmisc | |
ptx | [] [] [] |
pwdutils | |
python | |
radius | [] |
recode | [] [] [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] [] |
sed | [] [] |
sh-utils | [] [] |
shared-mime-info | [] [] |
sharutils | [] [] [] [] [] |
silky | |
skencil | [] () |
sketch | [] () |
solfege | [] |
soundtracker | [] [] |
sp | [] |
stardict | [] |
tar | |
texinfo | [] [] |
textutils | [] [] [] |
tin | () () |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | [] [] [] [] [] [] |
xchat | [] [] [] [] |
xkeyboard-config | |
xpad | |
+-------------------------------------------------+
af am ar az be bg bs ca cs cy da de el en en_GB
10 0 0 2 7 4 0 41 43 3 52 90 20 1 15
eo es et eu fa fi fr ga gl he hr hu id is it
+-----------------------------------------------+
GNUnet | |
a2ps | [] [] [] () |
aegis | |
ant-phone | [] |
anubis | [] |
ap-utils | [] |
aspell | [] [] |
bash | [] [] [] [] |
batchelor | [] [] |
bfd | [] |
bibshelf | [] [] [] |
binutils | [] [] |
bison | [] [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] |
clisp | [] [] |
console-tools | |
coreutils | [] [] [] [] [] |
cpio | [] [] |
cpplib | [] [] |
darkstat | [] () [] [] [] |
dialog | [] [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] [] [] [] [] |
doodle | [] [] |
e2fsprogs | [] [] [] |
enscript | [] [] |
error | [] [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | [] [] |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] [] |
gcc | [] |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | () |
glunarclock | [] [] [] |
gmult | [] [] [] |
gnubiff | () () |
gnucash | [] () [] |
gnucash-glossary | [] [] |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] [] [] |
gpe-clock | [] [] [] |
gpe-conf | [] |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-go | [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] [] |
gpe-taskmanager | [] [] [] |
gpe-timesheet | [] [] [] [] |
gpe-today | [] [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] [] [] [] [] |
gprof | [] [] [] |
gpsdrive | () () [] () |
gramadoir | [] [] |
grep | [] [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] [] [] |
gsasl | [] [] [] |
gss | [] |
gst-plugins | [] [] [] |
gstreamer | [] |
gtick | [] [] [] [] [] |
gtkspell | [] [] [] [] [] [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
impost | [] [] |
indent | [] [] [] [] [] [] [] [] [] [] [] |
iso_3166 | [] [] [] |
iso_3166_1 | [] [] [] [] [] [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] [] |
jpilot | [] [] |
jtag | [] |
jwhois | [] [] [] [] [] |
kbd | [] [] |
latrine | [] [] [] |
ld | [] [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] [] [] |
libgsasl | [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] [] |
libidn | [] [] |
lifelines | () |
lilypond | [] |
lingoteach | [] [] [] |
lynx | [] [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] [] [] [] [] |
man-db | () |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] |
nano | [] [] () [] [] |
nano_1_0 | [] [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
psmisc | [] [] |
ptx | [] [] [] [] [] [] [] [] [] |
pwdutils | |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] [] [] |
rpm | [] |
screem | |
scrollkeeper | [] [] [] |
sed | [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] [] |
shared-mime-info | [] [] [] [] [] [] |
sharutils | [] [] [] [] [] [] [] |
silky | [] |
skencil | [] [] |
sketch | [] [] |
solfege | [] |
soundtracker | [] [] [] |
sp | [] |
stardict | [] |
tar | [] [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
tp-robot | [] [] |
tuxpaint | [] [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | [] [] |
util-linux | [] [] [] [] [] [] |
vorbis-tools | [] [] |
wastesedge | () |
wdiff | [] [] [] [] [] [] [] [] |
wget | [] [] [] [] [] [] [] [] [] [] |
xchat | [] [] [] [] [] |
xkeyboard-config | |
xpad | [] [] [] |
+-----------------------------------------------+
eo es et eu fa fi fr ga gl he hr hu id is it
13 85 21 15 2 35 115 45 17 8 6 40 27 1 45
ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
+-----------------------------------------------+
GNUnet | |
a2ps | () [] [] () |
aegis | () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | |
aspell | [] [] |
bash | [] |
batchelor | [] |
bfd | |
bibshelf | |
binutils | |
bison | [] [] [] |
bluez-pin | [] |
clisp | [] |
console-tools | |
coreutils | [] [] |
cpio | |
cpplib | |
darkstat | [] [] |
dialog | [] |
diffutils | [] [] [] |
doodle | |
e2fsprogs | |
enscript | [] |
error | [] |
fetchmail | [] [] |
fileutils | [] [] |
findutils | [] |
flex | [] [] |
fslint | [] |
gas | |
gawk | [] [] |
gbiff | [] |
gcal | |
gcc | |
gettext-examples | [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] |
gip | [] |
gliv | [] |
glunarclock | [] [] |
gmult | [] |
gnubiff | |
gnucash | () () [] |
gnucash-glossary | [] |
gpe-aerial | [] |
gpe-beam | [] |
gpe-calendar | [] |
gpe-clock | [] |
gpe-conf | [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] |
gpe-ownerinfo | [] |
gpe-sketchbook | [] |
gpe-su | [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] |
gpe-todo | [] |
gphoto2 | [] [] |
gprof | |
gpsdrive | () () () |
gramadoir | () |
grep | [] [] [] |
gretl | |
gsasl | [] |
gss | |
gst-plugins | [] |
gstreamer | [] |
gtick | [] |
gtkspell | [] [] |
hello | [] [] [] [] [] [] [] [] |
id-utils | [] |
impost | |
indent | [] [] |
iso_3166 | [] |
iso_3166_1 | [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] |
jpilot | () () () |
jtag | |
jwhois | [] |
kbd | [] |
latrine | [] |
ld | |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] |
libgsasl | [] |
libiconv | [] |
libidn | |
lifelines | [] |
lilypond | [] |
lingoteach | [] |
lynx | [] [] |
m4 | [] [] |
mailutils | |
make | [] [] [] |
man-db | () |
minicom | [] |
mysecretdiary | [] |
nano | [] [] |
nano_1_0 | [] [] [] |
opcodes | [] |
parted | [] [] |
psmisc | [] [] |
ptx | [] [] [] |
pwdutils | |
python | |
radius | |
recode | [] |
rpm | [] [] |
screem | [] |
scrollkeeper | [] [] [] |
sed | [] [] |
sh-utils | [] [] |
shared-mime-info | [] [] [] [] |
sharutils | [] [] |
silky | [] |
skencil | |
sketch | |
solfege | [] [] |
soundtracker | |
sp | () |
stardict | [] [] |
tar | [] [] |
texinfo | [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] |
vorbis-tools | [] |
wastesedge | [] |
wdiff | [] [] |
wget | [] [] |
xchat | [] [] [] [] |
xkeyboard-config | [] |
xpad | [] |
+-----------------------------------------------+
ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
33 11 1 1 1 2 2 3 11 0 15 96 7 5 0
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+-------------------------------------------------+
GNUnet | |
a2ps | () [] [] [] [] [] [] |
aegis | () () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | () |
aspell | [] [] |
bash | [] [] [] |
batchelor | [] |
bfd | |
bibshelf | |
binutils | [] [] |
bison | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] [] |
clisp | [] |
console-tools | [] |
coreutils | [] [] [] [] |
cpio | [] [] |
cpplib | |
darkstat | [] [] [] [] [] [] |
dialog | [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] |
fetchmail | [] () [] [] [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] [] |
fslint | [] [] [] |
gas | |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] |
gcc | |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | [] [] [] |
glunarclock | [] [] [] [] [] [] |
gmult | [] [] [] [] |
gnubiff | () [] |
gnucash | () [] [] [] [] |
gnucash-glossary | [] [] [] |
gpe-aerial | [] [] [] [] [] [] |
gpe-beam | [] [] [] [] [] [] |
gpe-calendar | [] [] [] [] [] [] [] |
gpe-clock | [] [] [] [] [] [] [] |
gpe-conf | [] [] [] [] [] [] |
gpe-contacts | [] [] [] |
gpe-edit | [] [] [] [] [] [] [] |
gpe-go | [] [] [] [] [] |
gpe-login | [] [] [] [] [] [] [] |
gpe-ownerinfo | [] [] [] [] [] [] [] |
gpe-sketchbook | [] [] [] [] [] [] [] |
gpe-su | [] [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] [] [] |
gpe-today | [] [] [] [] [] [] [] |
gpe-todo | [] [] [] [] [] [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | [] |
gramadoir | [] |
grep | [] [] [] [] [] [] [] |
gretl | [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] |
gst-plugins | [] [] [] [] |
gstreamer | [] [] [] [] |
gtick | [] [] [] |
gtkspell | [] [] [] [] [] [] |
hello | [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
impost | |
indent | [] [] [] [] [] [] |
iso_3166 | [] [] [] [] [] |
iso_3166_1 | [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] [] [] |
iso_4217 | [] [] |
iso_639 | [] [] [] |
jpilot | |
jtag | [] |
jwhois | [] [] [] () () |
kbd | [] [] [] |
latrine | [] [] |
ld | [] |
libc | [] [] [] [] [] |
libextractor | [] |
libgpewidget | [] [] [] [] [] [] |
libgsasl | [] [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] |
libidn | [] () |
lifelines | [] [] |
lilypond | [] |
lingoteach | [] |
lynx | [] [] [] |
m4 | [] [] [] [] [] |
mailutils | [] [] [] |
make | [] [] [] [] |
man-db | [] [] |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] [] |
nano | [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
psmisc | [] [] |
ptx | [] [] [] [] [] [] |
pwdutils | [] |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] |
rpm | [] [] [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] |
shared-mime-info | [] [] [] [] [] |
sharutils | [] [] [] |
silky | [] |
skencil | [] [] [] |
sketch | [] [] [] |
solfege | |
soundtracker | [] [] |
sp | |
stardict | [] [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] [] [] |
wget | [] [] [] [] [] [] [] [] [] |
xchat | [] [] [] [] [] [] |
xkeyboard-config | |
xpad | |
+-------------------------------------------------+
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
1 0 48 30 58 6 79 71 5 45 13 12 50 86 0
tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
+--------------------------------------------+
GNUnet | | 0
a2ps | [] [] [] | 19
aegis | | 0
ant-phone | [] | 4
anubis | [] | 9
ap-utils | () | 1
aspell | [] [] [] | 13
bash | | 10
batchelor | [] [] | 7
bfd | | 1
bibshelf | [] | 5
binutils | [] | 6
bison | [] | 17
bluez-pin | [] [] [] [] [] | 24
clisp | | 7
console-tools | [] | 4
coreutils | [] | 16
cpio | [] [] | 6
cpplib | [] [] | 7
darkstat | [] () () | 15
dialog | [] [] [] | 25
diffutils | [] [] [] [] | 28
doodle | [] | 5
e2fsprogs | [] | 8
enscript | [] | 12
error | [] [] [] | 16
fetchmail | [] | 12
fileutils | [] [] [] | 18
findutils | [] [] | 17
flex | [] [] | 15
fslint | [] | 7
gas | [] | 3
gawk | [] | 14
gbiff | | 4
gcal | [] | 5
gcc | [] | 3
gettext-examples | [] [] [] [] | 20
gettext-runtime | [] [] [] [] [] | 25
gettext-tools | [] [] [] | 17
gimp-print | [] | 11
gip | [] | 8
gliv | [] | 6
glunarclock | [] [] | 13
gmult | [] [] [] | 13
gnubiff | [] | 3
gnucash | () [] | 10
gnucash-glossary | [] | 8
gpe-aerial | [] [] | 13
gpe-beam | [] [] | 13
gpe-calendar | [] [] [] [] | 18
gpe-clock | [] [] [] [] | 17
gpe-conf | [] [] | 12
gpe-contacts | [] [] | 6
gpe-edit | [] [] [] [] | 15
gpe-go | [] [] | 11
gpe-login | [] [] [] [] [] | 18
gpe-ownerinfo | [] [] [] [] | 19
gpe-sketchbook | [] [] | 14
gpe-su | [] [] [] | 16
gpe-taskmanager | [] [] [] | 17
gpe-timesheet | [] [] [] [] | 17
gpe-today | [] [] [] [] [] | 19
gpe-todo | [] [] [] | 16
gphoto2 | [] [] | 17
gprof | [] [] | 10
gpsdrive | | 2
gramadoir | [] | 6
grep | [] [] [] [] | 32
gretl | | 4
gsasl | [] [] | 12
gss | [] | 5
gst-plugins | [] [] | 16
gstreamer | [] [] [] | 14
gtick | [] | 11
gtkspell | [] [] [] | 20
hello | [] [] [] [] | 37
id-utils | [] [] | 13
impost | [] | 3
indent | [] [] [] | 24
iso_3166 | [] [] [] | 12
iso_3166_1 | [] [] | 20
iso_3166_2 | | 2
iso_3166_3 | [] [] | 8
iso_4217 | [] [] | 10
iso_639 | [] [] | 12
jpilot | [] [] [] | 6
jtag | | 2
jwhois | [] [] [] | 12
kbd | [] [] | 12
latrine | [] [] | 8
ld | [] | 5
libc | [] [] | 22
libextractor | | 1
libgpewidget | [] [] | 17
libgsasl | [] | 7
libiconv | [] [] [] [] [] | 32
libidn | [] [] | 5
lifelines | | 4
lilypond | [] | 5
lingoteach | | 5
lynx | [] [] | 14
m4 | [] [] | 17
mailutils | [] | 7
make | [] [] | 18
man-db | | 5
minicom | | 11
mysecretdiary | [] [] | 12
nano | | 11
nano_1_0 | [] [] | 17
opcodes | [] | 7
parted | [] [] [] | 17
psmisc | [] | 7
ptx | [] [] | 23
pwdutils | | 1
python | | 0
radius | [] | 6
recode | [] [] | 22
rpm | [] [] | 11
screem | | 1
scrollkeeper | [] [] | 23
sed | [] [] | 19
sh-utils | [] | 15
shared-mime-info | [] [] | 19
sharutils | [] [] [] | 20
silky | | 3
skencil | | 6
sketch | | 6
solfege | | 4
soundtracker | [] | 8
sp | [] | 3
stardict | [] [] [] [] | 10
tar | [] [] | 13
texinfo | [] [] | 14
textutils | [] [] [] | 17
tin | | 1
tp-robot | [] [] | 7
tuxpaint | [] [] [] [] | 34
unicode-han-tra... | | 0
unicode-transla... | | 2
util-linux | [] [] | 17
vorbis-tools | [] | 10
wastesedge | | 1
wdiff | [] [] | 22
wget | [] [] [] [] | 31
xchat | [] [] [] | 22
xkeyboard-config | | 1
xpad | [] | 5
+--------------------------------------------+
72 teams tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
147 domains 0 0 1 78 29 0 71 16 0 41 20 0 1711
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If April 2005 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
1.6 Using `gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.
+1 -4
View File
@@ -1,12 +1,9 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-02-12
WeeChat known bugs, 2005-05-21
- ./configure does not check that Curses headers are installed
- ./configure does not check that Gtk 2.0 libraries are installed
- ./configure does not check that Perl headers & libraries are installed
- too much nicks in the channel (> height of window) => some nicks are hidden
- 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
+14 -1
View File
@@ -1,9 +1,22 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-03-20
ChangeLog - 2005-05-21
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
* added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12)
* added transfer rate for DCC files
* added "-all" option for /nick command
* buffers timestamp can now be changed (new option in config file)
* WeeChat now ok under *BSD and Mac OS X
* fixed nicklist sort
* fixed crash when purging old DCC
* fixed crash with 64-bits arch (like AMD64) when converting UTF-8
* added missing IRC commands (307, 341, 485, 671)
Version 0.1.1 (2005-03-20):
* added nicks count for channel buffers
* added FIFO pipe for remote control
+37 -13
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Intended audience:
@@ -22,8 +22,10 @@ finding a solution.
Q: I heard about many GUI for WeeChat. How can I compile/use them?
A: Curses GUI is built by default.
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
To build Gtk, wxWidgets or Qt GUI you've to specify extra options to
./configure script:
--enable-gtk to enable Gtk GUI
--enable-wxwidgets to enable wxWidgets 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!
@@ -34,8 +36,8 @@ A: Curses GUI is built by default.
Q: I can't compile WeeChat CVS.
A: Check that you have latest version of autoconf and automake.
WeeChat has been developed with autoconf version 2.56 and automake
version 1.7.
WeeChat has been developed with autoconf version 2.59 and automake
version 1.9.5.
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.
@@ -48,12 +50,14 @@ Q: Why using WeeChat ? X-Chat and Irssi are so good...
A: Because WeeChat is very light and has new features.
Some new features:
* many GUI (Curses, Gtk, Qt),
* many GUI (Curses, Gtk, wxWidgets, 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 ;)
More info on this page: http://weechat.flashtux.org/features.php
2.2
@@ -61,6 +65,7 @@ A: Because WeeChat is very light and has new features.
Q: I've launched WeeChat, but I'm lost, what can I do?
A: For help you can type /help. For help about a command, type /help command.
Keys and commands are listed in documentation.
2.3
@@ -86,19 +91,23 @@ A: Today you can't do that. This is planed for a future version.
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
A: You can use /perl command to load scripts
(default path is ~/.weechat/perl).
A: You can use /perl command to load scripts (default path is
~/.weechat/perl).
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
when WeeChat is starting up.
WeeChat perl scripts are compatible with X-Chat, but not with Irssi,
sorry ;)
WeeChat Perl scripts are 80% compatible with X-Chat, but not with Irssi.
2.6
================================================================================
Q: How can I load Python scripts?
Are Python scripts compatible with X-chat or/and Irssi ?
A: Today Python interface is not developed, so you can't load any Python script.
A: You can use /python command to load scripts (default path is
~/.weechat/python).
Note that scripts in ~/.weechat/python/autoload are automatically loaded
when WeeChat is starting up.
WeeChat Python scripts are 80% compatible with X-Chat, but not with Irssi.
2.7
@@ -148,13 +157,27 @@ A: There is 2 ways to submit your feature request:
3.4
================================================================================
Q: Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
Q: What is the list of supported platforms for WeeChat?
A: Yes. Future versions will be available for these OS.
A: Today WeeChat was succesfully tested on these platforms:
- GNU/Linux (any distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (with Cygwin and some code changes)
3.5
================================================================================
Q: Will WeeChat be ported to QNX or other operating systems?
A: Yes. Future versions will be available for these OS.
We need help for such systems, any help is welcome :)
3.6
================================================================================
Q: I want to help WeeChat developers. What can I do?
A: There's many tasks to do (code, documentation, ...)
@@ -162,8 +185,9 @@ A: There's many tasks to do (code, documentation, ...)
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
Q: Can I give money or other things to WeeChat developers?
A: Beer is welcome :)
Otherwise Paypal account is: flashcode@free.fr (no limit for gifts :)
+38 -15
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Public concerné :
@@ -23,9 +23,10 @@ Q: J'ai entendu parler de plusieurs interfaces pour WeeChat.
Comment puis-je les compiler/utiliser ?
R: L'interface Curses est construite par défaut.
Pour construire l'interface Gtk ou Qt, vous devez spécifier des options
pour le script ./configure :
Pour construire l'interface Gtk, wxWidgets ou Qt, vous devez spécifier des
options pour le script ./configure :
--enable-gtk pour activer l'interface Gtk
--enable-wxwidgets pour activer l'interface wxWidgets
--enable-qt pour activer l'interface Qt
Tapez ./configure --help pour voir les options disponibles.
ATTENTION : seule l'interface Curses est ok aujourd'hui.
@@ -37,8 +38,8 @@ R: L'interface Curses est construite par d
Q: Je ne peux pas compiler le CVS WeeChat.
R: Vérifiez que vous avez bien la dernière version d'autoconf et automake.
WeeChat a été développé avec autoconf version 2.56 et automake
version 1.7.
WeeChat a été développé avec autoconf version 2.59 et automake
version 1.9.5.
Vous devez avoir au moins ces versions pour compiler le CVS WeeChat.
Si vous n'avez pas ou ne souhaitez pas installer ces versions, vous
pouvez télécharger et installer le paquet "devel", un paquet construit
@@ -52,12 +53,14 @@ Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
Quelques nouvelles fonctionnalités :
* plusieurs interfaces (Curses, Gtk, Qt),
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt),
* extensible par des scripts (Perl, Python, Ruby),
* développé à partir de zéro (non basé sur un quelconque client IRC)
* multi-platformes
* 100% GPL et libre
C'est le client IRC le plus "geek" ;)
Plus d'infos sur cette page: http://weechat.flashtux.org/features.php
2.2
@@ -66,6 +69,7 @@ Q: J'ai lanc
R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
tapez /help commande.
Les touches et commandes sont listées dans la documentation.
2.3
@@ -92,20 +96,23 @@ R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
R: La commande /perl permet de charger les scripts Perl
(le chemin par défaut est ~/.weechat/perl).
R: La commande /perl permet de charger les scripts Perl (le chemin par défaut
est ~/.weechat/perl).
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Perl WeeChat sont compatibles avec X-Chat, mais pas Irssi,
désolé ;)
Les scripts Perl WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
Les scripts Python sont-ils compatibles avec X-chat et/ou Irssi ?
R: Aujourd'hui l'interface Python n'est pas déceloppée.
Vous ne pouvez donc charger aucun script Python.
R: La commande /python permet de charger les scripts Python (le chemin par
défaut est ~/.weechat/python).
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Python WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.7
@@ -161,13 +168,27 @@ R: Il y a 2 mani
3.4
================================================================================
Q: WeeChat sera-t-il porté sur *BSD, QNX, MacOS X, Microsoft Windows ?
Q: Quelle est la liste des plate-formes supportées par WeeChat ?
R: Oui. Les futures versions seront disponibles pour ces OS.
R: Aujourd'hui WeeChat a été testé avec succès sur ces plate-formes :
- GNU/Linux (toute distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (avec Cygwin et quelques modifications de code)
3.5
================================================================================
Q: WeeChat sera-t-il porté sur QNX ou d'autres systèmes d'exploitation ?
R: Oui. Les futures versions seront disponibles pour ces OS.
Nous avons besoin d'aide pour ces systèmes, toute aide est la bienvenue :)
3.6
================================================================================
Q: Je souhaiterai aider les développeurs WeeChat. Que puis-je faire ?
R: Il y a plusieurs choses Ă  faire (code, documentation, ...)
@@ -176,8 +197,10 @@ R: Il y a plusieurs choses
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
R: La bière est la bienvenue :)
Sinon le compte Paypal est: flashcode@free.fr (il n'y a pas de limite pour
les dons :)
+4 -2
View File
@@ -17,12 +17,14 @@
SUBDIRS = po intl src
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
debian/changelog debian/control \
debian/copyright debian/files \
debian/copyright \
debian/rules debian/weechat-common.docs \
debian/weechat-common.install debian/weechat-curses.dirs \
debian/weechat-curses.install debian/weechat-gtk.dirs \
debian/weechat-gtk.install
man_MANS = weechat-curses.1
ACLOCAL_AMFLAGS = -I m4
+4
View File
@@ -1,6 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-05-21
WeeChat 0.1.2 released.
* FlashCode, 2005-03-20
WeeChat 0.1.1 released.
+13 -12
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-03-20
TODO - 2005-05-21
Legend:
# done
@@ -10,25 +10,32 @@ Legend:
? is this really necessary?
v0.1.1:
v0.1.2:
------
* General:
+ Windows version
+ Solaris version
+ *BSD version
# *BSD version
# Mac OS X version
* IRC protocol:
# "/dcc send" command
# "/dcc chat" command (and incoming DCC chats)
- customizable CTCP version reply
* Interface:
# nicklist scroll keys
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
# connect to server with child process (background)
- SSL support
* Configuration:
- add key bindings to config file
* Plugins:
# Python plugin
# "/python load" and "/python unload" commands to (un)load Python scripts
Future versions:
@@ -64,14 +71,8 @@ Future versions:
* TCP/IP communication:
- proxy support
- SSL support
- IPv6 protocol implementation
* Plugins:
- Python plugin
- "/python load" and "/python unload" commands to (un)load Python scripts
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
* Configuration:
- add key bindings to config file
+13 -53
View File
@@ -1,55 +1,15 @@
#!/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"
# gettextize updates Makefile.am, configure.in
cp configure.in configure.in.old
cp Makefile.am Makefile.am.old
gettextize --copy --force --intl --no-changelog &&
mv Makefile.am.old Makefile.am
mv configure.in.old configure.in
aclocal &&
# autoheader creates config.h.in needed by autoconf
autoheader &&
# autoconf creates configure
autoconf &&
# automake creates Makefile.in
automake --add-missing --copy --gnu
+128 -9
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.1, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.2, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.1])
AM_INIT_AUTOMAKE([weechat], [0.1.2])
# Checks for programs.
AC_PROG_CC
@@ -36,6 +36,9 @@ AM_GNU_GETTEXT
# Checks for libraries.
AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
# 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 sys/types.h unistd.h pwd.h errno.h])
@@ -44,42 +47,82 @@ AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h s
AC_HEADER_TIME
AC_STRUCT_TM
AC_MSG_CHECKING([for socklen_t])
AC_CACHE_VAL(ac_cv_type_socklen_t,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t t;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no,
)])
if test $ac_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
fi
AC_MSG_RESULT($ac_cv_type_socklen_t)
# Checks for library functions.
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_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=yes,enable_wxwidgets=no)
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)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=yes,enable_python=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_python="no"
PYTHON_CFLAGS=
enable_ruby="no"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
# AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([ncurses library not found! Install ncurses library or run ./configure with --disable-ncurses parameter.])
AC_MSG_ERROR([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
NCURSES_LIBS="-lncurses"
AC_SUBST(NCURSES_LIBS)
fi
if test "x$enable_wxwidgets" = "xyes" ; then
if test "$wxWin" != 1; then
AC_MSG_ERROR([
*** wxWindows must be installed on your system
*** but wx-config script couldn't be found.
*** Please check that wx-config is in path, the directory
*** where wxWindows libraries are installed (returned by
*** 'wx-config --libs' command) is in LD_LIBRARY_PATH or
*** equivalent variable and wxWindows version is 2.3.4 or above.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LDFLAGS="$LDFLAGS $WX_LIBS"
WXWIDGETS_CFLAGS=""
WXWIDGETS_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.])
@@ -94,12 +137,77 @@ PLUGINS_LIBS=
if test "x$enable_perl" = "xyes" ; then
enable_plugins="yes"
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
AC_PATH_PROG(PERL, perl)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
*** but perl interpreter couldn't be found in path.
Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl library)
PERL_LIB=`$PERL -e 'use Config; print "$Config{installprefix}/lib/$Config{libperl}"'`
if test -r "$PERL_LIB"; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
else
AC_MSG_ERROR([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
AC_SUBST(PERL_CFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
if test "x$enable_python" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PYTHON, python)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
*** but python interpreter couldn't be found in path.
*** Please check that python is in path, or install
*** it with your software package manager.])
fi
PYTHON_INCLUDE=`$PYTHON -c 'import sys ; print "%s/include/python%s" % (sys.prefix, sys.version[[:3]])'`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print ' -I' + distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.])
fi
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c 'import sys; print "%s/lib/python%s/config" % (sys.prefix, sys.version[[:3]])'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[0:3]]'`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -a -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print string.join(distutils.sysconfig.get_config_vars('LINKFORSHARED', 'BLDLIBRARY', 'SHLIBS'))"`
else
AC_MSG_ERROR([
*** Python library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/python/lib_weechat_python.a $PYTHON_LFLAGS"
AC_SUBST(PYTHON_CFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE(PLUGINS)
fi
@@ -120,14 +228,20 @@ if test "x$debug" = "x2" ; then
AC_DEFINE(DEBUG)
fi
dnl For FreeBSD
LIBS="$LIBS $INTLLIBS"
CFLAGS="$CFLAGS $CPPFLAGS"
AC_OUTPUT([Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
src/plugins/Makefile
src/plugins/perl/Makefile
src/plugins/python/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
src/gui/gtk/Makefile
src/gui/qt/Makefile
intl/Makefile
@@ -140,6 +254,9 @@ listgui=
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
fi
@@ -148,7 +265,9 @@ if test "x$enable_qt" = "xyes" ; then
fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([No interface specified... Please specify at least ncurses, Gtk or Qt.])
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
fi
msg_debug_compiler="no"
+15 -1
View File
@@ -1,6 +1,20 @@
weechat (0.1.2-1) unstable; urgency=low
* WeeChat version 0.1.2, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 21 May 2005 08:00:00 +0200
weechat (0.1.1-2) unstable; urgency=low
* debian/control:
- Add myself to uploaders.
- Remove unecessary dependency on weechat-gtk (Closes: #308287).
-- Julien Louis <ptitlouis@sysif.net> Tue, 10 May 2005 22:38:52 +0200
weechat (0.1.1-1) unstable; urgency=low
* WeeChat version 0.1.1, see ChangeLog for detail.
* WeeChat version 0.1.1, see ChangeLog for detail (closes: #306492)
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 20 Mar 2005 08:00:00 +0200
+3 -2
View File
@@ -2,12 +2,13 @@ Source: weechat
Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev, python2.3 (>= 2.3), python-dev
Standards-Version: 3.6.1
Package: weechat
Architecture: all
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${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.
+1 -1
View File
@@ -1,5 +1,5 @@
This package was debianized by FlashCode <flashcode@flashtux.org> on
Sat, 20 Mar 2005 08:00:00 +0200.
Sat, 21 May 2005 08:00:00 +0200.
It was downloaded from http://weechat.flashtux.org/download
+1 -1
View File
@@ -15,7 +15,7 @@ configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
--enable-perl
--enable-perl --enable-python
touch configure-stamp
+230 -37
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
@subtitle Documentation for WeeChat v0.1.2 - May, 21 2005
@image{weechat_image}
@@ -270,6 +270,9 @@ Type: string (any string), default value: ''@*
@item look_charset_internal
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
Type: string (any string), default value: 'ISO-8859-1'@*
@item look_buffer_timestamp
Timestamp for buffers@*
Type: string (any string), default value: '[%H:%M:%S]'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -414,6 +417,9 @@ Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_voice
Color for voice symbol@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_sep
Color for nick separator@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@@ -498,6 +504,9 @@ Type: integer (values: between 0 and 2147483647), default value: 1@*
@item irc_lag_disconnect
Disconnect after important lag (in minutes, 0 = never disconnect)@*
Type: integer (values: between 0 and 2147483647), default value: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -668,6 +677,9 @@ Switch to previous / next window@*
@item F10
Remove last infobar message@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@@ -692,6 +704,9 @@ Switch to first channel of next server (or server buffer if no channel is opened
@item Alt + digit (1-9)
Switch to buffer by number@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node WeeChat commands, FIFO pipe, Key bindings, Usage
@@ -750,13 +765,20 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item perl [load filename] | [autoload] | [unload]
@item perl [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item python [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@@ -980,11 +1002,12 @@ list nicknames on channels@*
@*
channel: channel name@*
@*
@item nick nickname
@item nick [-all] nickname
@*
change current nickname@*
@*
nickname: new nickname for current IRC server@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice nickname text
@*
@@ -1251,7 +1274,7 @@ List all Perl scripts: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( name, version, shutdown_function, description );}@*
@command{weechat::register ( name, version, shutdown_function, description );}@*
@*
This is first function to call in Perl script.@*
All Perl scripts for WeeChat should call this function.@*
@@ -1267,42 +1290,29 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Print message in current window (channel or server).@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( channel, [server,] message );}@*
@command{weechat::print ( message, [channel, [server]] );}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@item @option{message}: message to display
@end itemize
@*
@emph{Examples:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( delay, message );}@*
@command{weechat::print_infobar ( delay, message );}@*
@*
Print message in infobar.@*
@@ -1314,11 +1324,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( name, function );}@*
@command{weechat::add_message_handler ( name, function );}@*
@*
Attach a Perl function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@@ -1333,18 +1343,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_message_handler ("privmsg", my_function);}@*
@code{weechat::add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( name, function );}@*
@command{weechat::add_command_handler ( name, function );}@*
@*
Create new WeeChat command, linked with Perl function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -1359,23 +1369,41 @@ available until your Perl script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_command_handler ("command", my_command);}@*
@code{weechat::add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [server,] name );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( name, [server] );}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{server}: internal name of server
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@@ -1388,7 +1416,7 @@ Get various info about WeeChat, server or user.@*
@*
@emph{Examples:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1396,7 +1424,172 @@ Get various info about WeeChat, server or user.@*
@node Python scripts, Ruby scripts, Perl scripts, Extensions
@section Python scripts
Not developed!
@subsection Load/unload Python scripts
Python scripts are loaded and unloaded with @command{/python} command.
(type @kbd{/help python} within WeeChat to get help about command).@*
@emph{Examples:}@*
@itemize @bullet
@item
Load a Python script: @kbd{/python load /tmp/sample.py}@*
@item
Unload all Python scripts: @kbd{/python unload}@*
@item
List all Python scripts: @kbd{/python}@*
@end itemize
@subsection WeeChat / Python API
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description );}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: unique name to identify script (each script must have
unique name)
@item @option{version}: script's version
@item @option{shutdown_function}: Python function called when script is
unloaded (optional parameter, empty string means nothing is called at the end)
@item @option{description}: short description of script.
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] );}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( delay, message );}@*
@*
Print message in infobar.@*
@emph{Arguments:}
@itemize @minus
@item @option{delay}: after this delay (in seconds), message will be erased
(if 0, message will not be erased).
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message");}@*
@*
@item
@command{weechat.add_message_handler ( name, function );}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of IRC message@*
To know list of IRC messages, please refer to RFC 1459 and/or 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{function}: Python function called when message is received
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ weechat.print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( name, function );}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of new command@*
This name may be existing command, so that the command is overrided by
Python function. Be careful when overriding WeeChat commands, they'll not be
available until your Python script will be unloaded.
@item @option{function}: Python function linked with command
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( name, [server] );}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@item @option{2 or channel}: get channel name
@item @option{3 or server}: get server name
@item @option{4 or weechatdir}: get WeeChat home directory
@item @option{5 or away}: get away flag for server
@end itemize
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Ruby scripts, , Python scripts, Extensions
@section Ruby scripts
+267 -75
View File
@@ -35,7 +35,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
@subtitle Documentaci@'on para WeeChat v0.1.2 - 21 de mayo de 2005
@image{weechat_image}
@@ -210,7 +210,7 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
* Ficheros de configuracion::
* Atajos de teclado::
* Comandos WeeChat::
* FIFO pipe::
* Canal FIFO::
@end menu
@node Iniciar WeeChat, Ficheros de configuracion, Uso, Uso
@@ -269,6 +269,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item look_charset_internal
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
@item look_buffer_timestamp
Fecha y hora para las bĂşfers@*
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
@item look_color_nicks
Mostrar nombres de usuario con colores diferentes@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -413,6 +416,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_voice
Color para el s@'imbolo de voz@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_sep
Color para el separador de alias@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@@ -498,7 +504,7 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 1@*
Desconexi@'on tras un lag importante (en minutos, 0 = no desconectar nunca)@*
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Crea una tuber@'ia FIFO para control remoto@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item dcc_auto_accept_files
Aceptar autom@'aticamente los ficheros dcc entrantes@*
@@ -671,6 +677,9 @@ Ir a la ventana anterior / siguiente@*
@item F10
Borrar el @'ultimo mensaje en la barra de informaciones@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Refrescar toda la ventana@*
@*
@@ -695,9 +704,12 @@ Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor
@item Alt + (1-9)
Saltar a la memoria temporal con ese n@'umero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node Comandos WeeChat, FIFO pipe, Atajos de teclado, Uso
@node Comandos WeeChat, Canal FIFO, Atajos de teclado, Uso
@section Comandos WeeChat
Comandos internos WeeChat:@*
@@ -743,9 +755,9 @@ nombre_del_servidor: nombre del servidor del que desconectarse@*
@*
@item debug dump
@*
print debug messages@*
imprime mensajes de depuraci@'on@*
@*
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@*
volcado: almacena un volcado de memoria en el archivo de registro de Weechat (se escribe el mismo volcado cuando Weechat se cuelga)@*
@*
@item help [comando]
@*
@@ -753,13 +765,20 @@ mostrar ayuda sobre los comandos@*
@*
comando: nombre de un comando de Weechat @'o de IRC@*
@*
@item perl [load fichero] | [autoload] | [unload]
@item perl [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Perl scripts@*
@*
fichero: Perl script (archivo) a cargar@*
Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@*
@*
@item python [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Python scripts@*
@*
fichero: Python script (archivo) a cargar@*
Sin argumentos, el comando /python lista todos los Python scripts cargados.@*
@*
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@*
lista, a@~nade o elimina servidores@*
@@ -824,10 +843,10 @@ mensaje: mensaje para el estado ausente (si no se da ning
@*
@item ban [canal] [usariio [usuario ...]]
@*
bans nicks or hosts@*
banea usuarios o m@'aquinas@*
@*
channel: channel for ban@*
nickname: user or host to ban@*
canal: canal en el que banear@*
usuario: nombre de usuario o m@'aquina a banear@*
@*
@item ctcp usuario tipo
@*
@@ -900,11 +919,11 @@ comentario: comentario para la expulsi@'on@*
@*
@item kickban [canal] usuario [comentario]
@*
kicks and bans a nick from a channel@*
expulsa y banea a un usuario de un canal@*
@*
channel: channel where user is@*
nickname: nickname to kick and ban@*
comment: comment for kick@*
canal: canal donde est@'a el usuario@*
usuario: nombre de usuario a expulsar y banear@*
comentario: comentario para la expulsi@'on@*
@*
@item kill usuario comentario
@*
@@ -983,11 +1002,12 @@ listar usuarios en canales@*
@*
canal: nombre del canal@*
@*
@item nick usuario
@item nick [-all] usuarios
@*
cambiar el nombre de usuario actual@*
@*
usuario: nuevo nombre de usuario para el servidor IRC actual@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice usuario texto
@*
@@ -1118,10 +1138,10 @@ target: servidor objetivo@*
@*
@item unban [canal] usuario [usuario ...]
@*
unbans nicks or hosts@*
desbanea usuarios o m@'aquinas@*
@*
channel: channel for unban@*
nickname: user or host to unban@*
canal: canal en el que desbanear (quitar la prohibici@'on)@*
usuario: usuario o m@'aquina a desbanear@*
@*
@item userhost usuario [usuario ...]
@*
@@ -1177,37 +1197,40 @@ destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@end table
@node FIFO pipe, , Comandos WeeChat, Uso
@section FIFO pipe
@node Canal FIFO, , Comandos WeeChat, Uso
@section Canal FIFO
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
Puedes controlar WeeChat a distantia, enviando comandos o texto a un canal FIFO
(debes activar la opci@'on "irc_fifo_pipe" que est@'a desactivada por defecto).@*
El canal FIFO est@'a dentro del directorio ~/.weechat/ y se llama
"weechat_fifo_xxxxx" (donde xxxxx es el ID del proceso (PID) de WeeChat).@*
Entonces si tienes varios WeeChat que se est@'an ejecutando, tendr@'as varios
canales FIFO, uno por cada sesi@'on.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
La sintaxis para enviar comandos o texto dentro del canal FIFO es la siguiente:@*
@command{servidor,canal *texto o comando aqu@'i}@*
donde el serviros y el canal son opcionales pero si precisa el canal, debes
precisar tambi@'en el servidor.@*
@*
Some examples:
Algunos ejemplos:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@item @bullet{} cambiar el seud@'onimo en freenode por "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@item @bullet{} escribir texto en el canal #weechat:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@command{echo "freenode,#weechat *@exclamdown{}Hola a todos!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} escribir texto en el canal corriente (el que se puede visualizar en WeeChat actualmente)
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@command{echo "*¡Hola!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
Puedes escribir un script que envia los comandos a todos los programas WeeChat
que se est@'an ejecutando de momento. Por ejemplo:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
@@ -1217,8 +1240,8 @@ You can write a script to send command to all running WeeChat at same time, for
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
Si el script se llama "auto_weechat_command", puedes ejecutarlo hac@'i:@*
@command{./auto_weechat_command "freenode,#weechat *Hola"}
@c ******************************* Extensions *********************************
@@ -1253,7 +1276,7 @@ Listar los programas Perl cargados: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@*
Es la primera funci@'on a la que llamar en el programa Perl.@*
Todos los programas en Perl para WeeChat deben llamar esta funci@'on.@*
@@ -1269,42 +1292,29 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@*
@item
@command{IRC::print ( mensaje );}@*
@*
Escribe un mensaje en la ventana actual (canal o servidor).@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print ("mensaje");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [servidor,] mensaje );}@*
@command{weechat::print ( mensaje, [canal, [servidor]] );}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@item @option{mensaje}: mensaje que debe escribir en el canal
@end itemize
@*
@emph{Ejemplos:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "mensaje");}@*
@code{IRC::print_with_channel ("#weechat", "mensaje");}@*
@emph{Ejemplo:}@*
@code{weechat::print ("mensaje");}@*
@code{weechat::print ("mensaje", "#weechat");}@*
@code{weechat::print ("mensaje", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( retraso, mensaje );}@*
@command{weechat::print_infobar ( retraso, mensaje );}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@@ -1316,11 +1326,11 @@ Escribir un mensaje en la barra de informaciones.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print_infobar (5, "mensaje");}@*
@code{weechat::print_infobar (5, "mensaje");}@*
@*
@item
@command{IRC::add_message_handler ( nombre, funci@'on );}@*
@command{weechat::add_message_handler ( nombre, funci@'on );}@*
@*
Adjunta una funci@'on Perl a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@@ -1336,18 +1346,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_message_handler ("privmsg", mi_funcion);}@*
@code{weechat::add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nombre, funci@'on );}@*
@command{weechat::add_command_handler ( nombre, funci@'on );}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Perl.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@@ -1362,23 +1372,41 @@ al antiguo comando si el script Perl est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_command_handler ("comando", mi_comando);}@*
@code{weechat::add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nombre );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nombre, [servidor] );}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{servidor}: nombre interno del servidor
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@@ -1390,8 +1418,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$version = weechat::get_info("version");}@*
@code{$nick = weechat::get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1399,7 +1427,171 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@node Programas Python, Programas Ruby, Programas Perl, Extensiones
@section Programas Python
¡No desarrollado!
@subsection Cargar/descargar programas Python
Los programas Python se cargan y descargan con el comando @command{/python}
(escribiendo @kbd{/help python} en WeeChat para obtener la ayuda acerca del comando).@*
@emph{Ejemplos:}@*
@itemize @bullet
@item
Cargar un programa Python: @kbd{/python load /tmp/ejemplo.py}@*
@item Descargar todos los programas Python: @kbd{/python unload}@*
@item
Listar los programas Python cargados: @kbd{/python}@*
@end itemize
@subsection Interfaz WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre @'unico para identificar el programa (cada programa debe
tener un nombre distinto)
@item @option{versi@'on}: versi@'on del programa
@item @option{funci@'on_final}: funci@'on Python llamada cuando el programa finaliza
(par@'ametro facultativo, una cadena llena significa que no hay ninguna funci@'on que llamar)
@item @option{descripci@'on}: descripci@'on breve del programa
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje");}@*
@code{weechat.prnt ("mensaje", "#weechat");}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje );}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{plazo}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{message}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje");}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on );}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del mensaje IRC que producir@'a la llamada a la funci@'on.@*
Para saber qu@'e tipo de mensajes IRC existen puede leer las
RFC 1459 y/o 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{funci@'on}: funci@'on en Python llamada cuando se reciba el mensaje.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on );}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del nuevo comando@*
Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a
el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder
al antiguo comando si el script Python est@'a cargado.
@item @option{funcion}: funci@'on Python assiciada al comando.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] );}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@item @option{2 o channel}: obtener el nombre del canal
@item @option{3 o server}: obtener el nombre del servidor
@item @option{4 o weechatdir}: obtener el directorio home de WeeChat
@item @option{5 o away}: obtener la informaci@'on "away" del servidor
@end itemize
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Programas Ruby, , Programas Python, Extensiones
@section Programas Ruby
+228 -38
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
@subtitle Documentation pour WeeChat v0.1.2 - 21 Mai 2005
@image{weechat_image}
@@ -270,6 +270,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item look_charset_internal
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
@item look_buffer_timestamp
Horodatage pour les tampons@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '[%H:%M:%S]'@*
@item look_color_nicks
Afficher les utilisateurs avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -414,6 +417,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_voice
Couleur pour le symbole voix@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_sep
Couleur pour le s@'eparateur de pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@@ -671,6 +677,9 @@ Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item F11 / F12
Faire d@'efiler la liste des pseudos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@@ -695,6 +704,9 @@ Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Faire d@'efiler la liste des pseudos@*
@*
@end table
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
@@ -753,13 +765,20 @@ afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item perl [load fichier] | [autoload] | [unload]
@item perl [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Perl@*
@*
fichier: script Perl (fichier) @`a charger@*
Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
@*
@item python [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Python@*
@*
fichier: script Python (fichier) @`a charger@*
Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@@ -983,11 +1002,12 @@ lister les utilisateurs sur des canaux@*
@*
canal: nom du canal@*
@*
@item nick pseudo
@item nick [-all] pseudo
@*
changer le pseudo courant@*
@*
pseudo: nouveau pseudo pour le serveur IRC courant@*
-all: d@'efinir le nouveau pseudo sur tous les serveurs connect@'es@*
pseudo: nouveau pseudo@*
@*
@item notice pseudo texte
@*
@@ -1254,7 +1274,7 @@ Lister les scripts Perl charg@'es : @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nom, version, fonction_de_fin, description );}@*
@command{weechat::register ( nom, version, fonction_de_fin, description );}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Perl.@*
Tout script Perl pour WeeChat doit appeler cette fonction.@*
@@ -1271,42 +1291,29 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Affiche un message dans la fen@^etre courante (canal ou serveur).@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [serveur,] message );}@*
@command{weechat::print ( message, [canal, [serveur]] );}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemples :}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@emph{Exemple :}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( d@'elai, message );}@*
@command{weechat::print_infobar ( d@'elai, message );}@*
@*
Affiche un message dans la barre d'infos.@*
@@ -1318,11 +1325,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( nom, fonction );}@*
@command{weechat::add_message_handler ( nom, fonction );}@*
@*
Attache une fonction Perl @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@@ -1338,18 +1345,18 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_message_handler ("privmsg", ma_fonction);}@*
@code{weechat::add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nom, fonction );}@*
@command{weechat::add_command_handler ( nom, fonction );}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Perl.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@@ -1364,23 +1371,41 @@ ne seront plus accessibles tant que le script Perl sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_command_handler ("commande", ma_commande);}@*
@code{weechat::add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [serveur,] nom );}@*
@command{weechat::command ( commande, [canal, [serveur]] );}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat::command ("bonjour tout le monde !");}@*
@code{weechat::command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nom, [serveur] );}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{serveur}: nom interne du serveur
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@@ -1393,7 +1418,7 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@*
@emph{Exemples :}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1401,7 +1426,172 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@node Scripts Python, Scripts Ruby, Scripts Perl, Extensions
@section Scripts Python
Non d@'evelopp@'e !
@subsection Charger/d@'echarger des scripts Python
Les scripts Python sont charg@'es et d@'echarg@'es avec la commande @command{/python}
(tapez @kbd{/help python} dans WeeChat pour obtenir de l'aide sur la commande).@*
@emph{Exemples :}@*
@itemize @bullet
@item
Charger un script Python : @kbd{/python load /tmp/essai.py}@*
@item D@'echarger tous les scripts Python : @kbd{/python unload}@*
@item
Lister les scripts Python charg@'es : @kbd{/python}@*
@end itemize
@subsection Interface WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description );}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom unique pour identifier le script (chaque script doit
avoir un nom diff@'erent)
@item @option{version}: version du script
@item @option{fonction_de_fin}: fonction Python appel@'ee quand le script est
d@'echarg@'e (param@`etre facultatif, une cha@^ine vide signifiant qu'il n'y a pas
de fonction @`a appeler)
@item @option{description}: description br@`eve du script.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] );}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message );}@*
@*
Affiche un message dans la barre d'infos.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e
(si 0, le message ne sera pas effac@'e).
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message");}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction );}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom du message IRC pour lequel la fonction est appel@'ee@*
Pour conna@^itre la liste des messages IRC disponibles, merci de consulter les
RFC 1459 et/ou 2812 :@*
RFC 1459 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{fonction}: fonction Python appel@'ee lorsque le message est re@,{c}u
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction );}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de la nouvelle commande@*
Il peut s'agir d'une commande existante, auquel cas celle-ci est @'ecras@'ee par
la fonction Python. Soyez prudent en @'ecrasant les commandes WeeChat, car elles
ne seront plus accessibles tant que le script Python sera charg@'e.
@item @option{fonction}: fonction Python associ@'ee @`a la commande
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] );}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !");}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] );}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@item @option{2 ou channel}: obtenir le nom du canal
@item @option{3 ou server}: obtenir le nom du serveur
@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat
@item @option{5 ou away}: obtenir le drapeau "away" du serveur
@end itemize
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Scripts Ruby, , Scripts Python, Extensions
@section Scripts Ruby
+204 -34
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.1 - 20 de Mar@,{c}o de 2005
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2 - 21 de Maio de 2005
@image{weechat_image}
@@ -284,6 +284,9 @@ Comute ao janela anterior / seguinte@*
@item F10
Apagar a @'ultima mensagem da barra do info@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Redesenhe a janela inteira@*
@*
@@ -308,6 +311,9 @@ Comute @`a primeira canaleta do servidor seguinte (ou do amortecedor do servidor
@item Alt + d@'igito (1-9)
Comute ao amortecedor pelo n@'umero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node Comandos do WeeChat, FIFO pipe, Recursos de teclado, Utilizacao
@@ -392,7 +398,7 @@ Listar todos os Scripts Perl: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@*
@command{weechat::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@*
@*
Esta @'e a primeira fun@,{c}@~ao a invocar num Script Perl.@*
Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@*
@@ -406,42 +412,29 @@ Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{IRC::print ( mensagem );}@*
@*
Imprimne uma mensagem na janela actual (canal ou servidor).@*
@emph{Argumentos:}
@itemize @minus
@item @option{mensagem}: mensagem a mostrar
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::print ("mensagem");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [servidor,] mensagem );}@*
@command{weechat::print ( mensagem, [canal, [servidor]] );}@*
@*
Imprimne uma mensagem na canal.@*
@emph{Argumentos:}
@itemize @minus
@item @option{mensagem}: mensagem a mostrar
@item @option{canal}: nome da canal
@item @option{servidor}: nome interno da servidor
@item @option{mensagem}: mensagem a mostrar
@end itemize
@*
@emph{Exemplos:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "mensagem");}@*
@code{IRC::print_with_channel ("#weechat", "mensagem");}@*
@emph{Exemplo:}@*
@code{weechat::print ("mensagem");}@*
@code{weechat::print ("mensagem", "#weechat");}@*
@code{weechat::print ("mensagem", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( atrasa, mensagem );}@*
@command{weechat::print_infobar ( atrasa, mensagem );}@*
@*
Imprimne uma mensagem na barra do info.@*
@@ -453,11 +446,11 @@ Imprimne uma mensagem na barra do info.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::print_infobar (5, "mensagem");}@*
@code{weechat::print_infobar (5, "mensagem");}@*
@*
@item
@command{IRC::add_message_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat::add_message_handler ( nome, fun@,{c}@~ao );}@*
@*
Anexa uma fun@,{c}@~ao Perl a uma mensagem de IRC.@*
A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@*
@@ -472,17 +465,17 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::add_message_handler ("privmsg", my_function);}@*
@code{weechat::add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat::add_command_handler ( nome, fun@,{c}@~ao );}@*
@*
Cria um novo comando do Weechat, ligado a uma fun@,{c}@~ao Perl.@*
A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@*
@@ -495,23 +488,41 @@ Este nome pode pertencer a um comando j
@end itemize
@*
@emph{Exemplo:}@*
@code{IRC::add_command_handler ("command", my_command);}@*
@code{weechat::add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ weechat::print("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nome );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nome, [servidor] );}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@emph{Argumentos:}
@itemize @minus
@item @option{servidor}: nome interno da servidor
@item @option{nome}: nome do info a recuperar:
@item @option{servidor}: nome interno da servidor
@itemize @minus
@item @option{0 ou version}: comece a vers@~ao de WeeChat
@item @option{1 ou nick}: comece o nickname
@@ -524,7 +535,7 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@*
@emph{Exemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -532,7 +543,166 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@node Scripts Python, Scripts Ruby, Scripts Perl, Extencoes
@section Scripts Python
N@~AO DESENVOLVIDO!
@subsection Carregar/Descarregar Scripts Python
Os Scripts Python s@~ao carregados e descarregados com o comando @command{/python}.
(escreve @kbd{/help python} dentro do WeeChat para obteres ajuda acerca do comando).@*
@emph{Exemplos:}@*
@itemize @bullet
@item
Carregar um Script Python: @kbd{/python load /tmp/sample.py}@*
@item
Descarregar todos os Scripts Python: @kbd{/python unload}@*
@item
Listar todos os Scripts Python: @kbd{/python}@*
@end itemize
@subsection Interface WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@*
@*
Esta @'e a primeira fun@,{c}@~ao a invocar num Script Python.@*
Todos os Scripts Python para o Weechat devem invocar esta fun@,{c}@~ao.@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome @'unico que indentifique o script (cada Script Python deve ter um @'unico nome)
@item @option{vers@~ao}: vers@~ao do script
@item @option{fun@,{c}@~ao_de_shutdown}: fun@,{c}@~ao Python invocada quando o script Ă© descarregado (par@^ametro opcional, se deixado em branco significa que nada deve ser chamado)
@item @option{descri@,{c}@~ao}: breve descri@,{c}@~ao do script.
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{weechat.prnt ( mensagem, [canal, [servidor]] );}@*
@*
Imprimne uma mensagem na canal.@*
@emph{Argumentos:}
@itemize @minus
@item @option{mensagem}: mensagem a mostrar
@item @option{canal}: nome da canal
@item @option{servidor}: nome interno da servidor
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.prnt ("mensagem");}@*
@code{weechat.prnt ("mensagem", "#weechat");}@*
@code{weechat.prnt ("mensagem", "#weechat", "freenode");}@*
@*
@item
@command{weechat.print_infobar ( atrasa, mensagem );}@*
@*
Imprimne uma mensagem na barra do info.@*
@emph{Argumentos:}
@itemize @minus
@item @option{atrasa}: depois que isto atrasa (nos segundos), a mensagem estar@'a apagada
(se 0, mensagem n@~ao forem apagados).
@item @option{mensagem}: mensagem a mostrar
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.print_infobar (5, "mensagem");}@*
@*
@item
@command{weechat.add_message_handler ( nome, fun@,{c}@~ao );}@*
@*
Anexa uma fun@,{c}@~ao Python a uma mensagem de IRC.@*
A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome da mensagem IRC@*
Para conheceres uma lista de mensagens de IRC, por favor lĂŞ o RFC 1459 e/ou o 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python invocada quando a mensagem Ă© recebida
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{weechat.add_command_handler ( nome, fun@,{c}@~ao );}@*
@*
Cria um novo comando do Weechat, ligado a uma fun@,{c}@~ao Python.@*
A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome do novo comando@*
Este nome pode pertencer a um comando já existente, o qual ser@'a sobreposto pela fun@,{c}@~ao Python. Tem cuidado quando fizeres isto: os comandos originais não estar@~ao acessiveis antes de teres descarregado o Script Python.
@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python ligada ao comando
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat.get_info ( nome, [servidor] );}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@emph{Argumentos:}
@itemize @minus
@item @option{nome}: nome do info a recuperar:
@item @option{servidor}: nome interno da servidor
@itemize @minus
@item @option{0 ou version}: comece a vers@~ao de WeeChat
@item @option{1 ou nick}: comece o nickname
@item @option{2 ou channel}: comece o nome da canal
@item @option{3 ou server}: comece o nome do servidor
@item @option{4 ou weechatdir}: comece a WeeChat o diret@'orio home
@item @option{5 ou away}: comece a bandeira ausente para o servidor
@end itemize
@end itemize
@*
@emph{Exemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@*
@end itemize
@node Scripts Ruby, , Scripts Python, Extencoes
@section Scripts Ruby
+2
View File
@@ -9,6 +9,8 @@
./src/irc/irc.h
./src/plugins/perl/wee-perl.c
./src/plugins/perl/wee-perl.h
./src/plugins/python/wee-python.c
./src/plugins/python/wee-python.h
./src/plugins/plugins.c
./src/plugins/plugins.h
./src/gui/curses/gui-input.c
+803 -701
View File
File diff suppressed because it is too large Load Diff
+809 -701
View File
File diff suppressed because it is too large Load Diff
+783 -685
View File
File diff suppressed because it is too large Load Diff
+180 -14
View File
@@ -73,10 +73,15 @@ t_weechat_command weechat_commands[] =
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
{ "perl", N_("list/load/unload Perl scripts"),
N_("[load filename] | [autoload] | [unload]"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Perl script (file) to load\n"
"Without argument, /perl command lists all loaded Perl scripts."),
0, 2, weechat_cmd_perl, NULL },
{ "python", N_("list/load/unload Python scripts"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Python script (file) to load\n"
"Without argument, /python command lists all loaded Python scripts."),
0, 2, weechat_cmd_python, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
@@ -652,6 +657,8 @@ void
user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
{
t_irc_nick *ptr_nick;
int plugin_args_length;
char *plugin_args;
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
return;
@@ -677,7 +684,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
else
server_sendf (server, "PRIVMSG %s :%s\r\n",
CHANNEL(buffer)->name, command);
if (CHANNEL(buffer)->type == CHAT_PRIVATE)
{
gui_printf_type_color (CHANNEL(buffer)->buffer,
@@ -712,6 +719,27 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
WEECHAT_ERROR);
}
}
/* sending a copy of the message as PRIVMSG to plugins because irc server doesn't */
plugin_args_length = strlen ("localhost PRIVMSG :") +
strlen (CHANNEL(buffer)->name) + strlen(command) + 16;
plugin_args = (char *) malloc (plugin_args_length * sizeof (*plugin_args));
if (plugin_args)
{
snprintf (plugin_args, plugin_args_length,
"localhost PRIVMSG %s :%s",
CHANNEL(buffer)->name, command);
plugin_event_msg ("privmsg", server->name, plugin_args);
free (plugin_args);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s unable to call handler for message (not enough memory)\n"),
WEECHAT_ERROR);
}
}
else
{
@@ -1286,19 +1314,18 @@ weechat_cmd_help (int argc, char **argv)
int
weechat_cmd_perl (int argc, char **argv)
{
#ifdef PLUGINS
#ifdef PLUGIN_PERL
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
#ifdef PLUGIN_PERL
switch (argc)
{
case 0:
/* list registered Perl scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered Perl scripts:\n"));
gui_printf (NULL, _("Registered %s scripts:\n"), "Perl");
if (perl_scripts)
{
for (ptr_plugin_script = perl_scripts; ptr_plugin_script;
@@ -1320,7 +1347,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl message handlers:\n"));
gui_printf (NULL, _("%s message handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1329,8 +1356,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => Perl(%s)\n"),
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1342,7 +1370,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl command handlers:\n"));
gui_printf (NULL, _("%s command handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1351,8 +1379,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => Perl(%s)\n"),
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1366,13 +1395,13 @@ weechat_cmd_perl (int argc, char **argv)
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
if (strcasecmp (argv[0], "unload") == 0)
else if (strcasecmp (argv[0], "reload") == 0)
{
/* unload all Perl scripts */
plugin_unload (PLUGIN_TYPE_PERL, NULL);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Perl scripts unloaded\n"));
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PERL, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
@@ -1418,11 +1447,148 @@ weechat_cmd_perl (int argc, char **argv)
(void) argv;
#endif /* PLUGIN_PERL */
return 0;
}
/*
* weechat_cmd_python: list/load/unload Python scripts
*/
int
weechat_cmd_python (int argc, char **argv)
{
#ifdef PLUGIN_PYTHON
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
switch (argc)
{
case 0:
/* list registered Python scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered %s scripts:\n"), "Python");
if (python_scripts)
{
for (ptr_plugin_script = python_scripts; ptr_plugin_script;
ptr_plugin_script = ptr_plugin_script->next_script)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, " %s v%s%s%s\n",
ptr_plugin_script->name,
ptr_plugin_script->version,
(ptr_plugin_script->description[0]) ? " - " : "",
ptr_plugin_script->description);
}
}
else
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Python message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s message handlers:\n"), "Python");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Python command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s command handlers:\n"), "Python");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
else if (strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
{
/* load Python script */
if (strstr(argv[1], DIR_SEPARATOR))
path_script = NULL;
else
{
path_length = strlen (weechat_home) + strlen (argv[1]) + 7;
path_script = (char *) malloc (path_length * sizeof (char));
snprintf (path_script, path_length, "%s%s%s%s%s",
weechat_home, DIR_SEPARATOR, "python",
DIR_SEPARATOR, argv[1]);
}
plugin_load (PLUGIN_TYPE_PYTHON,
(path_script) ? path_script : argv[1]);
if (path_script)
free (path_script);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
break;
default:
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Python support.\n"
"Please rebuild WeeChat with "
"\"--enable-python\" option for ./configure script\n"));
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGINS */
#endif /* PLUGIN_PYTHON */
return 0;
}
+1
View File
@@ -70,6 +70,7 @@ extern int weechat_cmd_debug (int, char **);
extern int weechat_cmd_disconnect (int, char **);
extern int weechat_cmd_help (int, char **);
extern int weechat_cmd_perl (int, char **);
extern int weechat_cmd_python (int, char **);
extern int weechat_cmd_save (int, char **);
extern int weechat_cmd_server (int, char **);
extern int weechat_cmd_set (char *);
+10 -1
View File
@@ -193,7 +193,8 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "perl") == 0)
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -202,6 +203,9 @@ completion_build_list (t_completion *completion, void *channel)
weelist_add (&completion->completion_list,
&completion->last_completion,
"autoload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"reload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"unload");
@@ -392,6 +396,11 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "me") == 0)
{
completion->context = COMPLETION_NICK;
return;
}
if (strcasecmp (completion->base_command, "notice") == 0)
{
if (completion->base_command_arg != 1)
+13 -4
View File
@@ -52,7 +52,9 @@
#include <iconv.h>
#endif
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
#include "weechat.h"
#include "weeconfig.h"
@@ -115,8 +117,10 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf, *ptr_inbuf, *ptr_outbuf;
int inbytesleft, outbytesleft;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (strcasecmp(from_code, to_code) != 0))
@@ -573,6 +577,9 @@ weechat_welcome_message ()
cfg_look_startup_version)
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX1,
"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
wee_log_printf ("%s (%s %s %s)\n",
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
}
/*
@@ -625,7 +632,7 @@ wee_dump (int crash)
if (crash)
{
sigsegv = 1;
wee_log_printf ("very bad, WeeChat is crashing (SIGSEGV received)...\n");
wee_log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
}
wee_log_printf ("\n");
@@ -734,7 +741,9 @@ main (int argc, char *argv[])
textdomain (PACKAGE);
#endif
#ifdef HAVE_LANGINFO_CODESET
local_charset = strdup (nl_langinfo (CODESET));
#endif
signal (SIGINT, my_sigint); /* ignore SIGINT signal */
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
@@ -761,8 +770,8 @@ main (int argc, char *argv[])
}
gui_init (); /* init WeeChat interface */
plugin_init (); /* init plugin interface(s) */
weechat_welcome_message (); /* display WeeChat welcome message */
plugin_init (); /* init plugin interface(s) */
/* auto-connect to servers */
server_auto_connect (server_cmd_line);
fifo_create (); /* create FIFO pipe for remote control */
+5 -1
View File
@@ -30,7 +30,11 @@
#if defined(ENABLE_NLS) && !defined(_)
#include <locale.h>
#include <libintl.h>
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#else
#include "../../intl/libintl.h"
#endif
#define _(x) gettext(x)
#ifdef gettext_noop
#define N_(string) gettext_noop (string)
+12 -2
View File
@@ -66,6 +66,7 @@ char *cfg_look_weechat_slogan;
char *cfg_look_charset_decode;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks;
int cfg_look_color_actions;
int cfg_look_remove_colors_from_msgs;
@@ -112,6 +113,10 @@ t_config_option weechat_options_look[] =
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
"[%H:%M:%S]", NULL, NULL, &cfg_look_buffer_timestamp, config_change_buffer_content },
{ "look_color_nicks", N_("display nick names with different colors"),
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -210,6 +215,7 @@ int cfg_col_nick_chanadmin;
int cfg_col_nick_op;
int cfg_col_nick_halfop;
int cfg_col_nick_voice;
int cfg_col_nick_more;
int cfg_col_nick_sep;
int cfg_col_nick_self;
int cfg_col_nick_private;
@@ -370,6 +376,10 @@ t_config_option weechat_options_colors[] =
N_("color for voice symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_nick_voice, NULL, &config_change_color },
{ "col_nick_more", N_("color for '+' when scrolling nicks"),
N_("color for '+' when scrolling nicks"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_more, NULL, &config_change_color },
{ "col_nick_sep", N_("color for nick separator"),
N_("color for nick separator"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -1379,7 +1389,7 @@ config_create_default ()
}
printf (_("%s: creating default config file...\n"), PACKAGE_NAME);
wee_log_printf (_("creating default config file\n"));
wee_log_printf (_("Creating default config file\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
@@ -1551,7 +1561,7 @@ config_write (char *config_name)
return -1;
}
wee_log_printf (_("saving config to disk\n"));
wee_log_printf (_("Saving config to disk\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
+2
View File
@@ -83,6 +83,7 @@ extern char *cfg_look_weechat_slogan;
extern char *cfg_look_charset_decode;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks;
extern int cfg_look_color_actions;
extern int cfg_look_remove_colors_from_msgs;
@@ -132,6 +133,7 @@ extern int cfg_col_nick_chanadmin;
extern int cfg_col_nick_op;
extern int cfg_col_nick_halfop;
extern int cfg_col_nick_voice;
extern int cfg_col_nick_more;
extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
extern int cfg_col_nick_private;
+12 -1
View File
@@ -15,10 +15,21 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
noinst_LIBRARIES = lib_weechat_gui_common.a
lib_weechat_gui_common_a_SOURCES = gui-common.c \
gui.h
if GUI_NCURSES
curses_dir=curses
endif
if GUI_WXWIDGETS
wxwidgets_dir=wxwidgets
endif
if GUI_GTK
gtk_dir=gtk
endif
@@ -27,4 +38,4 @@ if GUI_QT
qt_dir=qt
endif
SUBDIRS = $(curses_dir) $(gtk_dir) $(qt_dir)
SUBDIRS = . $(curses_dir) $(wxwidgets_dir) $(gtk_dir) $(qt_dir)
+3 -4
View File
@@ -19,12 +19,11 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = weechat-curses
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(NCURSES_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_curses_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_curses_SOURCES = gui-display.c \
gui-input.c
+272 -85
View File
@@ -30,6 +30,7 @@
#include <string.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#include <ncurses.h>
#include "../../common/weechat.h"
@@ -65,6 +66,7 @@ char *nicks_colors[COLOR_WIN_NICK_NUMBER] =
int color_attr[NUM_COLORS];
/*
* gui_assign_color: assign a color (read from config)
*/
@@ -141,7 +143,7 @@ gui_get_color_by_value (int color_value)
void
gui_window_set_color (WINDOW *window, int num_color)
{
if (has_colors)
if (has_colors ())
{
if (color_attr[num_color - 1] & A_BOLD)
wattron (window, COLOR_PAIR (num_color) | A_BOLD);
@@ -763,6 +765,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
wprintw (ptr_win->win_chat, ">");
for (j = 0; j < 10 - num_bars; j++)
wprintw (ptr_win->win_chat, " ");
if (ptr_dcc->size < 1024*10)
num_unit = 0;
else if (ptr_dcc->size < 1024*1024)
@@ -777,20 +780,31 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
unit_format[num_unit],
unit_format[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->pos) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->pos)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit],
((long double) ptr_dcc->size) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->size)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
if (ptr_dcc->bytes_per_sec < 1024*1024)
num_unit = 1;
else if (ptr_dcc->bytes_per_sec < 1024*1024*1024)
num_unit = 2;
else
num_unit = 3;
sprintf (format, " (%s %%s/s)", unit_format[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->bytes_per_sec) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
wclrtoeol (ptr_win->win_chat);
}
else
{
date_tmp = localtime (&(ptr_dcc->start_time));
strftime (date, sizeof (date) - 1, "%a, %d %b %Y %H:%M:%S", date_tmp);
wprintw (ptr_win->win_chat, " %s", date);
wclrtoeol (ptr_win->win_chat);
}
wclrtoeol (ptr_win->win_chat);
ptr_win->dcc_last_displayed = ptr_dcc;
i += 2;
}
@@ -860,7 +874,7 @@ void
gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
int i, x, y, column, max_length;
int i, j, x, y, column, max_length, nicks_displayed;
char format[32], format_empty[32];
t_irc_nick *ptr_nick;
@@ -943,71 +957,103 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
x = 0;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0;
column = 0;
for (ptr_nick = CHANNEL(buffer)->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_height - 1);
else
nicks_displayed = ptr_win->win_nick_height;
ptr_nick = CHANNEL(buffer)->nicks;
for (i = 0; i < ptr_win->win_nick_start; i++)
{
switch (cfg_look_nicklist_position)
if (!ptr_nick)
break;
ptr_nick = ptr_nick->next_nick;
}
if (ptr_nick)
{
for (i = 0; i < nicks_displayed; i++)
{
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
switch (cfg_look_nicklist_position)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if ( ((i == 0) && (ptr_win->win_nick_start > 0))
|| ((i == nicks_displayed - 1) && (ptr_nick->next_nick)) )
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_MORE);
j = (max_length + 1) >= 4 ? 4 : max_length + 1;
for (x = 1; x <= j; x++)
mvwprintw (ptr_win->win_nick, y, x, "+");
}
else
{
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
ptr_nick = ptr_nick->next_nick;
if (!ptr_nick)
break;
}
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
}
}
}
}
@@ -1269,7 +1315,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
x = ptr_win->win_width - strlen (str_nicks) - 4;
}
else
x = ptr_win->win_width;
x = ptr_win->win_width - 2;
string = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
@@ -1313,7 +1359,7 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
char text[1024 + 1];
char text_time[1024 + 1];
/* make gcc happy */
(void) buffer;
@@ -1338,9 +1384,9 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
local_time = localtime (&time_seconds);
if (local_time)
{
strftime (text, 1024, cfg_look_infobar_timestamp, local_time);
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
wprintw (ptr_win->win_infobar, "%s", text);
wprintw (ptr_win->win_infobar, "%s", text_time);
}
if (gui_infobar)
{
@@ -1552,6 +1598,7 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
gui_current_window->buffer->num_displayed--;
window->buffer = buffer;
window->win_nick_start = 0;
gui_calculate_pos_size (window);
/* destroy Curses windows */
@@ -1800,6 +1847,100 @@ gui_move_page_down (t_gui_window *window)
}
}
/*
* gui_nick_move_beginning: go to beginning of nicklist
*/
void
gui_nick_move_beginning (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_end: go to the end of nicklist
*/
void
gui_nick_move_end (t_gui_window *window)
{
int new_start;
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
new_start = CHANNEL(window->buffer)->nicks_count - window->win_nick_height;
if (new_start < 0)
new_start = 0;
else if (new_start >= 1)
new_start++;
if (new_start != window->win_nick_start)
{
window->win_nick_start = new_start;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_up: scroll one page up in nicklist
*/
void
gui_nick_move_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start -= (window->win_nick_height - 1);
if (window->win_nick_start <= 1)
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_down: scroll one page down in nicklist
*/
void
gui_nick_move_page_down (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
&& (window->win_nick_start + window->win_nick_height - 1 < CHANNEL(window->buffer)->nicks_count))
{
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_height - 1);
else
window->win_nick_start += (window->win_nick_height - 2);
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_window_init_subviews: init subviews for a WeeChat window
*/
@@ -2187,6 +2328,8 @@ gui_init_colors ()
cfg_col_nick_halfop & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_VOICE,
cfg_col_nick_voice & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_MORE,
cfg_col_nick_more & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SEP,
cfg_col_nick_sep & A_CHARTEXT, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SELF,
@@ -2246,6 +2389,7 @@ gui_init_colors ()
color_attr[COLOR_WIN_NICK_OP - 1] = (cfg_col_nick_op >= 0) ? cfg_col_nick_op & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_HALFOP - 1] = (cfg_col_nick_halfop >= 0) ? cfg_col_nick_halfop & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_VOICE - 1] = (cfg_col_nick_voice >= 0) ? cfg_col_nick_voice & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_MORE - 1] = (cfg_col_nick_more >= 0) ? cfg_col_nick_more & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_SEP - 1] = 0;
color_attr[COLOR_WIN_NICK_SELF - 1] = (cfg_col_nick_self >= 0) ? cfg_col_nick_self & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_PRIVATE - 1] = (cfg_col_nick_private >= 0) ? cfg_col_nick_private & A_BOLD : 0;
@@ -2398,7 +2542,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
pos[0] = '\n';
if (buffer->num_displayed > 0)
gui_draw_buffer_chat (buffer, 0);
if (buffer->num_displayed == 0)
if (gui_add_hotlist && (buffer->num_displayed == 0))
{
if (3 - buffer->last_line->line_with_message -
buffer->last_line->line_with_highlight <=
@@ -2423,7 +2567,11 @@ void
gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message, ...)
{
static char buf[8192];
char timestamp[16];
char text_time[1024 + 1];
char text_time_char[2];
time_t time_seconds;
struct tm *local_time;
int time_first_digit, time_last_digit;
char *pos, *buf2, *buf3;
int i, j;
va_list argptr;
@@ -2454,6 +2602,12 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
}
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
va_start (argptr, message);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
@@ -2502,19 +2656,52 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
pos = buf3 - 1;
while (pos)
{
/* TODO: read timestamp format from config! */
if ((!buffer->last_line) || (buffer->line_complete))
{
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "[");
snprintf (timestamp, 16, "%02d", date_tmp->tm_hour);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_min);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_sec);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
strftime (text_time, 1024, cfg_look_buffer_timestamp, local_time);
time_first_digit = -1;
time_last_digit = -1;
i = 0;
while (text_time[i])
{
if (isdigit (text_time[i]))
{
if (time_first_digit == -1)
time_first_digit = i;
time_last_digit = i;
}
i++;
}
text_time_char[1] = '\0';
i = 0;
while (text_time[i])
{
text_time_char[0] = text_time[i];
if (time_first_digit < 0)
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
{
if ((i < time_first_digit) || (i > time_last_digit))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK,
text_time_char);
else
{
if (isdigit (text_time[i]))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP,
text_time_char);
}
}
i++;
}
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, " ");
}
gui_add_message (buffer, type, color, pos + 1);
pos = strchr (pos + 1, '\n');
+39 -19
View File
@@ -53,7 +53,7 @@ gui_read_keyb ()
int key, i;
t_gui_buffer *ptr_buffer;
t_irc_server *ptr_server;
t_irc_dcc *ptr_dcc;
t_irc_dcc *ptr_dcc, *ptr_dcc_next;
char new_char[3], *decoded_string;
t_irc_dcc *dcc_selected;
@@ -72,8 +72,6 @@ gui_read_keyb ()
case KEY_F(3):
case KEY_F(4):
case KEY_F(9):
case KEY_F(11):
case KEY_F(12):
break;
/* previous buffer in window */
case KEY_F(5):
@@ -96,6 +94,12 @@ gui_read_keyb ()
gui_infobar_remove ();
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
break;
case KEY_F(11):
gui_nick_move_page_up (gui_current_window);
break;
case KEY_F(12):
gui_nick_move_page_down (gui_current_window);
break;
/* cursor up */
case KEY_UP:
if (gui_current_window->buffer->dcc)
@@ -416,25 +420,38 @@ gui_read_keyb ()
case KEY_RIGHT:
gui_switch_to_next_buffer (gui_current_window);
break;
/* Alt + home */
case KEY_HOME:
gui_nick_move_beginning (gui_current_window);
break;
/* Alt + end */
case KEY_END:
gui_nick_move_end (gui_current_window);
break;
/* Alt + page up */
case KEY_PPAGE:
gui_nick_move_page_up (gui_current_window);
break;
/* Alt + page down */
case KEY_NPAGE:
gui_nick_move_page_down (gui_current_window);
break;
case 79:
/* TODO: replace 79 by constant name! */
if (key == 79)
if ((key = getch()) != ERR)
{
if ((key = getch()) != ERR)
switch (key)
{
switch (key)
{
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
}
break;
@@ -591,10 +608,13 @@ gui_read_keyb ()
case 'p':
case 'P':
gui_current_window->dcc_selected = NULL;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
ptr_dcc = dcc_list;
while (ptr_dcc)
{
ptr_dcc_next = ptr_dcc->next_dcc;
if (DCC_ENDED(ptr_dcc->status))
dcc_free (ptr_dcc);
ptr_dcc = ptr_dcc_next;
}
gui_redraw_buffer (gui_current_window->buffer);
break;
+3 -4
View File
@@ -19,12 +19,11 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
bin_PROGRAMS = weechat-gtk
weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
weechat_gtk_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(GTK_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_gtk_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_gtk_SOURCES = gui-display.c \
gui-input.c
+9 -6
View File
@@ -43,6 +43,8 @@
int gui_init_ok = 0; /* = 1 if GUI is initialized */
int gui_ok = 0; /* = 1 if GUI is ok */
/* (0 when term size too small) */
int gui_add_hotlist = 1; /* 0 is for temporarly disable */
/* hotlist add for all buffers */
t_gui_window *gui_windows = NULL; /* pointer to first window */
t_gui_window *last_gui_window = NULL; /* pointer to last window */
@@ -64,7 +66,7 @@ gui_window_new (int x, int y, int width, int height)
t_gui_window *new_window;
#ifdef DEBUG
wee_log_printf ("creating new window (x:%d, y:%d, width:%d, height:%d)\n",
wee_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
x, y, width, height);
#endif
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
@@ -85,6 +87,7 @@ gui_window_new (int x, int y, int width, int height)
new_window->win_nick_y = 0;
new_window->win_nick_width = 0;
new_window->win_nick_height = 0;
new_window->win_nick_start = 0;
new_window->win_title = NULL;
new_window->win_chat = NULL;
@@ -135,7 +138,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
t_gui_buffer *new_buffer;
#ifdef DEBUG
wee_log_printf ("creating new buffer\n");
wee_log_printf ("Creating new buffer\n");
#endif
/* use first buffer if no server was assigned to this buffer */
@@ -324,8 +327,7 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
else
wee_log_printf (_("%s not enough memory for infobar message\n"),
WEECHAT_ERROR);
wee_log_printf (_("Not enough memory for infobar message\n"));
free (buf2);
}
@@ -500,7 +502,7 @@ gui_new_line (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("%s not enough memory for new line!\n"));
wee_log_printf (_("Not enough memory for new line\n"));
return NULL;
}
@@ -543,7 +545,7 @@ gui_new_message (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("not enough memory!\n"));
wee_log_printf (_("Not enough memory for new message\n"));
return NULL;
}
return new_message;
@@ -840,6 +842,7 @@ gui_window_print_log (t_gui_window *window)
wee_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y);
wee_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width);
wee_log_printf (" win_nick_height . . : %d\n", window->win_nick_height);
wee_log_printf (" win_nick_start. . . : %d\n", window->win_nick_start);
wee_log_printf (" win_title . . . . . : 0x%X\n", window->win_title);
wee_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat);
wee_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick);
+25 -18
View File
@@ -26,7 +26,7 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 49
#define NUM_COLORS 50
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
@@ -56,19 +56,20 @@
#define COLOR_WIN_NICK_OP 27
#define COLOR_WIN_NICK_HALFOP 28
#define COLOR_WIN_NICK_VOICE 29
#define COLOR_WIN_NICK_SEP 30
#define COLOR_WIN_NICK_SELF 31
#define COLOR_WIN_NICK_PRIVATE 32
#define COLOR_WIN_NICK_FIRST 33
#define COLOR_WIN_NICK_LAST 42
#define COLOR_WIN_NICK_MORE 30
#define COLOR_WIN_NICK_SEP 31
#define COLOR_WIN_NICK_SELF 32
#define COLOR_WIN_NICK_PRIVATE 33
#define COLOR_WIN_NICK_FIRST 34
#define COLOR_WIN_NICK_LAST 43
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 43
#define COLOR_DCC_WAITING 44
#define COLOR_DCC_CONNECTING 45
#define COLOR_DCC_ACTIVE 46
#define COLOR_DCC_DONE 47
#define COLOR_DCC_FAILED 48
#define COLOR_DCC_ABORTED 49
#define COLOR_DCC_SELECTED 44
#define COLOR_DCC_WAITING 45
#define COLOR_DCC_CONNECTING 46
#define COLOR_DCC_ACTIVE 47
#define COLOR_DCC_DONE 48
#define COLOR_DCC_FAILED 49
#define COLOR_DCC_ABORTED 50
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
@@ -209,9 +210,10 @@ struct t_gui_window
int win_chat_cursor_y; /* position of cursor in chat window */
/* nicklist window settings */
int win_nick_x, win_nick_y; /* chat window position */
int win_nick_width; /* width of chat window */
int win_nick_height; /* height of chat window */
int win_nick_x, win_nick_y; /* nick window position */
int win_nick_width; /* width of nick window */
int win_nick_height; /* height of nick window */
int win_nick_start; /* # of 1st nick for display (scroll) */
/* windows for Curses GUI */
void *win_title; /* title window */
@@ -250,6 +252,7 @@ struct t_gui_window
extern int gui_init_ok;
extern int gui_ok;
extern int gui_add_hotlist;
extern t_gui_window *gui_windows;
extern t_gui_window *last_gui_window;
extern t_gui_window *gui_current_window;
@@ -301,8 +304,12 @@ extern void gui_switch_to_previous_buffer (t_gui_window *);
extern void gui_switch_to_next_buffer (t_gui_window *);
extern void gui_switch_to_previous_window (t_gui_window *);
extern void gui_switch_to_next_window (t_gui_window *);
extern void gui_move_page_up ();
extern void gui_move_page_down ();
extern void gui_move_page_up (t_gui_window *);
extern void gui_move_page_down (t_gui_window *);
extern void gui_nick_move_beginning (t_gui_window *);
extern void gui_nick_move_end (t_gui_window *);
extern void gui_nick_move_page_up (t_gui_window *);
extern void gui_nick_move_page_down (t_gui_window *);
extern void gui_curses_resize_handler ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
+29
View File
@@ -0,0 +1,29 @@
# Copyright (c) 2003-2005 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
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = weechat-wxwidgets
weechat_wxwidgets_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(WXWIDGETS_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_wxwidgets_SOURCES = gui-display.c \
gui-input.c
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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 wxWidgets GUI */
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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-input: user input functions for wxWidgets GUI */
+9 -2
View File
@@ -152,8 +152,10 @@ t_irc_command irc_commands[] =
N_("[channel[,channel]]"), N_("channel: channel name"),
0, 1, 1, NULL, irc_cmd_send_names, NULL },
{ "nick", N_("change current nickname"),
N_("nickname"), N_("nickname: new nickname for current IRC server"),
1, 1, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
N_("[-all] nickname"),
N_("-all: set new nickname for all connected servers\n"
"nickname: new nickname"),
1, 2, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
{ "notice", N_("send notice message to user"),
N_("nickname text"), N_("nickname: user to send notice to\ntext: text to send"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
@@ -298,6 +300,7 @@ t_irc_command irc_commands[] =
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
@@ -320,6 +323,7 @@ t_irc_command irc_commands[] =
{ "333", N_("infos about topic (nick & date changed)"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
{ "353", N_("list of nicks on channel"),
@@ -431,11 +435,14 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "671", N_("whois (secure connection)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
};
+45 -2
View File
@@ -63,6 +63,38 @@ dcc_redraw (int highlight)
}
}
/*
* dcc_calculate_speed: calculate DCC speed (for files only)
*/
void
dcc_calculate_speed (t_irc_dcc *ptr_dcc, int ended)
{
time_t local_time, elapsed;
local_time = time (NULL);
if (ended || local_time > ptr_dcc->last_check_time)
{
if (ended)
{
elapsed = local_time - ptr_dcc->start_transfer;
if (elapsed == 0)
elapsed = 1;
ptr_dcc->bytes_per_sec = ptr_dcc->pos / elapsed;
}
else
{
elapsed = local_time - ptr_dcc->last_check_time;
if (elapsed == 0)
elapsed = 1;
ptr_dcc->bytes_per_sec = (ptr_dcc->pos - ptr_dcc->last_check_pos) / elapsed;
}
ptr_dcc->last_check_time = local_time;
ptr_dcc->last_check_pos = ptr_dcc->pos;
}
}
/*
* dcc_connect: connect to another host
*/
@@ -200,6 +232,9 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
if (DCC_IS_CHAT(ptr_dcc->type))
channel_remove_dcc (ptr_dcc);
if (DCC_IS_FILE(ptr_dcc->type))
dcc_calculate_speed (ptr_dcc, 1);
if (ptr_dcc->sock != -1)
{
close (ptr_dcc->sock);
@@ -327,6 +362,7 @@ dcc_accept (t_irc_dcc *ptr_dcc)
ptr_dcc->file = open (ptr_dcc->local_filename,
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
0644);
ptr_dcc->start_transfer = time (NULL);
}
else
{
@@ -363,6 +399,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
new_dcc->type = type;
new_dcc->status = DCC_WAITING;
new_dcc->start_time = time (NULL);
new_dcc->start_transfer = time (NULL);
new_dcc->addr = addr;
new_dcc->port = port;
new_dcc->nick = strdup (nick);
@@ -378,6 +415,9 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
new_dcc->size = size;
new_dcc->pos = 0;
new_dcc->ack = 0;
new_dcc->last_check_time = 0;
new_dcc->last_check_pos = 0;
new_dcc->bytes_per_sec = 0;
new_dcc->prev_dcc = NULL;
new_dcc->next_dcc = dcc_list;
if (dcc_list)
@@ -786,7 +826,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
}
/*
* dcc_handle: receive/send data for each active DCC (files only)
* dcc_handle: receive/send data for all active DCC
*/
void
@@ -838,6 +878,7 @@ dcc_handle ()
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
ptr_dcc->start_transfer = time (NULL);
dcc_redraw (1);
}
}
@@ -921,6 +962,7 @@ dcc_handle ()
ptr_dcc->pos += (unsigned long) num_read;
pos = htonl (ptr_dcc->pos);
send (ptr_dcc->sock, (char *) &pos, 4, 0);
dcc_calculate_speed (ptr_dcc, 0);
if (ptr_dcc->pos >= ptr_dcc->size)
{
dcc_close (ptr_dcc, DCC_DONE);
@@ -987,6 +1029,7 @@ dcc_handle ()
return;
}
ptr_dcc->pos += (unsigned long) num_sent;
dcc_calculate_speed (ptr_dcc, 0);
dcc_redraw (0);
}
}
@@ -1008,7 +1051,7 @@ dcc_end ()
if (ptr_dcc->sock != -1)
{
if (ptr_dcc->status == DCC_ACTIVE)
wee_log_printf (_("aborting active DCC: \"%s\" from %s\n"),
wee_log_printf (_("Aborting active DCC: \"%s\" from %s\n"),
ptr_dcc->filename, ptr_dcc->nick);
dcc_close (ptr_dcc, DCC_FAILED);
}
+22 -4
View File
@@ -51,6 +51,26 @@ nick_find_color (t_irc_nick *nick)
return COLOR_WIN_NICK_FIRST + color;
}
/*
* nick_score_for_sort: return score for sorting nick, according to privileges
*/
int
nick_score_for_sort (t_irc_nick *nick)
{
if (nick->is_chanowner)
return -32;
if (nick->is_chanadmin)
return -16;
if (nick->is_op)
return -8;
if (nick->is_halfop)
return -4;
if (nick->has_voice)
return -2;
return 0;
}
/*
* nick_compare: compare two nicks
* return: -1 is nick1 < nick2
@@ -64,10 +84,8 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2)
{
int score1, score2, comp;
score1 = - ( (nick1->is_chanowner * 32) + (nick1->is_chanadmin * 16) +
(nick1->is_op * 8) + (nick1->is_halfop * 4) + (nick1->has_voice * 2) );
score2 = - ( (nick2->is_chanowner * 32) + (nick2->is_chanadmin * 16) +
(nick2->is_op * 8) + (nick2->is_halfop * 4) + (nick2->has_voice * 2) );
score1 = nick_score_for_sort (nick1);
score2 = nick_score_for_sort (nick2);
comp = strcasecmp(nick1->nick, nick2->nick);
if (comp > 0)
+167 -20
View File
@@ -740,29 +740,30 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
if (pos)
pos[0] = '\0';
/* change nickname in any opened private window */
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer))
{
if ((CHANNEL(ptr_buffer)->name)
&& (strcasecmp (host, CHANNEL(ptr_buffer)->name) == 0))
{
free (CHANNEL(ptr_buffer)->name);
CHANNEL(ptr_buffer)->name = strdup (arguments);
}
}
}
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
ptr_nick = nick_search (ptr_channel, host);
if (ptr_nick)
{
/* change nickname in any opened private window */
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer))
{
if ((CHANNEL(ptr_buffer)->name)
&& (strcmp (ptr_nick->nick, CHANNEL(ptr_buffer)->name) == 0))
{
free (CHANNEL(ptr_buffer)->name);
CHANNEL(ptr_buffer)->name = strdup (arguments);
}
}
}
/* change nickname on channel */
nick_is_me = (strcmp (ptr_nick->nick, server->nick) == 0) ? 1 : 0;
if (nick_is_me)
gui_add_hotlist = 0;
nick_change (ptr_channel, ptr_nick, arguments);
irc_display_prefix (ptr_channel->buffer, PREFIX_INFO);
if (nick_is_me)
@@ -786,6 +787,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
arguments);
if (gui_buffer_has_nicklist (ptr_channel->buffer))
gui_draw_buffer_nick (ptr_channel->buffer, 1);
gui_add_hotlist = 1;
}
}
@@ -1994,6 +1996,48 @@ irc_cmd_recv_306 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_307: '307' command (whois, registered nick)
*/
int
irc_cmd_recv_307 (t_irc_server *server, char *host, char *arguments)
{
char *pos_nick, *pos_msg;
/* make gcc happy */
(void) host;
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
while (pos_nick[0] == ' ')
pos_nick++;
pos_msg = strchr (pos_nick, ' ');
if (pos_msg)
{
pos_msg[0] = '\0';
pos_msg++;
while (pos_msg[0] == ' ')
pos_msg++;
if (pos_msg[0] == ':')
pos_msg++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK, "%s", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "] ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT, "%s\n",
pos_msg);
}
}
return 0;
}
/*
* irc_cmd_recv_311: '311' command (whois, user)
*/
@@ -2847,6 +2891,68 @@ irc_cmd_recv_333 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_341: '341' command received (inviting)
*/
int
irc_cmd_recv_341 (t_irc_server *server, char *host, char *arguments)
{
char *pos, *pos_nick, *pos_channel;
pos = strchr (host, '!');
if (pos)
pos[0] = '\0';
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
pos_nick[0] = '\0';
pos_nick++;
while (pos_nick[0] == ' ')
pos_nick++;
pos_channel = strchr (pos_nick, ' ');
if (pos_channel)
{
pos_channel[0] = '\0';
pos_channel++;
while (pos_channel[0] == ' ')
pos_channel++;
if (pos_channel[0] == ':')
pos_channel++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
"%s ", arguments);
gui_printf (server->buffer, _("has invited"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
" %s ", pos_nick);
gui_printf (server->buffer, _("on"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL,
" %s\n", pos_channel);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify channel for \"%s\" command\n"),
WEECHAT_ERROR, "341");
return -1;
}
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify nickname for \"%s\" command\n"),
WEECHAT_ERROR, "341");
return -1;
}
return 0;
}
/*
* irc_cmd_recv_351: '351' command received (server version)
*/
@@ -2970,16 +3076,16 @@ irc_cmd_recv_352 (t_irc_server *server, char *host, char *arguments)
PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK,
"%s", pos_nick);
"%s ", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT,
_(" on "));
_("on"));
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_CHANNEL,
"%s ", pos_channel);
" %s", pos_channel);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT,
"%s %s ",
" %s %s ",
pos_attr, pos_hopcount);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_HOST,
@@ -3511,3 +3617,44 @@ irc_cmd_recv_438 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_671: '671' command (whois, secure connection)
*/
int
irc_cmd_recv_671 (t_irc_server *server, char *host, char *arguments)
{
char *pos_nick, *pos_message;
/* make gcc happy */
(void) host;
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
while (pos_nick[0] == ' ')
pos_nick++;
pos_message = strchr (pos_nick, ' ');
if (pos_message)
{
pos_message[0] = '\0';
pos_message++;
while (pos_message[0] == ' ')
pos_message++;
if (pos_message[0] == ':')
pos_message++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK, "%s", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "] ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT, "%s\n", pos_message);
}
}
return 0;
}
+24 -3
View File
@@ -94,6 +94,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
time_t elapsed;
char buffer[4096];
gui_add_hotlist = 0;
if (arguments && (strncmp (arguments, "-all", 4) == 0))
{
pos = arguments + 4;
@@ -184,6 +185,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
}
}
gui_draw_buffer_status (gui_current_window->buffer, 1);
gui_add_hotlist = 1;
return 0;
}
@@ -1031,9 +1033,28 @@ irc_cmd_send_names (t_irc_server *server, char *arguments)
int
irc_cmd_send_nick (t_irc_server *server, int argc, char **argv)
{
if (argc != 1)
return -1;
server_sendf (server, "NICK %s\r\n", argv[0]);
t_irc_server *ptr_server;
if (argc == 2)
{
if (strncmp (argv[0], "-all", 4) != 0)
return -1;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->is_connected)
server_sendf (ptr_server, "NICK %s\r\n", argv[1]);
}
}
else
{
if (argc == 1)
server_sendf (server, "NICK %s\r\n", argv[0]);
else
return -1;
}
return 0;
}
+2 -2
View File
@@ -323,7 +323,7 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
return NULL;
#ifdef DEBUG
wee_log_printf ("creating new server (name:%s, address:%s, port:%d, pwd:%s, "
wee_log_printf ("Creating new server (name:%s, address:%s, port:%d, pwd:%s, "
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
"command:%s, autojoin:%s, autorejoin:%s)\n",
name, address, port, (password) ? password : "",
@@ -843,7 +843,7 @@ server_connect (t_irc_server *server)
gui_printf (server->buffer,
_("%s: connecting to %s:%d...\n"),
PACKAGE_NAME, server->address, server->port);
wee_log_printf (_("connecting to server %s:%d...\n"),
wee_log_printf (_("Connecting to server %s:%d...\n"),
server->address, server->port);
/* close any opened connection and kill child process if running */

Some files were not shown because too many files have changed in this diff Show More