mirror of
https://github.com/weechat/weechat.git
synced 2026-06-18 00:54:47 +02:00
Compare commits
238 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 72d15555ac | |||
| 904ed30e82 | |||
| f782970158 | |||
| ffd9a850c2 | |||
| 3e53c517d0 | |||
| 9d59722879 | |||
| 6db6b35e40 | |||
| aacbf82675 | |||
| e64138b70a | |||
| 440214d098 | |||
| 17fdaf83d3 | |||
| 487d776b87 | |||
| 9f88f68e3b | |||
| 5a0461ac69 | |||
| 48deeb9e77 | |||
| f6fb874c88 | |||
| 8c2876a77c | |||
| 3060525426 | |||
| 5a4515b759 | |||
| 8babdca0dc | |||
| 1d211a16da | |||
| f8c913a77a | |||
| 5c56f9ff33 | |||
| 8361053576 | |||
| 70d6af7a0e | |||
| fb607cb4ab | |||
| b2183ee3ed | |||
| 22b80dec65 | |||
| 8ee907af02 | |||
| a5cd14add5 | |||
| 34ee7e4076 | |||
| b11f2b2c4b | |||
| aff43aa355 | |||
| d861cb0fd3 | |||
| c92ad8b195 | |||
| 06cc936937 | |||
| 451f623c98 | |||
| 8df7ac464b | |||
| 2f6a4140d6 | |||
| 9909adc0a4 | |||
| 3eced7694b | |||
| b7fc6747f6 | |||
| ff82fdffb7 | |||
| 480e40d6f8 | |||
| 5699898d5b | |||
| a0e5c4567b | |||
| 4c4f5ab012 | |||
| c308b2ec1f | |||
| cc47e94422 | |||
| 70331a15b5 | |||
| 6cf207f23a | |||
| 7fae7c504a | |||
| 7f68da2c74 | |||
| ee68e1c944 | |||
| ede2bf1374 | |||
| 9563cf2b9d | |||
| 2068aa5322 | |||
| 0221e4ab15 | |||
| f50ed1f267 | |||
| f46984357d | |||
| b38908ff67 | |||
| eccf1ad92d | |||
| f0541c5f12 | |||
| 37edc90d7f | |||
| 055a2c6a64 | |||
| c5f1a1af6c | |||
| e5ba6dcb85 | |||
| 636a6ca088 | |||
| 9680e67a9a | |||
| 2a22ebbf06 | |||
| f4f63412f8 | |||
| cd47f4246e | |||
| 7e3db3dfa4 | |||
| dc7595c78e | |||
| daa802a6a2 | |||
| 3e17a27c01 | |||
| 87d3725823 | |||
| a38b9ecf79 | |||
| d8b775d2c4 | |||
| f6ff17ebb0 | |||
| 98338e2e20 | |||
| de3d072220 | |||
| 130d9012f8 | |||
| c7cab37e16 | |||
| 99e3f219af | |||
| 935d8e9304 | |||
| b48fb5c0ec | |||
| 08aa5570d8 | |||
| 62059cb614 | |||
| 4e434e4fb3 | |||
| 3b2e2ad006 | |||
| cb329a3f33 | |||
| 59795445c5 | |||
| c1e68a4d24 | |||
| 9f9c2c7147 | |||
| 507ae028c5 | |||
| 5235fd119c | |||
| 0fbcc93e6c | |||
| 78b4477644 | |||
| e5eedac4c3 | |||
| 439cc20c3d | |||
| 6460e337f2 | |||
| 4af2f3a02d | |||
| 7509710c33 | |||
| 39cc46b609 | |||
| 0c7f9f274d | |||
| 16c7e4b61c | |||
| 1ac38c3458 | |||
| ad624059ad | |||
| 6599c52352 | |||
| fe90f3d4e4 | |||
| 8b0ca6ac41 | |||
| 7f0a3f795b | |||
| 02c0b9fab3 | |||
| 37b5e25f7f | |||
| 2e7e88f7fa | |||
| 5816e4526e | |||
| d13e2328b1 | |||
| 1838637f24 | |||
| 6beb0f1cb0 | |||
| b0260b6494 | |||
| fe2bb8516b | |||
| 9eb6643f63 | |||
| d2f855b7ee | |||
| 586e89b191 | |||
| f6bb78a3b2 | |||
| 1c9456f2a7 | |||
| 545fa4c332 | |||
| ec9da8cc85 | |||
| 2322eb0625 | |||
| 0eea93bba3 | |||
| 1bc71392c4 | |||
| 94a5c72590 | |||
| 15f75d157c | |||
| 7e802070ca | |||
| c2dd7e4ffb | |||
| 524fbba036 | |||
| 87aa03b2cf | |||
| a47e4a9567 | |||
| 88fd88373d | |||
| ed5f70aa6a | |||
| 8659d94965 | |||
| 949c4f72e0 | |||
| a4650a7f92 | |||
| 127edfb0fe | |||
| 631eab3c66 | |||
| 1418897108 | |||
| f4ab9dcc33 | |||
| d88ad92c72 | |||
| 01aa8472c0 | |||
| c1ce18e2f6 | |||
| bdaaa6182f | |||
| c7a8d68f70 | |||
| 78ca78855e | |||
| 293bf5988b | |||
| 65b4c157d1 | |||
| e36b53bf74 | |||
| 59cddf7a40 | |||
| dce5e4fa18 | |||
| 5d08d5e27c | |||
| 93e69f5b3e | |||
| beb846884c | |||
| 343e7fe59d | |||
| 057cffe9f0 | |||
| 86c2fb3031 | |||
| b7ba64c744 | |||
| 7d944ceca4 | |||
| 6172338bb7 | |||
| 27f45cdc6a | |||
| 9761177a2c | |||
| 3352658af4 | |||
| b314ee0f43 | |||
| 758f7f0103 | |||
| b33e8c6482 | |||
| 23f3622f2c | |||
| 6021ee85cb | |||
| bcee678a56 | |||
| 40ffeb9e0c | |||
| fb0e3a4e95 | |||
| daf2087164 | |||
| a17a5337dc | |||
| a56d65a7c0 | |||
| 5af8e4f6e7 | |||
| a065de071c | |||
| 22d8c1017b | |||
| 9481ec0c9c | |||
| f80489f469 | |||
| 2fd53dcc37 | |||
| b34bb801dc | |||
| 14fdcc5157 | |||
| 0b523df418 | |||
| b81b747b96 | |||
| 0da4487a11 | |||
| f2258884d9 | |||
| 1bee0ba0b2 | |||
| 69730a21dd | |||
| d6459aa638 | |||
| 58a1fc72db | |||
| 1bc997b238 | |||
| 1f03444a6b | |||
| c525b231e4 | |||
| 6963ca7b65 | |||
| 99d86d64ab | |||
| 94face39a6 | |||
| 2a34684bc1 | |||
| 5068f4d365 | |||
| 212ec7a76d | |||
| 08b0272a9b | |||
| d01081241a | |||
| 8ef6192b49 | |||
| f98d66a842 | |||
| 6175a89580 | |||
| 23bfafed6a | |||
| fccefcdf04 | |||
| d86af240fa | |||
| c803419616 | |||
| cc324abb75 | |||
| 8c8a4104f0 | |||
| 83bdd97916 | |||
| 56af0e3284 | |||
| 9abddbb7e9 | |||
| c0b6a23959 | |||
| 173c7f7f2e | |||
| eaa33bfb8e | |||
| fcd3809326 | |||
| 8d4497a764 | |||
| d9c032fee3 | |||
| 9fb1176b1b | |||
| 9ed873ed94 | |||
| 27fd4beca7 | |||
| 6a55ee4f79 | |||
| 4a13abcc9b | |||
| e499c1cb32 | |||
| 12b0742668 | |||
| 04e9677405 | |||
| 3ff8d488e7 | |||
| a4ee390737 | |||
| 2b99338176 |
@@ -16,10 +16,10 @@ Developers:
|
||||
|
||||
* Scripts plugins
|
||||
|
||||
Kolter <kolter@free.fr>
|
||||
Kolter <kolter@openics.org>
|
||||
Web : http://kolter.free.fr
|
||||
IRC : nick is "kolter" @ irc.freenode.net
|
||||
Jabber: kolter@jabber.org
|
||||
Jabber: kolter@im.openics.org
|
||||
|
||||
|
||||
Debian packager:
|
||||
@@ -33,11 +33,15 @@ Julien Louis <ptitlouis@sysif.net>
|
||||
Contributors:
|
||||
------------
|
||||
|
||||
Rudolf Polzer <rpolzer-rp@durchnull.de> (IRC: "divVerent")
|
||||
Jiri Golembiovsky <golemj@gmail.com> (IRC: "GolemJ")
|
||||
Jim Ramsay <i.am@jimramsay.com> (IRC: "lack")
|
||||
Odin <odin@dtdm.org> (IRC: "[Odin]")
|
||||
Pistos (IRC: "pistos")
|
||||
Rudolf Polzer <rpolzer-rp@durchnull.de>, IRC: "divVerent"
|
||||
Jiri Golembiovsky <golemj@gmail.com>, IRC: "GolemJ"
|
||||
Jim Ramsay <i.am@jimramsay.com>, IRC: "lack"
|
||||
Odin <odin@dtdm.org>, IRC: "Odin"
|
||||
Pistos, IRC: "pistos"
|
||||
Gwenn, IRC: "gwenn"
|
||||
Voroskoi, IRC: "voroskoi"
|
||||
Frank Zacharias
|
||||
Pavel Shevchuk, IRC: "Stalwart"
|
||||
|
||||
|
||||
=====
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2006-03-18
|
||||
|
||||
- display bugs with UTF-8 chars coded on more than 2 bytes
|
||||
- divide long messages (> 512 bytes) into more messages so IRC server can
|
||||
parse them correctly
|
||||
- some refresh bugs with splited windows
|
||||
- command name for /server can not contain spaces
|
||||
- when many WeeChat are launched, log file is not properly written
|
||||
(cleared by each WeeChat at startup)
|
||||
- WeeChat may crash if too much nicks in nicklist when position is top
|
||||
or bottom
|
||||
WeeChat known bugs:
|
||||
please look at https://savannah.nongnu.org/bugs/?group=weechat
|
||||
|
||||
@@ -1,8 +1,102 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2006-03-18
|
||||
ChangeLog - 2006-08-19
|
||||
|
||||
Version 0.2.0 (2006-08-19):
|
||||
* added 'C'lear option on IRC raw buffer
|
||||
* IRC raw buffer now uses join/part prefix with color to display messages
|
||||
* added send of "quit" message to server when using /disconnect
|
||||
* fixed "wallops" command when received, now displayed by WeeChat (bug #17441)
|
||||
* fixed /wallops command (now many words are correctly sent)
|
||||
* fixed command 348 (channel exception list, received by /mode #chan e)
|
||||
* added missing modes (channel & user), now all modes are allowed (bug #16606)
|
||||
* added "%m" for completion with self nick (on current server)
|
||||
* added missing IRC commands (310, 326, 329, 338)
|
||||
* fixed DCC restore after /upgrade (order is now correctly saved)
|
||||
* fixed away after server disconnection (now away is set again when
|
||||
reconnecting) (bug #16359)
|
||||
* fixed DCC file connection problem (connection from receiver to sender)
|
||||
* improved DCC speed (up to x5 on LAN) by forking for DCC files and a
|
||||
new option "dcc_fast_send" (does not wait for ACK) (task #5758)
|
||||
* fixed crash when purging DCC with high number of DCC (> window size)
|
||||
* fixed completion for command handlers (now empty completion_template
|
||||
means nick completion, "-" string means no completion at all)
|
||||
* fixed nick alignment problem when look_nickmode is off
|
||||
* added generic function for incoming numeric IRC commands (bug #16611)
|
||||
* fixed crash when doing "/part something" on a server buffer (bug #17201)
|
||||
* charsets are now checked when set by /charset command
|
||||
* added "look_save_on_exit" option (patch from Emanuele Giaquinta)
|
||||
* fixed crash on DCC buffer under Darwin 8 (bug #17115)
|
||||
* added configure option for doc XSL prefix (bug #16991)
|
||||
* fixed bug with spaces in script names (bug #16957)
|
||||
* fixed random crash when "MODE #chan -l" is received
|
||||
* fixed bug in IRC parser (random crash with malformed IRC messages)
|
||||
* fixed refresh bugs when terminal is resized: too many refreshs,
|
||||
display bug with splited windows
|
||||
* case ignored for channel names in charset options (bug #16858)
|
||||
* fixed crash when setting look_one_server_buffer to ON (bug #16932)
|
||||
* added new functions in plugin/script API: get window info,
|
||||
get buffer info, get buffer content
|
||||
* added polish, russian and czech quickstart guide
|
||||
* fixed display bug with special char (bug #16732)
|
||||
* added color encoding for some commands like /me
|
||||
* renamed plugins names (removed "lib" prefix in name)
|
||||
* fixed crash when closing DCC/raw buffer if 2 are open (bug #16808)
|
||||
* fixed crashes with DCC chat remove/purge on DCC view (bug #16775)
|
||||
* fixed bug with connection to bnc (bug #16760)
|
||||
* command /save now writes plugins options (~/.weechat/plugins.rc)
|
||||
* fixed crash with "register" function in plugin scripts (bug #16701)
|
||||
* fixed random crash at exit (/quit or /upgrade) with splited windows
|
||||
|
||||
Version 0.1.9 (2006-05-25):
|
||||
* fixed /squery command (message sent to server, now ok with # args > 2)
|
||||
* fixed /alias command (with an alias name, display content)
|
||||
* improved lua plugin detection (bug #16574)
|
||||
* added backtrace when WeeChat crashes, log file automatically renamed
|
||||
* added lock for log file (~/.weechat/weechat.log), only one WeeChat
|
||||
process can use this file (bug #16382)
|
||||
* fixed crash with malformed UTF-8 strings
|
||||
* fixed crash with ncurses color when too many colors defined in ncurses
|
||||
(bug #16556)
|
||||
* added new key to find previous completion (shift-tab by default)
|
||||
* fixed bug with long outgoing IRC messages (> 512 bytes) (bug #16358)
|
||||
* fixed Ruby crash when handler does not return OK or KO (bug #16552)
|
||||
* fixed UTF-8 display bug with chars using more than one cell on screen
|
||||
(bug #16356)
|
||||
* fixed display bug with DCC file size when > 1 Gb
|
||||
* fixed refresh bug (deadlock in curses) when terminal is resized
|
||||
(bug #16542)
|
||||
* fixed nicklist sort bug
|
||||
* added russian translations (thanks to Pavel Shevchuk)
|
||||
* added german doc (thanks to Frank Zacharias)
|
||||
* added missing IRC commands (006, 007, 290, 292, 310, 379, 437, 974)
|
||||
* fixed crash when multiple pv have same name: now it's forbidden
|
||||
and pv buffer is not renamed (when a nick changes) if another
|
||||
exists with same name (bug #16369)
|
||||
* command /clear [-all] now clears hotlist
|
||||
* fixed crash after /upgrade if a line in history is empty (bug #16379)
|
||||
* fixed many crashes with DCC chat (bug #16416)
|
||||
* added new option to customize input prompt
|
||||
* added nick modes
|
||||
* fixed commands 332, 333 (/topic now ok when channel is not opened)
|
||||
* removed color encoding and charset conversion for commands (only
|
||||
allowed in text sent to channel/private)
|
||||
* added hostnames associeted to nicks (available for /ban completion)
|
||||
* added "+p" mode for channels, fixed mode display in status bar
|
||||
* added nick alignment options
|
||||
* fixed /names command: now displays result when not on a channel
|
||||
* fixed refresh bug (too many refresh) when terminal is resized
|
||||
* fixed nicklist display bugs when on top or bottom of chat window
|
||||
* added keyboard handler to plugin API
|
||||
* improved script plugin loader
|
||||
* added hostname/IP option for connection to server
|
||||
* fixed --disable-plugins option in configure script
|
||||
* added /setp command (set plugin options)
|
||||
* fixed high CPU usage when running under a screen that has been killed
|
||||
* aliases are executed before WeeChat/IRC commands, /builtin command added
|
||||
* added /cycle command, /part command does close buffer any more (use
|
||||
/buffer close (or alias /close) to part and close buffer
|
||||
|
||||
Version 0.1.8 (2006-03-18):
|
||||
* improved Ruby plugin
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2006-03-18
|
||||
WeeChat FAQ, 2006-08-19
|
||||
=======================
|
||||
|
||||
Intended audience:
|
||||
@@ -75,7 +75,7 @@ A: For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: I don't see come chars with accents, what can I do?
|
||||
Q: I don't see some chars with accents, what can I do?
|
||||
|
||||
A: You have to setup charset used for decoding (ISO and UTF), encoding, and
|
||||
internal WeeChat charset.
|
||||
@@ -139,6 +139,17 @@ A: You can use /lua command to load scripts (default path is
|
||||
when WeeChat is starting up.
|
||||
Lua scripts are not compatible with other IRC clients.
|
||||
|
||||
|
||||
2.9
|
||||
================================================================================
|
||||
Q: When I'm using weechat under screen, I have weird chars, when I switch
|
||||
window for example, how to fix that?
|
||||
|
||||
A: This may be caused by bad value of TERM variable (look at echo $TERM).
|
||||
For example, "xterm-color" displays such weird chars, use "xterm" which
|
||||
is ok (like many other values).
|
||||
|
||||
|
||||
3.1
|
||||
================================================================================
|
||||
Q: How should I report bugs?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2006-03-18
|
||||
WeeChat FAQ, 2006-08-19
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
@@ -145,6 +145,16 @@ R: La commande /lua permet de charger les scripts Lua (le chemin par
|
||||
Les scripts Lua ne sont pas compatibles avec d'autres clients IRC.
|
||||
|
||||
|
||||
2.9
|
||||
================================================================================
|
||||
Q: Quand j'utilise weechat sous screen, j'ai des caractères bizarres
|
||||
notamment en changeant de fenêtre, comment corriger ça ?
|
||||
|
||||
R: Cela peut être du à la variable TERM qui n'a pas la bonne valeur
|
||||
(regardez echo $TERM). Par exemple "xterm-color" provoque ce genre de
|
||||
problèmes, utilisez "xterm" qui est ok (comme plein d'autres valeurs).
|
||||
|
||||
|
||||
3.1
|
||||
================================================================================
|
||||
Q: Comment dois-je reporter les bugs ?
|
||||
|
||||
@@ -1,9 +1,34 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2006-03-03 (draft)
|
||||
* FlashCode, 2006-08-19
|
||||
|
||||
Important release notes for 0.1.8 (draft):
|
||||
Important release notes:
|
||||
|
||||
- if you upgraded with /upgrade in WeeChat, you should /disconnect and
|
||||
then /reconnect on each server, to display properly channel/user modes
|
||||
- if you're using plugins, you should remove some old plugins libraries
|
||||
in WeeChat system library directory (commonly
|
||||
/usr/local/lib/weechat/plugins): remove lib* files (like libperl.*,
|
||||
libpython.*, ..) and keep only new libraries (perl.*, python.*, ..)
|
||||
|
||||
* FlashCode, 2006-05-25
|
||||
|
||||
WeeChat 0.1.9 released.
|
||||
|
||||
Important release notes:
|
||||
|
||||
- please close all DCC chat buffers before using /upgrade command,
|
||||
otherwise you may experience problems with DCC chats.
|
||||
- some changes in script API: now timer handlers functions takes exactly
|
||||
0 (zero) argument (in version 0.1.8, two arguments were mandatory but
|
||||
not used: server and args)
|
||||
|
||||
* FlashCode, 2006-03-18
|
||||
|
||||
WeeChat 0.1.8 released.
|
||||
|
||||
Important release notes:
|
||||
|
||||
- it is recommended for users of version 0.1.7 (or any older), to
|
||||
replace values in setup file (~/.weechat/weechat.rc) :
|
||||
|
||||
@@ -1,91 +1,5 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2006-03-18
|
||||
|
||||
Legend:
|
||||
# done
|
||||
+ currently in development
|
||||
- pending
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
* General:
|
||||
+ Windows version
|
||||
# Solaris version
|
||||
|
||||
* Interface:
|
||||
+ Gtk GUI
|
||||
? Qt GUI
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
- add dark colors (demi intensity)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- interpret 'old-school' special chars in messages: *bold* _underline_ /italic/
|
||||
- minimal width of nick in text area
|
||||
- display number of highlights since last buffer read (pink square)
|
||||
- add "*" on the side of message buffer when alt-j or other meta modifier is on
|
||||
- completion with tab key for all words starting with "#" by opened chans names
|
||||
- completion when input line is empty should add last nick that wrote to me
|
||||
# open new channels near server (not at the end of buffers)
|
||||
- add filename completion (for example with /dcc send)
|
||||
- have only one info_bar common to all windows
|
||||
- be able to search in history and global history (as with <Ctrl+r> in bash)
|
||||
|
||||
* WeeChat commands
|
||||
- be able to bind a key on more than one command
|
||||
# be able to make an alias running more than one command
|
||||
- host with "*" possible with /ignore command
|
||||
- "/completion" command: do shortcuts (for example when we type "u"
|
||||
in the text bar it send it to the server as "you")
|
||||
- "/last": command to look for text in previous messages
|
||||
- get help on config settings with /help option instead of /set option (since
|
||||
many options can be displayed and help is not displayed in this case)
|
||||
- "/cycle": do a /part then /join on current channel
|
||||
- be able to save the current buffer with a single command
|
||||
(/buffer dump /path/to/file), or to make it possible to write a script
|
||||
that does so (see plugins)
|
||||
- "/reconnect": reconnect to all servers, without waiting for
|
||||
auto-reconnect delay after disconnection
|
||||
- save hotlist when doing /upgrade
|
||||
|
||||
* IRC protocol:
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
- when we're away, WeeChat should log all the lines begenning by our nick.
|
||||
When we come back from our away it should print it to the current window
|
||||
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
|
||||
nick/host connect to the given irc network
|
||||
- display one time away message of remote user in private (optional)
|
||||
# add max number of nicks for away check (do not check away nicks on
|
||||
channels with high number of nicks)
|
||||
- add anti-flood mechanism, when pasting more than N lines
|
||||
- add mask for /ban command, and ban types (host, nick)
|
||||
|
||||
* Configuration:
|
||||
# be able to launch more than one command when connecting to server
|
||||
# use ~/.weechat/dcc by default for DCC incoming files (and create
|
||||
directory at startup if not found)
|
||||
- add global username/realname, used if server values are not filled
|
||||
# add command line arg (--dir) to choose weechat home dir
|
||||
(~/.weechat by default)
|
||||
- be able to set more than one server address for network
|
||||
- save buffer numbers (order) to config file and restore them when
|
||||
opened, or make it possible by script
|
||||
|
||||
* Plugins:
|
||||
- allow print function to write on all buffers or all channels of a server
|
||||
- add "outgoing" message event so scripts can edit user-input text before
|
||||
it is sent to the channel
|
||||
# add a timer function so scripts can do things like timeouts, delayed
|
||||
processing, etc.
|
||||
- allow print function to write on all buffers or all channels of a server
|
||||
# allow plugins to perform actions on "highlight" messages
|
||||
# get_servers(), get_channels(server), get_nicks(server,channel)
|
||||
# Lua plugin
|
||||
? Tcl plugin
|
||||
? Php plugin (maybe if possible)
|
||||
? "fish" plugin (cf http://fish.sekure.us/)
|
||||
# script plugins (perl, python, ruby, ..) should load scripts in system dir,
|
||||
not only ~/.weechat/xxxx/autoload/
|
||||
- allow plugins to get the contents of a specified (or at least the
|
||||
"current") buffer.
|
||||
WeeChat TODO:
|
||||
please look at https://savannah.nongnu.org/task/?group=weechat
|
||||
|
||||
+9
-5
@@ -3,14 +3,18 @@
|
||||
# gettextize updates Makefile.am, configure.in
|
||||
cp configure.in configure.in.old
|
||||
cp Makefile.am Makefile.am.old
|
||||
gettextize --copy --force --intl --no-changelog &&
|
||||
if test "$1" = "--auto" ; then
|
||||
grep -v 'read dummy < /dev/tty' $(which gettextize) | /bin/sh -s -- --copy --force --intl --no-changelog
|
||||
else
|
||||
gettextize --copy --force --intl --no-changelog
|
||||
fi
|
||||
mv Makefile.am.old Makefile.am
|
||||
mv configure.in.old configure.in
|
||||
libtoolize --automake --force --copy &&
|
||||
aclocal &&
|
||||
libtoolize --automake --force --copy
|
||||
aclocal
|
||||
# autoheader creates config.h.in needed by autoconf
|
||||
autoheader &&
|
||||
autoheader
|
||||
# autoconf creates configure
|
||||
autoconf &&
|
||||
autoconf
|
||||
# automake creates Makefile.in
|
||||
automake --add-missing --copy --gnu
|
||||
|
||||
+280
-70
@@ -19,10 +19,10 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.56)
|
||||
AC_INIT(WeeChat, 0.1.8, flashcode@flashtux.org)
|
||||
AC_INIT(WeeChat, 0.2.0, flashcode@flashtux.org)
|
||||
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([weechat], [0.1.8])
|
||||
AM_INIT_AUTOMAKE([weechat], [0.2.0])
|
||||
|
||||
# Checks for programs
|
||||
AC_PROG_CC
|
||||
@@ -32,6 +32,7 @@ AM_PROG_LIBTOOL
|
||||
# Add some flags for some OS
|
||||
case "$host_os" in
|
||||
freebsd* | openbsd*)
|
||||
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
;;
|
||||
netbsd*)
|
||||
@@ -46,7 +47,7 @@ solaris*)
|
||||
esac
|
||||
|
||||
# Gettext
|
||||
ALL_LINGUAS="fr es cs hu"
|
||||
ALL_LINGUAS="fr es cs hu de ru"
|
||||
AM_GNU_GETTEXT
|
||||
|
||||
# Checks for libraries
|
||||
@@ -55,7 +56,12 @@ AC_CHECK_LIB(ncursesw, initscr, LIBNCURSESW_FOUND=1, LIBNCURSESW_FOUND=0)
|
||||
|
||||
# Checks for header files
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h])
|
||||
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 regex.h wchar.h sys/file.h])
|
||||
|
||||
if echo "$host_os" | grep "^openbsd" 1>/dev/null 2>&1 ; then
|
||||
AC_CHECK_HEADER(utf8/wchar.h, LDFLAGS="$LDFLAGS -lutf8", [AC_MSG_ERROR([
|
||||
*** on OpenBSD systems, package libutf8 must be installed to compile WeeChat])])
|
||||
fi
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics
|
||||
AC_HEADER_TIME
|
||||
@@ -78,7 +84,7 @@ AC_MSG_RESULT($ac_cv_type_socklen_t)
|
||||
# Checks for library functions.
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([gethostbyname gethostname getsockname 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 regexec])
|
||||
|
||||
# Variables in config.h
|
||||
|
||||
@@ -90,25 +96,29 @@ AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
|
||||
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
|
||||
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
|
||||
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
|
||||
AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
|
||||
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
|
||||
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
|
||||
AH_VERBATIM([DEBUG], [#undef DEBUG])
|
||||
|
||||
# Arguments for ./configure
|
||||
|
||||
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
|
||||
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
|
||||
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no)
|
||||
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
|
||||
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
|
||||
AC_ARG_ENABLE(perl, [ --disable-perl Turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes)
|
||||
AC_ARG_ENABLE(python, [ --disable-python Turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes)
|
||||
AC_ARG_ENABLE(ruby, [ --disable-ruby Turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes)
|
||||
AC_ARG_ENABLE(lua, [ --disable-lua Turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes)
|
||||
AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='')
|
||||
AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
|
||||
AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
|
||||
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
|
||||
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
|
||||
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
|
||||
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
|
||||
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no)
|
||||
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
|
||||
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
|
||||
AC_ARG_ENABLE(perl, [ --disable-perl Turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes)
|
||||
AC_ARG_ENABLE(python, [ --disable-python Turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes)
|
||||
AC_ARG_ENABLE(ruby, [ --disable-ruby Turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes)
|
||||
AC_ARG_ENABLE(lua, [ --disable-lua Turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes)
|
||||
AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='')
|
||||
AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
|
||||
AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
|
||||
AC_ARG_ENABLE(aspell, [ --disable-aspell Turn off Aspell plugin (default=compiled if found)],enable_aspell=$enableval,enable_aspell=yes)
|
||||
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
|
||||
AC_ARG_WITH(doc_xsl_prefix, [ --with-doc-xsl-prefix=DIR Docbook html/chunk.xsl is in DIR (default=autodetect)],doc_xsl_prefix=$withval,doc_xsl_prefix='')
|
||||
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
|
||||
|
||||
not_found=""
|
||||
|
||||
@@ -132,8 +142,8 @@ if test "x$enable_ncurses" = "xyes" ; then
|
||||
fi
|
||||
else
|
||||
NCURSES_LIBS="-lncursesw"
|
||||
AC_CHECK_HEADERS(ncursesw/curses.h)
|
||||
fi
|
||||
AC_CHECK_HEADERS([ncurses.h ncursesw/curses.h])
|
||||
AC_SUBST(NCURSES_LIBS)
|
||||
fi
|
||||
|
||||
@@ -178,12 +188,59 @@ if test "x$enable_gtk" = "xyes" ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# iconv
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
iconv_found="no"
|
||||
|
||||
AC_CHECK_HEADER(iconv.h,ac_found_iconv_header="yes",ac_found_iconv_header="no")
|
||||
if test "x$ac_found_iconv_header" = "xyes" ; then
|
||||
AC_CHECK_LIB(iconv,iconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
|
||||
if test "x$ac_found_iconv_lib" = "xyes" ; then
|
||||
LIBS="$LIBS -liconv"
|
||||
fi
|
||||
AC_MSG_CHECKING(for iconv usability in programs)
|
||||
AC_TRY_RUN([
|
||||
#include <iconv.h>
|
||||
int main(int argc, char **argv) {
|
||||
iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
|
||||
if (conv != (iconv_t) -1) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}],iconv_found="yes")
|
||||
if test "x$iconv_found" = "xno" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$iconv_found" = "xno" ; then
|
||||
AC_MSG_ERROR([
|
||||
*** Iconv headers and/or libraries couldn't be found in your system.
|
||||
*** Try to install them with your software package manager.
|
||||
*** WeeChat can't be built without Iconv support.])
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# plugins
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
PLUGINS_LIBS=
|
||||
|
||||
if test "x$enable_plugins" != "xyes" ; then
|
||||
enable_plugins="no"
|
||||
enable_perl="no"
|
||||
enable_python="no"
|
||||
enable_ruby="no"
|
||||
enable_lua="no"
|
||||
enable_aspell="no"
|
||||
fi
|
||||
|
||||
# ---------------------------------- perl --------------------------------------
|
||||
|
||||
if test "x$enable_perl" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
@@ -233,6 +290,8 @@ if test "x$enable_perl" = "xyes" ; then
|
||||
AC_DEFINE(PLUGIN_PERL)
|
||||
fi
|
||||
|
||||
# --------------------------------- python -------------------------------------
|
||||
|
||||
if test "x$enable_python" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
@@ -290,6 +349,8 @@ if test "x$enable_python" = "xyes" ; then
|
||||
AC_DEFINE(PLUGIN_PYTHON)
|
||||
fi
|
||||
|
||||
# ---------------------------------- ruby --------------------------------------
|
||||
|
||||
if test "x$enable_ruby" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
@@ -325,12 +386,14 @@ if test "x$enable_ruby" = "xyes" ; then
|
||||
AC_DEFINE(PLUGIN_RUBY)
|
||||
fi
|
||||
|
||||
# ---------------------------------- lua --------------------------------------
|
||||
|
||||
if test "x$enable_lua" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LFLAGS="$LFLAGS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
|
||||
LUA_CFLAGS=""
|
||||
LUA_LFLAGS=""
|
||||
@@ -340,7 +403,7 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
CPPFLAGS="$CPPFLAGS -I$lua_inc"
|
||||
fi
|
||||
if test -n "$lua_lib"; then
|
||||
LFLAGS="$LFLAGS -L$lua_lib"
|
||||
LDFLAGS="$LDFLAGS -L$lua_lib"
|
||||
fi
|
||||
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
@@ -348,8 +411,9 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
AC_CHECK_PROGS(PKGCONFIG, pkg-config)
|
||||
if test "x$PKGCONFIG" != "x"; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
|
||||
for l in "$lua_suffix" "" "50" "5.0" ; do
|
||||
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l && $PKGCONFIG --exists lualib$l`
|
||||
echo
|
||||
for l in "$lua_suffix" "" "50" "5.0" "51" "5.1" ; do
|
||||
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null && $PKGCONFIG --exists lualib$l 2>/dev/null`
|
||||
if test "x$?" = "x0" ; then
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
|
||||
@@ -358,60 +422,72 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
AC_MSG_RESULT(found)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
LUACONFIG=""
|
||||
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config50 lua-config5.0)
|
||||
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config50 lua-config5.0 lua-config51 lua-config5.1)
|
||||
if test "x$LUACONFIG" != "x" ; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies with lua-config)
|
||||
echo
|
||||
LUA_CFLAGS=`$LUACONFIG --include`
|
||||
LUA_LFLAGS=`$LUACONFIG --libs`
|
||||
fi
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
AC_MSG_RESULT(found)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies)
|
||||
echo
|
||||
AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
|
||||
AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
|
||||
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
|
||||
LUA_CFLAGS="$CFLAGS"
|
||||
fi
|
||||
for l in "$lua_suffix" "" "50" "5.0" ; do
|
||||
AC_CHECK_LIB(lua$l,lua_open,ac_found_lua_lib="yes",ac_found_lua_lib="no")
|
||||
AC_CHECK_LIB(lualib$l,luaopen_base,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
|
||||
for l in "$lua_suffix" "" "50" "5.0" "51" "5.1" ; do
|
||||
AC_CHECK_LIB(lua$l,lua_call,ac_found_lua_lib="yes",ac_found_lua_lib="no")
|
||||
if test "x$ac_found_lua_lib" = "xyes" ; then
|
||||
LUA_LFLAGS="$LFLAGS -llua$l"
|
||||
break
|
||||
fi
|
||||
if test "x$ac_found_liblua_lib" = "xyes" ; then
|
||||
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
|
||||
break
|
||||
fi
|
||||
done
|
||||
LUA_LFLAGS="$LDFLAGS -llua$l -lm"
|
||||
|
||||
ac2_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -llua$l -lm"
|
||||
|
||||
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
|
||||
LDFLAGS="$LDFLAGS -ldl"
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(lualib$l,luaL_openlib,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
|
||||
if test "x$ac_found_liblua_lib" = "xyes" ; then
|
||||
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
|
||||
|
||||
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
|
||||
LUA_LFLAGS="$LUA_LFLAGS -ldl"
|
||||
fi
|
||||
fi
|
||||
|
||||
LDFLAGS="$ac2_save_LDFLAGS"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LFLAGS="$ac_save_LFLAGS"
|
||||
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
AC_MSG_CHECKING(for Lua compiling and linking)
|
||||
LUA_TEST=`LT=luatest.c ; echo "#include <lua.h>" > $LT; echo "#include <lualib.h>" >> $LT; echo "int main() { luaopen_base((lua_State *)lua_open()); return 0; }" >> $LT ; $CC -Wall $LT -o $LT.out $LUA_CFLAGS $LUA_LFLAGS $CFLAGS $LDFLAGS 1>/dev/null 2>&1 ; echo $?; rm -f $LT $LT.out 1>/dev/null 2>&1`
|
||||
if test "x$LUA_TEST" != "x0" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([
|
||||
*** Lua (>=5.0) headers and librairies couldn't be found in your system.
|
||||
*** Lua (>=5.0) headers and/or librairies couldn't be found in your system.
|
||||
*** Try to install liblua, liblualib and liblua-dev with your software package manager.
|
||||
*** WeeChat will be built without Lua support.])
|
||||
enable_lua="no"
|
||||
not_found="$not_found lua"
|
||||
else
|
||||
AC_MSG_RESULT(found)
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
fi
|
||||
|
||||
if test "x$enable_lua" = "xyes" ; then
|
||||
@@ -420,6 +496,42 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
AC_DEFINE(PLUGIN_LUA)
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# aspell
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
if test "x$enable_aspell" = "xyes" ; then
|
||||
ASPELL_CFLAGS=""
|
||||
ASPELL_LFLAGS=""
|
||||
|
||||
AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no")
|
||||
AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no")
|
||||
|
||||
AC_MSG_CHECKING(for aspell headers and librairies)
|
||||
if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([
|
||||
*** Aspell headers and/or libraries couldn't be found in your system.
|
||||
*** Try to install them with your software package manager.
|
||||
*** WeeChat will be built without Aspell support.])
|
||||
enable_aspell="no"
|
||||
not_found="$not_found aspell"
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_aspell" = "xyes" ; then
|
||||
AC_SUBST(ASPELL_CFLAGS)
|
||||
AC_SUBST(ASPELL_LFLAGS)
|
||||
AC_DEFINE(PLUGIN_ASPELL)
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# dynamic loader
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
if test "x$enable_plugins" = "xyes" ; then
|
||||
AC_CHECK_FUNCS(dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
|
||||
if test "$LIBDL_FOUND" != "yes"; then
|
||||
@@ -438,6 +550,7 @@ if test "x$enable_plugins" = "xyes" ; then
|
||||
enable_python="no"
|
||||
enable_ruby="no"
|
||||
enable_lua="no"
|
||||
enable_aspell="no"
|
||||
not_found="$not_found plugins"
|
||||
fi
|
||||
fi
|
||||
@@ -452,17 +565,87 @@ if test "x$enable_gnutls" = "xyes" ; then
|
||||
*** libgnutls was not found. You may want to get it from ftp://ftp.gnutls.org/pub/gnutls/
|
||||
*** WeeChat will be built without GnuTLS support.]]))
|
||||
if test "x$found_gnutls" = "xyes" ; then
|
||||
GNUTLS_CFLAGS=`libgnutls-config --cflags`
|
||||
GNUTLS_LFLAGS=`libgnutls-config --libs`
|
||||
AC_SUBST(GNUTLS_CFLAGS)
|
||||
AC_SUBST(GNUTLS_LFLAGS)
|
||||
AC_DEFINE(HAVE_GNUTLS)
|
||||
GNUTLS_CFLAGS=`libgnutls-config --cflags`
|
||||
GNUTLS_LFLAGS=`libgnutls-config --libs`
|
||||
AC_SUBST(GNUTLS_CFLAGS)
|
||||
AC_SUBST(GNUTLS_LFLAGS)
|
||||
AC_DEFINE(HAVE_GNUTLS)
|
||||
else
|
||||
enable_gnutls="no"
|
||||
not_found="$not_found gnutls"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# flock
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
enable_flock="no"
|
||||
AC_CACHE_CHECK([for flock() support], ac_have_flock, [
|
||||
AC_TRY_COMPILE(
|
||||
[ #include <sys/file.h>
|
||||
],
|
||||
[ flock(0, LOCK_SH); ],
|
||||
[ ac_have_flock="yes" ],
|
||||
[ ac_have_flock="no" ])])
|
||||
|
||||
if test "x$ac_have_flock" = "xyes"; then
|
||||
enable_flock="yes"
|
||||
AC_DEFINE(HAVE_FLOCK)
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# backtrace
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
enable_backtrace="no"
|
||||
if test "x$debug" != "x0" ; then
|
||||
AC_CACHE_CHECK([for execinfo.h and backtrace], ac_have_backtrace, [
|
||||
AC_TRY_COMPILE(
|
||||
[ #include <execinfo.h>
|
||||
],
|
||||
[ void *trace[128]; int n = backtrace(trace, 128); ],
|
||||
[ ac_have_backtrace="yes" ],
|
||||
[ ac_have_backtrace="no" ])])
|
||||
if test "x$ac_have_backtrace" = "xyes"; then
|
||||
enable_backtrace="yes"
|
||||
AC_DEFINE(HAVE_BACKTRACE,1,[glibc backtrace function])
|
||||
fi
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# documentation
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING(for html/chunk.xsl)
|
||||
DOC_XSL_PREFIX=""
|
||||
|
||||
if test -n "$doc_xsl_prefix"; then
|
||||
doc_xsl_prefix_path="$doc_xsl_prefix"
|
||||
else
|
||||
doc_xsl_prefix_path="/usr/share/xml/docbook/xsl-stylesheets-1.69"
|
||||
doc_xsl_prefix_path="${doc_xsl_prefix_arr} /usr/share/xml/docbook/stylesheet/nwalsh"
|
||||
fi
|
||||
|
||||
for p in $doc_xsl_prefix_path; do
|
||||
if test -f ${p}/html/chunk.xsl; then
|
||||
DOC_XSL_PREFIX="$p"
|
||||
fi
|
||||
done
|
||||
|
||||
if test "x$DOC_XSL_PREFIX" == "x"; then
|
||||
AC_MSG_RESULT(no)
|
||||
enable_doc="no"
|
||||
AC_MSG_WARN([
|
||||
*** Docbook XSL files not found
|
||||
*** WeeChat will be built without documentation.
|
||||
*** Try ./configure --with-doc-xsl-prefix=DIR if you have DIR/html/chunk.xsl file])
|
||||
else
|
||||
AC_MSG_RESULT($DOC_XSL_PREFIX)
|
||||
AC_SUBST(DOC_XSL_PREFIX)
|
||||
enable_doc="yes"
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# general vars
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -477,23 +660,33 @@ fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
|
||||
|
||||
WEECHAT_LIBDIR=`eval echo ${libdir}/weechat`
|
||||
WEECHAT_LIBDIR=`eval eval echo ${libdir}/weechat`
|
||||
AC_DEFINE_UNQUOTED(WEECHAT_LIBDIR, "$WEECHAT_LIBDIR")
|
||||
|
||||
WEECHAT_SHAREDIR=`eval echo ${datadir}/weechat`
|
||||
WEECHAT_SHAREDIR=`eval eval echo ${datadir}/weechat`
|
||||
AC_DEFINE_UNQUOTED(WEECHAT_SHAREDIR, "$WEECHAT_SHAREDIR")
|
||||
|
||||
weechat_libdir=${libdir}/weechat
|
||||
AC_SUBST(weechat_libdir)
|
||||
|
||||
COMMON_CFLAGS="-Wall -W"
|
||||
AC_MSG_CHECKING([whether we have GNU assembler])
|
||||
GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
|
||||
if test "$GAS"; then
|
||||
COMMON_CFLAGS="${COMMON_CFLAGS} -pipe"
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
CFLAGS=`echo $CFLAGS | sed s/-g//g`
|
||||
if test "x$CFLAGS" = "x" ; then
|
||||
CFLAGS="-O2"
|
||||
fi
|
||||
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
|
||||
CFLAGS="-Wall -W $CFLAGS -pipe -g"
|
||||
CFLAGS="$COMMON_CFLAGS $CFLAGS -g"
|
||||
else
|
||||
CFLAGS="-Wall -W $CFLAGS -pipe"
|
||||
CFLAGS="$COMMON_CFLAGS $CFLAGS"
|
||||
fi
|
||||
|
||||
if test "x$debug" = "x2" ; then
|
||||
@@ -503,7 +696,7 @@ fi
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
|
||||
case "$host_os" in
|
||||
freebsd* | netbsd*)
|
||||
freebsd*)
|
||||
if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then
|
||||
CFLAGS="$CFLAGS -pthread"
|
||||
fi
|
||||
@@ -514,6 +707,12 @@ openbsd*)
|
||||
CFLAGS="$CFLAGS -pthread"
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then
|
||||
CFLAGS="$CFLAGS -pthread"
|
||||
fi
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
;;
|
||||
gnu*)
|
||||
if test "x$enable_plugins" = "xyes" ; then
|
||||
LDFLAGS="$LDFLAGS -lpthread"
|
||||
@@ -527,21 +726,27 @@ esac
|
||||
# output Makefiles
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
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(PLUGINS, test "$enable_plugins" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
|
||||
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
|
||||
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(PLUGINS, test "$enable_plugins" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
|
||||
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
|
||||
AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
doc/Makefile
|
||||
doc/fr/Makefile
|
||||
doc/en/Makefile
|
||||
doc/fr/Makefile
|
||||
doc/de/Makefile
|
||||
doc/ru/Makefile
|
||||
doc/pl/Makefile
|
||||
doc/cs/Makefile
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/irc/Makefile
|
||||
@@ -551,6 +756,7 @@ AC_OUTPUT([Makefile
|
||||
src/plugins/scripts/python/Makefile
|
||||
src/plugins/scripts/ruby/Makefile
|
||||
src/plugins/scripts/lua/Makefile
|
||||
src/plugins/aspell/Makefile
|
||||
src/gui/Makefile
|
||||
src/gui/curses/Makefile
|
||||
src/gui/wxwidgets/Makefile
|
||||
@@ -601,12 +807,16 @@ fi
|
||||
echo ""
|
||||
echo "Interfaces........................ :$listgui"
|
||||
echo "Build with GNUtls support......... : $enable_gnutls"
|
||||
echo "Build with flock support.......... : $enable_flock"
|
||||
echo "Build with Plugin support......... : $enable_plugins"
|
||||
echo " Perl plugin......... : $enable_perl"
|
||||
echo " Python plugin....... : $enable_python"
|
||||
echo " Ruby plugin......... : $enable_ruby"
|
||||
echo " Lua plugin.......... : $enable_lua"
|
||||
echo " Aspell plugin....... : $enable_aspell"
|
||||
echo "Compile with debug info........... : $msg_debug_compiler"
|
||||
echo " Backtrace........... : $enable_backtrace"
|
||||
echo "Build doc..........................: $enable_doc"
|
||||
echo "Print debugging messages.......... : $msg_debug_verbose"
|
||||
echo ""
|
||||
eval echo "WeeChat will be installed in $bindir."
|
||||
|
||||
Vendored
+49
@@ -1,3 +1,52 @@
|
||||
weechat (0.1.9-3) unstable; urgency=low
|
||||
|
||||
* Remove gnutls Build-Depends introduced in the previous upload
|
||||
(closes: #379765).
|
||||
* Move xsltproc, docbook-xml, docbook-xsl to Build-Depends-Indep.
|
||||
* Change icon format from png to xpm.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Tue, 25 Jul 2006 11:53:25 +0200
|
||||
|
||||
weechat (0.1.9-2) unstable; urgency=low
|
||||
|
||||
* Fix ${datadir} expansion in configure.in which caused some problem when
|
||||
loading scripts from /usr/share/weechat.
|
||||
* Add weechat-scripts to weechat-plugins Suggests.
|
||||
* Apply patch from Andreas Metzler to make weechat binNMUable
|
||||
(Closes: #379419).
|
||||
* Build-Depends against libgnutls13-dev | libgnutls-dev.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sun, 23 Jul 2006 17:28:34 +0200
|
||||
|
||||
weechat (0.1.9-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Thu, 25 May 2006 07:40:53 +0200
|
||||
|
||||
weechat (0.1.8-2) unstable; urgency=low
|
||||
|
||||
* Switch to cdbs
|
||||
* update debhelper compatibility to 5
|
||||
* update Build-Depends
|
||||
* update debian/copyright
|
||||
* Bump Standards-Version, no changes needed
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 21 Apr 2006 22:39:00 +0200
|
||||
|
||||
weechat (0.1.8-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* Add liblualib50-dev and docbook-xml to Build-Depends
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 18 Mar 2006 11:32:52 +0100
|
||||
|
||||
weechat (0.1.7-2) unstable; urgency=low
|
||||
|
||||
* force linking against libpthread on GNU/Hurd (Closes: #350487)
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sun, 5 Feb 2006 18:23:24 +0100
|
||||
|
||||
weechat (0.1.7-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
4
|
||||
5
|
||||
|
||||
Vendored
+7
-5
@@ -3,12 +3,13 @@ Section: net
|
||||
Priority: optional
|
||||
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
|
||||
Uploaders: Julien Louis <ptitlouis@sysif.net>
|
||||
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, libgnutls-dev, libtool, xsltproc, docbook-xsl
|
||||
Standards-Version: 3.6.2
|
||||
Build-Depends-Indep: xsltproc, docbook-xsl, docbook-xml
|
||||
Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, liblualib50-dev, libgnutls-dev, libtool, dpkg-dev (>= 1.13.19)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: weechat
|
||||
Architecture: all
|
||||
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version})
|
||||
Depends: weechat-common (= ${source:Version}), weechat-curses (>= ${binary: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.
|
||||
@@ -25,8 +26,8 @@ Description: Fast, light and extensible IRC client
|
||||
|
||||
Package: weechat-curses
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Recommends: weechat-plugins (= ${Source-Version})
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${source:Version})
|
||||
Recommends: weechat-plugins (= ${binary: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.
|
||||
@@ -52,6 +53,7 @@ Description: Common files for WeeChat
|
||||
Package: weechat-plugins
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Suggests: weechat-scripts
|
||||
Description: Plugins for WeeChat
|
||||
This package provides some plugins to enhance weechat with scripting languages
|
||||
such as perl python or ruby.
|
||||
|
||||
Vendored
+3
-1
@@ -3,7 +3,9 @@ Sat, 21 May 2005 08:00:00 +0200.
|
||||
|
||||
It was downloaded from http://weechat.flashtux.org/download
|
||||
|
||||
Upstream Author: FlashCode <flashcode@flashtux.org>
|
||||
Upstream Authors:
|
||||
- FlashCode <flashcode@flashtux.org>
|
||||
- kolter <kolter@free.fr>
|
||||
|
||||
Copyright:
|
||||
|
||||
|
||||
Vendored
+23
-74
@@ -1,85 +1,34 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses cdbs. Originaly written by Robert Millan.
|
||||
# This file is public domain.
|
||||
|
||||
#export DH_VERBOSE=1
|
||||
DEB_AUTO_CLEANUP_RCS := yes
|
||||
|
||||
# Add here any variable or target overrides you need
|
||||
|
||||
DEB_CONFIGURE_USER_FLAGS := --with-debug=0
|
||||
DEB_STRIP_EXCLUDE := libperl.a
|
||||
DEB_DH_INSTALL_SOURCEDIR := $(CURDIR)/debian/tmp
|
||||
DEB_INSTALL_DOCS_weechat-common := FAQ FAQ.fr
|
||||
DEB_DH_MAKESHLIBS_ARGS_weechat-plugins := -n
|
||||
|
||||
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
CFLAGS += -O0
|
||||
else
|
||||
CFLAGS += -O2
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
||||
INSTALL_PROGRAM += -s
|
||||
INSTALL_PROGRAM += -s
|
||||
endif
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
|
||||
--infodir=\$${prefix}/share/info --enable-perl --enable-python --enable-ruby \
|
||||
--with-debug=0
|
||||
touch configure-stamp
|
||||
ifeq ($(DEB_HOST_ARCH_OS),hurd)
|
||||
DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS="-lpthread"
|
||||
endif
|
||||
|
||||
include /usr/share/cdbs/1/class/autotools.mk
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
$(MAKE)
|
||||
touch build-stamp
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
-$(MAKE) distclean
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
||||
dh_install
|
||||
# install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
# install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
install -D -o root -g root -m 644 weechat_icon_32.png $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat_icon_32.png
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
dh_testdir -pweechat-common -pweechat
|
||||
dh_testroot -pweechat-common -pweechat
|
||||
dh_installchangelogs ChangeLog -pweechat-common
|
||||
dh_installdocs -pweechat-common
|
||||
dh_installinfo -pweechat-common
|
||||
dh_installexamples -pweechat-common
|
||||
dh_compress -pweechat-common -pweechat
|
||||
dh_link -pweechat usr/share/doc/weechat-common usr/share/doc/weechat
|
||||
dh_fixperms -pweechat-common -pweechat
|
||||
dh_installdeb -pweechat-common -pweechat
|
||||
dh_shlibdeps -pweechat-common -pweechat
|
||||
dh_gencontrol -pweechat-common -pweechat
|
||||
dh_md5sums -pweechat-common -pweechat
|
||||
dh_builddeb -pweechat-common -pweechat
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir -a -pweechat-curses -pweechat-plugins
|
||||
dh_testroot -a -pweechat-curses -pweechat-plugins
|
||||
dh_installchangelogs ChangeLog -pweechat-plugins
|
||||
dh_installdocs -pweechat-plugins
|
||||
dh_installman doc/weechat-curses.1 -pweechat-curses
|
||||
dh_link -pweechat-curses usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
dh_installmenu -pweechat-curses
|
||||
dh_strip -a -pweechat-curses -pweechat-plugins --exclude=libperl.a
|
||||
dh_compress -a -pweechat-curses -p weechat-plugins
|
||||
dh_fixperms -a -pweechat-curses -pweechat-plugins
|
||||
dh_installdeb -a -pweechat-curses -pweechat-plugins
|
||||
dh_shlibdeps -a -pweechat-curses -pweechat-plugins
|
||||
dh_gencontrol -a -pweechat-curses -pweechat-plugins
|
||||
dh_md5sums -a -pweechat-curses -pweechat-plugins
|
||||
dh_builddeb -a -pweechat-curses -pweechat-plugins
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
install/weechat-common::
|
||||
install -D -o root -g root -m 644 debian/weechat.xpm $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat.xpm
|
||||
|
||||
Vendored
+2
-2
@@ -1,2 +1,2 @@
|
||||
debian/tmp/usr/share/locale/
|
||||
debian/tmp/usr/share/doc/weechat/html usr/share/doc/weechat-common
|
||||
usr/share/locale/
|
||||
usr/share/doc/weechat/html usr/share/doc/weechat-common
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
debian/tmp/usr/bin/weechat-curses
|
||||
usr/bin/weechat-curses
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
doc/weechat-curses.1
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
?package(weechat-curses):needs="text" section="Apps/Net" \
|
||||
title="weechat-curses" \
|
||||
icon="/usr/share/pixmaps/weechat_icon_32.png" \
|
||||
icon="/usr/share/pixmaps/weechat.xpm" \
|
||||
command="/usr/bin/weechat-curses"
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
debian/tmp/usr/lib
|
||||
usr/lib/weechat/plugins/*so*
|
||||
|
||||
Vendored
+295
@@ -0,0 +1,295 @@
|
||||
/* XPM */
|
||||
static char *weechat[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 257 2",
|
||||
" c #000000",
|
||||
". c #0A0904",
|
||||
"X c #080813",
|
||||
"o c #080716",
|
||||
"O c #110D08",
|
||||
"+ c #150A15",
|
||||
"@ c #1A0D1A",
|
||||
"# c #19150C",
|
||||
"$ c #151517",
|
||||
"% c #1F1F32",
|
||||
"& c #13132C",
|
||||
"* c #260A26",
|
||||
"= c #351935",
|
||||
"- c #271927",
|
||||
"; c #262608",
|
||||
": c #322C0C",
|
||||
"> c #36380B",
|
||||
", c #353316",
|
||||
"< c #232516",
|
||||
"1 c #242224",
|
||||
"2 c #292935",
|
||||
"3 c #2D302D",
|
||||
"4 c #2D3330",
|
||||
"5 c #3B333B",
|
||||
"6 c #1D1C4A",
|
||||
"7 c #110F7B",
|
||||
"8 c #0E0D65",
|
||||
"9 c #221F60",
|
||||
"0 c #282948",
|
||||
"q c #292855",
|
||||
"w c #333447",
|
||||
"e c #383855",
|
||||
"r c #2A2978",
|
||||
"t c #302F70",
|
||||
"y c #353465",
|
||||
"u c #363574",
|
||||
"i c #2A286E",
|
||||
"p c #2E4110",
|
||||
"a c #39410C",
|
||||
"s c #3E4C11",
|
||||
"d c #3F5220",
|
||||
"f c #394041",
|
||||
"g c #3E4753",
|
||||
"h c #493F11",
|
||||
"j c #4F1050",
|
||||
"k c #4A0F4B",
|
||||
"l c #572657",
|
||||
"z c #4D374D",
|
||||
"x c #403F6F",
|
||||
"c c #640964",
|
||||
"v c #641E64",
|
||||
"b c #701770",
|
||||
"n c #790A79",
|
||||
"m c #683C68",
|
||||
"M c #623662",
|
||||
"N c #6B2B6B",
|
||||
"B c #454A08",
|
||||
"V c #484C15",
|
||||
"C c #554B16",
|
||||
"Z c #58560A",
|
||||
"A c #595B0B",
|
||||
"S c #545715",
|
||||
"D c #4C5712",
|
||||
"F c #4D5034",
|
||||
"G c #504F24",
|
||||
"H c #4E710E",
|
||||
"J c #4D7C1C",
|
||||
"K c #5B6713",
|
||||
"L c #506B11",
|
||||
"P c #546927",
|
||||
"I c #506D2E",
|
||||
"U c #665B14",
|
||||
"Y c #696C0C",
|
||||
"T c #68730D",
|
||||
"R c #6F7010",
|
||||
"E c #707128",
|
||||
"W c #4D504D",
|
||||
"Q c #46456A",
|
||||
"! c #4C4C7B",
|
||||
"~ c #434577",
|
||||
"^ c #554C69",
|
||||
"/ c #5B5A7D",
|
||||
"( c #54547A",
|
||||
") c #535964",
|
||||
"_ c #567745",
|
||||
"` c #4D6B57",
|
||||
"' c #5D6C78",
|
||||
"] c #587069",
|
||||
"[ c #6A487C",
|
||||
"{ c #6D576D",
|
||||
"} c #645475",
|
||||
"| c #76557A",
|
||||
" . c #786678",
|
||||
".. c #70707D",
|
||||
"X. c #676768",
|
||||
"o. c #3F3E82",
|
||||
"O. c #2D2BAA",
|
||||
"+. c #3D3BA4",
|
||||
"@. c #3B39B9",
|
||||
"#. c #484888",
|
||||
"$. c #4A4C96",
|
||||
"%. c #585885",
|
||||
"&. c #595890",
|
||||
"*. c #555494",
|
||||
"=. c #4745A6",
|
||||
"-. c #4947B5",
|
||||
";. c #514FBB",
|
||||
":. c #5A58BB",
|
||||
">. c #5C5BAF",
|
||||
",. c #755581",
|
||||
"<. c #605FB6",
|
||||
"1. c #6B6883",
|
||||
"2. c #68679B",
|
||||
"3. c #7A7497",
|
||||
"4. c #76698F",
|
||||
"5. c #6968A6",
|
||||
"6. c #706FB5",
|
||||
"7. c #7675BB",
|
||||
"8. c #6E6DB6",
|
||||
"9. c #4947C3",
|
||||
"0. c #5351C2",
|
||||
"q. c #5D5BC0",
|
||||
"w. c #6B6ACC",
|
||||
"e. c #6361C7",
|
||||
"r. c #7170C6",
|
||||
"t. c #7877D2",
|
||||
"y. c #56840C",
|
||||
"u. c #6A8814",
|
||||
"i. c #63980B",
|
||||
"p. c #748614",
|
||||
"a. c #7F9C0D",
|
||||
"s. c #749218",
|
||||
"d. c #698F13",
|
||||
"f. c #6C852A",
|
||||
"g. c #798C35",
|
||||
"h. c #76912B",
|
||||
"j. c #76B505",
|
||||
"k. c #70A50F",
|
||||
"l. c #7EA525",
|
||||
"z. c #678946",
|
||||
"x. c #A57A5A",
|
||||
"c. c #9A1E9A",
|
||||
"v. c #861B86",
|
||||
"b. c #912B92",
|
||||
"n. c #8A298A",
|
||||
"m. c #A030A0",
|
||||
"M. c #864886",
|
||||
"N. c #8F469E",
|
||||
"B. c #975897",
|
||||
"V. c #8A788A",
|
||||
"C. c #936A93",
|
||||
"Z. c #987599",
|
||||
"A. c #866892",
|
||||
"S. c #9470AB",
|
||||
"D. c #A25FA2",
|
||||
"F. c #B16FB1",
|
||||
"G. c #B07FB1",
|
||||
"H. c #B776B7",
|
||||
"J. c #807FD0",
|
||||
"K. c #A37AC2",
|
||||
"L. c #87880B",
|
||||
"P. c #888513",
|
||||
"I. c #869A0A",
|
||||
"U. c #8B9B14",
|
||||
"Y. c #94970D",
|
||||
"T. c #9B9C13",
|
||||
"R. c #98961A",
|
||||
"E. c #968D16",
|
||||
"W. c #929D2F",
|
||||
"Q. c #82A90B",
|
||||
"!. c #8CAA06",
|
||||
"~. c #82B30A",
|
||||
"^. c #84B706",
|
||||
"/. c #97A913",
|
||||
"(. c #96B90A",
|
||||
"). c #99B914",
|
||||
"_. c #91AB10",
|
||||
"`. c #A39A1C",
|
||||
"'. c #A09A3D",
|
||||
"]. c #A9AE05",
|
||||
"[. c #A7AA16",
|
||||
"{. c #A7B90B",
|
||||
"}. c #ACB712",
|
||||
"|. c #BDBA18",
|
||||
" X c #B7B711",
|
||||
".X c #B0B726",
|
||||
"XX c #9A8B4B",
|
||||
"oX c #9EC008",
|
||||
"OX c #BCC40D",
|
||||
"+X c #BCC90E",
|
||||
"@X c #B1C707",
|
||||
"#X c #AEC90C",
|
||||
"$X c #C4AE2A",
|
||||
"%X c #C4CB11",
|
||||
"&X c #C8D809",
|
||||
"*X c #CBD011",
|
||||
"=X c #D1CF1A",
|
||||
"-X c #D1D50E",
|
||||
";X c #D7E803",
|
||||
":X c #918197",
|
||||
">X c #858494",
|
||||
",X c #8987BA",
|
||||
"<X c #928BBB",
|
||||
"1X c #9B9BA8",
|
||||
"2X c #9B98B8",
|
||||
"3X c #8784A3",
|
||||
"4X c #A787A8",
|
||||
"5X c #AE9CAE",
|
||||
"6X c #AC99B1",
|
||||
"7X c #B988B9",
|
||||
"8X c #BB92BC",
|
||||
"9X c #B598B8",
|
||||
"0X c #A0A0A7",
|
||||
"qX c #A6A6B7",
|
||||
"wX c #8382C6",
|
||||
"eX c #8382D4",
|
||||
"rX c #8D8CD4",
|
||||
"tX c #9C8CC7",
|
||||
"yX c #908FD9",
|
||||
"uX c #9493C6",
|
||||
"iX c #9A99DB",
|
||||
"pX c #9493D3",
|
||||
"aX c #A693C8",
|
||||
"sX c #A09AD5",
|
||||
"dX c #A8A5C9",
|
||||
"fX c #A9A6D6",
|
||||
"gX c #B7A8C7",
|
||||
"hX c #B7B6DA",
|
||||
"jX c #B5B1CE",
|
||||
"kX c #B7B4E2",
|
||||
"lX c #A9A8E2",
|
||||
"zX c #C88EC8",
|
||||
"xX c #C38BC3",
|
||||
"cX c #C695C6",
|
||||
"vX c #C2ADC2",
|
||||
"bX c #C7A6C7",
|
||||
"nX c #C4B5C4",
|
||||
"mX c #C6B9D3",
|
||||
"MX c #DDB9DD",
|
||||
"NX c #D9B4D9",
|
||||
"BX c #D3A4D4",
|
||||
"VX c #C9C5CA",
|
||||
"CX c #CAC9D7",
|
||||
"ZX c #D4CBD4",
|
||||
"AX c #D9C1D9",
|
||||
"SX c #DACEDA",
|
||||
"DX c #C4C3E4",
|
||||
"FX c #CBC9E6",
|
||||
"GX c #D8D7E6",
|
||||
"HX c #E7CCE7",
|
||||
"JX c #E9CFE9",
|
||||
"KX c #EADBEA",
|
||||
"LX c #E4DAE4",
|
||||
"PX c #EDE2ED",
|
||||
"IX c #EAEAF4",
|
||||
"UX c #F0E1F0",
|
||||
"YX c None",
|
||||
/* pixels */
|
||||
"YXYXYXYXYXYXYXYXYXSXLXIXUXCX YXYXYXYXVXLXPXPXZX. YXYXYXYXYX",
|
||||
"YXYXYXYXYXYXYXnXKXUXUXKXJXSXnX YXnXKXPXPXPXKXSXnX YXYXYXYX",
|
||||
"YXYXYXYXYXYX9XHXJXMX0XvX:X9XSX .HXJXAX5XvX>XvXAX. YXYXYXYX",
|
||||
"YXYXYXYXYXYXMXMXkXx.. | 4XNXvX NXMXMXV. { 4XNXbX YXYXYX",
|
||||
"YXYXYXYXYXBXBX8XZ. 4X8X8XZ. { BX8X4X G.7XcXZ. YXYXYX",
|
||||
"YXYXYXYXLXcXcXC.z zXxX7X) X.G.G.C.z zXcX7X5 5 VX YXYX",
|
||||
"YXYX1XIXGXBXCXC.+ H.H.F.6XIXIX8X| B.- F.H.8X5X0XCXCX YX",
|
||||
"YXYX3 GXmX8XmXZ.M M.D.m | VXCXGX4X| B.M.B.D.m gXqX1XCXW YX",
|
||||
"YXYX CXgXS.jXA.= + = 2XFXqXFXZ.| n.l @ = jX>X..GX$ YX",
|
||||
"YXYX hXaXA.jX,.= + kXFXDXFX3.{ m l * w hXV.2XdX YX",
|
||||
"YXYX hXdX,.fX[ v n.j b.kX2XDXhX1.4.v b.m.j S.tX3XkX1. YX",
|
||||
"YXYX fXdX4.aX^ j v.c.N.fX) kXuX} <X= b c.c.G.tX1.kX% YXYX",
|
||||
"YXYX <XfXuX<X[ k c c S.uX( fX,X' iXk c n b tX/ 3.uX YXYX",
|
||||
"YXYX 2.iXrX2./ $ pX2.6.rX,XQ iX2 2 iXQ pX/ YXYX",
|
||||
"YXYX e rXrX( %.e ( rX( 5.7.wXQ J.y 5.yX( yX& YXYXYX",
|
||||
"YXYXYX t.eXQ 5.~ 7.7.2.% 2.eX&.2.&. J.6.8.5. YXYXYX",
|
||||
"YXYXYX r.t.y 8.#.o 8.~ *. x t.r.~ 8. 0 t.! r.0 o $ F YXYXYX",
|
||||
"YXYXYX <.w.~ >.#.d ] #.0 q w.w.y w.o #.e.$.<.. d I I YX",
|
||||
"YXYXYX =.e.=.#.g z.I t X q ;.e.u :.y :.o.q.u < J y.d YX",
|
||||
"YXYXYX y 0.0.r ] _ I 6 o -.0.-.=.0.;.t 0.o , I y.p YX",
|
||||
"YXYXYXYX 9.9.i ' _ g X + +.9.9.@.;.i +.r y.k.i.y.H ",
|
||||
"YXYXXXW.Q.] =.@.z.J 4 . V s.E o.@.@.-.' d.z.L ; s j.j.j.i.D ",
|
||||
"YXXXW.Q.Q.f.) O.l.f.# D Q.u.u.o O.$.g.g.h.^.^.> s.oX~.~.u.s ",
|
||||
"YX}.oXD a P w 9 ~.f.S T p.p.K ~ ).g q g j.(.. # k.a.K ",
|
||||
".X#X{. . ; 7 0 _.!.V O I.U.C . oXg.6 8 4 Y.(. a /.).T ",
|
||||
"+X#X(. 1 # T.{., #X{.C B +XI. I./.{. T #XoXA YX",
|
||||
"&X+X}.Y P.%X[.P.+X@X. &X@XY Z ;X/.A T.OX}.+X; Y.}.[.B YXYX",
|
||||
".X*XOX;X;X XZ T.*XL. =X%XP.; ;X%X*XT.> `.|., ].`. X: YXYX",
|
||||
". Y.].T.A . C C ; $X-Xh P.].R O R : XE.P.O YXYX",
|
||||
" E U C . YXYX",
|
||||
"YX YX. # YXYXYX",
|
||||
"YXYXYXYXYXYXYXYXYXYXYXYXYX YXYXYXYXYXYXYXYXYX YXYXYXYXYX"
|
||||
};
|
||||
+13
-2
@@ -15,8 +15,19 @@
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
SUBDIRS = fr en
|
||||
SUBDIRS = . en fr de ru pl cs
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl weechat-html.xsl
|
||||
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl.in weechat-html.xsl.in
|
||||
|
||||
all-local: weechat-html.xsl weechat-html-one.xsl
|
||||
|
||||
weechat-html.xsl: weechat-html.xsl.in
|
||||
sed -e 's,\@DOC_XSL_PREFIX\@,$(DOC_XSL_PREFIX),g' < weechat-html.xsl.in > weechat-html.xsl
|
||||
|
||||
weechat-html-one.xsl: weechat-html-one.xsl.in
|
||||
sed -e 's,\@DOC_XSL_PREFIX\@,$(DOC_XSL_PREFIX),g' < weechat-html-one.xsl.in > weechat-html-one.xsl
|
||||
|
||||
clean-local:
|
||||
-rm -f weechat-html.xsl weechat-html-one.xsl
|
||||
|
||||
+26
-12
@@ -22,20 +22,25 @@
|
||||
# with weechat-curses command
|
||||
#
|
||||
|
||||
@all_lang = ("fr_FR", "en_US");
|
||||
@all_lang = ("fr_FR", "en_US", "de_DE");
|
||||
%all_encodings = ("fr_FR" => "iso-8859-1",
|
||||
"en_US" => "iso-8859-1");
|
||||
"en_US" => "iso-8859-1",
|
||||
"de_DE" => "iso-8859-1");
|
||||
%all_types = ("fr_FR" => "type",
|
||||
"en_US" => "type",
|
||||
"de_DE" => "Typ",
|
||||
"es_ES" => "tipo");
|
||||
%all_values = ("fr_FR" => "valeurs",
|
||||
"en_US" => "values",
|
||||
"de_DE" => "Werte",
|
||||
"es_ES" => "valores");
|
||||
%all_default = ("fr_FR" => "valeur par défaut",
|
||||
"en_US" => "default value",
|
||||
"de_DE" => "Standardwert",
|
||||
"es_ES" => "valor por defecto");
|
||||
%all_desc = ("fr_FR" => "description",
|
||||
"en_US" => "description",
|
||||
"de_DE" => "Beschreibung",
|
||||
"es_ES" => "descripción");
|
||||
$warning_do_not_edit = "\n<!-- ********* WARNING! *********\n\n"
|
||||
." This file is automatically built with a Perl script. DO NOT EDIT!\n"
|
||||
@@ -44,16 +49,25 @@ $warning_do_not_edit = "\n<!-- ********* WARNING! *********\n\n"
|
||||
foreach $lng (@all_lang)
|
||||
{
|
||||
create_commands ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -w | tail +3", "weechat_commands");
|
||||
"weechat-curses -w | sed 1,2d", "weechat_commands");
|
||||
create_commands ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -i | tail +3", "irc_commands");
|
||||
"weechat-curses -i | sed 1,2d", "irc_commands");
|
||||
create_key_func ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -f | tail +3", "key_functions");
|
||||
"weechat-curses -f | sed 1,2d", "key_functions");
|
||||
create_config ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -c | tail +3", "config");
|
||||
"weechat-curses -c | sed 1,2d", "config");
|
||||
print "\n";
|
||||
}
|
||||
|
||||
sub toxml
|
||||
{
|
||||
$_ = $_[0];
|
||||
$_ =~ s/&/&/g;
|
||||
$_ =~ s/</</g;
|
||||
$_ =~ s/>/>/g;
|
||||
return $_;
|
||||
}
|
||||
|
||||
sub create_commands
|
||||
{
|
||||
$lang = $_[0];
|
||||
@@ -74,13 +88,13 @@ sub create_commands
|
||||
{
|
||||
print XML "</programlisting>\n" if ($started == 1);
|
||||
$started = 1;
|
||||
print XML "<command>$1</command>\n";
|
||||
print XML "<command>".toxml($1)."</command>\n";
|
||||
print XML "<programlisting>";
|
||||
}
|
||||
else
|
||||
{
|
||||
chomp ($_);
|
||||
print XML "$_\n";
|
||||
print XML toxml($_)."\n";
|
||||
}
|
||||
}
|
||||
print XML "</programlisting>\n";
|
||||
@@ -156,10 +170,10 @@ sub create_config
|
||||
$_ = $1;
|
||||
s/(.*)/\u$1/;
|
||||
$desc = $_;
|
||||
print XML " <entry>".$type."</entry>\n";
|
||||
print XML " <entry>".$values."</entry>\n";
|
||||
print XML " <entry>".$default."</entry>\n";
|
||||
print XML " <entry>".$desc."</entry>\n";
|
||||
print XML " <entry>".toxml($type)."</entry>\n";
|
||||
print XML " <entry>".toxml($values)."</entry>\n";
|
||||
print XML " <entry>".toxml($default)."</entry>\n";
|
||||
print XML " <entry>".toxml($desc)."</entry>\n";
|
||||
print XML "</row>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
LANGCODE = cs
|
||||
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(QUICKSTART)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
@@ -0,0 +1,104 @@
|
||||
WeeChat (česká verze)
|
||||
=========================
|
||||
|
||||
1. Spuštění weechat
|
||||
Podle požadovaného GUI je třeba spustit:
|
||||
- weechat-curses pro Curses GUI
|
||||
- weechat-gtk pro GTK GUI (vyvíjí se)
|
||||
- weechat-qt pro Qt GUI (není vyvíjeno)
|
||||
- weechat-wxwidgets pro WxWidgets GUI (není vyvíjeno)
|
||||
|
||||
2. Online nápověda / možnosti
|
||||
|
||||
WeeChat má nápovědu pro všechny příkazy (/help příkaz)
|
||||
Pro získání nápovědy k příkazu se používá /help příkaz
|
||||
|
||||
Pro nastavení voleb použijte /set volba = hodnota
|
||||
Lze použít /set volba s částečným jménem (zobrazí všechny možnosti
|
||||
obsahující písmena), nebo pouze s celým jménem volby bez hodnoty
|
||||
(pro zobrazení dlouhé nápovědy k volbě).
|
||||
|
||||
Důležitá poznámka: nastavení je ukládáno při skončení WeeChat
|
||||
(nebo pomocí příkazu /save). NEEDITUJTE kontiguracni soubor za
|
||||
běhu WeeChat, protože do něj můŽe WeeChat kdykoliv zapsat
|
||||
a není možné jej znovu načíst. Pro změnu jakýchkoliv voleb
|
||||
použijte příkaz /set, WeeChat okamžitě použije nové nastavení.
|
||||
|
||||
3. Vytvoření serveru
|
||||
|
||||
Například irc.quakenet.org, port 6667:
|
||||
/server quakenet irc.quakenet.org 6667
|
||||
(pro kompletní nápovědu použijte /help server)
|
||||
|
||||
4. Nastavení vlastních voleb serveru
|
||||
|
||||
Přezdívky:
|
||||
/set quakenet.server_nick1 = "mujeprezdivka"
|
||||
/set quakenet.server_nick2 = "mujeprezdivka2"
|
||||
/set quakenet.server_nick3 = "mujeprezdivka3"
|
||||
|
||||
Uživatelské jméno / skutečné jméno:
|
||||
/set quakenet.server_username = "moje uživatelské jméno"
|
||||
/set quakenet.server_realname = "moje skutečné jméno"
|
||||
|
||||
Automatické připojení k serveru:
|
||||
/set quakenet.server_autoconnect = on
|
||||
|
||||
Ostatní volby:
|
||||
Pro zobrazení voleb serveru a jejich hodnot použijte /set quakenet
|
||||
Pro nastavení volby použijte /set quakenet.volba_serveru = hodnota
|
||||
|
||||
5. Připojení k serveru a automatické připojení ke kanálům
|
||||
|
||||
/connect quakenet
|
||||
|
||||
6. Příchod/odchod na/z kanálu
|
||||
|
||||
Příchod na kanál:
|
||||
/join #kanál
|
||||
Odchod z kanálu:
|
||||
/part [ukončovací zpráva]
|
||||
Odchod z kanálu a zavření bufferu:
|
||||
/close [ukončovací zpráva]
|
||||
(/close je alias na /buffer close)
|
||||
|
||||
7. Správa bufferů/oken
|
||||
|
||||
Buffery lze spravovat pomocí příkazu "/buffer" a okna pomocí
|
||||
příkazu "/window".
|
||||
Například pro rozdělení okna vertikálně na malé okno (1/3 šíčky)
|
||||
a velké (2/3) použijte příkaz:
|
||||
/window splitv 33
|
||||
|
||||
8. Klávesové zkratky
|
||||
|
||||
Podle Vaší klávesnice a/nebo potřeb si můžete změnit jakoukoliv
|
||||
klávesu pomocí příkazu "/key".
|
||||
Užitečná klávesa je meta-k (alt-k) pro nalezení klávesového kódu.
|
||||
|
||||
Například pro napojení meta-y (alt-y) na příkaz "/buffer close""
|
||||
/key (stiskněte meta-k) (stiskněte meta-y) /buffer close
|
||||
Dostanete řádek podobný tomuto:
|
||||
/key meta-y /buffer close
|
||||
|
||||
9. Pluginy/skripty
|
||||
|
||||
Na některých distibucích jako Debian, jsou pluginy dostupné v samostatném
|
||||
balíčku (jako weechat-plugins).
|
||||
Pluginy jsou automatikcy načteny při nalezení.
|
||||
Pro WeeChat je dostupných spousta pluginů/skriptů, více na:
|
||||
http://weechat.flashtux.org/plugins.php
|
||||
Pro načítání/rušení pluginů/skriptů se podívejde do dokumentace WeeChat.
|
||||
|
||||
10. Další dokumentace
|
||||
|
||||
Nyní můžete používat WeeChat a číst FAQ/dokumentaci v případě dalších dotazů:
|
||||
http://weechat.flashtux.org/faq.php
|
||||
http://weechat.flashtux.org/doc.php
|
||||
|
||||
Uživejte si WeeChat!
|
||||
|
||||
--
|
||||
(c) 2006-05-31, napsal FlashCode <flashcode@flashtux.org>, přeložil GolemJ <golemj@gmail.com>
|
||||
This document is part of WeeChat and is distributed under GPL licence.
|
||||
Tento dokunet je součástí WeeChat a je distribuován pod licencí GPL.
|
||||
@@ -0,0 +1,63 @@
|
||||
# Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
LANGCODE = de
|
||||
BOOK = weechat.$(LANGCODE)
|
||||
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
|
||||
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
all-local: html-stamp
|
||||
|
||||
# HTML output with chunks (many pages)
|
||||
|
||||
html: html-stamp
|
||||
|
||||
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
mkdir -p html/
|
||||
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html/
|
||||
touch html-stamp
|
||||
|
||||
# HTML output, all in one page
|
||||
|
||||
html1: html1-stamp
|
||||
|
||||
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
mkdir -p html1/
|
||||
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html1/
|
||||
touch html1-stamp
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
+1260
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,443 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- ********* WARNING! *********
|
||||
|
||||
This file is automatically built with a Perl script. DO NOT EDIT!
|
||||
-->
|
||||
|
||||
<command>admin [Ziel]</command>
|
||||
<programlisting>
|
||||
Information über den Server-Administrator abfragen
|
||||
|
||||
Ziel: Server
|
||||
|
||||
</programlisting>
|
||||
<command>ame Nachricht</command>
|
||||
<programlisting>
|
||||
Nachricht an alle Channels aller verbundenen Server schicken
|
||||
|
||||
zu sendende Nachricht
|
||||
|
||||
</programlisting>
|
||||
<command>amsg Text</command>
|
||||
<programlisting>
|
||||
Nachricht an alle Channels aller verbundener Server schicken
|
||||
|
||||
Text: zu sendender Text
|
||||
|
||||
</programlisting>
|
||||
<command>away [-all] [Nachricht]</command>
|
||||
<programlisting>
|
||||
Abwesenheitsnachricht ein/ausschalten
|
||||
|
||||
-all: Abwesenheitszustand auf allen Servern ändern
|
||||
Nachricht: Abwesenheitsnachricht (bzw. keine, um den Abwesenheitszustand zu deaktivieren)
|
||||
|
||||
</programlisting>
|
||||
<command>ban [Channel] [Nickname [Nickname ...]]</command>
|
||||
<programlisting>
|
||||
Nicknames oder Hosts sperren/verbannen
|
||||
|
||||
Channel: Channel für die Sperre
|
||||
Nickname: zu sperrender User oder Host
|
||||
|
||||
</programlisting>
|
||||
<command>ctcp Nickname Typ [Argumente]</command>
|
||||
<programlisting>
|
||||
CTCP-Nachricht verschicken
|
||||
|
||||
Nickname: User, an den die CTCP-Nachricht geschickt werden soll
|
||||
Typ: Typ der CTCP-Nachricht (z.B. "version", "ping", ...)
|
||||
Argumente: Argumente für CTCP
|
||||
|
||||
</programlisting>
|
||||
<command>cycle [Channel[,Channel]] [Abschiedsnachricht]</command>
|
||||
<programlisting>
|
||||
einen Channel verlassen und wieder betreten
|
||||
|
||||
Channel: zu verlassender Channel
|
||||
Abschiedsnachricht: Abschiedsnachricht (die den anderen Usern angezeigt wird)
|
||||
|
||||
</programlisting>
|
||||
<command>dehalfop Nickname [Nickname]</command>
|
||||
<programlisting>
|
||||
Halb-Operatorstatus aberkennen
|
||||
|
||||
</programlisting>
|
||||
<command>deop Nickname [Nickname]</command>
|
||||
<programlisting>
|
||||
Operatorstatus aberkennen
|
||||
|
||||
</programlisting>
|
||||
<command>devoice Nickname [Nickname]</command>
|
||||
<programlisting>
|
||||
Voice wegnehmen
|
||||
|
||||
</programlisting>
|
||||
<command>die</command>
|
||||
<programlisting>
|
||||
Server herunterfahren
|
||||
|
||||
</programlisting>
|
||||
<command>halfop Nickname [Nickname]</command>
|
||||
<programlisting>
|
||||
Halb-Operatorstatus verleihen
|
||||
|
||||
</programlisting>
|
||||
<command>info [Ziel]</command>
|
||||
<programlisting>
|
||||
Information über den Server abfragen
|
||||
|
||||
Ziel: Servername
|
||||
|
||||
</programlisting>
|
||||
<command>invite Nickname Channel</command>
|
||||
<programlisting>
|
||||
jemanden in einen Channel einladen
|
||||
|
||||
Nickname: Chatname des Einzuladenden
|
||||
Channel: Channel, in den er eingeladen werden soll
|
||||
|
||||
</programlisting>
|
||||
<command>ison Nickname [Nickname ...]</command>
|
||||
<programlisting>
|
||||
überprüfen, ob jemand zur Zeit im IRC ist
|
||||
|
||||
Nickname: Nickname
|
||||
|
||||
</programlisting>
|
||||
<command>join Channel[,Channel] [Passwort[,Passwort]]</command>
|
||||
<programlisting>
|
||||
einen Channel betreten
|
||||
|
||||
Channel: zu betretender Channel
|
||||
Passwort: Channelpasswort (+k-Mode)
|
||||
|
||||
</programlisting>
|
||||
<command>kick [Channel] Nickname [Kommentar]</command>
|
||||
<programlisting>
|
||||
einen User aus einem Channel herauskicken
|
||||
|
||||
Channel: Channel des Benutzers
|
||||
Nickname: Nickname des Benutzers
|
||||
Kommentar: Begründung für den Kick
|
||||
|
||||
</programlisting>
|
||||
<command>kickban [Channel] Nickname [Kommentar]</command>
|
||||
<programlisting>
|
||||
kickt und verbannt jemanden von einem Channel
|
||||
|
||||
Channel: Channel des Benutzers
|
||||
Nickname: Nickname des Benutzers
|
||||
Kommentar: Begründung für den Kickban
|
||||
|
||||
</programlisting>
|
||||
<command>kill Nickname Kommentar</command>
|
||||
<programlisting>
|
||||
Jemanden vom Server werfen
|
||||
|
||||
Nickname: Chatname
|
||||
Kommentar: Begründung
|
||||
|
||||
</programlisting>
|
||||
<command>links [[Server] Servermaske]</command>
|
||||
<programlisting>
|
||||
Alle dem antwortenden Server bekannten Servernamen auflisten
|
||||
|
||||
Server: dieser Server soll die Anfrage beantworten
|
||||
Servermaske: die aufzulistenden Server sollen diesem Muster entsprechen
|
||||
|
||||
</programlisting>
|
||||
<command>list [Channel[,Channel] [Server]]</command>
|
||||
<programlisting>
|
||||
Channels mit ihren Topics auflisten
|
||||
|
||||
Channel: aufzulistender Channel (reguläre Ausdrücke sind möglich)
|
||||
Server: Servername
|
||||
|
||||
</programlisting>
|
||||
<command>lusers [Maske [Ziel]]</command>
|
||||
<programlisting>
|
||||
Statistik über die Größe dieses IRC-Netzwerks abfragen
|
||||
|
||||
Maske: Nur Server, die diesem Muster entsprechen
|
||||
Ziel: Server, der die Anfrage weiterleiten soll
|
||||
|
||||
</programlisting>
|
||||
<command>me Nachricht</command>
|
||||
<programlisting>
|
||||
eine CTCP ACTION an den aktuellen Channel senden
|
||||
|
||||
zu sendende Nachricht
|
||||
|
||||
</programlisting>
|
||||
<command>mode { Channel {[+|-]|o|p|s|i|t|n|b|v} [Limit] [User] [Bannmaske] } | {Nickname {[+|-]|i|w|s|o} }</command>
|
||||
<programlisting>
|
||||
Channel- oder Usermode ändern
|
||||
|
||||
Channelmodi:
|
||||
Channel: zu ändernder Channel
|
||||
o: gib/nimm Operatorstatus
|
||||
p: privater Channel
|
||||
s: geheimer Channel
|
||||
i: geschlossener Channel (Zutritt nur mit Einladung)
|
||||
t: nur Operatoren dürfen das Topic setzen
|
||||
n: keine Channelnachrichten von außerhalb des Channels
|
||||
m: moderierter Channel (schreiben nur mit Voice)
|
||||
l: maximale Anzahl an Usern im Channel festlegen
|
||||
b: Bannmaske für zu sperrende User (in nick!ident@host-Form)
|
||||
e: lege Ausnahmemaske fest
|
||||
v: gib/nimm Voice (d.h. Schreibrecht bei moderierten Channels)
|
||||
k: Channelkey/Channelpasswort festlegen
|
||||
Usermodi:
|
||||
Nickname: zu ändernder Nickname
|
||||
i: User als unsichtbar kennzeichnen
|
||||
s: User empfängt Server-Nachrichten
|
||||
w: User empfängt WALLOPS
|
||||
o: User ist Channeloperator
|
||||
|
||||
</programlisting>
|
||||
<command>motd [Ziel]</command>
|
||||
<programlisting>
|
||||
die "Nachricht von heute" abfragen
|
||||
|
||||
Ziel: Servername
|
||||
|
||||
</programlisting>
|
||||
<command>msg Empfänger[,Empfänger] Text</command>
|
||||
<programlisting>
|
||||
Nachricht an Nick/Channel verschicken
|
||||
|
||||
Empfänger: Nick/Channel (darf eine Maske sein, '*' = aktueller Channel)
|
||||
Text: zu sendender Text
|
||||
|
||||
</programlisting>
|
||||
<command>names [Channel[,Channel]]</command>
|
||||
<programlisting>
|
||||
Nicknames in Channels auflisten
|
||||
|
||||
Channel: Channelname
|
||||
|
||||
</programlisting>
|
||||
<command>nick [-all] Nickname</command>
|
||||
<programlisting>
|
||||
aktuellen Nickname wechseln
|
||||
|
||||
-all: Nickname auf allen verbundenen Servern ändern
|
||||
Nickname: neuer Nickname
|
||||
|
||||
</programlisting>
|
||||
<command>notice Nickname Text</command>
|
||||
<programlisting>
|
||||
NOTICE an einen User verschicken
|
||||
|
||||
Nickname: Empfänger der Nachricht
|
||||
Text: zu sendender Text
|
||||
|
||||
</programlisting>
|
||||
<command>op Nickname [Nickname]</command>
|
||||
<programlisting>
|
||||
Channeloperatorstatus verleihen
|
||||
|
||||
</programlisting>
|
||||
<command>oper Benutzername Passwort</command>
|
||||
<programlisting>
|
||||
Serveroperatorprivilegien anfordern
|
||||
|
||||
Benutzername/Passwort: Account im IRC-Server
|
||||
|
||||
</programlisting>
|
||||
<command>part [Channel[,Channel]] [Abschiedsnachricht]</command>
|
||||
<programlisting>
|
||||
einen Channel verlassen
|
||||
|
||||
Channel: zu verlassender Channel
|
||||
Abschiedsnachricht: Abschiedsnachricht, die den anderen Usern angezeigt wird
|
||||
|
||||
</programlisting>
|
||||
<command>ping Server1 [Server2]</command>
|
||||
<programlisting>
|
||||
Server anpingen
|
||||
|
||||
Server1: Anzupingender Server
|
||||
Server2: Ping an diesen Server weiterleiten
|
||||
|
||||
</programlisting>
|
||||
<command>pong Daemon [Daemon2]</command>
|
||||
<programlisting>
|
||||
auf Ping antworten
|
||||
|
||||
Daemon: Daemon, der auf die Ping-Nachricht geantwortet hat
|
||||
Daemon2: Nachricht an diesen Daemon weiterleiten
|
||||
|
||||
</programlisting>
|
||||
<command>query Nickname [Text]</command>
|
||||
<programlisting>
|
||||
private Nachricht an jemanden schicken
|
||||
|
||||
Nickname: Nickname für privaten Chat
|
||||
Text: zu sendender Text
|
||||
|
||||
</programlisting>
|
||||
<command>quit [Abschiedsnachricht]</command>
|
||||
<programlisting>
|
||||
alle Verbindungen trennen und Programm beenden
|
||||
|
||||
Abschiednachricht: anderen Usern zu zeigende Nachricht
|
||||
|
||||
</programlisting>
|
||||
<command>quote Daten</command>
|
||||
<programlisting>
|
||||
Daten direkt an Server senden (siehe RFC 2812)
|
||||
|
||||
Daten: zu sendende Rohdaten
|
||||
|
||||
</programlisting>
|
||||
<command>rehash</command>
|
||||
<programlisting>
|
||||
den Server dazu bringen, seine Konfigurationsdatei neu zu laden
|
||||
|
||||
</programlisting>
|
||||
<command>restart</command>
|
||||
<programlisting>
|
||||
den Server dazu bringen, sich selbst neu zu starten
|
||||
|
||||
</programlisting>
|
||||
<command>service Nickname reserviert Distribution Typ reserviert Info</command>
|
||||
<programlisting>
|
||||
einen neuen Service eintragen
|
||||
|
||||
Distribution: Sichtbarkeit des Services
|
||||
Typ: für spätere Verwendung reserviert
|
||||
|
||||
</programlisting>
|
||||
<command>servlist [Maske [Typ]]</command>
|
||||
<programlisting>
|
||||
zur Zeit verbundene Services auflisten
|
||||
|
||||
Maske: nur zutreffende Services auflisten
|
||||
Typ: nur Services von diesem Typ auflisten
|
||||
|
||||
</programlisting>
|
||||
<command>squery Service Text</command>
|
||||
<programlisting>
|
||||
Nachricht an einen Service senden
|
||||
|
||||
Service: Name des Service
|
||||
Text: zu sendender Text
|
||||
|
||||
</programlisting>
|
||||
<command>squit Server Kommentar</command>
|
||||
<programlisting>
|
||||
Serververbindungen trennen
|
||||
|
||||
Server: Servername
|
||||
Kommentar: Trennungsgrund
|
||||
|
||||
</programlisting>
|
||||
<command>stats [Anfrage [Server]]</command>
|
||||
<programlisting>
|
||||
Serverstatistik abfragen
|
||||
|
||||
Anfrage: c/h/i/k/l/m/o/y/u (siehe RFC1459)
|
||||
Server: zu befragender Server
|
||||
|
||||
</programlisting>
|
||||
<command>summon User [Ziel [Channel]]</command>
|
||||
<programlisting>
|
||||
Nutzer, die auf dem IRC-Server arbeiten, darum bitten, auf den IRC-Server zu kommen
|
||||
|
||||
User: Benutzername
|
||||
Ziel: Servername
|
||||
Channel: Channelname
|
||||
|
||||
</programlisting>
|
||||
<command>time [Ziel]</command>
|
||||
<programlisting>
|
||||
Ortszeit des Servers abfragen
|
||||
|
||||
Ziel: der zu fragende Server
|
||||
|
||||
</programlisting>
|
||||
<command>topic [Channel] [Topic]</command>
|
||||
<programlisting>
|
||||
Channeltopic abfragen/setzen
|
||||
|
||||
Channel: Channelname
|
||||
Topic: neues Topic (oder "-delete" zum Entfernen des Topics)
|
||||
|
||||
</programlisting>
|
||||
<command>trace [Ziel]</command>
|
||||
<programlisting>
|
||||
Route zum angegebenen Server ermitteln
|
||||
|
||||
Ziel: Server
|
||||
|
||||
</programlisting>
|
||||
<command>unban [Channel] nickname [nickname ...]</command>
|
||||
<programlisting>
|
||||
Bann aufheben
|
||||
|
||||
Channel: Channel, in dem der Bann aufzuheben ist
|
||||
Nickname: User, für den der Bann aufzuheben ist
|
||||
|
||||
</programlisting>
|
||||
<command>userhost Nickname [Nickname ...]</command>
|
||||
<programlisting>
|
||||
liste von Nickname-Informationen ermitteln
|
||||
|
||||
Nickname: Nickname
|
||||
|
||||
</programlisting>
|
||||
<command>users [Ziel]</command>
|
||||
<programlisting>
|
||||
auf dem Server eingeloggte User auflisten
|
||||
|
||||
Ziel: Server
|
||||
|
||||
</programlisting>
|
||||
<command>version [Server | Nickname]</command>
|
||||
<programlisting>
|
||||
Versionsinformationen von Nickname oder Server ermitteln
|
||||
|
||||
Server: Servername
|
||||
Nickname: Nickname
|
||||
|
||||
</programlisting>
|
||||
<command>voice Nickname [Nickname]</command>
|
||||
<programlisting>
|
||||
Voice vergeben
|
||||
|
||||
</programlisting>
|
||||
<command>wallops Text</command>
|
||||
<programlisting>
|
||||
Nachricht an alle User schicken, die den 'w'-Mode gesetzt haben
|
||||
|
||||
zu sendender Text
|
||||
|
||||
</programlisting>
|
||||
<command>who [Maske ["o"]]</command>
|
||||
<programlisting>
|
||||
erweiterte Nicknameliste
|
||||
|
||||
Maske: nur Information über betreffende Nicknames abfragen
|
||||
o: nur Operatoren ausgeben, die dem Filter entsprechen
|
||||
|
||||
</programlisting>
|
||||
<command>whois [Server] Nickname[,Nickname]</command>
|
||||
<programlisting>
|
||||
Information über User abfragen
|
||||
|
||||
Server: Servername
|
||||
Nickname: Nickname (oder eine Maske)
|
||||
|
||||
</programlisting>
|
||||
<command>whowas Nickname [,Nickname [,Nickname ...]] [Anzahl [Ziel]]</command>
|
||||
<programlisting>
|
||||
Information über die Vergangenheit eines Nicknames erfragen
|
||||
|
||||
Nickname: abzufragende Nicknames
|
||||
Anzahl: maximale Anzahl an Antworten (negative Zahl für eine vollständige Liste)
|
||||
Ziel: zu suchende Hostmaske
|
||||
|
||||
</programlisting>
|
||||
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- ********* WARNING! *********
|
||||
|
||||
This file is automatically built with a Perl script. DO NOT EDIT!
|
||||
-->
|
||||
|
||||
<row>
|
||||
<entry><literal>return</literal></entry>
|
||||
<entry>Zeile terminieren</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>tab</literal></entry>
|
||||
<entry>Wort vervollständigen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>tab_previous</literal></entry>
|
||||
<entry>finde letzte Wortvervollständigung</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>backspace</literal></entry>
|
||||
<entry>vorheriges Zeichen löschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete</literal></entry>
|
||||
<entry>nächstes Zeichen löschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_end_line</literal></entry>
|
||||
<entry>bis zum Zeilenende löschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_beginning_line</literal></entry>
|
||||
<entry>bis zum Zeilenanfang löschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_line</literal></entry>
|
||||
<entry>ganze Zeile löschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_previous_word</literal></entry>
|
||||
<entry>vorheriges Wort löschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_next_word</literal></entry>
|
||||
<entry>nächstes Wort löschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>clipboard_paste</literal></entry>
|
||||
<entry>einfügen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>transpose_chars</literal></entry>
|
||||
<entry>Zeichen vertauschen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>home</literal></entry>
|
||||
<entry>zum Zeilenanfang gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>end</literal></entry>
|
||||
<entry>zum Zeilenende gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>left</literal></entry>
|
||||
<entry>ein Zeichen nach links gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>previous_word</literal></entry>
|
||||
<entry>ein Wort nach links gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>right</literal></entry>
|
||||
<entry>ein Zeichen nach rechts gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>next_word</literal></entry>
|
||||
<entry>ein Wort nach rechts gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>up</literal></entry>
|
||||
<entry>vorherigen Befehl aus dem Verlauf abfragen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>up_global</literal></entry>
|
||||
<entry>vorherigen Befehl aus dem globalen Verlauf abfragen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>down</literal></entry>
|
||||
<entry>nächsten Befehl aus dem Verlauf abfragen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>down_global</literal></entry>
|
||||
<entry>nächsten Befehl aus dem globalen Verlauf abfragen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>page_up</literal></entry>
|
||||
<entry>eine Seite hochscrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>page_down</literal></entry>
|
||||
<entry>eine Seite herunterscrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_up</literal></entry>
|
||||
<entry>einige Zeilen hochscrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_down</literal></entry>
|
||||
<entry>einige Zeilen herunterscrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_top</literal></entry>
|
||||
<entry>nach ganz oben scrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_bottom</literal></entry>
|
||||
<entry>nach ganz unten scrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_beginning</literal></entry>
|
||||
<entry>zum Anfang der Nicklist gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_end</literal></entry>
|
||||
<entry>zum Ende der Nicklist gehen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_page_up</literal></entry>
|
||||
<entry>Nickliste eine Seite hochscrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_page_down</literal></entry>
|
||||
<entry>Nickliste eine Seite herunterscrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_smart</literal></entry>
|
||||
<entry>zu nächstem aktiven Puffer springen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_dcc</literal></entry>
|
||||
<entry>zum DCC-Puffer springen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_raw_data</literal></entry>
|
||||
<entry>gehe zum IRC-Rohdaten-Puffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_last_buffer</literal></entry>
|
||||
<entry>zum letzten Puffer springen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_server</literal></entry>
|
||||
<entry>zum Serverpuffer springen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_next_server</literal></entry>
|
||||
<entry>zum nächsten Server springen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>switch_server</literal></entry>
|
||||
<entry>wechsel den aktiven Server im Server-Puffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_previous_highlight</literal></entry>
|
||||
<entry>scrolle zur vorherigen hervorhebung im Puffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_next_highlight</literal></entry>
|
||||
<entry>scrolle zur nächsten Hervorhebung im Puffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_unread</literal></entry>
|
||||
<entry>scrolle zur ersten, ungelesenen Zeile im Puffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
<entry>Hotlist leeren</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>infobar_clear</literal></entry>
|
||||
<entry>Infobar leeren</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>refresh</literal></entry>
|
||||
<entry>Bild neu aufbauen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>grab_key</literal></entry>
|
||||
<entry>Tastencode ermitteln und einfügen</entry>
|
||||
</row>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- ********* WARNING! *********
|
||||
|
||||
This file is automatically built with a Perl script. DO NOT EDIT!
|
||||
-->
|
||||
|
||||
<command>alias [Aliasname [Befehl [Argumente]]]</command>
|
||||
<programlisting>
|
||||
einen Alias für einen Befehl anlegen
|
||||
|
||||
Aliasname: Name des Alias
|
||||
Befehl: Befehlsname (WeeChat- oder IRC-Befehl ohne führenden '/', mehrere Befehle können durch Semikola getrennt werden)
|
||||
Argumente: Argumente für den Befehl
|
||||
|
||||
</programlisting>
|
||||
<command>buffer [Aktion [Argumente] | Nummer | [[Server] [Channel]]]</command>
|
||||
<programlisting>
|
||||
Puffer verwalten
|
||||
|
||||
Aktion: Pufferaktion:
|
||||
move: Puffer in der Liste bewegen (kann auch relativ sein, wie -1)
|
||||
close: Puffer schließen (eine Part-Message kann optional angegeben werden)
|
||||
list: alle offenen Puffer auflisten (Standardaktion)
|
||||
notify: Notify-Level für Puffer festlegen (0=nie, 1=bei hervorgehobenen Nachrichten, 2=1+persönliche Nachricht, 3=2+join/part)
|
||||
Server
|
||||
Channel: gehe zum Puffer mit Servernamen oder Channelnamen
|
||||
Nummer: gehe zu Puffer mit dieser Nummer
|
||||
|
||||
</programlisting>
|
||||
<command>builtin Befehl</command>
|
||||
<programlisting>
|
||||
starte eingebauten WeeChat/IRC-Befehl (ohne Plugin-Handler oder Aliase)
|
||||
|
||||
Befehl: auszuführender Befehl (falls nicht vorhanden wird automatisch ein '/' vorangestellt)
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) Zeichensatz]</command>
|
||||
<programlisting>
|
||||
ändere Zeichensatz für den Server oder Channel
|
||||
|
||||
decode_iso: Zeichensatz um ISO zu decoden
|
||||
decode_utf: Zeichensatz um UTF zu decoden
|
||||
encode: der zum encoden benutzte Zeichensatz
|
||||
Zeichensatz: Zeichensatz, der benutzt werden soll (zum Beispiel: ISO-8859-15, UTF-8,..)
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all]</command>
|
||||
<programlisting>
|
||||
Fenster leeren
|
||||
|
||||
-all: alle Fenster leeren
|
||||
|
||||
</programlisting>
|
||||
<command>connect [Servername]</command>
|
||||
<programlisting>
|
||||
mit einem Server verbinden
|
||||
|
||||
Servername: Zielserver
|
||||
|
||||
</programlisting>
|
||||
<command>disconnect [Servername]</command>
|
||||
<programlisting>
|
||||
Serververbindung trennen
|
||||
|
||||
Servername: Name des zu trennenden Servers
|
||||
|
||||
</programlisting>
|
||||
<command>dcc Aktion [Nickname [Datei]]</command>
|
||||
<programlisting>
|
||||
DCC (Filetransfer oder Chat) starten oder Chat beenden
|
||||
|
||||
Aktion: 'send' (Datei) oder 'chat' oder 'close' (Chat)
|
||||
Nickname: Empfänger der Datei bzw. Chatpartner
|
||||
Datei: zu versendende (lokal vorliegende) Datei
|
||||
|
||||
</programlisting>
|
||||
<command>debug dump | windows</command>
|
||||
<programlisting>
|
||||
Debugging-Nachricht ausgeben
|
||||
|
||||
dump: Speicherabbild im WeeChat-Logfile ablegen (wie nach einem Programmabsturz)
|
||||
windows: zeigt Fensterdaten an
|
||||
|
||||
</programlisting>
|
||||
<command>help [Befehl]</command>
|
||||
<programlisting>
|
||||
Hilfe zu Befehlen abfragen
|
||||
|
||||
Befehl: Name eines WeeChat- oder IRC-Befehls
|
||||
|
||||
</programlisting>
|
||||
<command>history [clear | Anzahl]</command>
|
||||
<programlisting>
|
||||
zeigt Befehlsverlauf des Puffers
|
||||
|
||||
clear: Löscht Verlauf
|
||||
Anzahl: zeigt die gewünschte Anzahl an Verlaufseinträgen
|
||||
|
||||
</programlisting>
|
||||
<command>ignore [Maske [[Typ | Befehl] [Channel [Server]]]]</command>
|
||||
<programlisting>
|
||||
IRC-Nachrichten und/oder Hosts ignorieren
|
||||
|
||||
Nummer: Nummer des zu entfernenden Eintrags (siehe Liste)
|
||||
Maske: Nickname oder Hostmaske, die ignoriert werden soll
|
||||
Typ: Typ der Nachrichten, die ignoriert werden sollen (action, ctcp, dcc, pv)
|
||||
Befehl: IRC-Befehl
|
||||
Channel: Channel, in dem ignoriert werden soll
|
||||
Server: Server, auf dem ignoriert werden soll
|
||||
|
||||
Bei jedem Argument steht '*' für 'alle'.
|
||||
Ohne Argumente listet /ignore alle definierten /ignore-Regeln auf.
|
||||
|
||||
</programlisting>
|
||||
<command>key [Taste Funktion/Befehl] [unbind Taste] [functions] [reset -yes]</command>
|
||||
<programlisting>
|
||||
belegen/freigeben von Tasten
|
||||
|
||||
Taste: diese Taste mit einer internen Funktion oder einem Befehl, beginnend mit "/", belegen
|
||||
unbind: Tastenbelegung aufheben
|
||||
functions: interne Funktionen für Tastenbelegungen auflisten
|
||||
reset: Standardbelegung wiederherstellen und entferne alle eigenen Belegungen (Vorsicht!)
|
||||
|
||||
</programlisting>
|
||||
<command>plugin [load Dateiname] | [autoload] | [reload] | [unload]</command>
|
||||
<programlisting>
|
||||
auflisten/laden/entladen von Plugins
|
||||
|
||||
Dateiname: zu ladendes Plugin
|
||||
|
||||
Ohne Argumente werden alle geladenen Plugins aufgelistet.
|
||||
|
||||
</programlisting>
|
||||
<command>server [Servername] | [Servername Hostname Port [-auto | -noauto] [-ipv6] [-ssl] [-pwd Passwort] [-nicks Nick1 Nick2 Nick3] [-username Benutzername] [-realname Name] [-command Befehl] [-autojoin Channel[,Channel]] ] | [del Servername]</command>
|
||||
<programlisting>
|
||||
Auflisten, Hinzufügen oder Entfernen von Servern
|
||||
|
||||
Servername: anzuzeigender Servername
|
||||
Hostname: Name oder IP-Adresse des Servers
|
||||
Port: Port des Servers
|
||||
ipv6: IPv6 benutzen
|
||||
ssl: SSL benutzen
|
||||
Passwort: Serverpasswort
|
||||
Nick1: erster Nickname
|
||||
Nick2: zweiter Nickname
|
||||
Nick3: dritter Nicname
|
||||
Benutzername: Benutzername
|
||||
Realname: voller Name des Benutzers
|
||||
|
||||
</programlisting>
|
||||
<command>save [Datei]</command>
|
||||
<programlisting>
|
||||
Konfiguration abspeichern
|
||||
|
||||
Datei: Name der zu speichernden Konfigurationsdatei
|
||||
|
||||
</programlisting>
|
||||
<command>set [Option [ = Wert]]</command>
|
||||
<programlisting>
|
||||
Konfigurationsparameter setzen
|
||||
|
||||
Option: Name einer Option (wenn der Name vorhanden ist, aber kein Wert, dann wird eine Hilfe zur Option ausgegeben
|
||||
Wert: Wert der Option
|
||||
|
||||
Option kann Servername.server_xxx lauten, wobei "Servername" der interne Servername ist und "xxx" eine Option für diesen Server.
|
||||
|
||||
</programlisting>
|
||||
<command>setp [Option [ = Wert]]</command>
|
||||
<programlisting>
|
||||
Konfigurationsparameter für Plugin setzen
|
||||
|
||||
Option: Name einer Plugin-Option
|
||||
Wert: Wert für Option
|
||||
|
||||
Option wird wie folgt formatiert: Plugin.Option, z.B. perl.myscript.item1
|
||||
|
||||
</programlisting>
|
||||
<command>unalias Aliasname</command>
|
||||
<programlisting>
|
||||
einen Alias entfernen
|
||||
|
||||
Aliasname: Name des zu löschenden Aliases
|
||||
|
||||
</programlisting>
|
||||
<command>unignore [Nummer | [Maske [[Typ | Befehl] [Channel [Server]]]]</command>
|
||||
<programlisting>
|
||||
/ignore-Regel entfernen
|
||||
|
||||
Nummer: Nummer des zu entfernenden Eintrags (siehe Liste)
|
||||
Maske: Nickname oder Hostmaske, die ignoriert werden soll
|
||||
Typ: Typ der Nachrichten, die ignoriert werden sollen (action, ctcp, dcc, pv)
|
||||
Befehl: IRC-Befehl
|
||||
Channel: Channel, in dem ignoriert werden soll
|
||||
Server: Server, auf dem ignoriert werden soll
|
||||
|
||||
Bei jedem Argument steht '*' für 'alle'.
|
||||
Ohne Argumente listet /unignore alle definierten /ignore-Regeln auf.
|
||||
|
||||
</programlisting>
|
||||
<command>upgrade</command>
|
||||
<programlisting>
|
||||
aktualisiert WeeChat ohne die Verbindung zum Server zu trennen
|
||||
|
||||
Dieser Befehl wird auf dem Weechat-Binary ausgeführt, daher sollte dieses kompiliert oder mit einem Paketmanager installiert sein, bevor der Befehl ausgeführt wird.
|
||||
|
||||
</programlisting>
|
||||
<command>uptime [-o]</command>
|
||||
<programlisting>
|
||||
zeigt die Uptime von Weechat an
|
||||
|
||||
-o: sendet die Weechat-Uptime als IRC-Nachricht in den aktuellen Channel
|
||||
|
||||
</programlisting>
|
||||
<command>window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all]]</command>
|
||||
<programlisting>
|
||||
Fenster verwalten
|
||||
|
||||
list: listet die geöffneten Fenster (Default, kann auch weggelassen werden)
|
||||
-1: springt zum vorherigen Fenster
|
||||
+1: springt zum nächsten Fenster
|
||||
b#: springt zum nächsten Fenster, dass Puffer Nummer # anzeigt
|
||||
up: wechselt zum Fenster über dem aktuellen
|
||||
down: wechselt zum Fenster unter dem aktuellen
|
||||
left: wechselt zum linken Fenster
|
||||
right: wechselt zum rechten Fenster
|
||||
splith: teilt das aktuelle Fenster horizontal
|
||||
splitv: teilt das aktuelle Fenster vertikal
|
||||
resize: verändert die Größe des aktuellen Fensters, die neue Größe ist <pct> Prozent des Elternfensters groß
|
||||
merge: vereinigt Fenster miteinander (all = alle Fenster vereinigen)
|
||||
|
||||
Bei splith und splitv gibt pct die neue Größe des Fensters im verhältnis zur aktuellen Größe an. Zum Beispiel würde 25 bedeuten, dass das neue Fenster nur noch ein Viertel der Größe des alten Fensters hätte.
|
||||
|
||||
</programlisting>
|
||||
@@ -0,0 +1,109 @@
|
||||
WeeChat Schnellstarter (deutsche Version)
|
||||
======================
|
||||
|
||||
1. Weechat starten
|
||||
|
||||
Entsprechend dem gewählten User-Interface müssen Du starten:
|
||||
- weechat-curses für das Curses GUI
|
||||
- weechat-gtk für das Gtk GUI (in Entwicklung)
|
||||
- weechat-qt für das Qt GUI (in Planung)
|
||||
- weechat-wxwidgets für das WxWidgets GUI (in Planung)
|
||||
|
||||
2. Online-Hilfe / Optionen
|
||||
|
||||
WeeChat hat eine eingebaute Hilfe für all Kommandos, tippe einfach /help
|
||||
Um Hilfe zu einem Kommando zu bekommen, tippe /help Kommando
|
||||
|
||||
Um Optionen zu verändern, benutzt du /set Option = Wert
|
||||
Du brauchst /set Option nur mit den Anfangsbuchstaben eingeben
|
||||
(<tab> zeigt alle Optionen mit den gleichen Buchstaben) oder mit dem vollen
|
||||
Namen ohne einen Wert, um eine ausführliche Hilfe zu bekommen.
|
||||
|
||||
Wichtig: die Einstellungen werden gespeichert, wenn WeeChat beendet wird
|
||||
(oder mit dem Befehl /save). Verändere die Einstellungen nicht, wenn WeeChat
|
||||
läuft, weil WeeChat diese Datei zu jeder Zeit überschreiben kann und
|
||||
Änderungen verloren sind. Um irgendeine Einstellung zu verändern, verwendest du
|
||||
das /set Kommando, WeeChat wird die neuen Einstellungen umgehend übernehmen.
|
||||
|
||||
3. Einen Server-Eintrag anlegen
|
||||
|
||||
Zum Beispiel für irc.quakenet.org, Port 6667:
|
||||
/server quakenet irc.quakenet.org 6667
|
||||
(/help Server für volle Hilfe zu diesem Kommando)
|
||||
|
||||
4. Eigene Server-Optionen setzen
|
||||
|
||||
Nickname:
|
||||
/set quakenet.server_nick1 = "mynick"
|
||||
/set quakenet.server_nick2 = "mynick2"
|
||||
/set quakenet.server_nick3 = "mynick3"
|
||||
|
||||
Username/Klarname:
|
||||
/set quakenet.server_username = "My username"
|
||||
/set quakenet.server_realname = "My real name"
|
||||
|
||||
Automatische Server-Verbindung:
|
||||
/set quakenet.server_autoconnect = on
|
||||
|
||||
Automatisches Betreten eines Channels:
|
||||
/set quakenet.server_autojoin = "#chan1,#chan2"
|
||||
|
||||
Andere Optionen:
|
||||
Du kannst die Server-Optionen und ihre Werte mit /set quakenet sehen
|
||||
Um eine Option zu setzen, tippe /set quakenet.option = Wert
|
||||
|
||||
5. Verbinden zu einem Server und automatisch einen Channel betreten
|
||||
|
||||
/connect quakenet
|
||||
|
||||
6. Channels betreten/verlassen
|
||||
|
||||
Einen Channel betreten:
|
||||
/join #channel
|
||||
Einen Channel verlassen:
|
||||
/part [Nachricht]
|
||||
Einen Channel verlassen und den Buffer schliessen:
|
||||
/close [Nachricht]
|
||||
(/close ist ein Alias für /buffer close)
|
||||
|
||||
7. Buffer/Fenster Management
|
||||
|
||||
Du kannst die einzelnen Buffer mit /buffer und Fenster mit /window
|
||||
verwalten.
|
||||
Um zum Beispiel das Fenster in ein kleineres (1/3 breit) und ein
|
||||
grosses (2/3 breit) zu teilen, nutzt du das folgende Kommando:
|
||||
/window splitv 33
|
||||
|
||||
8. Tastenkombinationen
|
||||
|
||||
Entsprechend deiner Tastatur und/oder deinen Wünschen, kannst du jede Taste
|
||||
mit "/key" neu zuordnen.
|
||||
Eine nützliche Taste ist meta-k (alt-k), sie zeigt die Tastaturcodes an.
|
||||
|
||||
Um zum Beispiel meta-y (alt-y) dem Kommando "/buffer close" zuzuordnen:
|
||||
/key (tippe meta-k) (tippe meta-y) /buffer close
|
||||
Und du bekommst damit die Kommandozeile:
|
||||
/key meta-y /buffer close
|
||||
|
||||
9. Plugins/Skripte
|
||||
|
||||
In einigen Distributionen, wie zum Beispiel Debian, sind Plugins in separaten
|
||||
Paketen verfügbar (wie weechat-plugins). Plugins werden automatisch geladen,
|
||||
wenn welche gefunden wurden.
|
||||
Viele Plugins/Skripte für WeeChat sind zu finden auf:
|
||||
http://weechat.flashtux.org/plugins.php
|
||||
Bitte lies für das Laden/Entladen von Plugins oder Skripten die Dokumentation.
|
||||
|
||||
|
||||
10. Mehr Dokumentation
|
||||
|
||||
Jetzt kannst du WeeChat starten und die FAQ/Dokumentation lesen, falls du weitere
|
||||
Fragen hast:
|
||||
http://weechat.flashtux.org/faq.php
|
||||
http://weechat.flashtux.org/doc.php
|
||||
|
||||
Viel Spass mit WeeChat!
|
||||
|
||||
--
|
||||
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
|
||||
This document is part of WeeChat and is distributed under GPL licence.
|
||||
+6
-2
@@ -18,8 +18,9 @@
|
||||
LANGCODE = en
|
||||
BOOK = weechat.$(LANGCODE)
|
||||
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
|
||||
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
@@ -30,6 +31,7 @@ all-local: html-stamp
|
||||
html: html-stamp
|
||||
|
||||
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
mkdir -p html/
|
||||
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html/
|
||||
@@ -40,6 +42,7 @@ html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
|
||||
html1: html1-stamp
|
||||
|
||||
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
mkdir -p html1/
|
||||
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html1/
|
||||
@@ -50,10 +53,11 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f *.html *.pdf *.txt
|
||||
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
|
||||
+82
-5
@@ -5,6 +5,13 @@
|
||||
This file is automatically built with a Perl script. DO NOT EDIT!
|
||||
-->
|
||||
|
||||
<row>
|
||||
<entry><option>look_save_on_exit</option></entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>'on' or 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Save config file on exit</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_set_title</option></entry>
|
||||
<entry>boolean</entry>
|
||||
@@ -38,21 +45,21 @@
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>'ISO-8859-1'</entry>
|
||||
<entry>ISO charset for decoding messages from server (used only if locale is UTF-8) (if empty, messages are not converted if locale is UTF-8</entry>
|
||||
<entry>ISO charset for decoding messages from server (used only if locale is UTF-8) (if empty, messages are not converted if locale is UTF-8)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_decode_utf</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>'UTF-8'</entry>
|
||||
<entry>UTF charset for decoding messages from server (used only if locale is not UTF-8) (if empty, messages are not converted if locale is not UTF-8</entry>
|
||||
<entry>UTF charset for decoding messages from server (used only if locale is not UTF-8) (if empty, messages are not converted if locale is not UTF-8)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_encode</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, messages are not converted)</entry>
|
||||
<entry>Charset for encoding messages sent to server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_internal</option></entry>
|
||||
@@ -129,7 +136,7 @@
|
||||
<entry>integer</entry>
|
||||
<entry>between 0 and 100</entry>
|
||||
<entry>0</entry>
|
||||
<entry>Max size for nicklist (width or height, depending on look_nicklist_position (0 = no max size; if min == max and > 0, then size is fixed))</entry>
|
||||
<entry>Max size for nicklist (width or height, depending on look_nicklist_position (0 = no max size; if min == max and > 0, then size is fixed))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_no_nickname</option></entry>
|
||||
@@ -152,6 +159,48 @@
|
||||
<entry>'off'</entry>
|
||||
<entry>Display space if nick mode is not (half)op/voice</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_prefix</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Text to display before nick in chat window</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_suffix</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>' |'</entry>
|
||||
<entry>Text to display after nick in chat window</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_nick</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>'none', 'left', 'right'</entry>
|
||||
<entry>'right'</entry>
|
||||
<entry>Nick alignment (fixed size for nicks in chat window (none, left, right))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_other</option></entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>'on' or 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Alignment for other messages (not beginning with a nick)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 8 and 64</entry>
|
||||
<entry>14</entry>
|
||||
<entry>Size for aligning nick and other messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size_max</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 8 and 64</entry>
|
||||
<entry>20</entry>
|
||||
<entry>Max size for aligning nick and other messages (should be >= to look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>string</entry>
|
||||
@@ -243,6 +292,13 @@
|
||||
<entry>' '</entry>
|
||||
<entry>Use a marker on servers/channels to show first unread line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_input_format</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>'[%n(%m)] '</entry>
|
||||
<entry>Format for input prompt ('%c' is replaced by channel or server, '%n' by nick and '%m' by nick modes)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_real_white</option></entry>
|
||||
<entry>boolean</entry>
|
||||
@@ -481,6 +537,13 @@
|
||||
<entry>'default'</entry>
|
||||
<entry>Color for input text</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_input_server</option></entry>
|
||||
<entry>color</entry>
|
||||
<entry>Curses or Gtk color</entry>
|
||||
<entry>'brown'</entry>
|
||||
<entry>Color for input text (server name)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_input_channel</option></entry>
|
||||
<entry>color</entry>
|
||||
@@ -897,7 +960,7 @@
|
||||
<row>
|
||||
<entry><option>dcc_timeout</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 1 and 2147483647</entry>
|
||||
<entry>between 5 and 2147483647</entry>
|
||||
<entry>300</entry>
|
||||
<entry>Timeout for dcc request (in seconds)</entry>
|
||||
</row>
|
||||
@@ -908,6 +971,13 @@
|
||||
<entry>65536</entry>
|
||||
<entry>Block size for dcc packets in bytes (default: 65536)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>dcc_fast_send</option></entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>'on' or 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Does not wait for ACK when sending file</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>dcc_port_range</option></entry>
|
||||
<entry>string</entry>
|
||||
@@ -1125,6 +1195,13 @@
|
||||
<entry>''</entry>
|
||||
<entry>Real name to use on IRC server</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_hostname</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Custom hostname/IP for server (optional, if empty local hostname is used)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_command</option></entry>
|
||||
<entry>string</entry>
|
||||
|
||||
@@ -51,13 +51,12 @@ send a CTCP message (Client-To-Client Protocol)
|
||||
arguments: arguments for CTCP
|
||||
|
||||
</programlisting>
|
||||
<command>dcc action [nickname [file]]</command>
|
||||
<command>cycle [channel[,channel]] [part_message]</command>
|
||||
<programlisting>
|
||||
starts DCC (file or chat) or close chat
|
||||
leave and rejoin a channel
|
||||
|
||||
action: 'send' (file) or 'chat' or 'close' (chat)
|
||||
nickname: nickname to send file or chat
|
||||
file: filename (on local host)
|
||||
channel: channel name for cycle
|
||||
part_message: part message (displayed to other users)
|
||||
|
||||
</programlisting>
|
||||
<command>dehalfop [nickname [nickname]]</command>
|
||||
@@ -153,7 +152,7 @@ server_mask: list of servers must match this mask
|
||||
<programlisting>
|
||||
list channels and their topic
|
||||
|
||||
channel: channel to list
|
||||
channel: channel to list (a regexp is allowed)
|
||||
server: server name
|
||||
|
||||
</programlisting>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<entry><literal>tab</literal></entry>
|
||||
<entry>complete word</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>tab_previous</literal></entry>
|
||||
<entry>find previous completion for word</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>backspace</literal></entry>
|
||||
<entry>delete previous char</entry>
|
||||
|
||||
+1498
-59
File diff suppressed because it is too large
Load Diff
+39
-10
@@ -5,28 +5,36 @@
|
||||
This file is automatically built with a Perl script. DO NOT EDIT!
|
||||
-->
|
||||
|
||||
<command>alias [alias_name [command [arguments]]</command>
|
||||
<command>alias [alias_name [command [arguments]]]</command>
|
||||
<programlisting>
|
||||
create an alias for a command
|
||||
|
||||
alias_name: name of alias
|
||||
command: command name (WeeChat or IRC command, without first '/')
|
||||
command: command name (WeeChat or IRC command, many commands can be separated by semicolons)
|
||||
arguments: arguments for command
|
||||
|
||||
</programlisting>
|
||||
<command>buffer [action | number | [[server] [channel]]]</command>
|
||||
<command>buffer [action [args] | number | [[server] [channel]]]</command>
|
||||
<programlisting>
|
||||
manage buffers
|
||||
|
||||
action: action to do:
|
||||
move: move buffer in the list (may be relative, for example -1)
|
||||
close: close buffer (for channel: same as /part without part message)
|
||||
list: list opened buffers (no parameter implies this list)
|
||||
close: close buffer (optional arg is part message, for a channel)
|
||||
list: list open buffers (no parameter implies this list)
|
||||
notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)
|
||||
server
|
||||
channel: jump to buffer by server and/or channel name
|
||||
number: jump to buffer by number
|
||||
|
||||
</programlisting>
|
||||
<command>builtin command</command>
|
||||
<programlisting>
|
||||
launch WeeChat/IRC builtin command (do not look at plugins handlers or aliases)
|
||||
|
||||
command: command to execute (a '/' is automatically added if not found at beginning of command)
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
|
||||
<programlisting>
|
||||
@@ -58,6 +66,15 @@ disconnect from a server
|
||||
|
||||
servername: server name to disconnect
|
||||
|
||||
</programlisting>
|
||||
<command>dcc action [nickname [file]]</command>
|
||||
<programlisting>
|
||||
starts DCC (file or chat) or close chat
|
||||
|
||||
action: 'send' (file) or 'chat' or 'close' (chat)
|
||||
nickname: nickname to send file or chat
|
||||
file: filename (on local host)
|
||||
|
||||
</programlisting>
|
||||
<command>debug dump | windows</command>
|
||||
<programlisting>
|
||||
@@ -141,10 +158,22 @@ file: filename for writing config
|
||||
</programlisting>
|
||||
<command>set [option [ = value]]</command>
|
||||
<programlisting>
|
||||
set config parameters
|
||||
set config options
|
||||
|
||||
option: name of an option (if name is full and no value is given, then help is displayed on option)
|
||||
value: value for option
|
||||
value: value for option
|
||||
|
||||
Option may be: servername.server_xxx where "servername" is an internal server name and "xxx" an option for this server.
|
||||
|
||||
</programlisting>
|
||||
<command>setp [option [ = value]]</command>
|
||||
<programlisting>
|
||||
set plugin config options
|
||||
|
||||
option: name of a plugin option
|
||||
value: value for option
|
||||
|
||||
Option is format: plugin.option, example: perl.myscript.item1
|
||||
|
||||
</programlisting>
|
||||
<command>unalias alias_name</command>
|
||||
@@ -173,7 +202,7 @@ Without argument, /unignore command lists all defined ignore.
|
||||
<programlisting>
|
||||
upgrade WeeChat without disconnecting from servers
|
||||
|
||||
This command run again WeeChat binary, so it should have been compiled installed with a package manager before running this command.
|
||||
This command run again WeeChat binary, so it should have been compiled or installed with a package manager before running this command.
|
||||
|
||||
</programlisting>
|
||||
<command>uptime [-o]</command>
|
||||
@@ -187,7 +216,7 @@ show WeeChat uptime
|
||||
<programlisting>
|
||||
manage windows
|
||||
|
||||
list: list opened windows (no parameter implies this list)
|
||||
list: list open windows (no parameter implies this list)
|
||||
-1: jump to previous window
|
||||
+1: jump to next window
|
||||
b#: jump to next window displaying buffer number #
|
||||
@@ -197,7 +226,7 @@ manage windows
|
||||
right: switch to window on the right
|
||||
splith: split current window horizontally
|
||||
splitv: split current window vertically
|
||||
resize: resize window size, new size is pct%% of parent window
|
||||
resize: resize window size, new size is <pct> pourcentage of parent window
|
||||
merge: merge window with another (all = keep only one window)
|
||||
|
||||
For splith and splitv, pct is a pourcentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
WeeChat quick start guide (english version)
|
||||
=========================
|
||||
|
||||
1. Launch weechat
|
||||
|
||||
According to choosed GUI, you have to launch:
|
||||
- weechat-curses for Curses GUI
|
||||
- weechat-gtk for Gtk GUI (under development)
|
||||
- weechat-qt for Qt GUI (not developed)
|
||||
- weechat-wxwidgets for WxWidgets GUI (not developed)
|
||||
|
||||
2. Online help / options
|
||||
|
||||
WeeChat has help for all commands, just issue /help
|
||||
To get help on a command, issue /help command
|
||||
|
||||
To set options, use /set option = value
|
||||
You can use /set option with partial name (display all options
|
||||
containg letters), or with only a full option name without value
|
||||
(to see long help for option).
|
||||
|
||||
Important note: settings are saved when WeeChat ends (or with "/save"
|
||||
command). Do NOT edit setup file while WeeChat is running, because WeeChat
|
||||
may write this file at any time, and it's not possible to reload it.
|
||||
To change any settings, use "/set" command, WeeChat immediately uses new
|
||||
settings.
|
||||
|
||||
3. Create a server
|
||||
|
||||
For example irc.quakenet.org, port 6667:
|
||||
/server quakenet irc.quakenet.org 6667
|
||||
(/help server for full command help)
|
||||
|
||||
4. Set custom server options
|
||||
|
||||
Nicks:
|
||||
/set quakenet.server_nick1 = "mynick"
|
||||
/set quakenet.server_nick2 = "mynick2"
|
||||
/set quakenet.server_nick3 = "mynick3"
|
||||
|
||||
Username/realname:
|
||||
/set quakenet.server_username = "My username"
|
||||
/set quakenet.server_realname = "My real name"
|
||||
|
||||
Auto-connect to server:
|
||||
/set quakenet.server_autoconnect = on
|
||||
|
||||
Auto-join for some channels:
|
||||
/set quakenet.server_autojoin = "#chan1,#chan2"
|
||||
|
||||
Other options:
|
||||
You can see servers options and values with /set quakenet
|
||||
To set an option, use /set quakenet.server_option = value
|
||||
|
||||
5. Connect to server and auto-join channels:
|
||||
|
||||
/connect quakenet
|
||||
|
||||
6. Join/part channels
|
||||
|
||||
Join a channel:
|
||||
/join #channel
|
||||
Part a channel:
|
||||
/part [quit message]
|
||||
Part a channel and close buffer:
|
||||
/close [quit message]
|
||||
(/close is an alias on /buffer close)
|
||||
|
||||
7. Buffer/window management
|
||||
|
||||
You can manage buffers with "/buffer" command and windows
|
||||
with "/window" command.
|
||||
For example, to split verticaly screen into a small window (1/3 width),
|
||||
and a large (2/3), use command:
|
||||
/window splitv 33
|
||||
|
||||
8. Key bindings
|
||||
|
||||
According to your keyboard and/or your needs, you can rebind any key
|
||||
with "/key" command.
|
||||
A useful key is meta-k (alt-k) to find key codes.
|
||||
|
||||
For example, to bind meta-y (alt-y) to command "/buffer close":
|
||||
/key (press meta-k) (press meta-y) /buffer close
|
||||
You'll have a command line like:
|
||||
/key meta-y /buffer close
|
||||
|
||||
9. Plugins/scripts
|
||||
|
||||
On some distros like Debian, plugins are available via a separate package
|
||||
(like weechat-plugins).
|
||||
Plugins are automatically loaded when found.
|
||||
Many plugins/scripts are available for WeeChat, please look at:
|
||||
http://weechat.flashtux.org/plugins.php
|
||||
Please look at WeeChat documentation to load/unload plugins or scripts.
|
||||
|
||||
10. More documentation
|
||||
|
||||
You can now use WeeChat and read FAQ/documentation for any other question:
|
||||
http://weechat.flashtux.org/faq.php
|
||||
http://weechat.flashtux.org/doc.php
|
||||
|
||||
Enjoy WeeChat!
|
||||
|
||||
--
|
||||
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
|
||||
This document is part of WeeChat and is distributed under GPL licence.
|
||||
+6
-2
@@ -18,8 +18,9 @@
|
||||
LANGCODE = fr
|
||||
BOOK = weechat.$(LANGCODE)
|
||||
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
|
||||
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
@@ -30,6 +31,7 @@ all-local: html-stamp
|
||||
html: html-stamp
|
||||
|
||||
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
mkdir -p html/
|
||||
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html/
|
||||
@@ -40,6 +42,7 @@ html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
|
||||
html1: html1-stamp
|
||||
|
||||
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
mkdir -p html1/
|
||||
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html1/
|
||||
@@ -50,10 +53,11 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f *.html *.pdf *.txt
|
||||
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
|
||||
+81
-4
@@ -5,6 +5,13 @@
|
||||
This file is automatically built with a Perl script. DO NOT EDIT!
|
||||
-->
|
||||
|
||||
<row>
|
||||
<entry><option>look_save_on_exit</option></entry>
|
||||
<entry>booléen</entry>
|
||||
<entry>'on' ou 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Sauvegarder la configuration en quittant</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_set_title</option></entry>
|
||||
<entry>booléen</entry>
|
||||
@@ -52,7 +59,7 @@
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Jeu de caractères pour encoder les messages envoyés au serveur, exemples: UFT-8, ISO-8859-1 (si non renseigné, les messages ne sont pas convertis)</entry>
|
||||
<entry>Jeu de caractères pour encoder les messages envoyés au serveur, exemples: UTF-8, ISO-8859-1 (si non renseigné, les messages ne sont pas convertis)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_internal</option></entry>
|
||||
@@ -129,7 +136,7 @@
|
||||
<entry>entier</entry>
|
||||
<entry>entre 0 et 100</entry>
|
||||
<entry>0</entry>
|
||||
<entry>Taille maximum pour la fenêtre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille maximum; si min == max et > 0, alors la taille est fixe))</entry>
|
||||
<entry>Taille maximum pour la fenêtre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille maximum; si min == max et > 0, alors la taille est fixe))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_no_nickname</option></entry>
|
||||
@@ -152,6 +159,48 @@
|
||||
<entry>'off'</entry>
|
||||
<entry>Afficher un espace si le mode utilisateur n'est pas (half)op/voice</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_prefix</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Texte à afficher avant le pseudo dans la fenêtre de discussion</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_suffix</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>' |'</entry>
|
||||
<entry>Texte à afficher après le pseudo dans la fenêtre de discussion</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_nick</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>'none', 'left', 'right'</entry>
|
||||
<entry>'right'</entry>
|
||||
<entry>Alignement des pseudos (taille fixe pour les pseudos dans la fenêtre de discussion (none, left, right))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_other</option></entry>
|
||||
<entry>booléen</entry>
|
||||
<entry>'on' ou 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Alignement pour les autres messages (ne commençant pas par un pseudo)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 8 et 64</entry>
|
||||
<entry>14</entry>
|
||||
<entry>Taille pour l'alignement des pseudos et autres messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_size_max</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 8 et 64</entry>
|
||||
<entry>20</entry>
|
||||
<entry>Taille maximum pour l'alignement des pseudos et autres messages (doit être >= à look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
@@ -243,6 +292,13 @@
|
||||
<entry>' '</entry>
|
||||
<entry>Utiliser un marqueur sur les serveurs/canaux pour montrer la première ligne non lue</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_input_format</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>'[%n(%m)] '</entry>
|
||||
<entry>Format pour l'invite de la zone de saisie ('%c' est remplacé par le canal ou serveur, '%n' par le pseudo et '%m' par les modes du pseudo)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_real_white</option></entry>
|
||||
<entry>booléen</entry>
|
||||
@@ -481,6 +537,13 @@
|
||||
<entry>'default'</entry>
|
||||
<entry>Couleur pour le texte saisi</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_input_server</option></entry>
|
||||
<entry>couleur</entry>
|
||||
<entry>couleur Curses ou Gtk</entry>
|
||||
<entry>'brown'</entry>
|
||||
<entry>Couleur pour le texte saisi (nom du serveur)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_input_channel</option></entry>
|
||||
<entry>couleur</entry>
|
||||
@@ -822,7 +885,7 @@
|
||||
<entry>entier</entry>
|
||||
<entry>entre 0 et 2147483647</entry>
|
||||
<entry>0</entry>
|
||||
<entry>Intervalle entre deux vérifications des absences (en minutes, 0 = ne jemais vérifier)</entry>
|
||||
<entry>Intervalle entre deux vérifications des absences (en minutes, 0 = ne jamais vérifier)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_away_check_max_nicks</option></entry>
|
||||
@@ -897,7 +960,7 @@
|
||||
<row>
|
||||
<entry><option>dcc_timeout</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 1 et 2147483647</entry>
|
||||
<entry>entre 5 et 2147483647</entry>
|
||||
<entry>300</entry>
|
||||
<entry>Délai d'attente pour les requêtes dcc (en secondes)</entry>
|
||||
</row>
|
||||
@@ -908,6 +971,13 @@
|
||||
<entry>65536</entry>
|
||||
<entry>Taille de bloc pour les paquets dcc en octets (défaut: 65536)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>dcc_fast_send</option></entry>
|
||||
<entry>booléen</entry>
|
||||
<entry>'on' ou 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>N'attend pas les accusés de réception lors de l'envoi de fichier</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>dcc_port_range</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
@@ -1125,6 +1195,13 @@
|
||||
<entry>''</entry>
|
||||
<entry>Nom réel pour le serveur IRC</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_hostname</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Nom de machine/IP personnalisé pour le serveur (optionnel, si non renseigné, le nom de machine local est utilisé)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_command</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
|
||||
@@ -51,13 +51,12 @@ envoyer un message CTCP (Client-To-Client Protocol)
|
||||
arguments: arguments pour le CTCP
|
||||
|
||||
</programlisting>
|
||||
<command>dcc action [pseudo [fichier]]</command>
|
||||
<command>cycle [canal[,canal]] [message_de_fin]</command>
|
||||
<programlisting>
|
||||
démarre le DCC (fichier ou discussion) ou ferme une discussion
|
||||
quitter et rejoindre un canal
|
||||
|
||||
action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture discussion)
|
||||
pseudo: pseudo pour envoyer le fichier ou discuter
|
||||
fichier: nom du fichier (sur la machine locale)
|
||||
canal: canal pour le cycle
|
||||
message_de_fin: message de fin (affiché aux autres utilisateurs)
|
||||
|
||||
</programlisting>
|
||||
<command>dehalfop [pseudo [pseudo]]</command>
|
||||
@@ -149,11 +148,11 @@ lister tous les noms de serveurs connus du serveur qui r
|
||||
masque_serveur: liste des serveurs correspondant au masque
|
||||
|
||||
</programlisting>
|
||||
<command>list [canal[,canall] [serveur]]</command>
|
||||
<command>list [canal[,canal] [serveur]]</command>
|
||||
<programlisting>
|
||||
lister les canaux et leur sujet
|
||||
|
||||
canal: canal à lister
|
||||
canal: canal à lister (une expression régulière est acceptée)
|
||||
serveur: nom du serveur
|
||||
|
||||
</programlisting>
|
||||
@@ -248,7 +247,7 @@ obtenir le statut d'op
|
||||
utilisateur/mot_de_passe: utilisé pour obtenir les privilèges sur le serveur IRC courant
|
||||
|
||||
</programlisting>
|
||||
<command>part [canal[,canall] [message_de_fin]</command>
|
||||
<command>part [canal[,canal]] [message_de_fin]</command>
|
||||
<programlisting>
|
||||
quitter un canal
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<entry><literal>tab</literal></entry>
|
||||
<entry>compléter le mot</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>tab_previous</literal></entry>
|
||||
<entry>trouver le mot complété précédent</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>backspace</literal></entry>
|
||||
<entry>effacer le caractère précédent</entry>
|
||||
|
||||
+1525
-56
File diff suppressed because it is too large
Load Diff
+39
-10
@@ -5,27 +5,35 @@
|
||||
This file is automatically built with a Perl script. DO NOT EDIT!
|
||||
-->
|
||||
|
||||
<command>alias [nom_alias [commande [paramètres]]</command>
|
||||
<command>alias [nom_alias [commande [paramètres]]]</command>
|
||||
<programlisting>
|
||||
créer un alias pour une commande
|
||||
|
||||
nom_alias: nom de l'alias
|
||||
commande: nom de la commande (commande WeeChat ou IRC, sans le premier '/')
|
||||
commande: nom de la commande (commande WeeChat ou IRC, plusieurs commandes peuvent être séparées par des point-virgules)
|
||||
paramètres: paramètres pour la commande
|
||||
|
||||
</programlisting>
|
||||
<command>buffer [action | nombre | [[serveur] [canal]]]</command>
|
||||
<command>buffer [action [args] | nombre | [[serveur] [canal]]]</command>
|
||||
<programlisting>
|
||||
gestion des tampons
|
||||
|
||||
action: action à effectuer:
|
||||
move: déplacer le tampon dans la liste (peut être relatif, par exemple -1)
|
||||
close: fermer le tampon (pour un canal: équivalent à /part sans message de fin)
|
||||
move: déplace le tampon dans la liste (peut être relatif, par exemple -1)
|
||||
close: ferme le tampon (le paramètre optionnel est le message de fin, pour un canal)
|
||||
list: liste les tampons ouverts (pas de paramètre affiche cette liste)
|
||||
notify: fixer le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)
|
||||
notify: fixe le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)
|
||||
serveur
|
||||
canal: sauter au tampon par serveur et/ou nom de canal
|
||||
nombre: sauter au tampon qui a ce numéro
|
||||
canal: saute au tampon par serveur et/ou nom de canal
|
||||
nombre: saute au tampon qui a ce numéro
|
||||
|
||||
</programlisting>
|
||||
<command>builtin commande</command>
|
||||
<programlisting>
|
||||
lance une commande WeeChat/IRC interne (sans regarder les gestionnaires de commandes et les alias)
|
||||
|
||||
commande: commande à exécuter (un '/' est automatiquement ajouté s'il n'est pas trouvé au début de la commande)
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
|
||||
@@ -58,6 +66,15 @@ se d
|
||||
|
||||
nom_serveur: nom du serveur pour se déconnecter
|
||||
|
||||
</programlisting>
|
||||
<command>dcc action [pseudo [fichier]]</command>
|
||||
<programlisting>
|
||||
démarre le DCC (fichier ou discussion) ou ferme une discussion
|
||||
|
||||
action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture discussion)
|
||||
pseudo: pseudo pour envoyer le fichier ou discuter
|
||||
fichier: nom du fichier (sur la machine locale)
|
||||
|
||||
</programlisting>
|
||||
<command>debug dump | windows</command>
|
||||
<programlisting>
|
||||
@@ -141,11 +158,23 @@ fichier: fichier pour sauvegarder la configuration
|
||||
</programlisting>
|
||||
<command>set [option [ = valeur]]</command>
|
||||
<programlisting>
|
||||
modifier des paramètres de configuration
|
||||
modifier des options de configuration
|
||||
|
||||
option: nom de l'option (si le nom est complet et qu'aucune valeur n'est donnée, alors l'aide sur l'option est affichée)
|
||||
valeur: valeur pour l'option
|
||||
|
||||
L'option peut être: nomserveur.server_xxx où "nomserveur" est le nom interne d'un serveur et "xxx" une option pour ce serveur.
|
||||
|
||||
</programlisting>
|
||||
<command>setp [option [ = valeur]]</command>
|
||||
<programlisting>
|
||||
modifier des options de configuration des extensions
|
||||
|
||||
option: nom d'une option d'extension
|
||||
valeur: valeur pour l'option
|
||||
|
||||
L'option est au format: extension.option, par exemple: perl.monscript.variable1
|
||||
|
||||
</programlisting>
|
||||
<command>unalias nom_alias</command>
|
||||
<programlisting>
|
||||
@@ -197,7 +226,7 @@ gestion des fen
|
||||
right: saute à la fenêtre à droite
|
||||
splith: éclate la fenêtre en deux horizontalement
|
||||
splitv: éclate la fenêtre en deux verticalement
|
||||
resize: redimensionne une fenêtre, la nouvelle taille est pct%% de la fenêtre parent
|
||||
resize: redimensionne une fenêtre, la nouvelle taille est <pct> pourcentage de la fenêtre parent
|
||||
merge: fusionne la fenêtre avec une autre
|
||||
|
||||
Pour splith et splitv, pct est un pourcentage qui représente la taille de la nouvelle fenêtre, calculée par rapport à la taille de la fenêtre courante. Par exemple 25 signifie créer une fenêtre qui a pour taille: taille_courante / 4
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
Guide de démarrage rapide WeeChat (version française)
|
||||
=================================
|
||||
|
||||
1. Démarrer weechat
|
||||
|
||||
Selon l'interface choisie, vous devez lancer :
|
||||
- weechat-curses pour l'interface Curses
|
||||
- weechat-gtk pour l'interface Gtk (en développement)
|
||||
- weechat-qt pour l'interface Qt (non développée)
|
||||
- weechat-wxwidgets pour l'interface WxWidgets (non développée)
|
||||
|
||||
2. Aide en ligne / options
|
||||
|
||||
WeeChat dispose d'aide pour toutes les commandes, tapez simplement /help
|
||||
Pour avoir de l'aide sur une commande, tapez /help commande
|
||||
|
||||
Pour modifier des options, utilisez /set option = valeur
|
||||
Vous pouvez utiliser /set avec un nom partiel d'option (affiche alors
|
||||
les options contenant ces lettres), ou avec un nom complet d'option
|
||||
sans valeur (pour voir l'aide complète de l'option).
|
||||
|
||||
Note importante: les options sont sauvées lorsque WeeChat quitte (ou avec
|
||||
la commande "/save"). N'éditez PAS le fichier de configuration pendant que
|
||||
WeeChat tourne, car WeeChat peut écrire ce fichier à tout moment, et il
|
||||
n'est pas possible de le recharger.
|
||||
Pour changer toute option, utilisez la commande "/set", WeeChat prend en
|
||||
compte immédiatement les nouvelles valeurs.
|
||||
|
||||
3. Créer un serveur
|
||||
|
||||
Par exemple irc.quakenet.org, port 6667:
|
||||
/server quakenet irc.quakenet.org 6667
|
||||
(/help server pour l'aide complète sur la commande)
|
||||
|
||||
4. Définir les options du serveur
|
||||
|
||||
Pseudos :
|
||||
/set quakenet.server_nick1 = "mynick"
|
||||
/set quakenet.server_nick2 = "mynick2"
|
||||
/set quakenet.server_nick3 = "mynick3"
|
||||
|
||||
Nom d'utilisateur/réel :
|
||||
/set quakenet.server_username = "Mon nom d'utilisateur"
|
||||
/set quakenet.server_realname = "Mon nom réel"
|
||||
|
||||
Connexion auto au serveur :
|
||||
/set quakenet.server_autoconnect = on
|
||||
|
||||
Rejoindre automatiquement des canaux :
|
||||
/set quakenet.server_autojoin = "#canal1,#canal2"
|
||||
|
||||
Autres options :
|
||||
Vous pouvez voir les options du serveur et les valeurs avec /set quakenet
|
||||
Pour modifier une option, utilisez /set quakenet.server_option = valeur
|
||||
|
||||
5. Se connecter au serveur et rejoindre les canaux :
|
||||
|
||||
/connect quakenet
|
||||
|
||||
6. Rejoindre/quittre les canaux
|
||||
|
||||
Joindre un canal :
|
||||
/join #channel
|
||||
Quitter un canal :
|
||||
/part [message de fin]
|
||||
Quitter un canal et fermer le tampon :
|
||||
/close [message de fin]
|
||||
(/close est un alias sur /buffer close)
|
||||
|
||||
7. Gérer les tampons/fenêtres
|
||||
|
||||
Vous pouvez gérer les tampons avec la commande "/buffer" et les fenêtres
|
||||
avec la commande "/window".
|
||||
Par exemple, pour découper verticalement l'écran en une petite fenêtre
|
||||
(1/3 de la largeur) et une large (2/3 de la largeur), utilisez la commande
|
||||
/window splitv 33
|
||||
|
||||
8. Gérer les raccourcis clavier
|
||||
|
||||
Selon votre clavier et vos besoins, vous pouvez associer n'importe quelle
|
||||
touche à une commande avec la commande "/key".
|
||||
Une touche utile est meta-k (alt-k) pour trouver le code des touches.
|
||||
|
||||
Par exemple, pour associer meta-y (alt-y) à la commande "/buffer close" :
|
||||
/key (pressez meta-k) (pressez meta-y) /buffer close
|
||||
Vous aurez une ligne de commande qui ressemble à ceci :
|
||||
/key meta-y /buffer close
|
||||
|
||||
9. Extensions/scripts
|
||||
|
||||
Sur certaines distributions comme Debian, les extensions sont disponibles
|
||||
via un paquet séparé (par exemple weechat-plugins).
|
||||
Les extensions sont automatiquement chargées lorsqu'elles sont trouvées.
|
||||
Plusieurs extensions/scripts sont disponibles pour WeeChat, voir ici :
|
||||
http://weechat.flashtux.org/plugins.php
|
||||
Merci de regarder la documentation WeeChat pour charger/décharget des
|
||||
extensions ou des scripts.
|
||||
|
||||
10. Plus de documentation
|
||||
|
||||
Vous pouvez maintenant utiliser WeeChat et lire la FAQ/documentation pour
|
||||
toute autre question :
|
||||
http://weechat.flashtux.org/faq.php
|
||||
http://weechat.flashtux.org/doc.php
|
||||
|
||||
Bon WeeChat !
|
||||
|
||||
--
|
||||
(c) 2006-05-31, écrit par FlashCode <flashcode@flashtux.org>
|
||||
Ce document fait partie de WeeChat et est distribué sous license GPL.
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
LANGCODE = pl
|
||||
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(QUICKSTART)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
@@ -0,0 +1,111 @@
|
||||
Weechat szybki start (wersja polska)
|
||||
|
||||
1. Włączenie
|
||||
|
||||
Aby wybrać konkretny interfejs należy wpisać:
|
||||
- weechat-curses dla interfejsu curses
|
||||
- weechat-gtk dla interfejsu GTK (w fazie tworzenia)
|
||||
- weechat-qt dla interfejsu QT (planowany)
|
||||
- weechat-wxwidgets dla interfejsu WxWidgets (planowany)
|
||||
|
||||
|
||||
2. Pomoc online / opcje
|
||||
|
||||
Weechat posiada polecenie pomocy, którego można użyć dla każdej dostępnej opcji, wystarczy wpisać /help
|
||||
Aby otrzymać pomoc odnośnie komendy, wpisz /help <komenda>
|
||||
|
||||
Aby konfigurować opcje należy wpisać /set <opcja> = <wartość>
|
||||
Możesz wpisać /set <opcja> z nie pełną nazwą opcji (pokaże to opcje zawierające wpisany ciąg znaków),
|
||||
lub z całą nazwą opcji bez wartości (pokaże sie wtedy cała pomoc odnośnie opcji).
|
||||
|
||||
Uwaga: ustawienia są zapamiętywane podczas wyłączania WeeChata (albo po wpisaniu /save )
|
||||
NIE EDYTUJ pliku konfiguracyjnego WeeChata podczas pracy programu, ponieważ WeeChat może nadpisać
|
||||
ten plik w każdej chwili i nie będzie możliwości odzyskania ustawień.
|
||||
Aby zmienić każde z ustawień, używaj komendy "/set", WeeChat po jej użyciu od razu zacznie korzystać z nowych
|
||||
parametrów.
|
||||
|
||||
3. Dodawanie serwerów
|
||||
|
||||
Dla przykładu irc.quakenet.org, port 6667:
|
||||
/server quakenet irc.quakenet.org 6667
|
||||
(wpisz /help server dla pełnej pomocy)
|
||||
|
||||
4. Ustawianie własnych ustawień dotyczących serwera
|
||||
|
||||
Niki:
|
||||
/set quakenet.server_nick1 = "mój-nick"
|
||||
/set quakenet.server_nick2 = "mój-nick2"
|
||||
/set quakenet.server_nick3 = "mój-nick3"
|
||||
|
||||
Imię użytkownika:
|
||||
/set quakenet.server_username = "My username"
|
||||
/set quakenet.server_realname = "My real name"
|
||||
|
||||
Automatyczne łączenie do serwera przy starcie WeeChata:
|
||||
/set quakenet.server_autoconnect = on
|
||||
|
||||
Automatyczne wchodzenie na wybrane kanały po połączeniu sie do serwera:
|
||||
/set quakenet.server_autojoin = "#kanał1,#kanał2"
|
||||
|
||||
Inne opcje:
|
||||
Możesz zobaczyć inne opcje i ich właściwości po wpisaniu /set quakenet
|
||||
Aby ustawić konkretną opcję wpisz /set quakenet.server_opcja = wartość
|
||||
|
||||
|
||||
5. Łączenie do serwera i automatyczne wchodzenie na wybrane kanały:
|
||||
|
||||
/connect quakenet
|
||||
|
||||
6. Wchodzenie/wychodzenie na/z kanały/-ów
|
||||
|
||||
Wchodzenie na kanał:
|
||||
/join #kanał
|
||||
Wychodzenie z kanału:
|
||||
/part {wiadomość przy wychodzeniu}
|
||||
Wyjście z kanału i zamknięcie zakładki:
|
||||
/close {wiadomość przy wychodzeniu}
|
||||
("/close" to alias od "/bufer close")
|
||||
|
||||
7. Zarządzanie bufory/okna
|
||||
|
||||
Możesz zarządzać buforami przy pomocy polecenia "/buffer" i oknami "/windows"
|
||||
Przykład:
|
||||
-aby rozdzielić ekran w pionie na małe okno (1/3 szerokości),
|
||||
i na duże (2/3), wpisz:
|
||||
/window splthv 33
|
||||
|
||||
8. Przypisywanie funkcji do klawiszy:
|
||||
|
||||
W celu łatwiejszej pracy można przypisać dowolnym klawiszom wybrane funkcje/polecenia
|
||||
przy pomocy komendy "/key"
|
||||
Użyteczną może być funkcja meta-k (alt+k) która pozwala znaleźć przypisane klawiszom kody.
|
||||
|
||||
Przykład: aby zbindować (przypisać) meta-y (alt-y) do polecenia "/buffer close":
|
||||
/key (naciśnij meta-k) (naciśnij meta-y) /buffer close
|
||||
Otrzymujesz:
|
||||
/key meta-y /buffer close
|
||||
|
||||
|
||||
9. Wtyczki/skrypty
|
||||
|
||||
Na niektórych systemach operacyjnych, takich jak Debian, wtyczki są dostępne jako oddzielne paczki
|
||||
(np. weechat-plugins)
|
||||
Wtyczki są automatycznie ładowane przy starcie.
|
||||
Dodatkowe skrypty i wtyczki do WeeChata dostępne są na:
|
||||
http://weechat.flashtux.org/plugins.php
|
||||
Zajrzyj do dokumentacji WeeChata, aby dowiedzieć sie jak ladować i wyładować wtyczki i skrypty:
|
||||
http://weechat.flashtux.org/doc.php
|
||||
|
||||
10. Dokumentacja szczegółowa
|
||||
|
||||
Wiesz juz jak w podstawowy sposób używać WeeChata, aby dowiedzieć sie więcej poczytaj dokumentację.
|
||||
http://weechat.flashtux.org/faq.php
|
||||
http://weechat.flashtux.org/doc.php
|
||||
|
||||
Miłej pracy z WeeChatem!
|
||||
|
||||
--
|
||||
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
|
||||
Translated by dzik (znajdziecie mnie na irc.freenode.net)
|
||||
This document is part of WeeChat and is distributed under GPL licence.
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
LANGCODE = ru
|
||||
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(QUICKSTART)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
@@ -0,0 +1,110 @@
|
||||
Краткое руководство пользователя (русская версия)
|
||||
================================
|
||||
|
||||
1. Запуск WeeChat
|
||||
|
||||
В зависимости от выбранного интерфейса вы должны запустить:
|
||||
- weechat-curses для Curses интерфейса
|
||||
- weechat-gtk для GTK интерфейса (в разработке)
|
||||
- weechat-qt для Qt интерфейса (не разрабатывается)
|
||||
- weechat-wxwidgets для WxWidgets интерфейса (не разрабатывается)
|
||||
|
||||
2. Справка / настройки
|
||||
WeeChat содержит справку по всем командам, просто запустите /help
|
||||
Для получения справки по команде наберите /help команда
|
||||
|
||||
Для настройки используйте /set параметр = значение
|
||||
Вы можете использовать /set с частичным названием параметра
|
||||
(выведет все параметры с указанной фразой) или с полным названием
|
||||
(для получения подробной справки по параметру)
|
||||
|
||||
Внимание: настройки сохраняются при выходе из WeeChat (или командой
|
||||
"/save"). НЕ РЕДАКТИРУЙТЕ файл конфигурации когда WeeChat запущен,
|
||||
т.к. WeeChat может в любой момент перезаписать его. Возможности
|
||||
перезагрузить файл конфигурации нет. Для изменения любых настроек
|
||||
воспользуйтесь командой "/set", изменения вступят в силу
|
||||
незамедлительно.
|
||||
|
||||
3. Создание сервера
|
||||
|
||||
Например, irc.quakenet.org, порт 6667:
|
||||
/server quakenet irc.quakenet.org 6667
|
||||
(/help server выведет подробную справку)
|
||||
|
||||
4. Настройка сервера
|
||||
|
||||
Ники:
|
||||
/set quakenet.server_nick1 = "mynick"
|
||||
/set quakenet.server_nick2 = "mynick2"
|
||||
/set quakenet.server_nick3 = "mynick3"
|
||||
|
||||
Имя пользователя / реальное имя:
|
||||
/set quakenet.server_username = "Имя пользователя"
|
||||
/set quakenet.server_realname = "Реальное имя"
|
||||
|
||||
Автоматическое подключение к серверу:
|
||||
/set quakenet.server_autoconnect = on
|
||||
|
||||
Автоматический заход на некоторые каналы:
|
||||
/set quakenet.server_autojoin = "#chan1,#chan2"
|
||||
|
||||
Другие настройки:
|
||||
Чтобы вывести все настройки сервера наберите /set quakenet
|
||||
Для настройки наберите /set quakenet.параметр_сервера = значение
|
||||
|
||||
5. Подключение к серверу и автоматический заход на каналы:
|
||||
|
||||
/connect quakenet
|
||||
|
||||
6. Заход/покидание каналов
|
||||
|
||||
Зайти на канал:
|
||||
/join #канал
|
||||
Покинуть канал:
|
||||
/part [прощальное сообщение]
|
||||
Покинуть канал и закрыть буфер:
|
||||
/close [прощальное сообщение]
|
||||
(/close - это сокращение для /buffer close)
|
||||
|
||||
7. Управление буферами/окнами
|
||||
|
||||
Вы можете управлять буферами командой "/buffer" и окнами
|
||||
командой "/window".
|
||||
Например, чтобы разбить экран по вертикали на маленькое (треть
|
||||
экрана) и большое (2/3 экрана) окна наберите:
|
||||
/window splitv 33
|
||||
|
||||
8. Привязки клавиш
|
||||
|
||||
Вы можете переназначить любую клавишу в соответствии с вашими
|
||||
пожеланиями командой "/key".
|
||||
Полезна привязка meta-k (alt-k) для поиска нужных кодов клавиш.
|
||||
|
||||
Например, чтобы привязать meta-y (alt-y) к команде "/buffer close":
|
||||
/key (нажмите meta-k) (нажмите meta-y) /buffer close
|
||||
Вы получите команду:
|
||||
/key meta-y /buffer close
|
||||
|
||||
9. Plugins/скрипты
|
||||
|
||||
В некоторых дистрибутивах pluginы доступны отдельным пакетом
|
||||
(например, weechat-plugins).
|
||||
Pluginы загружаются автоматически.
|
||||
Для WeeChat доступны многочисленные pluginы и скрипты:
|
||||
http://weechat.flashtux.org/plugins.php
|
||||
Процесс загрузки и выгрузки pluginов и скриптов подробно описан в
|
||||
документации.
|
||||
|
||||
10. Другая документация
|
||||
|
||||
Теперь вы можете пользоваться WeeChat и почитать ЧаВо и документацию
|
||||
для поиска ответов на оставшиеся вопросы:
|
||||
http://weechat.flashtux.org/faq.php
|
||||
http://weechat.flashtux.org/doc.php
|
||||
|
||||
Наслаждайтесь WeeChat!
|
||||
|
||||
--
|
||||
(c) 2006-05-31, автор - FlashCode <flashcode@flashtux.org>
|
||||
(с) 2006-06-04, переводчик - Stalwart <stlwrt@gmail.com>
|
||||
Этот документ является частью WeeChat и распространяется по лицензии GPL.
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH WEECHAT 1 "March 2006" "FlashCode"
|
||||
.TH WEECHAT 1 "August 2006" "FlashCode"
|
||||
|
||||
.SH NAME
|
||||
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
|
||||
|
||||
@@ -12,6 +12,42 @@ table {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #000099;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #770077;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
background-color: #FFCCCC;
|
||||
}
|
||||
|
||||
.navheader {
|
||||
background-color: #E8E8FF;
|
||||
border: solid 1px #B5B5CC;
|
||||
}
|
||||
|
||||
.navheader hr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navfooter {
|
||||
background-color: #E8E8FF;
|
||||
border: solid 1px #B5B5CC;
|
||||
}
|
||||
|
||||
.navfooter hr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.title {
|
||||
background-color: #E5FFE5;
|
||||
border: solid 1px #CCDDCC;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.informaltable table {
|
||||
font-size: 11px;
|
||||
font-family: Verdana;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl"/>
|
||||
<xsl:import href="@DOC_XSL_PREFIX@/html/docbook.xsl"/>
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl"/>
|
||||
<xsl:import href="@DOC_XSL_PREFIX@/html/chunk.xsl"/>
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
+36
-4
@@ -1,3 +1,4 @@
|
||||
./src/irc/irc-mode.c
|
||||
./src/irc/irc-nick.c
|
||||
./src/irc/irc-server.c
|
||||
./src/irc/irc-channel.c
|
||||
@@ -14,14 +15,43 @@
|
||||
./src/plugins/plugins-config.h
|
||||
./src/plugins/plugins-interface.c
|
||||
./src/plugins/weechat-plugin.h
|
||||
./src/gui/curses/gui-input.c
|
||||
./src/gui/curses/gui-display.c
|
||||
./src/gui/gtk/gui-display.c
|
||||
./src/gui/gtk/gui-input.c
|
||||
./src/gui/curses/gui-curses-chat.c
|
||||
./src/gui/curses/gui-curses-color.c
|
||||
./src/gui/curses/gui-curses-infobar.c
|
||||
./src/gui/curses/gui-curses-input.c
|
||||
./src/gui/curses/gui-curses-keyboard.c
|
||||
./src/gui/curses/gui-curses-main.c
|
||||
./src/gui/curses/gui-curses-nicklist.c
|
||||
./src/gui/curses/gui-curses-panel.c
|
||||
./src/gui/curses/gui-curses-status.c
|
||||
./src/gui/curses/gui-curses-window.c
|
||||
./src/gui/curses/gui-curses.h
|
||||
./src/gui/gtk/gui-gtk-chat.c
|
||||
./src/gui/gtk/gui-gtk-color.c
|
||||
./src/gui/gtk/gui-gtk-infobar.c
|
||||
./src/gui/gtk/gui-gtk-input.c
|
||||
./src/gui/gtk/gui-gtk-keyboard.c
|
||||
./src/gui/gtk/gui-gtk-main.c
|
||||
./src/gui/gtk/gui-gtk-nicklist.c
|
||||
./src/gui/gtk/gui-gtk-panel.c
|
||||
./src/gui/gtk/gui-gtk-status.c
|
||||
./src/gui/gtk/gui-gtk-window.c
|
||||
./src/gui/gtk/gui-gtk.h
|
||||
./src/gui/gui-action.c
|
||||
./src/gui/gui-buffer.c
|
||||
./src/gui/gui-common.c
|
||||
./src/gui/gui-keyboard.c
|
||||
./src/gui/gui-log.c
|
||||
./src/gui/gui-panel.c
|
||||
./src/gui/gui-window.c
|
||||
./src/gui/gui.h
|
||||
./src/gui/gui-buffer.h
|
||||
./src/gui/gui-color.h
|
||||
./src/gui/gui-keyboard.h
|
||||
./src/gui/gui-panel.h
|
||||
./src/gui/gui-window.h
|
||||
./src/common/backtrace.c
|
||||
./src/common/backtrace.h
|
||||
./src/common/command.c
|
||||
./src/common/command.h
|
||||
./src/common/completion.c
|
||||
@@ -38,6 +68,8 @@
|
||||
./src/common/session.h
|
||||
./src/common/utf8.c
|
||||
./src/common/utf8.h
|
||||
./src/common/util.c
|
||||
./src/common/util.h
|
||||
./src/common/weechat.c
|
||||
./src/common/weechat.h
|
||||
./src/common/weeconfig.c
|
||||
|
||||
+1606
-1426
File diff suppressed because it is too large
Load Diff
@@ -21,6 +21,8 @@ noinst_LIBRARIES = lib_weechat_main.a
|
||||
|
||||
lib_weechat_main_a_SOURCES = weechat.c \
|
||||
weechat.h \
|
||||
backtrace.c \
|
||||
backtrace.h \
|
||||
command.c \
|
||||
command.h \
|
||||
completion.c \
|
||||
@@ -40,4 +42,6 @@ lib_weechat_main_a_SOURCES = weechat.c \
|
||||
session.c \
|
||||
session.h \
|
||||
utf8.c \
|
||||
utf8.h
|
||||
utf8.h \
|
||||
util.c \
|
||||
util.h
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* backtrace.c: display backtrace after a segfault */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#define __USE_GNU
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef HAVE_BACKTRACE
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
#include "weechat.h"
|
||||
#include "backtrace.h"
|
||||
#include "log.h"
|
||||
|
||||
|
||||
/*
|
||||
* weechat_backtrace_printf: display a backtrage line (on stderr and in WeeChat log)
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_backtrace_printf (char *message, ...)
|
||||
{
|
||||
static char buffer[4096];
|
||||
va_list argptr;
|
||||
|
||||
va_start (argptr, message);
|
||||
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
fprintf (stderr, "%s", buffer);
|
||||
weechat_log_printf ("%s", buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_backtrace_addr2line: display function name and line with a backtrace address
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_backtrace_addr2line (int number, void *address, char *symbol)
|
||||
{
|
||||
#ifdef HAVE_BACKTRACE
|
||||
int rc;
|
||||
Dl_info info;
|
||||
const void *addr;
|
||||
FILE *output;
|
||||
char cmd_line[1024];
|
||||
char line[1024], *ptr_line, *pos;
|
||||
char function_name[1024];
|
||||
int file_line;
|
||||
|
||||
rc = dladdr (address, &info);
|
||||
if ((rc == 0) || !info.dli_fname || !info.dli_fname[0])
|
||||
{
|
||||
weechat_backtrace_printf ("%03d %s\n", number, symbol);
|
||||
return;
|
||||
}
|
||||
|
||||
addr = address;
|
||||
if (info.dli_fbase >= (const void *) 0x40000000)
|
||||
addr = (const char *) addr - (unsigned int) info.dli_fbase;
|
||||
|
||||
snprintf (cmd_line, sizeof (cmd_line),
|
||||
"addr2line --functions --demangle -e $(which %s) %p",
|
||||
info.dli_fname, addr);
|
||||
output = popen (cmd_line, "r");
|
||||
if (!output)
|
||||
{
|
||||
weechat_backtrace_printf ("%03d %s\n", number, symbol);
|
||||
return;
|
||||
}
|
||||
function_name[0] = '\0';
|
||||
file_line = 0;
|
||||
while (!feof (output))
|
||||
{
|
||||
ptr_line = fgets (line, sizeof (line) - 1, output);
|
||||
if (ptr_line && ptr_line[0])
|
||||
{
|
||||
pos = strchr (ptr_line, '\n');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
if (strchr (ptr_line, ':'))
|
||||
{
|
||||
file_line = 1;
|
||||
weechat_backtrace_printf ("%03d %s%s%s%s\n",
|
||||
number,
|
||||
ptr_line,
|
||||
(function_name[0]) ? " [function " : "",
|
||||
function_name,
|
||||
(function_name[0]) ? "]" : "");
|
||||
function_name[0] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (function_name[0])
|
||||
weechat_backtrace_printf ("%03d %s",
|
||||
number, function_name);
|
||||
snprintf (function_name, sizeof (function_name),
|
||||
"%s", ptr_line);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (function_name[0])
|
||||
weechat_backtrace_printf ("%03d %s\n",
|
||||
number, function_name);
|
||||
pclose (output);
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) number;
|
||||
(void) address;
|
||||
(void) symbol;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_backtrace: display backtrace (called when a SIGSEGV is received)
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_backtrace ()
|
||||
{
|
||||
#ifdef HAVE_BACKTRACE
|
||||
void *trace[BACKTRACE_MAX];
|
||||
int trace_size, i;
|
||||
char **symbols;
|
||||
#endif
|
||||
|
||||
weechat_backtrace_printf ("======= WeeChat backtrace =======\n");
|
||||
weechat_backtrace_printf ("(written by %s, compiled on %s %s)\n",
|
||||
PACKAGE_STRING, __DATE__, __TIME__);
|
||||
|
||||
#ifdef HAVE_BACKTRACE
|
||||
trace_size = backtrace (trace, BACKTRACE_MAX);
|
||||
symbols = backtrace_symbols (trace, trace_size);
|
||||
|
||||
for (i = 0; i < trace_size; i++)
|
||||
{
|
||||
weechat_backtrace_addr2line (i + 1, trace[i], symbols[i]);
|
||||
}
|
||||
#else
|
||||
weechat_backtrace_printf (" No backtrace info (no debug info available "
|
||||
"or no backtrace possible on your system).\n");
|
||||
#endif
|
||||
|
||||
weechat_backtrace_printf ("======= End of backtrace =======\n");
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_BACKTACE_H
|
||||
#define __WEECHAT_BACKTACE_H 1
|
||||
|
||||
#define BACKTRACE_MAX 128
|
||||
|
||||
extern void weechat_backtrace ();
|
||||
|
||||
#endif /* backtrace.h */
|
||||
+871
-262
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,8 @@ struct t_weechat_command
|
||||
char *completion_template; /* template for completion */
|
||||
/* NULL=no completion, ""=default (nick) */
|
||||
int min_arg, max_arg; /* min & max number of arguments */
|
||||
int conversion; /* = 1 if cmd args are converted (charset */
|
||||
/* and color) before execution */
|
||||
int (*cmd_function_args)(t_irc_server *, t_irc_channel *, int, char **);
|
||||
/* function called when user enters cmd */
|
||||
int (*cmd_function_1arg)(t_irc_server *, t_irc_channel *, char *);
|
||||
@@ -71,13 +73,15 @@ extern char **explode_string (char *, char *, int, int *);
|
||||
extern void free_exploded_string (char **);
|
||||
extern char **split_multi_command (char *, char);
|
||||
extern void free_multi_command (char **);
|
||||
extern int exec_weechat_command (t_irc_server *, t_irc_channel *, char *);
|
||||
extern void user_command (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int exec_weechat_command (t_irc_server *, t_irc_channel *, char *, int);
|
||||
extern void user_command (t_irc_server *, t_irc_channel *, char *, int);
|
||||
extern int weechat_cmd_alias (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_buffer (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_buffer (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_builtin (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_charset (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_clear (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_connect (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_dcc (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_debug (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_disconnect (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_help (t_irc_server *, t_irc_channel *, int, char **);
|
||||
@@ -85,10 +89,12 @@ extern int weechat_cmd_history (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern void weechat_cmd_ignore_display (char *, t_irc_ignore *);
|
||||
extern int weechat_cmd_ignore (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_key (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_panel (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_plugin (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_save (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_server (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_set (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_setp (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_unalias (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_unignore (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_upgrade (t_irc_server *, t_irc_channel *, int, char **);
|
||||
|
||||
+325
-95
@@ -30,7 +30,9 @@
|
||||
#include "weechat.h"
|
||||
#include "completion.h"
|
||||
#include "command.h"
|
||||
#include "log.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
#include "weelist.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../irc/irc.h"
|
||||
@@ -53,12 +55,19 @@ completion_init (t_completion *completion, void *server, void *channel)
|
||||
completion->base_command = NULL;
|
||||
completion->base_command_arg = 0;
|
||||
completion->arg_is_nick = 0;
|
||||
completion->position = -1;
|
||||
completion->base_word = NULL;
|
||||
completion->base_word_pos = 0;
|
||||
completion->position = -1;
|
||||
completion->args = NULL;
|
||||
completion->direction = 0;
|
||||
|
||||
completion->completion_list = NULL;
|
||||
completion->last_completion = NULL;
|
||||
|
||||
completion->word_found = NULL;
|
||||
completion->position_replace = 0;
|
||||
completion->diff_size = 0;
|
||||
completion->diff_length = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -176,6 +185,23 @@ completion_get_command_infos (t_completion *completion,
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add: add a word to completion word list
|
||||
*/
|
||||
|
||||
void
|
||||
completion_list_add (t_completion *completion, char *word)
|
||||
{
|
||||
if (!completion->base_word || !completion->base_word[0]
|
||||
|| (ascii_strncasecmp (completion->base_word, word,
|
||||
strlen (completion->base_word)) == 0))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
word);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_alias: add alias to completion list
|
||||
*/
|
||||
@@ -187,9 +213,7 @@ completion_list_add_alias (t_completion *completion)
|
||||
|
||||
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
ptr_alias->alias_name);
|
||||
completion_list_add (completion, ptr_alias->alias_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,9 +228,7 @@ completion_list_add_alias_cmd (t_completion *completion)
|
||||
|
||||
for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
ptr_list->data);
|
||||
completion_list_add (completion, ptr_list->data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,9 +240,8 @@ void
|
||||
completion_list_add_channel (t_completion *completion)
|
||||
{
|
||||
if (completion->channel)
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_channel *)(completion->channel))->name);
|
||||
completion_list_add (completion,
|
||||
((t_irc_channel *)(completion->channel))->name);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -237,9 +258,7 @@ completion_list_add_server_channels (t_completion *completion)
|
||||
for (ptr_channel = ((t_irc_server *)(completion->server))->channels;
|
||||
ptr_channel; ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
ptr_channel->name);
|
||||
completion_list_add (completion, ptr_channel->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -273,9 +292,7 @@ completion_list_add_plugin_cmd (t_completion *completion)
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == HANDLER_COMMAND)
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
ptr_handler->command);
|
||||
completion_list_add (completion, ptr_handler->command);
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -296,9 +313,7 @@ completion_list_add_irc_cmd_sent (t_completion *completion)
|
||||
for (i = 0; irc_commands[i].command_name; i++)
|
||||
{
|
||||
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
irc_commands[i].command_name);
|
||||
completion_list_add (completion, irc_commands[i].command_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,9 +329,7 @@ completion_list_add_irc_cmd_recv (t_completion *completion)
|
||||
for (i = 0; irc_commands[i].command_name; i++)
|
||||
{
|
||||
if (irc_commands[i].recv_function)
|
||||
weelist_add(&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
irc_commands[i].command_name);
|
||||
completion_list_add(completion, irc_commands[i].command_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,9 +344,20 @@ completion_list_add_key_cmd (t_completion *completion)
|
||||
|
||||
for (i = 0; gui_key_functions[i].function_name; i++)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
gui_key_functions[i].function_name);
|
||||
completion_list_add (completion, gui_key_functions[i].function_name);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_self_nick: add self nick on server to completion list
|
||||
*/
|
||||
|
||||
void
|
||||
completion_list_add_self_nick (t_completion *completion)
|
||||
{
|
||||
if (completion->server)
|
||||
{
|
||||
completion_list_add (completion, ((t_irc_server *)(completion->server))->nick);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,16 +377,58 @@ completion_list_add_channel_nicks (t_completion *completion)
|
||||
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
|
||||
ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
ptr_nick->nick);
|
||||
completion_list_add (completion, ptr_nick->nick);
|
||||
}
|
||||
}
|
||||
if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_channel *)(completion->channel))->name);
|
||||
completion_list_add (completion,
|
||||
((t_irc_channel *)(completion->channel))->name);
|
||||
}
|
||||
completion->arg_is_nick = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_channel_nicks_hosts: add channel nicks and hosts to completion list
|
||||
*/
|
||||
|
||||
void
|
||||
completion_list_add_channel_nicks_hosts (t_completion *completion)
|
||||
{
|
||||
t_irc_nick *ptr_nick;
|
||||
char *buf;
|
||||
int length;
|
||||
|
||||
if (completion->channel)
|
||||
{
|
||||
if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
|
||||
ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
completion_list_add (completion, ptr_nick->nick);
|
||||
if (ptr_nick->host)
|
||||
{
|
||||
length = strlen (ptr_nick->nick) + 1 +
|
||||
strlen (ptr_nick->host) + 1;
|
||||
buf = (char *) malloc (length);
|
||||
if (buf)
|
||||
{
|
||||
snprintf (buf, length, "%s!%s",
|
||||
ptr_nick->nick, ptr_nick->host);
|
||||
completion_list_add (completion, buf);
|
||||
free (buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE))
|
||||
{
|
||||
completion_list_add (completion,
|
||||
((t_irc_channel *)(completion->channel))->name);
|
||||
}
|
||||
completion->arg_is_nick = 1;
|
||||
}
|
||||
@@ -386,9 +452,8 @@ completion_list_add_option (t_completion *completion)
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
weechat_options[i][j].option_name);
|
||||
completion_list_add (completion,
|
||||
weechat_options[i][j].option_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -400,13 +465,32 @@ completion_list_add_option (t_completion *completion)
|
||||
snprintf (option_name, sizeof (option_name), "%s.%s",
|
||||
ptr_server->name,
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
option_name);
|
||||
completion_list_add (completion, option_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_plugin_option: add plugin option to completion list
|
||||
*/
|
||||
|
||||
void
|
||||
completion_list_add_plugin_option (t_completion *completion)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_option *ptr_option;
|
||||
|
||||
for (ptr_option = plugin_options; ptr_option;
|
||||
ptr_option = ptr_option->next_option)
|
||||
{
|
||||
completion_list_add (completion, ptr_option->name);
|
||||
}
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) completion;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_part: add part message to completion list
|
||||
*/
|
||||
@@ -415,9 +499,28 @@ void
|
||||
completion_list_add_part (t_completion *completion)
|
||||
{
|
||||
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
cfg_irc_default_msg_part);
|
||||
completion_list_add (completion, cfg_irc_default_msg_part);
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_plugin: add plugin name to completion list
|
||||
*/
|
||||
|
||||
void
|
||||
completion_list_add_plugin (t_completion *completion)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_weechat_plugin *ptr_plugin;
|
||||
|
||||
for (ptr_plugin = weechat_plugins; ptr_plugin;
|
||||
ptr_plugin = ptr_plugin->next_plugin)
|
||||
{
|
||||
completion_list_add (completion, ptr_plugin->name);
|
||||
}
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) completion;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -428,9 +531,7 @@ void
|
||||
completion_list_add_quit (t_completion *completion)
|
||||
{
|
||||
if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
cfg_irc_default_msg_quit);
|
||||
completion_list_add (completion, cfg_irc_default_msg_quit);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -441,9 +542,8 @@ void
|
||||
completion_list_add_server (t_completion *completion)
|
||||
{
|
||||
if (completion->server)
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_server *)(completion->server))->name);
|
||||
completion_list_add (completion,
|
||||
((t_irc_server *)(completion->server))->name);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -458,9 +558,7 @@ completion_list_add_servers (t_completion *completion)
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
ptr_server->name);
|
||||
completion_list_add (completion, ptr_server->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,9 +584,9 @@ completion_list_add_topic (t_completion *completion)
|
||||
string2 = channel_iconv_decode ((t_irc_server *)(completion->server),
|
||||
(t_irc_channel *)(completion->channel),
|
||||
(string) ? string : ((t_irc_channel *)(completion->channel))->topic);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(string2) ? string2 : ((string) ? string : ((t_irc_channel *)(completion->channel))->topic));
|
||||
completion_list_add (completion,
|
||||
(string2) ? string2 : ((string) ?
|
||||
string : ((t_irc_channel *)(completion->channel))->topic));
|
||||
if (string)
|
||||
free (string);
|
||||
if (string2)
|
||||
@@ -522,44 +620,34 @@ completion_list_add_option_value (t_completion *completion)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (option_value && (*((int *)(option_value))))
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"on");
|
||||
completion_list_add (completion, "on");
|
||||
else
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"off");
|
||||
completion_list_add (completion, "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
snprintf (option_string, sizeof (option_string) - 1,
|
||||
"%d", (option_value) ? *((int *)(option_value)) : option->default_int);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
option_string);
|
||||
completion_list_add (completion, option_string);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(option_value) ?
|
||||
option->array_values[*((int *)(option_value))] :
|
||||
option->array_values[option->default_int]);
|
||||
completion_list_add (completion,
|
||||
(option_value) ?
|
||||
option->array_values[*((int *)(option_value))] :
|
||||
option->array_values[option->default_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(option_value) ?
|
||||
gui_get_color_name (*((int *)(option_value))) :
|
||||
option->default_string);
|
||||
completion_list_add (completion,
|
||||
(option_value) ?
|
||||
gui_color_get_name (*((int *)(option_value))) :
|
||||
option->default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
snprintf (option_string, sizeof (option_string) - 1,
|
||||
"\"%s\"",
|
||||
(option_value) ?
|
||||
((option_value) && (*((char **)(option_value)))) ?
|
||||
*((char **)(option_value)) :
|
||||
option->default_string);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
option_string);
|
||||
completion_list_add (completion, option_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -568,6 +656,36 @@ completion_list_add_option_value (t_completion *completion)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_plugin_option_value: add plugin option value to completion list
|
||||
*/
|
||||
|
||||
void
|
||||
completion_list_add_plugin_option_value (t_completion *completion)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
char *pos;
|
||||
t_plugin_option *ptr_option;
|
||||
|
||||
if (completion->args)
|
||||
{
|
||||
pos = strchr (completion->args, ' ');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
|
||||
ptr_option = plugin_config_search_internal (completion->args);
|
||||
if (ptr_option)
|
||||
completion_list_add (completion, ptr_option->value);
|
||||
|
||||
if (pos)
|
||||
pos[0] = ' ';
|
||||
}
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) completion;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_list_add_weechat_cmd: add WeeChat commands to completion list
|
||||
*/
|
||||
@@ -579,9 +697,7 @@ completion_list_add_weechat_cmd (t_completion *completion)
|
||||
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
weechat_commands[i].command_name);
|
||||
completion_list_add (completion, weechat_commands[i].command_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,15 +768,27 @@ completion_build_list_template (t_completion *completion, char *template)
|
||||
case 'k': /* key cmd/funtcions*/
|
||||
completion_list_add_key_cmd (completion);
|
||||
break;
|
||||
case 'm': /* self nickname */
|
||||
completion_list_add_self_nick (completion);
|
||||
break;
|
||||
case 'n': /* channel nicks */
|
||||
completion_list_add_channel_nicks (completion);
|
||||
break;
|
||||
case 'N': /* channel nicks and hosts */
|
||||
completion_list_add_channel_nicks_hosts (completion);
|
||||
break;
|
||||
case 'o': /* config option */
|
||||
completion_list_add_option (completion);
|
||||
break;
|
||||
case 'O': /* plugin option */
|
||||
completion_list_add_plugin_option (completion);
|
||||
break;
|
||||
case 'p': /* part message */
|
||||
completion_list_add_part (completion);
|
||||
break;
|
||||
case 'P': /* plugin name */
|
||||
completion_list_add_plugin (completion);
|
||||
break;
|
||||
case 'q': /* quit message */
|
||||
completion_list_add_quit (completion);
|
||||
break;
|
||||
@@ -676,6 +804,9 @@ completion_build_list_template (t_completion *completion, char *template)
|
||||
case 'v': /* value of config option */
|
||||
completion_list_add_option_value (completion);
|
||||
break;
|
||||
case 'V': /* value of plugin option */
|
||||
completion_list_add_plugin_option_value (completion);
|
||||
break;
|
||||
case 'w': /* WeeChat commands */
|
||||
completion_list_add_weechat_cmd (completion);
|
||||
break;
|
||||
@@ -705,7 +836,8 @@ completion_build_list (t_completion *completion)
|
||||
int max_arg, i;
|
||||
|
||||
completion_get_command_infos (completion, &template, &max_arg);
|
||||
if (!template || (completion->base_command_arg > max_arg))
|
||||
if (!template || (strcmp (template, "-") == 0) ||
|
||||
(completion->base_command_arg > max_arg))
|
||||
{
|
||||
completion_stop (completion);
|
||||
return;
|
||||
@@ -860,7 +992,8 @@ completion_find_context (t_completion *completion, char *buffer, int size, int p
|
||||
}
|
||||
|
||||
if (!completion->completion_list && completion->channel &&
|
||||
(((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
|
||||
&& (completion->context == COMPLETION_NICK))
|
||||
{
|
||||
/* nick completion in private (only other nick and self) */
|
||||
@@ -887,20 +1020,35 @@ completion_command (t_completion *completion)
|
||||
length = strlen (completion->base_word) - 1;
|
||||
word_found_seen = 0;
|
||||
other_completion = 0;
|
||||
for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist = last_index_command;
|
||||
else
|
||||
ptr_weelist = index_commands;
|
||||
while (ptr_weelist)
|
||||
{
|
||||
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
|
||||
{
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
completion->word_found = ptr_weelist->data;
|
||||
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist)
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist2 = ptr_weelist->prev_weelist;
|
||||
else
|
||||
ptr_weelist2 = ptr_weelist->next_weelist;
|
||||
|
||||
while (ptr_weelist2)
|
||||
{
|
||||
if (ascii_strncasecmp (ptr_weelist2->data,
|
||||
completion->base_word + 1, length) == 0)
|
||||
completion->base_word + 1, length) == 0)
|
||||
other_completion++;
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist2 = ptr_weelist2->prev_weelist;
|
||||
else
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist;
|
||||
}
|
||||
|
||||
if (other_completion == 0)
|
||||
completion->position = -1;
|
||||
else
|
||||
@@ -913,6 +1061,11 @@ completion_command (t_completion *completion)
|
||||
if (completion->word_found &&
|
||||
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist = ptr_weelist->prev_weelist;
|
||||
else
|
||||
ptr_weelist = ptr_weelist->next_weelist;
|
||||
}
|
||||
if (completion->word_found)
|
||||
{
|
||||
@@ -1003,8 +1156,12 @@ completion_command_arg (t_completion *completion, int nick_completion)
|
||||
length = strlen (completion->base_word);
|
||||
word_found_seen = 0;
|
||||
other_completion = 0;
|
||||
for (ptr_weelist = completion->completion_list; ptr_weelist;
|
||||
ptr_weelist = ptr_weelist->next_weelist)
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist = completion->last_completion;
|
||||
else
|
||||
ptr_weelist = completion->completion_list;
|
||||
|
||||
while (ptr_weelist)
|
||||
{
|
||||
if ((nick_completion && (completion_nickncmp (completion->base_word, ptr_weelist->data, length) == 0))
|
||||
|| ((!nick_completion) && (ascii_strncasecmp (completion->base_word, ptr_weelist->data, length) == 0)))
|
||||
@@ -1012,15 +1169,26 @@ completion_command_arg (t_completion *completion, int nick_completion)
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
completion->word_found = ptr_weelist->data;
|
||||
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist)
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist2 = ptr_weelist->prev_weelist;
|
||||
else
|
||||
ptr_weelist2 = ptr_weelist->next_weelist;
|
||||
|
||||
while (ptr_weelist2)
|
||||
{
|
||||
if ((nick_completion
|
||||
&& (completion_nickncmp (completion->base_word, ptr_weelist2->data, length) == 0))
|
||||
|| ((!nick_completion)
|
||||
&& (ascii_strncasecmp (completion->base_word, ptr_weelist2->data, length) == 0)))
|
||||
other_completion++;
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist2 = ptr_weelist2->prev_weelist;
|
||||
else
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist;
|
||||
}
|
||||
|
||||
if (other_completion == 0)
|
||||
completion->position = -1;
|
||||
else
|
||||
@@ -1033,6 +1201,11 @@ completion_command_arg (t_completion *completion, int nick_completion)
|
||||
if (completion->word_found &&
|
||||
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_weelist = ptr_weelist->prev_weelist;
|
||||
else
|
||||
ptr_weelist = ptr_weelist->next_weelist;
|
||||
}
|
||||
if (completion->word_found)
|
||||
{
|
||||
@@ -1054,7 +1227,8 @@ completion_nick (t_completion *completion)
|
||||
if (!completion->channel)
|
||||
return;
|
||||
|
||||
if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
|
||||
{
|
||||
if (!(completion->completion_list))
|
||||
{
|
||||
@@ -1072,9 +1246,13 @@ completion_nick (t_completion *completion)
|
||||
length = strlen (completion->base_word);
|
||||
word_found_seen = 0;
|
||||
other_completion = 0;
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_nick = ((t_irc_channel *)(completion->channel))->last_nick;
|
||||
else
|
||||
ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
|
||||
|
||||
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
|
||||
ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
while (ptr_nick)
|
||||
{
|
||||
if (completion_nickncmp (completion->base_word, ptr_nick->nick, length) == 0)
|
||||
{
|
||||
@@ -1086,14 +1264,25 @@ completion_nick (t_completion *completion)
|
||||
completion->position = -1;
|
||||
return;
|
||||
}
|
||||
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
|
||||
ptr_nick2 = ptr_nick2->next_nick)
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_nick2 = ptr_nick->prev_nick;
|
||||
else
|
||||
ptr_nick2 = ptr_nick->next_nick;
|
||||
|
||||
while (ptr_nick2)
|
||||
{
|
||||
if (completion_nickncmp (completion->base_word,
|
||||
ptr_nick2->nick,
|
||||
length) == 0)
|
||||
other_completion++;
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_nick2 = ptr_nick2->prev_nick;
|
||||
else
|
||||
ptr_nick2 = ptr_nick2->next_nick;
|
||||
}
|
||||
|
||||
if (other_completion == 0)
|
||||
completion->position = -1;
|
||||
else
|
||||
@@ -1108,6 +1297,11 @@ completion_nick (t_completion *completion)
|
||||
if (completion->word_found &&
|
||||
(ascii_strcasecmp (ptr_nick->nick, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
|
||||
if (completion->direction < 0)
|
||||
ptr_nick = ptr_nick->prev_nick;
|
||||
else
|
||||
ptr_nick = ptr_nick->next_nick;
|
||||
}
|
||||
if (completion->word_found)
|
||||
{
|
||||
@@ -1121,10 +1315,13 @@ completion_nick (t_completion *completion)
|
||||
*/
|
||||
|
||||
void
|
||||
completion_search (t_completion *completion, char *buffer, int size, int pos)
|
||||
completion_search (t_completion *completion, int direction,
|
||||
char *buffer, int size, int pos)
|
||||
{
|
||||
char *old_word_found;
|
||||
|
||||
completion->direction = direction;
|
||||
|
||||
/* if new completion => look for base word */
|
||||
if (pos != completion->position)
|
||||
{
|
||||
@@ -1178,3 +1375,36 @@ completion_search (t_completion *completion, char *buffer, int size, int pos)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_print_log: print completion list in log (usually for crash dump)
|
||||
*/
|
||||
|
||||
void
|
||||
completion_print_log (t_completion *completion)
|
||||
{
|
||||
weechat_log_printf ("[completion (addr:0x%X)]\n", completion);
|
||||
weechat_log_printf (" server . . . . . . . . : 0x%X\n", completion->server);
|
||||
weechat_log_printf (" channel. . . . . . . . : 0x%X\n", completion->channel);
|
||||
weechat_log_printf (" context. . . . . . . . : %d\n", completion->context);
|
||||
weechat_log_printf (" base_command . . . . . : '%s'\n", completion->base_command);
|
||||
weechat_log_printf (" base_command_arg . . . : %d\n", completion->base_command_arg);
|
||||
weechat_log_printf (" arg_is_nick. . . . . . : %d\n", completion->arg_is_nick);
|
||||
weechat_log_printf (" base_word. . . . . . . : '%s'\n", completion->base_word);
|
||||
weechat_log_printf (" base_word_pos. . . . . : %d\n", completion->base_word_pos);
|
||||
weechat_log_printf (" position . . . . . . . : %d\n", completion->position);
|
||||
weechat_log_printf (" args . . . . . . . . . : '%s'\n", completion->args);
|
||||
weechat_log_printf (" direction. . . . . . . : %d\n", completion->direction);
|
||||
weechat_log_printf (" completion_list. . . . : 0x%X\n", completion->completion_list);
|
||||
weechat_log_printf (" last_completion. . . . : 0x%X\n", completion->last_completion);
|
||||
weechat_log_printf (" word_found . . . . . . : '%s'\n", completion->word_found);
|
||||
weechat_log_printf (" position_replace . . . : %d\n", completion->position_replace);
|
||||
weechat_log_printf (" diff_size. . . . . . . : %d\n", completion->diff_size);
|
||||
weechat_log_printf (" diff_length. . . . . . : %d\n", completion->diff_length);
|
||||
if (completion->completion_list)
|
||||
{
|
||||
weechat_log_printf ("\n");
|
||||
weelist_print_log (completion->completion_list,
|
||||
"completion list element");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ struct t_completion
|
||||
int base_word_pos; /* beggining of base word */
|
||||
int position; /* position where Tab was pressed */
|
||||
char *args; /* command line args (including base word) */
|
||||
int direction; /* +1 = search next word, -1 = previous word */
|
||||
|
||||
/* for command argument completion */
|
||||
t_weelist *completion_list; /* data list for completion */
|
||||
@@ -57,6 +58,7 @@ struct t_completion
|
||||
|
||||
extern void completion_init (t_completion *, void *, void *);
|
||||
extern void completion_free (t_completion *);
|
||||
extern void completion_search (t_completion *, char *, int, int);
|
||||
extern void completion_search (t_completion *, int, char *, int, int);
|
||||
extern void completion_print_log (t_completion *);
|
||||
|
||||
#endif /* completion.h */
|
||||
|
||||
+3
-2
@@ -34,6 +34,7 @@
|
||||
#include "weechat.h"
|
||||
#include "fifo.h"
|
||||
#include "command.h"
|
||||
#include "log.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -156,7 +157,7 @@ fifo_exec (char *text)
|
||||
}
|
||||
if (ptr_server && pos)
|
||||
{
|
||||
ptr_channel = channel_search (ptr_server, pos + 1);
|
||||
ptr_channel = channel_search_any (ptr_server, pos + 1);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
@@ -169,7 +170,7 @@ fifo_exec (char *text)
|
||||
}
|
||||
}
|
||||
|
||||
user_command (ptr_server, ptr_channel, pos_msg);
|
||||
user_command (ptr_server, ptr_channel, pos_msg, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "weechat.h"
|
||||
#include "history.h"
|
||||
#include "util.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -73,6 +74,9 @@ void
|
||||
history_buffer_add (void *buffer, char *string)
|
||||
{
|
||||
t_history *new_history, *ptr_history;
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
if ( !((t_gui_buffer *)(buffer))->history
|
||||
|| ( ((t_gui_buffer *)(buffer))->history
|
||||
@@ -121,6 +125,9 @@ history_global_add (char *string)
|
||||
{
|
||||
t_history *new_history, *ptr_history;
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
if (!history_global
|
||||
|| (history_global
|
||||
&& ascii_strcasecmp (history_global->text, string) != 0))
|
||||
|
||||
+167
-132
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* log.c: log buffers to files */
|
||||
/* log.c: WeeChat log file */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -27,163 +27,198 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "log.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
char *weechat_log_filename = NULL; /* log name (~/.weechat/weechat.log) */
|
||||
FILE *weechat_log_file = NULL; /* WeeChat log file */
|
||||
|
||||
|
||||
/*
|
||||
* log_write_date: writes date to log file
|
||||
* weechat_log_open: initialize log file
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_log_open (char *filename, char *mode)
|
||||
{
|
||||
int filename_length;
|
||||
|
||||
/* exit if log already opened */
|
||||
if (weechat_log_file)
|
||||
return 0;
|
||||
|
||||
if (filename)
|
||||
weechat_log_filename = strdup (filename);
|
||||
else
|
||||
{
|
||||
filename_length = strlen (weechat_home) + 64;
|
||||
weechat_log_filename =
|
||||
(char *) malloc (filename_length * sizeof (char));
|
||||
snprintf (weechat_log_filename, filename_length,
|
||||
"%s/%s", weechat_home, WEECHAT_LOG_NAME);
|
||||
}
|
||||
|
||||
weechat_log_file = fopen (weechat_log_filename, mode);
|
||||
if (!weechat_log_file)
|
||||
{
|
||||
free (weechat_log_filename);
|
||||
weechat_log_filename = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_FLOCK
|
||||
if ((flock (fileno (weechat_log_file), LOCK_EX | LOCK_NB) != 0))
|
||||
{
|
||||
fclose (weechat_log_file);
|
||||
weechat_log_file = NULL;
|
||||
free (weechat_log_filename);
|
||||
weechat_log_filename = NULL;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_init: initialize log file
|
||||
*/
|
||||
|
||||
void
|
||||
log_write_date (t_gui_buffer *buffer)
|
||||
weechat_log_init ()
|
||||
{
|
||||
static char buf_time[256];
|
||||
if (!weechat_log_open (NULL, "w"))
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s unable to create/append to log file\n"
|
||||
"If another WeeChat process is using this file, try to run WeeChat\n"
|
||||
"with another home using \"--dir\" command line option.\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_printf: write a message in WeeChat log (<weechat_home>/weechat.log)
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_log_printf (char *message, ...)
|
||||
{
|
||||
static char buffer[4096];
|
||||
char *ptr_buffer;
|
||||
va_list argptr;
|
||||
static time_t seconds;
|
||||
struct tm *date_tmp;
|
||||
|
||||
if (buffer->log_file)
|
||||
{
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
if (date_tmp)
|
||||
{
|
||||
strftime (buf_time, sizeof (buf_time) - 1, cfg_log_timestamp, date_tmp);
|
||||
fprintf (buffer->log_file, "%s ", buf_time);
|
||||
fflush (buffer->log_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* log_write_line: writes a line to log file
|
||||
*/
|
||||
|
||||
void
|
||||
log_write_line (t_gui_buffer *buffer, char *message)
|
||||
{
|
||||
char *msg_no_color;
|
||||
if (!weechat_log_file)
|
||||
return;
|
||||
|
||||
if (buffer->log_file)
|
||||
{
|
||||
msg_no_color = (char *)gui_color_decode ((unsigned char *)message, 0);
|
||||
log_write_date (buffer);
|
||||
fprintf (buffer->log_file, "%s\n",
|
||||
(msg_no_color) ? msg_no_color : message);
|
||||
fflush (buffer->log_file);
|
||||
if (msg_no_color)
|
||||
free (msg_no_color);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* log_write: writes a message to log file
|
||||
*/
|
||||
|
||||
void
|
||||
log_write (t_gui_buffer *buffer, char *message)
|
||||
{
|
||||
char *msg_no_color;
|
||||
va_start (argptr, message);
|
||||
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
if (buffer->log_file)
|
||||
/* keep only valid chars */
|
||||
ptr_buffer = buffer;
|
||||
while (ptr_buffer[0])
|
||||
{
|
||||
msg_no_color = (char *)gui_color_decode ((unsigned char *)message, 0);
|
||||
fprintf (buffer->log_file, "%s",
|
||||
(msg_no_color) ? msg_no_color : message);
|
||||
fflush (buffer->log_file);
|
||||
if (msg_no_color)
|
||||
free (msg_no_color);
|
||||
if ((ptr_buffer[0] != '\n')
|
||||
&& (ptr_buffer[0] != '\r')
|
||||
&& ((unsigned char)(ptr_buffer[0]) < 32))
|
||||
ptr_buffer[0] = '.';
|
||||
ptr_buffer++;
|
||||
}
|
||||
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
if (date_tmp)
|
||||
fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s",
|
||||
date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday,
|
||||
date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec,
|
||||
buffer);
|
||||
else
|
||||
fprintf (weechat_log_file, "%s", buffer);
|
||||
fflush (weechat_log_file);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_close: close log file
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_log_close ()
|
||||
{
|
||||
/* close log file */
|
||||
if (weechat_log_file)
|
||||
{
|
||||
#ifdef HAVE_FLOCK
|
||||
flock (fileno (weechat_log_file), LOCK_UN);
|
||||
#endif
|
||||
fclose (weechat_log_file);
|
||||
weechat_log_file = NULL;
|
||||
}
|
||||
|
||||
/* free filename */
|
||||
if (weechat_log_filename)
|
||||
{
|
||||
free (weechat_log_filename);
|
||||
weechat_log_filename = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* log_start: starts a log
|
||||
* weechat_log_crash_rename: rename log file when crashing
|
||||
*/
|
||||
|
||||
void
|
||||
log_start (t_gui_buffer *buffer)
|
||||
int
|
||||
weechat_log_crash_rename ()
|
||||
{
|
||||
char *old_name, *new_name;
|
||||
int length;
|
||||
char *log_path, *log_path2;
|
||||
|
||||
log_path = weechat_strreplace (cfg_log_path, "~", getenv ("HOME"));
|
||||
log_path2 = weechat_strreplace (log_path, "%h", weechat_home);
|
||||
if (!log_path || !log_path2)
|
||||
{
|
||||
weechat_log_printf (_("Not enough memory to write log file for a buffer\n"));
|
||||
if (log_path)
|
||||
free (log_path);
|
||||
if (log_path2)
|
||||
free (log_path2);
|
||||
return;
|
||||
}
|
||||
length = strlen (log_path2) + 64;
|
||||
if (SERVER(buffer))
|
||||
length += strlen (SERVER(buffer)->name);
|
||||
if (CHANNEL(buffer))
|
||||
length += strlen (CHANNEL(buffer)->name);
|
||||
|
||||
buffer->log_filename = (char *) malloc (length);
|
||||
if (!buffer->log_filename)
|
||||
{
|
||||
weechat_log_printf (_("Not enough memory to write log file for a buffer\n"));
|
||||
if (log_path)
|
||||
free (log_path);
|
||||
if (log_path2)
|
||||
free (log_path2);
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy (buffer->log_filename, log_path2);
|
||||
if (log_path)
|
||||
free (log_path);
|
||||
if (log_path2)
|
||||
free (log_path2);
|
||||
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (buffer->log_filename, DIR_SEPARATOR);
|
||||
|
||||
if (SERVER(buffer))
|
||||
{
|
||||
strcat (buffer->log_filename, SERVER(buffer)->name);
|
||||
strcat (buffer->log_filename, ".");
|
||||
}
|
||||
if (CHANNEL(buffer))
|
||||
{
|
||||
strcat (buffer->log_filename, CHANNEL(buffer)->name);
|
||||
strcat (buffer->log_filename, ".");
|
||||
}
|
||||
strcat (buffer->log_filename, "weechatlog");
|
||||
|
||||
buffer->log_file = fopen (buffer->log_filename, "a");
|
||||
if (!buffer->log_file)
|
||||
{
|
||||
weechat_log_printf (_("Unable to write log file for a buffer\n"));
|
||||
free (buffer->log_filename);
|
||||
return;
|
||||
}
|
||||
log_write (buffer, _("**** Beginning of log "));
|
||||
log_write_date (buffer);
|
||||
log_write (buffer, "****\n");
|
||||
}
|
||||
time_t time_now;
|
||||
struct tm *local_time;
|
||||
|
||||
/*
|
||||
* log_end: ends a log
|
||||
*/
|
||||
if (!weechat_log_filename)
|
||||
return 0;
|
||||
|
||||
old_name = strdup (weechat_log_filename);
|
||||
if (!old_name)
|
||||
return 0;
|
||||
|
||||
void
|
||||
log_end (t_gui_buffer *buffer)
|
||||
{
|
||||
if (buffer->log_file)
|
||||
weechat_log_close ();
|
||||
|
||||
length = strlen (weechat_home) + 128;
|
||||
new_name = (char *) malloc (length);
|
||||
if (new_name)
|
||||
{
|
||||
log_write (buffer, _("**** End of log "));
|
||||
log_write_date (buffer);
|
||||
log_write (buffer, "****\n");
|
||||
fclose (buffer->log_file);
|
||||
buffer->log_file = NULL;
|
||||
time_now = time (NULL);
|
||||
local_time = localtime (&time_now);
|
||||
snprintf (new_name, length,
|
||||
"%s/weechat_crash_%04d%02d%02d_%d.log",
|
||||
weechat_home,
|
||||
local_time->tm_year + 1900,
|
||||
local_time->tm_mon + 1,
|
||||
local_time->tm_mday,
|
||||
getpid());
|
||||
if (rename (old_name, new_name) == 0)
|
||||
{
|
||||
fprintf (stderr, "*** Full crash dump was saved to %s file.\n",
|
||||
new_name);
|
||||
weechat_log_open (new_name, "a");
|
||||
free (old_name);
|
||||
free (new_name);
|
||||
return 1;
|
||||
}
|
||||
free (new_name);
|
||||
}
|
||||
if (buffer->log_filename)
|
||||
free (buffer->log_filename);
|
||||
|
||||
free (old_name);
|
||||
weechat_log_open (NULL, "a");
|
||||
return 0;
|
||||
}
|
||||
|
||||
+6
-7
@@ -21,13 +21,12 @@
|
||||
#ifndef __WEECHAT_LOG_H
|
||||
#define __WEECHAT_LOG_H 1
|
||||
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
extern char *weechat_log_filename;
|
||||
extern FILE *weechat_log_file;
|
||||
|
||||
extern void log_write_date (t_gui_buffer *);
|
||||
extern void log_write_line (t_gui_buffer *, char *);
|
||||
extern void log_write (t_gui_buffer *, char *);
|
||||
extern void log_start (t_gui_buffer *);
|
||||
extern void log_end (t_gui_buffer *);
|
||||
extern void weechat_log_init ();
|
||||
extern void weechat_log_close ();
|
||||
extern void weechat_log_printf (char *, ...);
|
||||
extern int weechat_log_crash_rename ();
|
||||
|
||||
#endif /* log.h */
|
||||
|
||||
+58
-9
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "weechat.h"
|
||||
#include "session.h"
|
||||
#include "log.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -147,6 +148,7 @@ session_save_nick (FILE *file, t_irc_nick *nick)
|
||||
rc = rc && (session_write_str (file, SESSION_NICK_NICK, nick->nick));
|
||||
rc = rc && (session_write_int (file, SESSION_NICK_FLAGS, nick->flags));
|
||||
rc = rc && (session_write_int (file, SESSION_NICK_COLOR, nick->color));
|
||||
rc = rc && (session_write_str (file, SESSION_NICK_HOST, nick->host));
|
||||
rc = rc && (session_write_id (file, SESSION_NICK_END));
|
||||
return rc;
|
||||
}
|
||||
@@ -172,6 +174,9 @@ session_save_channel (FILE *file, t_irc_channel *channel)
|
||||
rc = rc && (session_write_int (file, SESSION_CHAN_NICKS_COUNT, channel->nicks_count));
|
||||
rc = rc && (session_write_int (file, SESSION_CHAN_CHECKING_AWAY, channel->checking_away));
|
||||
rc = rc && (session_write_str (file, SESSION_CHAN_AWAY_MESSAGE, channel->away_message));
|
||||
rc = rc && (session_write_int (file, SESSION_CHAN_CYCLE, channel->cycle));
|
||||
rc = rc && (session_write_int (file, SESSION_CHAN_CLOSE, channel->close));
|
||||
rc = rc && (session_write_int (file, SESSION_CHAN_DISPLAY_CREATION_DATE, channel->display_creation_date));
|
||||
rc = rc && (session_write_id (file, SESSION_CHAN_END));
|
||||
|
||||
if (!rc)
|
||||
@@ -223,6 +228,7 @@ session_save_servers (FILE *file)
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_NICK3, ptr_server->nick3));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_USERNAME, ptr_server->username));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_REALNAME, ptr_server->realname));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_HOSTNAME, ptr_server->hostname));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_COMMAND, ptr_server->command));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_COMMAND_DELAY, ptr_server->command_delay));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_AUTOJOIN, ptr_server->autojoin));
|
||||
@@ -249,9 +255,11 @@ session_save_servers (FILE *file)
|
||||
#endif
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_UNTERMINATED_MESSAGE, ptr_server->unterminated_message));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_NICK, ptr_server->nick));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_NICK_MODES, ptr_server->nick_modes));
|
||||
rc = rc && (session_write_buf (file, SESSION_SERV_RECONNECT_START, &(ptr_server->reconnect_start), sizeof (time_t)));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_RECONNECT_JOIN, ptr_server->reconnect_join));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_IS_AWAY, ptr_server->is_away));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_AWAY_MESSAGE, ptr_server->away_message));
|
||||
rc = rc && (session_write_buf (file, SESSION_SERV_AWAY_TIME, &(ptr_server->away_time), sizeof (time_t)));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_LAG, ptr_server->lag));
|
||||
rc = rc && (session_write_buf (file, SESSION_SERV_LAG_CHECK_TIME, &(ptr_server->lag_check_time), sizeof (struct timeval)));
|
||||
@@ -286,8 +294,8 @@ session_save_dcc (FILE *file)
|
||||
|
||||
rc = 1;
|
||||
|
||||
for (ptr_dcc = dcc_list; ptr_dcc;
|
||||
ptr_dcc = ptr_dcc->next_dcc)
|
||||
for (ptr_dcc = last_dcc; ptr_dcc;
|
||||
ptr_dcc = ptr_dcc->prev_dcc)
|
||||
{
|
||||
rc = rc && (session_write_id (file, SESSION_OBJ_DCC));
|
||||
rc = rc && (session_write_str (file, SESSION_DCC_SERVER, (ptr_dcc->server) ? ptr_dcc->server->name : NULL));
|
||||
@@ -314,6 +322,9 @@ session_save_dcc (FILE *file)
|
||||
rc = rc && (session_write_buf (file, SESSION_DCC_LAST_ACTIVITY, &(ptr_dcc->last_activity), sizeof (time_t)));
|
||||
rc = rc && (session_write_buf (file, SESSION_DCC_BYTES_PER_SEC, &(ptr_dcc->bytes_per_sec), sizeof (unsigned long)));
|
||||
rc = rc && (session_write_buf (file, SESSION_DCC_ETA, &(ptr_dcc->eta), sizeof (unsigned long)));
|
||||
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_PID, ptr_dcc->child_pid));
|
||||
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_READ, ptr_dcc->child_read));
|
||||
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_WRITE, ptr_dcc->child_write));
|
||||
rc = rc && (session_write_id (file, SESSION_DCC_END));
|
||||
|
||||
if (!rc)
|
||||
@@ -362,7 +373,9 @@ session_save_line (FILE *file, t_gui_line *line)
|
||||
rc = rc && (session_write_int (file, SESSION_LINE_WITH_MESSAGE, line->line_with_message));
|
||||
rc = rc && (session_write_int (file, SESSION_LINE_WITH_HIGHLIGHT, line->line_with_highlight));
|
||||
rc = rc && (session_write_str (file, SESSION_LINE_DATA, line->data));
|
||||
rc = rc && (session_write_int (file, SESSION_LINE_OFS_AFTER_DATE, line->ofs_after_date));
|
||||
rc = rc && (session_write_int (file, SESSION_LINE_OFS_AFTER_DATE, line->ofs_start_message));
|
||||
rc = rc && (session_write_int (file, SESSION_LINE_OFS_START_MESSAGE, line->ofs_start_message));
|
||||
rc = rc && (session_write_str (file, SESSION_LINE_NICK, line->nick));
|
||||
rc = rc && (session_write_id (file, SESSION_LINE_END));
|
||||
return rc;
|
||||
}
|
||||
@@ -466,7 +479,7 @@ session_crash (FILE *file, char *message, ...)
|
||||
va_end (argptr);
|
||||
|
||||
fclose (file);
|
||||
gui_end ();
|
||||
gui_main_end ();
|
||||
fprintf (stderr, "%s %s\n",
|
||||
WEECHAT_ERROR, buffer);
|
||||
fprintf (stderr,
|
||||
@@ -856,6 +869,9 @@ session_load_server (FILE *file)
|
||||
case SESSION_SERV_REALNAME:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->realname)));
|
||||
break;
|
||||
case SESSION_SERV_HOSTNAME:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->hostname)));
|
||||
break;
|
||||
case SESSION_SERV_COMMAND:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->command)));
|
||||
break;
|
||||
@@ -922,6 +938,9 @@ session_load_server (FILE *file)
|
||||
case SESSION_SERV_NICK:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->nick)));
|
||||
break;
|
||||
case SESSION_SERV_NICK_MODES:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->nick_modes)));
|
||||
break;
|
||||
case SESSION_SERV_RECONNECT_START:
|
||||
rc = rc && (session_read_buf (file, &(session_current_server->reconnect_start), sizeof (time_t)));
|
||||
break;
|
||||
@@ -931,6 +950,9 @@ session_load_server (FILE *file)
|
||||
case SESSION_SERV_IS_AWAY:
|
||||
rc = rc && (session_read_int (file, &(session_current_server->is_away)));
|
||||
break;
|
||||
case SESSION_SERV_AWAY_MESSAGE:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->away_message)));
|
||||
break;
|
||||
case SESSION_SERV_AWAY_TIME:
|
||||
rc = rc && (session_read_buf (file, &(session_current_server->away_time), sizeof (time_t)));
|
||||
break;
|
||||
@@ -1045,6 +1067,15 @@ session_load_channel (FILE *file)
|
||||
case SESSION_CHAN_AWAY_MESSAGE:
|
||||
rc = rc && (session_read_str (file, &(session_current_channel->away_message)));
|
||||
break;
|
||||
case SESSION_CHAN_CYCLE:
|
||||
rc = rc && (session_read_int (file, &(session_current_channel->cycle)));
|
||||
break;
|
||||
case SESSION_CHAN_CLOSE:
|
||||
rc = rc && (session_read_int (file, &(session_current_channel->close)));
|
||||
break;
|
||||
case SESSION_CHAN_DISPLAY_CREATION_DATE:
|
||||
rc = rc && (session_read_int (file, &(session_current_channel->display_creation_date)));
|
||||
break;
|
||||
default:
|
||||
weechat_log_printf (_("session: warning: ignoring value from "
|
||||
"channel (object id: %d)\n"));
|
||||
@@ -1112,6 +1143,9 @@ session_load_nick (FILE *file)
|
||||
case SESSION_NICK_COLOR:
|
||||
rc = rc && (session_read_int (file, &(nick->color)));
|
||||
break;
|
||||
case SESSION_NICK_HOST:
|
||||
rc = rc && (session_read_str (file, &(nick->host)));
|
||||
break;
|
||||
default:
|
||||
weechat_log_printf (_("session: warning: ignoring value from "
|
||||
"nick (object id: %d)\n"));
|
||||
@@ -1190,7 +1224,7 @@ session_load_dcc (FILE *file)
|
||||
return 0;
|
||||
if (string && string[0])
|
||||
{
|
||||
ptr_channel = channel_search (ptr_server, string);
|
||||
ptr_channel = channel_search_any (ptr_server, string);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
session_crash (file, _("channel not found for DCC"));
|
||||
@@ -1266,6 +1300,15 @@ session_load_dcc (FILE *file)
|
||||
case SESSION_DCC_ETA:
|
||||
rc = rc && (session_read_buf (file, &(dcc->eta), sizeof (unsigned long)));
|
||||
break;
|
||||
case SESSION_DCC_CHILD_PID:
|
||||
rc = rc && (session_read_int (file, &(dcc->child_pid)));
|
||||
break;
|
||||
case SESSION_DCC_CHILD_READ:
|
||||
rc = rc && (session_read_int (file, &(dcc->child_read)));
|
||||
break;
|
||||
case SESSION_DCC_CHILD_WRITE:
|
||||
rc = rc && (session_read_int (file, &(dcc->child_write)));
|
||||
break;
|
||||
default:
|
||||
weechat_log_printf (_("session: warning: ignoring value from "
|
||||
"DCC (object id: %d)\n"));
|
||||
@@ -1381,7 +1424,7 @@ session_load_buffer (FILE *file)
|
||||
|
||||
if (channel_name)
|
||||
{
|
||||
ptr_channel = channel_search (ptr_server, channel_name);
|
||||
ptr_channel = channel_search_any_without_buffer (ptr_server, channel_name);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
session_crash (file, _("channel not found for buffer"));
|
||||
@@ -1446,7 +1489,7 @@ session_load_line (FILE *file)
|
||||
}
|
||||
|
||||
/* allocate line */
|
||||
line = gui_line_new (session_current_buffer);
|
||||
line = gui_buffer_line_new (session_current_buffer);
|
||||
if (!line)
|
||||
{
|
||||
session_crash (file, _("can't create new line"));
|
||||
@@ -1489,6 +1532,12 @@ session_load_line (FILE *file)
|
||||
case SESSION_LINE_OFS_AFTER_DATE:
|
||||
rc = rc && (session_read_int (file, &(line->ofs_after_date)));
|
||||
break;
|
||||
case SESSION_LINE_OFS_START_MESSAGE:
|
||||
rc = rc && (session_read_int (file, &(line->ofs_start_message)));
|
||||
break;
|
||||
case SESSION_LINE_NICK:
|
||||
rc = rc && (session_read_str (file, &(line->nick)));
|
||||
break;
|
||||
default:
|
||||
weechat_log_printf (_("session: warning: ignoring value from "
|
||||
"line (object id: %d)\n"));
|
||||
@@ -1661,8 +1710,8 @@ session_load (char *filename)
|
||||
ptr_server->buffer = gui_buffers;
|
||||
}
|
||||
|
||||
gui_switch_to_buffer (gui_windows, gui_buffers);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
gui_window_switch_to_buffer (gui_windows, gui_buffers);
|
||||
gui_window_redraw_buffer (gui_current_window->buffer);
|
||||
|
||||
fclose (file);
|
||||
|
||||
|
||||
+17
-5
@@ -88,7 +88,10 @@ enum t_session_server
|
||||
SESSION_SERV_LAG_NEXT_CHECK,
|
||||
SESSION_SERV_CHARSET_DECODE_ISO,
|
||||
SESSION_SERV_CHARSET_DECODE_UTF,
|
||||
SESSION_SERV_CHARSET_ENCODE
|
||||
SESSION_SERV_CHARSET_ENCODE,
|
||||
SESSION_SERV_HOSTNAME,
|
||||
SESSION_SERV_NICK_MODES,
|
||||
SESSION_SERV_AWAY_MESSAGE
|
||||
};
|
||||
|
||||
enum t_session_channel
|
||||
@@ -102,7 +105,10 @@ enum t_session_channel
|
||||
SESSION_CHAN_KEY,
|
||||
SESSION_CHAN_NICKS_COUNT,
|
||||
SESSION_CHAN_CHECKING_AWAY,
|
||||
SESSION_CHAN_AWAY_MESSAGE
|
||||
SESSION_CHAN_AWAY_MESSAGE,
|
||||
SESSION_CHAN_CYCLE,
|
||||
SESSION_CHAN_CLOSE,
|
||||
SESSION_CHAN_DISPLAY_CREATION_DATE
|
||||
};
|
||||
|
||||
enum t_session_nick
|
||||
@@ -110,7 +116,8 @@ enum t_session_nick
|
||||
SESSION_NICK_END = 0,
|
||||
SESSION_NICK_NICK,
|
||||
SESSION_NICK_FLAGS,
|
||||
SESSION_NICK_COLOR
|
||||
SESSION_NICK_COLOR,
|
||||
SESSION_NICK_HOST
|
||||
};
|
||||
|
||||
enum t_session_dcc
|
||||
@@ -139,7 +146,10 @@ enum t_session_dcc
|
||||
SESSION_DCC_LAST_CHECK_POS,
|
||||
SESSION_DCC_LAST_ACTIVITY,
|
||||
SESSION_DCC_BYTES_PER_SEC,
|
||||
SESSION_DCC_ETA
|
||||
SESSION_DCC_ETA,
|
||||
SESSION_DCC_CHILD_PID,
|
||||
SESSION_DCC_CHILD_READ,
|
||||
SESSION_DCC_CHILD_WRITE
|
||||
};
|
||||
|
||||
enum t_session_history
|
||||
@@ -166,7 +176,9 @@ enum t_session_line
|
||||
SESSION_LINE_WITH_MESSAGE,
|
||||
SESSION_LINE_WITH_HIGHLIGHT,
|
||||
SESSION_LINE_DATA,
|
||||
SESSION_LINE_OFS_AFTER_DATE
|
||||
SESSION_LINE_OFS_AFTER_DATE,
|
||||
SESSION_LINE_OFS_START_MESSAGE,
|
||||
SESSION_LINE_NICK
|
||||
};
|
||||
|
||||
enum t_session_uptime
|
||||
|
||||
+47
-7
@@ -24,7 +24,15 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define __USE_XOPEN
|
||||
|
||||
#if defined(__OpenBSD__)
|
||||
#include <utf8/wchar.h>
|
||||
#else
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
#include "weechat.h"
|
||||
#include "utf8.h"
|
||||
@@ -62,7 +70,7 @@ utf8_init ()
|
||||
int
|
||||
utf8_is_valid (char *string)
|
||||
{
|
||||
while (string[0])
|
||||
while (string && string[0])
|
||||
{
|
||||
/* UTF-8, 2 bytes, should be: 110vvvvv 10vvvvvv */
|
||||
if (((unsigned char)(string[0]) & 0xE0) == 0xC0)
|
||||
@@ -216,7 +224,7 @@ utf8_strlen (char *string)
|
||||
return strlen (string);
|
||||
|
||||
length = 0;
|
||||
while (string[0])
|
||||
while (string && string[0])
|
||||
{
|
||||
string = utf8_next_char (string);
|
||||
length++;
|
||||
@@ -225,7 +233,7 @@ utf8_strlen (char *string)
|
||||
}
|
||||
|
||||
/*
|
||||
* utf8_strlen: return length of an UTF-8 string, for N bytes
|
||||
* utf8_strnlen: return length of an UTF-8 string, for N bytes
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -247,7 +255,7 @@ utf8_strnlen (char *string, int bytes)
|
||||
|
||||
start = string;
|
||||
length = 0;
|
||||
while (string[0] && (string - start < bytes))
|
||||
while (string && string[0] && (string - start < bytes))
|
||||
{
|
||||
string = utf8_next_char (string);
|
||||
length++;
|
||||
@@ -255,6 +263,38 @@ utf8_strnlen (char *string, int bytes)
|
||||
return length;
|
||||
}
|
||||
|
||||
/*
|
||||
* utf8_width_screen: return number of chars needed on screen to display UTF-8 string
|
||||
*/
|
||||
|
||||
int
|
||||
utf8_width_screen (char *string)
|
||||
{
|
||||
int length, num_char;
|
||||
wchar_t *wstring;
|
||||
|
||||
if (!string)
|
||||
return 0;
|
||||
|
||||
if (!local_utf8)
|
||||
return strlen (string);
|
||||
|
||||
num_char = mbstowcs (NULL, string, 0) + 1;
|
||||
wstring = (wchar_t *) malloc ((num_char + 1) * sizeof (wchar_t));
|
||||
if (!wstring)
|
||||
return utf8_strlen (string);
|
||||
|
||||
if (mbstowcs (wstring, string, num_char) == (size_t)(-1))
|
||||
{
|
||||
free (wstring);
|
||||
return utf8_strlen (string);
|
||||
}
|
||||
|
||||
length = wcswidth (wstring, num_char);
|
||||
free (wstring);
|
||||
return length;
|
||||
}
|
||||
|
||||
/*
|
||||
* utf8_add_offset: moves forward N chars in an UTF-8 string
|
||||
*/
|
||||
@@ -271,7 +311,7 @@ utf8_add_offset (char *string, int offset)
|
||||
return string + offset;
|
||||
|
||||
count = 0;
|
||||
while (string[0] && (count < offset))
|
||||
while (string && string[0] && (count < offset))
|
||||
{
|
||||
string = utf8_next_char (string);
|
||||
count++;
|
||||
@@ -295,7 +335,7 @@ utf8_real_pos (char *string, int pos)
|
||||
|
||||
count = 0;
|
||||
real_pos = 0;
|
||||
while (string[0] && (count < pos))
|
||||
while (string && string[0] && (count < pos))
|
||||
{
|
||||
next_char = utf8_next_char (string);
|
||||
real_pos += (next_char - string);
|
||||
@@ -321,7 +361,7 @@ utf8_pos (char *string, int real_pos)
|
||||
|
||||
count = 0;
|
||||
limit = string + real_pos;
|
||||
while (string[0] && (string < limit))
|
||||
while (string && string[0] && (string < limit))
|
||||
{
|
||||
string = utf8_next_char (string);
|
||||
count++;
|
||||
|
||||
@@ -30,6 +30,7 @@ extern char *utf8_next_char (char *);
|
||||
extern int utf8_char_size (char *);
|
||||
extern int utf8_strlen (char *);
|
||||
extern int utf8_strnlen (char *, int);
|
||||
extern int utf8_width_screen (char *);
|
||||
extern char *utf8_add_offset (char *, int);
|
||||
extern int utf8_real_pos (char *, int);
|
||||
extern int utf8_pos (char *, int);
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* util.c: some useful functions for WeeChat */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
#include "weechat.h"
|
||||
#include "weeconfig.h"
|
||||
|
||||
|
||||
/*
|
||||
* ascii_tolower: locale independant string conversion to lower case
|
||||
*/
|
||||
|
||||
void
|
||||
ascii_tolower (char *string)
|
||||
{
|
||||
while (string && string[0])
|
||||
{
|
||||
if ((string[0] >= 'A') && (string[0] <= 'Z'))
|
||||
string[0] += ('a' - 'A');
|
||||
string++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ascii_toupper: locale independant string conversion to upper case
|
||||
*/
|
||||
|
||||
void
|
||||
ascii_toupper (char *string)
|
||||
{
|
||||
while (string && string[0])
|
||||
{
|
||||
if ((string[0] >= 'a') && (string[0] <= 'z'))
|
||||
string[0] -= ('a' - 'A');
|
||||
string++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ascii_strcasecmp: locale and case independent string comparison
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strcasecmp (char *string1, char *string2)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
while (string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
}
|
||||
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* ascii_strncasecmp: locale and case independent string comparison
|
||||
* with max length
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strncasecmp (char *string1, char *string2, int max)
|
||||
{
|
||||
int c1, c2, count;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
count = 0;
|
||||
while ((count < max) && string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count >= max)
|
||||
return 0;
|
||||
else
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* ascii_strcasestr: locale and case independent string search
|
||||
*/
|
||||
|
||||
char *
|
||||
ascii_strcasestr (char *string, char *search)
|
||||
{
|
||||
int length_search;
|
||||
|
||||
length_search = strlen (search);
|
||||
|
||||
if (!string || !search || (length_search == 0))
|
||||
return NULL;
|
||||
|
||||
while (string[0])
|
||||
{
|
||||
if (ascii_strncasecmp (string, search, length_search) == 0)
|
||||
return string;
|
||||
|
||||
string++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_iconv: convert string to another charset
|
||||
*/
|
||||
|
||||
char *
|
||||
weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
{
|
||||
char *outbuf;
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
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]
|
||||
&& (ascii_strcasecmp(from_code, to_code) != 0))
|
||||
{
|
||||
cd = iconv_open (to_code, from_code);
|
||||
if (cd == (iconv_t)(-1))
|
||||
outbuf = strdup (string);
|
||||
else
|
||||
{
|
||||
inbuf = strdup (string);
|
||||
ptr_inbuf = inbuf;
|
||||
inbytesleft = strlen (inbuf);
|
||||
outbytesleft = inbytesleft * 4;
|
||||
outbuf = (char *) malloc (outbytesleft + 2);
|
||||
ptr_outbuf = outbuf;
|
||||
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
|
||||
if (inbytesleft != 0)
|
||||
{
|
||||
free (outbuf);
|
||||
outbuf = strdup (string);
|
||||
}
|
||||
else
|
||||
ptr_outbuf[0] = '\0';
|
||||
free (inbuf);
|
||||
iconv_close (cd);
|
||||
}
|
||||
}
|
||||
else
|
||||
outbuf = strdup (string);
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) from_code;
|
||||
(void) to_code;
|
||||
outbuf = strdup (string);
|
||||
#endif /* HAVE_ICONV */
|
||||
|
||||
return outbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_iconv_check: check a charset
|
||||
* if a charset is NULL, internal charset is used
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_iconv_check (char *from_code, char *to_code)
|
||||
{
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
|
||||
if (!from_code || !from_code[0])
|
||||
from_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset;
|
||||
|
||||
if (!to_code || !to_code[0])
|
||||
to_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset;
|
||||
|
||||
cd = iconv_open (to_code, from_code);
|
||||
if (cd == (iconv_t)(-1))
|
||||
return 0;
|
||||
iconv_close (cd);
|
||||
return 1;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_strreplace: replace a string by new one in a string
|
||||
* note: returned value has to be free() after use
|
||||
*/
|
||||
|
||||
char *
|
||||
weechat_strreplace (char *string, char *search, char *replace)
|
||||
{
|
||||
char *pos, *new_string;
|
||||
int length1, length2, length_new, count;
|
||||
|
||||
if (!string || !search || !replace)
|
||||
return NULL;
|
||||
|
||||
length1 = strlen (search);
|
||||
length2 = strlen (replace);
|
||||
|
||||
/* count number of strings to replace */
|
||||
count = 0;
|
||||
pos = string;
|
||||
while (pos && pos[0] && (pos = strstr (pos, search)))
|
||||
{
|
||||
count++;
|
||||
pos += length1;
|
||||
}
|
||||
|
||||
/* easy: no string to replace! */
|
||||
if (count == 0)
|
||||
return strdup (string);
|
||||
|
||||
/* compute needed memory for new string */
|
||||
length_new = strlen (string) - (count * length1) + (count * length2) + 1;
|
||||
|
||||
/* allocate new string */
|
||||
new_string = (char *)malloc (length_new * sizeof (char));
|
||||
if (!new_string)
|
||||
return strdup (string);
|
||||
|
||||
/* replace all occurences */
|
||||
new_string[0] = '\0';
|
||||
while (string && string[0])
|
||||
{
|
||||
pos = strstr (string, search);
|
||||
if (pos)
|
||||
{
|
||||
strncat (new_string, string, pos - string);
|
||||
strcat (new_string, replace);
|
||||
pos += length1;
|
||||
}
|
||||
else
|
||||
strcat (new_string, string);
|
||||
string = pos;
|
||||
}
|
||||
return new_string;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_timeval_diff: calculates difference between two times (return in milliseconds)
|
||||
*/
|
||||
|
||||
long
|
||||
get_timeval_diff (struct timeval *tv1, struct timeval *tv2)
|
||||
{
|
||||
long diff_sec, diff_usec;
|
||||
|
||||
diff_sec = tv2->tv_sec - tv1->tv_sec;
|
||||
diff_usec = tv2->tv_usec - tv1->tv_usec;
|
||||
|
||||
if (diff_usec < 0)
|
||||
{
|
||||
diff_usec += 1000000;
|
||||
diff_sec--;
|
||||
}
|
||||
return ((diff_usec / 1000) + (diff_sec * 1000));
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_UTIL_H
|
||||
#define __WEECHAT_UTIL_H 1
|
||||
|
||||
extern void ascii_tolower (char *);
|
||||
extern void ascii_toupper (char *);
|
||||
extern int ascii_strcasecmp (char *, char *);
|
||||
extern int ascii_strncasecmp (char *, char *, int);
|
||||
extern char *ascii_strcasestr (char *, char *);
|
||||
extern char *weechat_iconv (char *, char *, char *);
|
||||
extern int weechat_iconv_check (char *, char *);
|
||||
extern char *weechat_strreplace (char *, char *, char *);
|
||||
extern long get_timeval_diff (struct timeval *, struct timeval *);
|
||||
|
||||
#endif /* util.h */
|
||||
+63
-310
@@ -42,7 +42,6 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
@@ -52,20 +51,19 @@
|
||||
#include <gnutls/gnutls.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "weechat.h"
|
||||
#include "weeconfig.h"
|
||||
#include "backtrace.h"
|
||||
#include "command.h"
|
||||
#include "fifo.h"
|
||||
#include "utf8.h"
|
||||
#include "log.h"
|
||||
#include "session.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -74,270 +72,24 @@
|
||||
#endif
|
||||
|
||||
|
||||
char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0]) */
|
||||
char *weechat_session = NULL; /* WeeChat session file (for /upgrade command) */
|
||||
time_t weechat_start_time; /* WeeChat start time (used by /uptime command) */
|
||||
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
|
||||
int sigsegv = 0; /* SIGSEGV received? */
|
||||
char *weechat_home = NULL; /* WeeChat home dir. (example: /home/toto/.weechat) */
|
||||
FILE *weechat_log_file = NULL; /* WeeChat log file (~/.weechat/weechat.log) */
|
||||
char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0]) */
|
||||
char *weechat_session = NULL; /* WeeChat session file (for /upgrade cmd) */
|
||||
time_t weechat_start_time; /* WeeChat start time (used by /uptime cmd) */
|
||||
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
|
||||
int sigsegv = 0; /* SIGSEGV received? */
|
||||
char *weechat_home = NULL; /* WeeChat home dir. (default: ~/.weechat) */
|
||||
|
||||
char *local_charset = NULL; /* local charset, for example: ISO-8859-1, UTF-8 */
|
||||
char *local_charset = NULL; /* local charset, for ex.: ISO-8859-1, UTF-8 */
|
||||
|
||||
int server_cmd_line; /* at least one server on WeeChat command line */
|
||||
int auto_connect; /* enabled by default, can by disabled on cmd line */
|
||||
int auto_load_plugins; /* enabled by default, can by disabled on cmd line */
|
||||
int server_cmd_line; /* at least 1 server on WeeChat command line */
|
||||
int auto_connect; /* enabled by default (cmd option to disable) */
|
||||
int auto_load_plugins; /* enabled by default (cmd option to disable) */
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* ascii_strcasecmp: locale and case independent string comparison
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strcasecmp (char *string1, char *string2)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
while (string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
}
|
||||
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* ascii_strncasecmp: locale and case independent string comparison
|
||||
* with max length
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strncasecmp (char *string1, char *string2, int max)
|
||||
{
|
||||
int c1, c2, count;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
count = 0;
|
||||
while ((count < max) && string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count >= max)
|
||||
return 0;
|
||||
else
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_printf: displays a message in WeeChat log (<weechat_home>/weechat.log)
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_log_printf (char *message, ...)
|
||||
{
|
||||
static char buffer[4096];
|
||||
char *ptr_buffer;
|
||||
va_list argptr;
|
||||
static time_t seconds;
|
||||
struct tm *date_tmp;
|
||||
|
||||
if (!weechat_log_file)
|
||||
return;
|
||||
|
||||
va_start (argptr, message);
|
||||
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
/* keep only valid chars */
|
||||
ptr_buffer = buffer;
|
||||
while (ptr_buffer[0])
|
||||
{
|
||||
if ((ptr_buffer[0] != '\n')
|
||||
&& (ptr_buffer[0] != '\r')
|
||||
&& ((unsigned char)(ptr_buffer[0]) < 32))
|
||||
ptr_buffer[0] = '.';
|
||||
ptr_buffer++;
|
||||
}
|
||||
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
if (date_tmp)
|
||||
fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s",
|
||||
date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday,
|
||||
date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec,
|
||||
buffer);
|
||||
else
|
||||
fprintf (weechat_log_file, "%s", buffer);
|
||||
fflush (weechat_log_file);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_iconv: convert string to another charset
|
||||
*/
|
||||
|
||||
char *
|
||||
weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
{
|
||||
char *outbuf;
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
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]
|
||||
&& (ascii_strcasecmp(from_code, to_code) != 0))
|
||||
{
|
||||
cd = iconv_open (to_code, from_code);
|
||||
if (cd == (iconv_t)(-1))
|
||||
outbuf = strdup (string);
|
||||
else
|
||||
{
|
||||
inbuf = strdup (string);
|
||||
ptr_inbuf = inbuf;
|
||||
inbytesleft = strlen (inbuf);
|
||||
outbytesleft = inbytesleft * 4;
|
||||
outbuf = (char *) malloc (outbytesleft + 2);
|
||||
ptr_outbuf = outbuf;
|
||||
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
|
||||
if (inbytesleft != 0)
|
||||
{
|
||||
free (outbuf);
|
||||
outbuf = strdup (string);
|
||||
}
|
||||
else
|
||||
ptr_outbuf[0] = '\0';
|
||||
free (inbuf);
|
||||
iconv_close (cd);
|
||||
}
|
||||
}
|
||||
else
|
||||
outbuf = strdup (string);
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) from_code;
|
||||
(void) to_code;
|
||||
outbuf = strdup (string);
|
||||
#endif /* HAVE_ICONV */
|
||||
|
||||
return outbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_strreplace: replace a string by new one in a string
|
||||
* note: returned value has to be free() after use
|
||||
*/
|
||||
|
||||
char *
|
||||
weechat_strreplace (char *string, char *search, char *replace)
|
||||
{
|
||||
char *pos, *new_string;
|
||||
int length1, length2, length_new, count;
|
||||
|
||||
if (!string || !search || !replace)
|
||||
return NULL;
|
||||
|
||||
length1 = strlen (search);
|
||||
length2 = strlen (replace);
|
||||
|
||||
/* count number of strings to replace */
|
||||
count = 0;
|
||||
pos = string;
|
||||
while (pos && pos[0] && (pos = strstr (pos, search)))
|
||||
{
|
||||
count++;
|
||||
pos += length1;
|
||||
}
|
||||
|
||||
/* easy: no string to replace! */
|
||||
if (count == 0)
|
||||
return strdup (string);
|
||||
|
||||
/* compute needed memory for new string */
|
||||
length_new = strlen (string) - (count * length1) + (count * length2) + 1;
|
||||
|
||||
/* allocate new string */
|
||||
new_string = (char *)malloc (length_new * sizeof (char));
|
||||
if (!new_string)
|
||||
return strdup (string);
|
||||
|
||||
/* replace all occurences */
|
||||
new_string[0] = '\0';
|
||||
while (string && string[0])
|
||||
{
|
||||
pos = strstr (string, search);
|
||||
if (pos)
|
||||
{
|
||||
strncat (new_string, string, pos - string);
|
||||
strcat (new_string, replace);
|
||||
pos += length1;
|
||||
}
|
||||
else
|
||||
strcat (new_string, string);
|
||||
string = pos;
|
||||
}
|
||||
return new_string;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_timeval_diff: calculates difference between two times (return in milliseconds)
|
||||
*/
|
||||
|
||||
long
|
||||
get_timeval_diff (struct timeval *tv1, struct timeval *tv2)
|
||||
{
|
||||
long diff_sec, diff_usec;
|
||||
|
||||
diff_sec = tv2->tv_sec - tv1->tv_sec;
|
||||
diff_usec = tv2->tv_usec - tv1->tv_usec;
|
||||
|
||||
if (diff_usec < 0)
|
||||
{
|
||||
diff_usec += 1000000;
|
||||
diff_sec--;
|
||||
}
|
||||
return ((diff_usec / 1000) + (diff_sec * 1000));
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_display_usage: display WeeChat usage
|
||||
*/
|
||||
@@ -534,10 +286,10 @@ weechat_display_keys ()
|
||||
printf ("\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
|
||||
printf ("* %s => %s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
(ptr_key->function) ? gui_key_function_search_by_ptr (ptr_key->function) : ptr_key->command);
|
||||
(ptr_key->function) ? gui_keyboard_function_search_by_ptr (ptr_key->function) : ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
@@ -657,8 +409,9 @@ weechat_parse_args (int argc, char *argv[])
|
||||
server_tmp.ipv6, server_tmp.ssl,
|
||||
server_tmp.password, server_tmp.nick1,
|
||||
server_tmp.nick2, server_tmp.nick3,
|
||||
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL,
|
||||
NULL, NULL, NULL))
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
server_tmp.autojoin, 1, NULL, NULL,
|
||||
NULL, NULL))
|
||||
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
server_destroy (&server_tmp);
|
||||
@@ -705,6 +458,7 @@ weechat_create_home_dirs ()
|
||||
{
|
||||
char *ptr_home;
|
||||
int dir_length;
|
||||
struct stat statinfo;
|
||||
|
||||
if (!weechat_home)
|
||||
{
|
||||
@@ -727,6 +481,17 @@ weechat_create_home_dirs ()
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
}
|
||||
|
||||
/* if home already exists, it has to be a directory */
|
||||
if (stat (weechat_home, &statinfo) == 0)
|
||||
{
|
||||
if (!S_ISDIR (statinfo.st_mode))
|
||||
{
|
||||
fprintf (stderr, _("%s home (%s) is not a directory\n"),
|
||||
WEECHAT_ERROR, weechat_home);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* create home directory; error is fatal */
|
||||
if (!weechat_create_dir (weechat_home))
|
||||
@@ -801,27 +566,6 @@ weechat_init_vars ()
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_init_log: initialize log file
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_init_log ()
|
||||
{
|
||||
int filename_length;
|
||||
char *filename;
|
||||
|
||||
filename_length = strlen (weechat_home) + 64;
|
||||
filename =
|
||||
(char *) malloc (filename_length * sizeof (char));
|
||||
snprintf (filename, filename_length, "%s/" WEECHAT_LOG_NAME, weechat_home);
|
||||
if ((weechat_log_file = fopen (filename, "wt")) == NULL)
|
||||
fprintf (stderr,
|
||||
_("%s unable to create/append to log file (%s/%s)"),
|
||||
WEECHAT_WARNING, weechat_home, WEECHAT_LOG_NAME);
|
||||
free (filename);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_config_read: read WeeChat config file
|
||||
*/
|
||||
@@ -907,8 +651,7 @@ weechat_shutdown (int return_code, int crash)
|
||||
fifo_remove ();
|
||||
if (weechat_home)
|
||||
free (weechat_home);
|
||||
if (weechat_log_file)
|
||||
fclose (weechat_log_file);
|
||||
weechat_log_close ();
|
||||
if (local_charset)
|
||||
free (local_charset);
|
||||
alias_free_all ();
|
||||
@@ -925,7 +668,7 @@ weechat_shutdown (int return_code, int crash)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_dump writes dump to WeeChat log file
|
||||
* weechat_dump: write dump to WeeChat log file
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -934,7 +677,6 @@ weechat_dump (int crash)
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
t_irc_dcc *ptr_dcc;
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
@@ -981,11 +723,9 @@ weechat_dump (int crash)
|
||||
}
|
||||
}
|
||||
|
||||
weechat_log_printf ("\n");
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
dcc_print_log (ptr_dcc);
|
||||
}
|
||||
dcc_print_log ();
|
||||
|
||||
gui_panel_print_log ();
|
||||
|
||||
weechat_log_printf ("\n");
|
||||
weechat_log_printf ("[windows/buffers]\n");
|
||||
@@ -1012,7 +752,7 @@ weechat_dump (int crash)
|
||||
weechat_log_printf ("\n");
|
||||
gui_buffer_print_log (ptr_buffer);
|
||||
}
|
||||
|
||||
|
||||
weechat_log_printf ("\n");
|
||||
ignore_print_log ();
|
||||
|
||||
@@ -1031,13 +771,25 @@ weechat_sigsegv ()
|
||||
weechat_dump (1);
|
||||
dcc_end ();
|
||||
server_free_all ();
|
||||
gui_end ();
|
||||
gui_main_end ();
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "*** Very bad! WeeChat has crashed (SIGSEGV received)\n");
|
||||
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file\n", weechat_home);
|
||||
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
|
||||
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
|
||||
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
|
||||
fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
|
||||
if (!weechat_log_crash_rename ())
|
||||
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
|
||||
weechat_home);
|
||||
fprintf (stderr, "***\n");
|
||||
fprintf (stderr, "*** Please help WeeChat developers to fix this bug:\n");
|
||||
fprintf (stderr, "*** 1. If you have a core file, please run: gdb weechat-curses core\n");
|
||||
fprintf (stderr, "*** then issue \"bt\" command and send result to developers\n");
|
||||
fprintf (stderr, "*** To enable core files with bash shell: ulimit -c 10000\n");
|
||||
fprintf (stderr, "*** 2. Otherwise send backtrace (below) and weechat.log\n");
|
||||
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
|
||||
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
|
||||
|
||||
weechat_backtrace ();
|
||||
|
||||
/* shutdown with error code */
|
||||
weechat_shutdown (EXIT_FAILURE, 1);
|
||||
}
|
||||
|
||||
@@ -1062,17 +814,17 @@ main (int argc, char *argv[])
|
||||
signal (SIGQUIT, SIG_IGN); /* ignore SIGQUIT signal */
|
||||
signal (SIGPIPE, SIG_IGN); /* ignore SIGPIPE signal */
|
||||
signal (SIGSEGV, weechat_sigsegv); /* crash dump when SIGSEGV received */
|
||||
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
|
||||
gui_main_pre_init (&argc, &argv); /* pre-initiliaze interface */
|
||||
weechat_init_vars (); /* initialize some variables */
|
||||
gui_key_init (); /* init keyb. (default key bindings)*/
|
||||
gui_keyboard_init (); /* init keyb. (default key bindings)*/
|
||||
weechat_parse_args (argc, argv); /* parse command line args */
|
||||
weechat_create_home_dirs (); /* create WeeChat directories */
|
||||
weechat_init_log (); /* init log file */
|
||||
weechat_log_init (); /* init log file */
|
||||
command_index_build (); /* build cmd index for completion */
|
||||
weechat_config_read (); /* read configuration */
|
||||
weechat_create_config_dirs (); /* create config directories */
|
||||
utf8_init (); /* init UTF-8 in WeeChat */
|
||||
gui_init (); /* init WeeChat interface */
|
||||
gui_main_init (); /* init WeeChat interface */
|
||||
fifo_create (); /* FIFO pipe for remote control */
|
||||
if (weechat_session)
|
||||
session_load (weechat_session); /* load previous session if asked */
|
||||
@@ -1090,11 +842,12 @@ main (int argc, char *argv[])
|
||||
plugin_end (); /* end plugin interface(s) */
|
||||
#endif
|
||||
server_disconnect_all (); /* disconnect from all servers */
|
||||
(void) config_write (NULL); /* save config file */
|
||||
if (cfg_look_save_on_exit)
|
||||
(void) config_write (NULL); /* save config file */
|
||||
command_index_free (); /* free commands index */
|
||||
dcc_end (); /* remove all DCC */
|
||||
server_free_all (); /* free all servers */
|
||||
gui_end (); /* shut down WeeChat GUI */
|
||||
gui_main_end (); /* shut down WeeChat GUI */
|
||||
weechat_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
|
||||
@@ -98,20 +98,13 @@ extern char *weechat_argv0;
|
||||
extern time_t weechat_start_time;
|
||||
extern int quit_weechat;
|
||||
extern char *weechat_home;
|
||||
extern FILE *weechat_log_file;
|
||||
extern char *local_charset;
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
extern gnutls_certificate_credentials gnutls_xcred;
|
||||
#endif
|
||||
|
||||
extern int ascii_strcasecmp (char *, char *);
|
||||
extern int ascii_strncasecmp (char *, char *, int);
|
||||
extern void weechat_log_printf (char *, ...);
|
||||
extern char *weechat_iconv (char *, char *, char *);
|
||||
extern char *weechat_strreplace (char *, char *, char *);
|
||||
extern void weechat_dump (int);
|
||||
extern long get_timeval_diff (struct timeval *, struct timeval *);
|
||||
extern void weechat_shutdown (int, int);
|
||||
|
||||
#endif /* weechat.h */
|
||||
|
||||
+123
-42
@@ -41,6 +41,7 @@
|
||||
#include "fifo.h"
|
||||
#include "log.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -64,6 +65,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
|
||||
|
||||
/* config, look & feel section */
|
||||
|
||||
int cfg_look_save_on_exit;
|
||||
int cfg_look_set_title;
|
||||
int cfg_look_startup_logo;
|
||||
int cfg_look_startup_version;
|
||||
@@ -87,7 +89,15 @@ int cfg_look_nicklist_max_size;
|
||||
int cfg_look_nickmode;
|
||||
int cfg_look_nickmode_empty;
|
||||
char *cfg_look_no_nickname;
|
||||
char *cfg_look_completor;
|
||||
char *cfg_look_nick_prefix;
|
||||
char *cfg_look_nick_suffix;
|
||||
int cfg_look_align_nick;
|
||||
char *cfg_look_align_nick_values[] =
|
||||
{ "none", "left", "right", NULL };
|
||||
int cfg_look_align_other;
|
||||
int cfg_look_align_size;
|
||||
int cfg_look_align_size_max;
|
||||
char *cfg_look_nick_completor;
|
||||
char *cfg_look_nick_completion_ignore;
|
||||
int cfg_look_nick_complete_first;
|
||||
int cfg_look_infobar;
|
||||
@@ -100,9 +110,14 @@ int cfg_look_hotlist_names_length;
|
||||
int cfg_look_day_change;
|
||||
char *cfg_look_day_change_timestamp;
|
||||
char *cfg_look_read_marker;
|
||||
char *cfg_look_input_format;
|
||||
|
||||
t_config_option weechat_options_look[] =
|
||||
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name and version"),
|
||||
{ { "look_save_on_exit", N_("save config file on exit"),
|
||||
N_("save config file on exit"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_save_on_exit, NULL, config_change_save_on_exit },
|
||||
{ "look_set_title", N_("set title for window (terminal for Curses GUI) with name and version"),
|
||||
N_("set title for window (terminal for Curses GUI) with name and version"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_set_title, NULL, config_change_title },
|
||||
@@ -120,16 +135,16 @@ t_config_option weechat_options_look[] =
|
||||
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, config_change_noop },
|
||||
{ "look_charset_decode_iso", N_("ISO charset for decoding messages from server (used only if locale is UTF-8)"),
|
||||
N_("ISO charset for decoding messages from server (used only if locale is UTF-8) "
|
||||
"(if empty, messages are not converted if locale is UTF-8"),
|
||||
"(if empty, messages are not converted if locale is UTF-8)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"ISO-8859-1", NULL, NULL, &cfg_look_charset_decode_iso, config_change_charset },
|
||||
{ "look_charset_decode_utf", N_("UTF charset for decoding messages from server (used only if locale is not UTF-8)"),
|
||||
N_("UTF charset for decoding messages from server (used only if locale is not UTF-8) "
|
||||
"(if empty, messages are not converted if locale is not UTF-8"),
|
||||
"(if empty, messages are not converted if locale is not UTF-8)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"UTF-8", NULL, NULL, &cfg_look_charset_decode_utf, config_change_charset },
|
||||
{ "look_charset_encode", N_("charset for encoding messages sent to server"),
|
||||
N_("charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, messages are not converted)"),
|
||||
N_("charset for encoding messages sent to server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_look_charset_encode, config_change_charset },
|
||||
{ "look_charset_internal", N_("forces internal WeeChat charset (should be empty in most cases)"),
|
||||
@@ -190,10 +205,35 @@ t_config_option weechat_options_look[] =
|
||||
N_("display space if nick mode is not (half)op/voice"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_look_nickmode_empty, NULL, config_change_buffers },
|
||||
{ "look_nick_prefix", N_("text to display before nick in chat window"),
|
||||
N_("text to display before nick in chat window"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_look_nick_prefix, config_change_noop },
|
||||
{ "look_nick_suffix", N_("text to display after nick in chat window"),
|
||||
N_("text to display after nick in chat window"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
" |", NULL, NULL, &cfg_look_nick_suffix, config_change_noop },
|
||||
{ "look_align_nick", N_("nick alignment (fixed size for nicks in chat window)"),
|
||||
N_("nick alignment (fixed size for nicks in chat window (none, left, right))"),
|
||||
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
|
||||
"right", cfg_look_align_nick_values, &cfg_look_align_nick, NULL, config_change_noop },
|
||||
{ "look_align_other", N_("alignment for other messages (not beginning with a nick)"),
|
||||
N_("alignment for other messages (not beginning with a nick)"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_align_other, NULL, config_change_noop },
|
||||
{ "look_align_size", N_("size for aligning nick and other messages"),
|
||||
N_("size for aligning nick and other messages"),
|
||||
OPTION_TYPE_INT, 8, 64, 14,
|
||||
NULL, NULL, &cfg_look_align_size, NULL, config_change_noop },
|
||||
{ "look_align_size_max", N_("max size for aligning nick and other messages"),
|
||||
N_("max size for aligning nick and other messages (should be >= to "
|
||||
"look_align_size)"),
|
||||
OPTION_TYPE_INT, 8, 64, 20,
|
||||
NULL, NULL, &cfg_look_align_size_max, NULL, config_change_noop },
|
||||
{ "look_nick_completor", N_("the string inserted after nick completion"),
|
||||
N_("the string inserted after nick completion"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
":", NULL, NULL, &cfg_look_completor, config_change_noop },
|
||||
":", NULL, NULL, &cfg_look_nick_completor, config_change_noop },
|
||||
{ "look_nick_completion_ignore", N_("chars ignored for nick completion"),
|
||||
N_("chars ignored for nick completion"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
@@ -243,7 +283,12 @@ t_config_option weechat_options_look[] =
|
||||
{ "look_read_marker", N_("use a marker on servers/channels to show first unread line"),
|
||||
N_("use a marker on servers/channels to show first unread line"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
" ", NULL, NULL, &cfg_look_read_marker, config_change_read_marker},
|
||||
" ", NULL, NULL, &cfg_look_read_marker, config_change_read_marker },
|
||||
{ "look_input_format", N_("format for input prompt"),
|
||||
N_("format for input prompt ('%c' is replaced by channel or server, "
|
||||
"'%n' by nick and '%m' by nick modes)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"[%n(%m)] ", NULL, NULL, &cfg_look_input_format, config_change_buffer_content },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -283,6 +328,7 @@ int cfg_col_infobar_delimiters;
|
||||
int cfg_col_infobar_highlight;
|
||||
int cfg_col_infobar_bg;
|
||||
int cfg_col_input;
|
||||
int cfg_col_input_server;
|
||||
int cfg_col_input_channel;
|
||||
int cfg_col_input_nick;
|
||||
int cfg_col_input_delimiters;
|
||||
@@ -457,6 +503,10 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for input text"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"default", NULL, &cfg_col_input, NULL, &config_change_color },
|
||||
{ "col_input_server", N_("color for input text (server name)"),
|
||||
N_("color for input text (server name)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"brown", NULL, &cfg_col_input_server, NULL, &config_change_color },
|
||||
{ "col_input_channel", N_("color for input text (channel name)"),
|
||||
N_("color for input text (channel name)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -752,6 +802,7 @@ int cfg_dcc_auto_accept_files;
|
||||
int cfg_dcc_auto_accept_chats;
|
||||
int cfg_dcc_timeout;
|
||||
int cfg_dcc_blocksize;
|
||||
int cfg_dcc_fast_send;
|
||||
char *cfg_dcc_port_range;
|
||||
char *cfg_dcc_own_ip;
|
||||
char *cfg_dcc_download_path;
|
||||
@@ -771,12 +822,16 @@ t_config_option weechat_options_dcc[] =
|
||||
NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, &config_change_noop },
|
||||
{ "dcc_timeout", N_("timeout for dcc request"),
|
||||
N_("timeout for dcc request (in seconds)"),
|
||||
OPTION_TYPE_INT, 1, INT_MAX, 300,
|
||||
OPTION_TYPE_INT, 5, INT_MAX, 300,
|
||||
NULL, NULL, &cfg_dcc_timeout, NULL, &config_change_noop },
|
||||
{ "dcc_blocksize", N_("block size for dcc packets"),
|
||||
N_("block size for dcc packets in bytes (default: 65536)"),
|
||||
OPTION_TYPE_INT, 1024, 102400, 65536,
|
||||
OPTION_TYPE_INT, DCC_MIN_BLOCKSIZE, DCC_MAX_BLOCKSIZE, 65536,
|
||||
NULL, NULL, &cfg_dcc_blocksize, NULL, &config_change_noop },
|
||||
{ "dcc_fast_send", N_("does not wait for ACK when sending file"),
|
||||
N_("does not wait for ACK when sending file"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_dcc_fast_send, NULL, &config_change_noop },
|
||||
{ "dcc_port_range", N_("allowed ports for outgoing dcc"),
|
||||
N_("restricts outgoing dcc to use only ports in the given range "
|
||||
"(useful for NAT) (syntax: a single port, ie. 5000 or a port "
|
||||
@@ -947,6 +1002,10 @@ t_config_option weechat_options_server[] =
|
||||
N_("real name to use on IRC server"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.realname), NULL },
|
||||
{ "server_hostname", N_("custom hostname/IP for server"),
|
||||
N_("custom hostname/IP for server (optional, if empty local hostname is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.hostname), NULL },
|
||||
{ "server_command", N_("command(s) to run when connected to server"),
|
||||
N_("command(s) to run when connected to server (many commands should be "
|
||||
"separated by ';', use '\\;' for a semicolon)"),
|
||||
@@ -1054,6 +1113,22 @@ config_change_noop ()
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_save_on_exit: called when "save_on_exit" flag is changed
|
||||
*/
|
||||
|
||||
void
|
||||
config_change_save_on_exit ()
|
||||
{
|
||||
if (!cfg_look_save_on_exit)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("%s you should now issue /save to write "
|
||||
"\"save_on_exit\" option in config file.\n"),
|
||||
WEECHAT_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_title: called when title is changed
|
||||
*/
|
||||
@@ -1062,9 +1137,9 @@ void
|
||||
config_change_title ()
|
||||
{
|
||||
if (cfg_look_set_title)
|
||||
gui_set_window_title ();
|
||||
gui_window_set_title ();
|
||||
else
|
||||
gui_reset_window_title ();
|
||||
gui_window_reset_title ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1074,8 +1149,8 @@ config_change_title ()
|
||||
void
|
||||
config_change_buffers ()
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
|
||||
gui_window_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1085,7 +1160,7 @@ config_change_buffers ()
|
||||
void
|
||||
config_change_buffer_content ()
|
||||
{
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
gui_window_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1098,7 +1173,7 @@ config_change_read_marker ()
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_redraw_buffer (ptr_win->buffer);
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1109,7 +1184,7 @@ void
|
||||
config_change_charset ()
|
||||
{
|
||||
utf8_init ();
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
gui_window_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1121,9 +1196,9 @@ void
|
||||
config_change_one_server_buffer ()
|
||||
{
|
||||
if (cfg_look_one_server_buffer)
|
||||
gui_merge_servers (gui_current_window);
|
||||
gui_buffer_merge_servers (gui_current_window);
|
||||
else
|
||||
gui_split_server (gui_current_window);
|
||||
gui_buffer_split_server (gui_current_window);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1133,9 +1208,9 @@ config_change_one_server_buffer ()
|
||||
void
|
||||
config_change_color ()
|
||||
{
|
||||
gui_init_color_pairs ();
|
||||
gui_rebuild_weechat_colors ();
|
||||
gui_refresh_windows ();
|
||||
gui_color_init_pairs ();
|
||||
gui_color_rebuild_weechat ();
|
||||
gui_window_refresh_windows ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1234,23 +1309,23 @@ config_change_log ()
|
||||
if (BUFFER_IS_SERVER(ptr_buffer))
|
||||
{
|
||||
if (cfg_log_auto_server && !ptr_buffer->log_file)
|
||||
log_start (ptr_buffer);
|
||||
gui_log_start (ptr_buffer);
|
||||
else if (!cfg_log_auto_server && ptr_buffer->log_file)
|
||||
log_end (ptr_buffer);
|
||||
gui_log_end (ptr_buffer);
|
||||
}
|
||||
if (BUFFER_IS_CHANNEL(ptr_buffer))
|
||||
{
|
||||
if (cfg_log_auto_channel && !ptr_buffer->log_file)
|
||||
log_start (ptr_buffer);
|
||||
gui_log_start (ptr_buffer);
|
||||
else if (!cfg_log_auto_channel && ptr_buffer->log_file)
|
||||
log_end (ptr_buffer);
|
||||
gui_log_end (ptr_buffer);
|
||||
}
|
||||
if (BUFFER_IS_PRIVATE(ptr_buffer))
|
||||
{
|
||||
if (cfg_log_auto_private && !ptr_buffer->log_file)
|
||||
log_start (ptr_buffer);
|
||||
gui_log_start (ptr_buffer);
|
||||
else if (!cfg_log_auto_private && ptr_buffer->log_file)
|
||||
log_end (ptr_buffer);
|
||||
gui_log_end (ptr_buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1290,7 +1365,7 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
*(option->ptr_int) = int_value;
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
if (!gui_assign_color (option->ptr_int, value))
|
||||
if (!gui_color_assign (option->ptr_int, value))
|
||||
return -1;
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
@@ -1318,7 +1393,7 @@ config_option_list_remove (char **string, char *item)
|
||||
name = (char *) malloc (strlen (item) + 2);
|
||||
strcpy (name, item);
|
||||
strcat (name, ":");
|
||||
pos = strstr (*string, name);
|
||||
pos = ascii_strcasestr (*string, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
@@ -1394,7 +1469,7 @@ config_option_list_get_value (char **string, char *item,
|
||||
name = (char *) malloc (strlen (item) + 2);
|
||||
strcpy (name, item);
|
||||
strcat (name, ":");
|
||||
pos = strstr (*string, name);
|
||||
pos = ascii_strcasestr (*string, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
@@ -1447,6 +1522,8 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
|
||||
return (void *)(&server->username);
|
||||
if (ascii_strcasecmp (option_name, "server_realname") == 0)
|
||||
return (void *)(&server->realname);
|
||||
if (ascii_strcasecmp (option_name, "server_hostname") == 0)
|
||||
return (void *)(&server->hostname);
|
||||
if (ascii_strcasecmp (option_name, "server_command") == 0)
|
||||
return (void *)(&server->command);
|
||||
if (ascii_strcasecmp (option_name, "server_command_delay") == 0)
|
||||
@@ -1524,7 +1601,7 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
*((int *)(ptr_data)) = int_value;
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
if (!gui_assign_color ((int *)ptr_data, value))
|
||||
if (!gui_color_assign ((int *)ptr_data, value))
|
||||
return -2;
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
@@ -1687,7 +1764,8 @@ config_allocate_server (char *filename, int line_number)
|
||||
cfg_server.port, cfg_server.ipv6, cfg_server.ssl,
|
||||
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
|
||||
cfg_server.nick3, cfg_server.username, cfg_server.realname,
|
||||
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
|
||||
cfg_server.hostname, cfg_server.command,
|
||||
cfg_server.command_delay, cfg_server.autojoin,
|
||||
cfg_server.autorejoin, cfg_server.notify_levels,
|
||||
cfg_server.charset_decode_iso, cfg_server.charset_decode_utf,
|
||||
cfg_server.charset_encode))
|
||||
@@ -1741,7 +1819,7 @@ config_default_values ()
|
||||
int_value;
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
if (!gui_assign_color (
|
||||
if (!gui_color_assign (
|
||||
weechat_options[i][j].ptr_int,
|
||||
weechat_options[i][j].default_string))
|
||||
gui_printf (NULL,
|
||||
@@ -1913,12 +1991,12 @@ config_read ()
|
||||
if (pos[0])
|
||||
{
|
||||
/* bind key (overwrite any binding with same key) */
|
||||
gui_key_bind (line, pos);
|
||||
gui_keyboard_bind (line, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* unbin key if no value given */
|
||||
gui_key_unbind (line);
|
||||
gui_keyboard_unbind (line);
|
||||
}
|
||||
}
|
||||
else if (section == CONFIG_SECTION_ALIAS)
|
||||
@@ -1969,7 +2047,7 @@ config_read ()
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for"
|
||||
_("%s %s, line %d: invalid value for "
|
||||
"option '%s'\n"
|
||||
"Expected: boolean value: "
|
||||
"'off' or 'on'\n"),
|
||||
@@ -2126,10 +2204,10 @@ config_create_default ()
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
function_name = gui_keyboard_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
@@ -2166,7 +2244,7 @@ config_create_default ()
|
||||
fprintf (file, "UB = \"unban\"\n");
|
||||
fprintf (file, "UNIG = \"unignore\"\n");
|
||||
fprintf (file, "W = \"who\"\n");
|
||||
fprintf (file, "WC = \"part\"\n");
|
||||
fprintf (file, "WC = \"window merge\"\n");
|
||||
fprintf (file, "WI = \"whois\"\n");
|
||||
fprintf (file, "WW = \"whowas\"\n");
|
||||
|
||||
@@ -2223,6 +2301,7 @@ config_create_default ()
|
||||
fprintf (file, "server_realname = \"WeeChat default realname\"\n");
|
||||
}
|
||||
|
||||
fprintf (file, "server_hostname = \"\"\n");
|
||||
fprintf (file, "server_command = \"\"\n");
|
||||
fprintf (file, "server_command_delay = 0\n");
|
||||
fprintf (file, "server_autojoin = \"\"\n");
|
||||
@@ -2325,7 +2404,7 @@ config_write (char *config_name)
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
gui_get_color_name (*weechat_options[i][j].ptr_int) :
|
||||
gui_color_get_name (*weechat_options[i][j].ptr_int) :
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
@@ -2344,10 +2423,10 @@ config_write (char *config_name)
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
function_name = gui_keyboard_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
@@ -2409,6 +2488,8 @@ config_write (char *config_name)
|
||||
fprintf (file, "server_nick3 = \"%s\"\n", ptr_server->nick3);
|
||||
fprintf (file, "server_username = \"%s\"\n", ptr_server->username);
|
||||
fprintf (file, "server_realname = \"%s\"\n", ptr_server->realname);
|
||||
fprintf (file, "server_hostname = \"%s\"\n",
|
||||
(ptr_server->hostname) ? ptr_server->hostname : "");
|
||||
fprintf (file, "server_command = \"%s\"\n",
|
||||
(ptr_server->command) ? ptr_server->command : "");
|
||||
fprintf (file, "server_command_delay = %d\n", ptr_server->command_delay);
|
||||
|
||||
+16
-1
@@ -54,6 +54,10 @@
|
||||
#define CFG_LOOK_NICKLIST_TOP 2
|
||||
#define CFG_LOOK_NICKLIST_BOTTOM 3
|
||||
|
||||
#define CFG_LOOK_ALIGN_NICK_NONE 0
|
||||
#define CFG_LOOK_ALIGN_NICK_LEFT 1
|
||||
#define CFG_LOOK_ALIGN_NICK_RIGHT 2
|
||||
|
||||
#define CFG_IRC_DISPLAY_AWAY_OFF 0
|
||||
#define CFG_IRC_DISPLAY_AWAY_LOCAL 1
|
||||
#define CFG_IRC_DISPLAY_AWAY_CHANNEL 2
|
||||
@@ -83,6 +87,7 @@ struct t_config_option
|
||||
void (*handler_change)();
|
||||
};
|
||||
|
||||
extern int cfg_look_save_on_exit;
|
||||
extern int cfg_look_set_title;
|
||||
extern int cfg_look_startup_logo;
|
||||
extern int cfg_look_startup_version;
|
||||
@@ -104,7 +109,13 @@ extern int cfg_look_nicklist_max_size;
|
||||
extern int cfg_look_nickmode;
|
||||
extern int cfg_look_nickmode_empty;
|
||||
extern char *cfg_look_no_nickname;
|
||||
extern char *cfg_look_completor;
|
||||
extern char *cfg_look_nick_prefix;
|
||||
extern char *cfg_look_nick_suffix;
|
||||
extern int cfg_look_align_nick;
|
||||
extern int cfg_look_align_other;
|
||||
extern int cfg_look_align_size;
|
||||
extern int cfg_look_align_size_max;
|
||||
extern char *cfg_look_nick_completor;
|
||||
extern char *cfg_look_nick_completion_ignore;
|
||||
extern int cfg_look_nick_complete_first;
|
||||
extern int cfg_look_infobar;
|
||||
@@ -117,6 +128,7 @@ extern int cfg_look_hotlist_names_length;
|
||||
extern int cfg_look_day_change;
|
||||
extern char *cfg_look_day_change_timestamp;
|
||||
extern char *cfg_look_read_marker;
|
||||
extern char *cfg_look_input_format;
|
||||
|
||||
extern int cfg_col_real_white;
|
||||
extern int cfg_col_separator;
|
||||
@@ -152,6 +164,7 @@ extern int cfg_col_infobar_delimiters;
|
||||
extern int cfg_col_infobar_highlight;
|
||||
extern int cfg_col_infobar_bg;
|
||||
extern int cfg_col_input;
|
||||
extern int cfg_col_input_server;
|
||||
extern int cfg_col_input_channel;
|
||||
extern int cfg_col_input_nick;
|
||||
extern int cfg_col_input_delimiters;
|
||||
@@ -208,6 +221,7 @@ extern int cfg_dcc_auto_accept_files;
|
||||
extern int cfg_dcc_auto_accept_chats;
|
||||
extern int cfg_dcc_timeout;
|
||||
extern int cfg_dcc_blocksize;
|
||||
extern int cfg_dcc_fast_send;
|
||||
extern char *cfg_dcc_port_range;
|
||||
extern char *cfg_dcc_own_ip;
|
||||
extern char *cfg_dcc_download_path;
|
||||
@@ -234,6 +248,7 @@ extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
|
||||
|
||||
extern char *config_get_section ();
|
||||
extern void config_change_noop ();
|
||||
extern void config_change_save_on_exit ();
|
||||
extern void config_change_title ();
|
||||
extern void config_change_buffers ();
|
||||
extern void config_change_buffer_content ();
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "weechat.h"
|
||||
#include "weelist.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -163,3 +165,22 @@ weelist_remove (t_weelist **weelist, t_weelist **last_weelist, t_weelist *elemen
|
||||
free (element);
|
||||
*weelist = new_weelist;
|
||||
}
|
||||
|
||||
/*
|
||||
* weelist_print_log: print weelist in log (usually for crash dump)
|
||||
*/
|
||||
|
||||
void
|
||||
weelist_print_log (t_weelist *weelist, char *name)
|
||||
{
|
||||
t_weelist *ptr_weelist;
|
||||
|
||||
for (ptr_weelist = weelist; ptr_weelist;
|
||||
ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
weechat_log_printf ("[%s (addr:0x%X)]\n", name, ptr_weelist);
|
||||
weechat_log_printf (" data . . . . . . . . . : '%s'\n", ptr_weelist->data);
|
||||
weechat_log_printf (" prev_weelist . . . . . : 0x%X\n", ptr_weelist->prev_weelist);
|
||||
weechat_log_printf (" next_weelist . . . . . : 0x%X\n", ptr_weelist->next_weelist);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,9 @@ struct t_weelist
|
||||
t_weelist *next_weelist;
|
||||
};
|
||||
|
||||
t_weelist *weelist_search (t_weelist *, char *);
|
||||
t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
|
||||
void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
|
||||
extern t_weelist *weelist_search (t_weelist *, char *);
|
||||
extern t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
|
||||
extern void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
|
||||
extern void weelist_print_log (t_weelist *, char *);
|
||||
|
||||
#endif /* weelist.h */
|
||||
|
||||
+11
-2
@@ -19,10 +19,19 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
noinst_LIBRARIES = lib_weechat_gui_common.a
|
||||
|
||||
lib_weechat_gui_common_a_SOURCES = gui-common.c \
|
||||
lib_weechat_gui_common_a_SOURCES = gui-buffer.c \
|
||||
gui-common.c \
|
||||
gui-action.c \
|
||||
gui-keyboard.c \
|
||||
gui.h
|
||||
gui-log.c \
|
||||
gui-window.c \
|
||||
gui-panel.c \
|
||||
gui.h \
|
||||
gui-buffer.h \
|
||||
gui-color.h \
|
||||
gui-keyboard.h \
|
||||
gui-panel.h \
|
||||
gui-window.h
|
||||
|
||||
if GUI_NCURSES
|
||||
curses_dir=curses
|
||||
|
||||
@@ -20,8 +20,7 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
bin_PROGRAMS = weechat-curses
|
||||
|
||||
if PLUGINS
|
||||
weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
|
||||
../gui-action.o \
|
||||
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
|
||||
../../common/lib_weechat_main.a \
|
||||
../../irc/lib_weechat_irc.a \
|
||||
../../plugins/lib_weechat_plugins.a \
|
||||
@@ -29,8 +28,7 @@ weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
|
||||
$(NCURSES_LIBS) \
|
||||
$(GNUTLS_LFLAGS)
|
||||
else
|
||||
weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
|
||||
../gui-action.o \
|
||||
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
|
||||
../../common/lib_weechat_main.a \
|
||||
../../irc/lib_weechat_irc.a \
|
||||
$(PLUGINS_LIBS) \
|
||||
@@ -38,5 +36,14 @@ weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
|
||||
$(GNUTLS_LFLAGS)
|
||||
endif
|
||||
|
||||
weechat_curses_SOURCES = gui-display.c \
|
||||
gui-input.c
|
||||
weechat_curses_SOURCES = gui-curses-chat.c \
|
||||
gui-curses-color.c \
|
||||
gui-curses-infobar.c \
|
||||
gui-curses-input.c \
|
||||
gui-curses-keyboard.c \
|
||||
gui-curses-main.c \
|
||||
gui-curses-nicklist.c \
|
||||
gui-curses-status.c \
|
||||
gui-curses-window.c \
|
||||
gui-curses-panel.c \
|
||||
gui-curses.h
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,602 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-color.c: color functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
|
||||
t_gui_color gui_weechat_colors[] =
|
||||
{ { -1, 0, 0, "default" },
|
||||
{ WEECHAT_COLOR_BLACK, 0, 0, "black" },
|
||||
{ WEECHAT_COLOR_RED, 0, 0, "red" },
|
||||
{ WEECHAT_COLOR_RED, 0, A_BOLD, "lightred" },
|
||||
{ WEECHAT_COLOR_GREEN, 0, 0, "green" },
|
||||
{ WEECHAT_COLOR_GREEN, 0, A_BOLD, "lightgreen" },
|
||||
{ WEECHAT_COLOR_YELLOW, 0, 0, "brown" },
|
||||
{ WEECHAT_COLOR_YELLOW, 0, A_BOLD, "yellow" },
|
||||
{ WEECHAT_COLOR_BLUE, 0, 0, "blue" },
|
||||
{ WEECHAT_COLOR_BLUE, 0, A_BOLD, "lightblue" },
|
||||
{ WEECHAT_COLOR_MAGENTA, 0, 0, "magenta" },
|
||||
{ WEECHAT_COLOR_MAGENTA, 0, A_BOLD, "lightmagenta" },
|
||||
{ WEECHAT_COLOR_CYAN, 0, 0, "cyan" },
|
||||
{ WEECHAT_COLOR_CYAN, 0, A_BOLD, "lightcyan" },
|
||||
{ WEECHAT_COLOR_WHITE, 0, A_BOLD, "white" },
|
||||
{ 0, 0, 0, NULL }
|
||||
};
|
||||
|
||||
int gui_irc_colors[GUI_NUM_IRC_COLORS][2] =
|
||||
{ { /* 0 */ WEECHAT_COLOR_WHITE, A_BOLD },
|
||||
{ /* 1 */ WEECHAT_COLOR_BLACK, 0 },
|
||||
{ /* 2 */ WEECHAT_COLOR_BLUE, 0 },
|
||||
{ /* 3 */ WEECHAT_COLOR_GREEN, 0 },
|
||||
{ /* 4 */ WEECHAT_COLOR_RED, A_BOLD },
|
||||
{ /* 5 */ WEECHAT_COLOR_RED, 0 },
|
||||
{ /* 6 */ WEECHAT_COLOR_MAGENTA, 0 },
|
||||
{ /* 7 */ WEECHAT_COLOR_YELLOW, 0 },
|
||||
{ /* 8 */ WEECHAT_COLOR_YELLOW, A_BOLD },
|
||||
{ /* 9 */ WEECHAT_COLOR_GREEN, A_BOLD },
|
||||
{ /* 10 */ WEECHAT_COLOR_CYAN, 0 },
|
||||
{ /* 11 */ WEECHAT_COLOR_CYAN, A_BOLD },
|
||||
{ /* 12 */ WEECHAT_COLOR_BLUE, A_BOLD },
|
||||
{ /* 13 */ WEECHAT_COLOR_MAGENTA, A_BOLD },
|
||||
{ /* 14 */ WEECHAT_COLOR_WHITE, 0 },
|
||||
{ /* 15 */ WEECHAT_COLOR_WHITE, A_BOLD }
|
||||
};
|
||||
|
||||
t_gui_color *gui_color[GUI_NUM_COLORS];
|
||||
|
||||
|
||||
/*
|
||||
* gui_color_assign: assign a WeeChat color (read from config)
|
||||
*/
|
||||
|
||||
int
|
||||
gui_color_assign (int *color, char *color_name)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* look for curses colors in table */
|
||||
i = 0;
|
||||
while (gui_weechat_colors[i].string)
|
||||
{
|
||||
if (ascii_strcasecmp (gui_weechat_colors[i].string, color_name) == 0)
|
||||
{
|
||||
*color = i;
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
/* color not found */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_get_name: get color name
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_color_get_name (int num_color)
|
||||
{
|
||||
return gui_weechat_colors[num_color].string;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_decode: parses a message (coming from IRC server),
|
||||
* and according:
|
||||
* - remove any color/style in message
|
||||
* or:
|
||||
* - change colors by codes to be compatible with
|
||||
* other IRC clients
|
||||
* After use, string returned has to be free()
|
||||
*/
|
||||
|
||||
unsigned char *
|
||||
gui_color_decode (unsigned char *string, int keep_colors)
|
||||
{
|
||||
unsigned char *out;
|
||||
int out_length, out_pos;
|
||||
char str_fg[3], str_bg[3];
|
||||
int fg, bg, attr;
|
||||
|
||||
out_length = (strlen ((char *)string) * 2) + 1;
|
||||
out = (unsigned char *)malloc (out_length);
|
||||
if (!out)
|
||||
return NULL;
|
||||
|
||||
out_pos = 0;
|
||||
while (string[0] && (out_pos < out_length - 1))
|
||||
{
|
||||
switch (string[0])
|
||||
{
|
||||
case GUI_ATTR_BOLD_CHAR:
|
||||
case GUI_ATTR_RESET_CHAR:
|
||||
case GUI_ATTR_FIXED_CHAR:
|
||||
case GUI_ATTR_REVERSE_CHAR:
|
||||
case GUI_ATTR_REVERSE2_CHAR:
|
||||
case GUI_ATTR_ITALIC_CHAR:
|
||||
case GUI_ATTR_UNDERLINE_CHAR:
|
||||
if (keep_colors)
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
break;
|
||||
case GUI_ATTR_COLOR_CHAR:
|
||||
string++;
|
||||
str_fg[0] = '\0';
|
||||
str_bg[0] = '\0';
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
str_fg[0] = string[0];
|
||||
str_fg[1] = '\0';
|
||||
string++;
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
str_fg[1] = string[0];
|
||||
str_fg[2] = '\0';
|
||||
string++;
|
||||
}
|
||||
}
|
||||
if (string[0] == ',')
|
||||
{
|
||||
string++;
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
str_bg[0] = string[0];
|
||||
str_bg[1] = '\0';
|
||||
string++;
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
str_bg[1] = string[0];
|
||||
str_bg[2] = '\0';
|
||||
string++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (keep_colors)
|
||||
{
|
||||
if (!str_fg[0] && !str_bg[0])
|
||||
out[out_pos++] = GUI_ATTR_COLOR_CHAR;
|
||||
else
|
||||
{
|
||||
attr = 0;
|
||||
if (str_fg[0])
|
||||
{
|
||||
sscanf (str_fg, "%d", &fg);
|
||||
fg %= GUI_NUM_IRC_COLORS;
|
||||
attr |= gui_irc_colors[fg][1];
|
||||
}
|
||||
if (str_bg[0])
|
||||
{
|
||||
sscanf (str_bg, "%d", &bg);
|
||||
bg %= GUI_NUM_IRC_COLORS;
|
||||
attr |= gui_irc_colors[bg][1];
|
||||
}
|
||||
if (attr & A_BOLD)
|
||||
{
|
||||
out[out_pos++] = GUI_ATTR_WEECHAT_SET_CHAR;
|
||||
out[out_pos++] = GUI_ATTR_BOLD_CHAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
out[out_pos++] = GUI_ATTR_WEECHAT_REMOVE_CHAR;
|
||||
out[out_pos++] = GUI_ATTR_BOLD_CHAR;
|
||||
}
|
||||
out[out_pos++] = GUI_ATTR_COLOR_CHAR;
|
||||
if (str_fg[0])
|
||||
{
|
||||
out[out_pos++] = (gui_irc_colors[fg][0] / 10) + '0';
|
||||
out[out_pos++] = (gui_irc_colors[fg][0] % 10) + '0';
|
||||
}
|
||||
if (str_bg[0])
|
||||
{
|
||||
out[out_pos++] = ',';
|
||||
out[out_pos++] = (gui_irc_colors[bg][0] / 10) + '0';
|
||||
out[out_pos++] = (gui_irc_colors[bg][0] % 10) + '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GUI_ATTR_WEECHAT_COLOR_CHAR:
|
||||
string++;
|
||||
if (isdigit (string[0]) && isdigit (string[1]))
|
||||
{
|
||||
if (keep_colors)
|
||||
{
|
||||
out[out_pos++] = string[0];
|
||||
out[out_pos++] = string[1];
|
||||
}
|
||||
string += 2;
|
||||
}
|
||||
break;
|
||||
case GUI_ATTR_WEECHAT_SET_CHAR:
|
||||
case GUI_ATTR_WEECHAT_REMOVE_CHAR:
|
||||
string++;
|
||||
if (string[0])
|
||||
{
|
||||
if (keep_colors)
|
||||
{
|
||||
out[out_pos++] = *(string - 1);
|
||||
out[out_pos++] = string[0];
|
||||
}
|
||||
string++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
}
|
||||
}
|
||||
out[out_pos] = '\0';
|
||||
return out;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_decode_for_user_entry: parses a message (coming from IRC server),
|
||||
* and replaces colors/bold/.. by %C, %B, ..
|
||||
* After use, string returned has to be free()
|
||||
*/
|
||||
|
||||
unsigned char *
|
||||
gui_color_decode_for_user_entry (unsigned char *string)
|
||||
{
|
||||
unsigned char *out;
|
||||
int out_length, out_pos;
|
||||
|
||||
out_length = (strlen ((char *)string) * 2) + 1;
|
||||
out = (unsigned char *)malloc (out_length);
|
||||
if (!out)
|
||||
return NULL;
|
||||
|
||||
out_pos = 0;
|
||||
while (string[0] && (out_pos < out_length - 1))
|
||||
{
|
||||
switch (string[0])
|
||||
{
|
||||
case GUI_ATTR_BOLD_CHAR:
|
||||
out[out_pos++] = '%';
|
||||
out[out_pos++] = 'B';
|
||||
string++;
|
||||
break;
|
||||
case GUI_ATTR_FIXED_CHAR:
|
||||
string++;
|
||||
break;
|
||||
case GUI_ATTR_RESET_CHAR:
|
||||
out[out_pos++] = '%';
|
||||
out[out_pos++] = 'O';
|
||||
string++;
|
||||
break;
|
||||
case GUI_ATTR_REVERSE_CHAR:
|
||||
case GUI_ATTR_REVERSE2_CHAR:
|
||||
out[out_pos++] = '%';
|
||||
out[out_pos++] = 'R';
|
||||
string++;
|
||||
break;
|
||||
case GUI_ATTR_ITALIC_CHAR:
|
||||
string++;
|
||||
break;
|
||||
case GUI_ATTR_UNDERLINE_CHAR:
|
||||
out[out_pos++] = '%';
|
||||
out[out_pos++] = 'R';
|
||||
string++;
|
||||
break;
|
||||
case GUI_ATTR_COLOR_CHAR:
|
||||
out[out_pos++] = '%';
|
||||
out[out_pos++] = 'C';
|
||||
string++;
|
||||
break;
|
||||
default:
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
}
|
||||
}
|
||||
out[out_pos] = '\0';
|
||||
return out;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_encode: parses a message (entered by user), and
|
||||
* encode special chars (%B, %C, ..) in IRC colors
|
||||
* After use, string returned has to be free()
|
||||
*/
|
||||
|
||||
unsigned char *
|
||||
gui_color_encode (unsigned char *string)
|
||||
{
|
||||
unsigned char *out;
|
||||
int out_length, out_pos;
|
||||
|
||||
out_length = (strlen ((char *)string) * 2) + 1;
|
||||
out = (unsigned char *)malloc (out_length);
|
||||
if (!out)
|
||||
return NULL;
|
||||
|
||||
out_pos = 0;
|
||||
while (string[0] && (out_pos < out_length - 1))
|
||||
{
|
||||
switch (string[0])
|
||||
{
|
||||
case '%':
|
||||
string++;
|
||||
switch (string[0])
|
||||
{
|
||||
case '\0':
|
||||
out[out_pos++] = '%';
|
||||
break;
|
||||
case '%': /* double '%' replaced by single '%' */
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
break;
|
||||
case 'B': /* bold */
|
||||
out[out_pos++] = GUI_ATTR_BOLD_CHAR;
|
||||
string++;
|
||||
break;
|
||||
case 'C': /* color */
|
||||
out[out_pos++] = GUI_ATTR_COLOR_CHAR;
|
||||
string++;
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
}
|
||||
}
|
||||
if (string[0] == ',')
|
||||
{
|
||||
out[out_pos++] = ',';
|
||||
string++;
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
if (isdigit (string[0]))
|
||||
{
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'O': /* reset */
|
||||
out[out_pos++] = GUI_ATTR_RESET_CHAR;
|
||||
string++;
|
||||
break;
|
||||
case 'R': /* reverse */
|
||||
out[out_pos++] = GUI_ATTR_REVERSE_CHAR;
|
||||
string++;
|
||||
break;
|
||||
case 'U': /* underline */
|
||||
out[out_pos++] = GUI_ATTR_UNDERLINE_CHAR;
|
||||
string++;
|
||||
break;
|
||||
default:
|
||||
out[out_pos++] = '%';
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
out[out_pos++] = string[0];
|
||||
string++;
|
||||
}
|
||||
}
|
||||
out[out_pos] = '\0';
|
||||
return out;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_build: build a WeeChat color with foreground,
|
||||
* background and attributes (attributes are
|
||||
* given with foreground color, with a OR)
|
||||
*/
|
||||
|
||||
t_gui_color *
|
||||
gui_color_build (int number, int foreground, int background)
|
||||
{
|
||||
t_gui_color *new_color;
|
||||
|
||||
new_color = (t_gui_color *)malloc (sizeof (t_gui_color));
|
||||
if (!new_color)
|
||||
return NULL;
|
||||
|
||||
new_color->foreground = gui_weechat_colors[foreground].foreground;
|
||||
new_color->background = gui_weechat_colors[background].foreground;
|
||||
new_color->attributes = gui_weechat_colors[foreground].attributes;
|
||||
new_color->string = (char *)malloc (4);
|
||||
if (new_color->string)
|
||||
snprintf (new_color->string, 4,
|
||||
"%s%02d",
|
||||
GUI_ATTR_WEECHAT_COLOR_STR, number);
|
||||
|
||||
return new_color;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_get_pair: get color pair with a WeeChat color number
|
||||
*/
|
||||
|
||||
int
|
||||
gui_color_get_pair (int num_color)
|
||||
{
|
||||
int fg, bg;
|
||||
|
||||
if ((num_color < 0) || (num_color > GUI_NUM_COLORS - 1))
|
||||
return WEECHAT_COLOR_WHITE;
|
||||
|
||||
fg = gui_color[num_color]->foreground;
|
||||
bg = gui_color[num_color]->background;
|
||||
|
||||
if (((fg == -1) || (fg == 99))
|
||||
&& ((bg == -1) || (bg == 99)))
|
||||
return 63;
|
||||
if ((fg == -1) || (fg == 99))
|
||||
fg = WEECHAT_COLOR_WHITE;
|
||||
if ((bg == -1) || (bg == 99))
|
||||
bg = 0;
|
||||
|
||||
return (bg * 8) + fg;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_init_pairs: init color pairs
|
||||
*/
|
||||
|
||||
void
|
||||
gui_color_init_pairs ()
|
||||
{
|
||||
int i;
|
||||
char shift_colors[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
|
||||
|
||||
if (has_colors ())
|
||||
{
|
||||
for (i = 1; i < 64; i++)
|
||||
init_pair (i, shift_colors[i % 8], (i < 8) ? -1 : shift_colors[i / 8]);
|
||||
|
||||
/* disable white on white, replaced by black on white */
|
||||
init_pair (63, -1, -1);
|
||||
|
||||
/* white on default bg is default (-1) */
|
||||
if (!cfg_col_real_white)
|
||||
init_pair (WEECHAT_COLOR_WHITE, -1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_init_weechat: init WeeChat colors
|
||||
*/
|
||||
|
||||
void
|
||||
gui_color_init_weechat ()
|
||||
{
|
||||
int i;
|
||||
|
||||
gui_color[COLOR_WIN_SEPARATOR] = gui_color_build (COLOR_WIN_SEPARATOR, cfg_col_separator, cfg_col_separator);
|
||||
gui_color[COLOR_WIN_TITLE] = gui_color_build (COLOR_WIN_TITLE, cfg_col_title, cfg_col_title_bg);
|
||||
gui_color[COLOR_WIN_CHAT] = gui_color_build (COLOR_WIN_CHAT, cfg_col_chat, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_TIME] = gui_color_build (COLOR_WIN_CHAT_TIME, cfg_col_chat_time, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_TIME_SEP] = gui_color_build (COLOR_WIN_CHAT_TIME_SEP, cfg_col_chat_time_sep, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_PREFIX1] = gui_color_build (COLOR_WIN_CHAT_PREFIX1, cfg_col_chat_prefix1, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_PREFIX2] = gui_color_build (COLOR_WIN_CHAT_PREFIX2, cfg_col_chat_prefix2, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_SERVER] = gui_color_build (COLOR_WIN_CHAT_SERVER, cfg_col_chat_server, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_JOIN] = gui_color_build (COLOR_WIN_CHAT_JOIN, cfg_col_chat_join, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_PART] = gui_color_build (COLOR_WIN_CHAT_PART, cfg_col_chat_part, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_NICK] = gui_color_build (COLOR_WIN_CHAT_NICK, cfg_col_chat_nick, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_HOST] = gui_color_build (COLOR_WIN_CHAT_HOST, cfg_col_chat_host, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_CHANNEL] = gui_color_build (COLOR_WIN_CHAT_CHANNEL, cfg_col_chat_channel, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_DARK] = gui_color_build (COLOR_WIN_CHAT_DARK, cfg_col_chat_dark, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_HIGHLIGHT] = gui_color_build (COLOR_WIN_CHAT_HIGHLIGHT, cfg_col_chat_highlight, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_READ_MARKER] = gui_color_build (COLOR_WIN_CHAT_READ_MARKER, cfg_col_chat_read_marker, cfg_col_chat_read_marker_bg);
|
||||
gui_color[COLOR_WIN_STATUS] = gui_color_build (COLOR_WIN_STATUS, cfg_col_status, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_DELIMITERS] = gui_color_build (COLOR_WIN_STATUS_DELIMITERS, cfg_col_status_delimiters, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_CHANNEL] = gui_color_build (COLOR_WIN_STATUS_CHANNEL, cfg_col_status_channel, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_DATA_MSG] = gui_color_build (COLOR_WIN_STATUS_DATA_MSG, cfg_col_status_data_msg, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_DATA_PRIVATE] = gui_color_build (COLOR_WIN_STATUS_DATA_PRIVATE, cfg_col_status_data_private, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_DATA_HIGHLIGHT] = gui_color_build (COLOR_WIN_STATUS_DATA_HIGHLIGHT, cfg_col_status_data_highlight, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_DATA_OTHER] = gui_color_build (COLOR_WIN_STATUS_DATA_OTHER, cfg_col_status_data_other, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_MORE] = gui_color_build (COLOR_WIN_STATUS_MORE, cfg_col_status_more, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_INFOBAR] = gui_color_build (COLOR_WIN_INFOBAR, cfg_col_infobar, cfg_col_infobar_bg);
|
||||
gui_color[COLOR_WIN_INFOBAR_DELIMITERS] = gui_color_build (COLOR_WIN_INFOBAR_DELIMITERS, cfg_col_infobar_delimiters, cfg_col_infobar_bg);
|
||||
gui_color[COLOR_WIN_INFOBAR_HIGHLIGHT] = gui_color_build (COLOR_WIN_INFOBAR_HIGHLIGHT, cfg_col_infobar_highlight, cfg_col_infobar_bg);
|
||||
gui_color[COLOR_WIN_INPUT] = gui_color_build (COLOR_WIN_INPUT, cfg_col_input, cfg_col_input_bg);
|
||||
gui_color[COLOR_WIN_INPUT_SERVER] = gui_color_build (COLOR_WIN_INPUT_SERVER, cfg_col_input_server, cfg_col_input_bg);
|
||||
gui_color[COLOR_WIN_INPUT_CHANNEL] = gui_color_build (COLOR_WIN_INPUT_CHANNEL, cfg_col_input_channel, cfg_col_input_bg);
|
||||
gui_color[COLOR_WIN_INPUT_NICK] = gui_color_build (COLOR_WIN_INPUT_NICK, cfg_col_input_nick, cfg_col_input_bg);
|
||||
gui_color[COLOR_WIN_INPUT_DELIMITERS] = gui_color_build (COLOR_WIN_INPUT_DELIMITERS, cfg_col_input_delimiters, cfg_col_input_bg);
|
||||
gui_color[COLOR_WIN_NICK] = gui_color_build (COLOR_WIN_NICK, cfg_col_nick, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_AWAY] = gui_color_build (COLOR_WIN_NICK_AWAY, cfg_col_nick_away, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_CHANOWNER] = gui_color_build (COLOR_WIN_NICK_CHANOWNER, cfg_col_nick_chanowner, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_CHANADMIN] = gui_color_build (COLOR_WIN_NICK_CHANADMIN, cfg_col_nick_chanadmin, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_OP] = gui_color_build (COLOR_WIN_NICK_OP, cfg_col_nick_op, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_HALFOP] = gui_color_build (COLOR_WIN_NICK_HALFOP, cfg_col_nick_halfop, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_VOICE] = gui_color_build (COLOR_WIN_NICK_VOICE, cfg_col_nick_voice, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_MORE] = gui_color_build (COLOR_WIN_NICK_MORE, cfg_col_nick_more, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_SEP] = gui_color_build (COLOR_WIN_NICK_SEP, cfg_col_nick_sep, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_SELF] = gui_color_build (COLOR_WIN_NICK_SELF, cfg_col_nick_self, cfg_col_nick_bg);
|
||||
gui_color[COLOR_WIN_NICK_PRIVATE] = gui_color_build (COLOR_WIN_NICK_PRIVATE, cfg_col_nick_private, cfg_col_nick_bg);
|
||||
|
||||
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
|
||||
{
|
||||
gui_color[COLOR_WIN_NICK_1 + i] = gui_color_build (COLOR_WIN_NICK_1 + i, cfg_col_nick_colors[i], cfg_col_chat_bg);
|
||||
}
|
||||
|
||||
gui_color[COLOR_DCC_SELECTED] = gui_color_build (COLOR_DCC_SELECTED, cfg_col_dcc_selected, cfg_col_chat_bg);
|
||||
gui_color[COLOR_DCC_WAITING] = gui_color_build (COLOR_DCC_WAITING, cfg_col_dcc_waiting, cfg_col_chat_bg);
|
||||
gui_color[COLOR_DCC_CONNECTING] = gui_color_build (COLOR_DCC_CONNECTING, cfg_col_dcc_connecting, cfg_col_chat_bg);
|
||||
gui_color[COLOR_DCC_ACTIVE] = gui_color_build (COLOR_DCC_ACTIVE, cfg_col_dcc_active, cfg_col_chat_bg);
|
||||
gui_color[COLOR_DCC_DONE] = gui_color_build (COLOR_DCC_DONE, cfg_col_dcc_done, cfg_col_chat_bg);
|
||||
gui_color[COLOR_DCC_FAILED] = gui_color_build (COLOR_DCC_FAILED, cfg_col_dcc_failed, cfg_col_chat_bg);
|
||||
gui_color[COLOR_DCC_ABORTED] = gui_color_build (COLOR_DCC_ABORTED, cfg_col_dcc_aborted, cfg_col_chat_bg);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_rebuild_weechat: rebuild WeeChat colors
|
||||
*/
|
||||
|
||||
void
|
||||
gui_color_rebuild_weechat ()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (has_colors ())
|
||||
{
|
||||
for (i = 0; i < GUI_NUM_COLORS; i++)
|
||||
{
|
||||
if (gui_color[i])
|
||||
{
|
||||
if (gui_color[i]->string)
|
||||
free (gui_color[i]->string);
|
||||
free (gui_color[i]);
|
||||
gui_color[i] = NULL;
|
||||
}
|
||||
}
|
||||
gui_color_init_weechat ();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_color_init: init GUI colors
|
||||
*/
|
||||
|
||||
void
|
||||
gui_color_init ()
|
||||
{
|
||||
if (has_colors ())
|
||||
{
|
||||
start_color ();
|
||||
use_default_colors ();
|
||||
}
|
||||
gui_color_init_pairs ();
|
||||
gui_color_init_weechat ();
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-infobar.c: infobar display functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/hotlist.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
|
||||
/*
|
||||
* gui_infobar_draw_time: draw time in infobar window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_infobar_draw_time (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) buffer;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
time_seconds = time (NULL);
|
||||
local_time = localtime (&time_seconds);
|
||||
if (local_time)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_infobar,
|
||||
0, 1,
|
||||
"%02d:%02d",
|
||||
local_time->tm_hour, local_time->tm_min);
|
||||
if (cfg_look_infobar_seconds)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar,
|
||||
":%02d",
|
||||
local_time->tm_sec);
|
||||
}
|
||||
wnoutrefresh (GUI_CURSES(ptr_win)->win_infobar);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_infobar_draw: draw infobar window for a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_infobar_draw (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
char text_time[1024 + 1];
|
||||
|
||||
/* make gcc happy */
|
||||
(void) buffer;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (erase)
|
||||
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
|
||||
|
||||
time_seconds = time (NULL);
|
||||
local_time = localtime (&time_seconds);
|
||||
if (local_time)
|
||||
{
|
||||
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar,
|
||||
"%02d:%02d",
|
||||
local_time->tm_hour, local_time->tm_min);
|
||||
if (cfg_look_infobar_seconds)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar,
|
||||
":%02d",
|
||||
local_time->tm_sec);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar, "]");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar,
|
||||
" %s", text_time);
|
||||
}
|
||||
if (gui_infobar)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar, " | ");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, gui_infobar->color);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar, "%s", gui_infobar->text);
|
||||
}
|
||||
|
||||
wnoutrefresh (GUI_CURSES(ptr_win)->win_infobar);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,425 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-input: input display functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/utf8.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
#ifdef PLUGINS
|
||||
#include "../../plugins/plugins.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* gui_input_set_color: set color for an input window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_set_color (t_gui_window *window, int irc_color)
|
||||
{
|
||||
int fg, bg;
|
||||
|
||||
fg = gui_irc_colors[irc_color][0];
|
||||
bg = gui_color[COLOR_WIN_INPUT]->background;
|
||||
|
||||
irc_color %= GUI_NUM_IRC_COLORS;
|
||||
if (gui_irc_colors[irc_color][1] & A_BOLD)
|
||||
wattron (GUI_CURSES(window)->win_input, A_BOLD);
|
||||
|
||||
if (((fg == -1) || (fg == 99))
|
||||
&& ((bg == -1) || (bg == 99)))
|
||||
wattron (GUI_CURSES(window)->win_input, COLOR_PAIR(63));
|
||||
else
|
||||
{
|
||||
if ((fg == -1) || (fg == 99))
|
||||
fg = WEECHAT_COLOR_WHITE;
|
||||
if ((bg == -1) || (bg == 99))
|
||||
bg = 0;
|
||||
wattron (GUI_CURSES(window)->win_input, COLOR_PAIR((bg * 8) + fg));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_get_prompt_length: return input prompt length (displayed on screen)
|
||||
*/
|
||||
|
||||
int
|
||||
gui_input_get_prompt_length (t_gui_window *window, char *nick)
|
||||
{
|
||||
char *pos, saved_char;
|
||||
int char_size, length;
|
||||
|
||||
length = 0;
|
||||
pos = cfg_look_input_format;
|
||||
while (pos && pos[0])
|
||||
{
|
||||
switch (pos[0])
|
||||
{
|
||||
case '%':
|
||||
pos++;
|
||||
switch (pos[0])
|
||||
{
|
||||
case 'c':
|
||||
if (CHANNEL(window->buffer))
|
||||
length += utf8_strlen (CHANNEL(window->buffer)->name);
|
||||
else
|
||||
{
|
||||
if (SERVER(window->buffer))
|
||||
length += utf8_strlen (SERVER(window->buffer)->name);
|
||||
}
|
||||
pos++;
|
||||
break;
|
||||
case 'm':
|
||||
if (SERVER(window->buffer))
|
||||
{
|
||||
if (SERVER(window->buffer)->nick_modes
|
||||
&& SERVER(window->buffer)->nick_modes[0])
|
||||
length += strlen (SERVER(window->buffer)->nick_modes);
|
||||
}
|
||||
pos++;
|
||||
break;
|
||||
case 'n':
|
||||
length += utf8_strlen (nick);
|
||||
pos++;
|
||||
break;
|
||||
default:
|
||||
length++;
|
||||
if (pos[0])
|
||||
{
|
||||
if (pos[0] == '%')
|
||||
pos++;
|
||||
else
|
||||
{
|
||||
length++;
|
||||
pos += utf8_char_size (pos);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
char_size = utf8_char_size (pos);
|
||||
saved_char = pos[char_size];
|
||||
pos[char_size] = '\0';
|
||||
length += utf8_width_screen (pos);
|
||||
pos[char_size] = saved_char;
|
||||
pos += char_size;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_draw_prompt: display input prompt
|
||||
* return: # chars displayed on screen (one UTF-8 char
|
||||
* may be displayed on more than 1 char on screen)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_draw_prompt (t_gui_window *window, char *nick)
|
||||
{
|
||||
char *pos, saved_char;
|
||||
int char_size;
|
||||
|
||||
wmove (GUI_CURSES(window)->win_input, 0, 0);
|
||||
pos = cfg_look_input_format;
|
||||
while (pos && pos[0])
|
||||
{
|
||||
switch (pos[0])
|
||||
{
|
||||
case '%':
|
||||
pos++;
|
||||
switch (pos[0])
|
||||
{
|
||||
case 'c':
|
||||
if (CHANNEL(window->buffer))
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
|
||||
COLOR_WIN_INPUT_CHANNEL);
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s",
|
||||
CHANNEL(window->buffer)->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SERVER(window->buffer))
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
|
||||
COLOR_WIN_INPUT_SERVER);
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s",
|
||||
SERVER(window->buffer)->name);
|
||||
}
|
||||
}
|
||||
pos++;
|
||||
break;
|
||||
case 'm':
|
||||
if (SERVER(window->buffer))
|
||||
{
|
||||
if (SERVER(window->buffer)->nick_modes
|
||||
&& SERVER(window->buffer)->nick_modes[0])
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
|
||||
COLOR_WIN_INPUT);
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s",
|
||||
SERVER(window->buffer)->nick_modes);
|
||||
}
|
||||
}
|
||||
pos++;
|
||||
break;
|
||||
case 'n':
|
||||
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
|
||||
COLOR_WIN_INPUT_NICK);
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s", nick);
|
||||
pos++;
|
||||
break;
|
||||
default:
|
||||
if (pos[0])
|
||||
{
|
||||
char_size = utf8_char_size (pos);
|
||||
saved_char = pos[char_size];
|
||||
pos[char_size] = '\0';
|
||||
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
|
||||
COLOR_WIN_INPUT_DELIMITERS);
|
||||
wprintw (GUI_CURSES(window)->win_input, "%%%s", pos);
|
||||
pos[char_size] = saved_char;
|
||||
pos += char_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintw (GUI_CURSES(window)->win_input, "%%");
|
||||
pos++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
char_size = utf8_char_size (pos);
|
||||
saved_char = pos[char_size];
|
||||
pos[char_size] = '\0';
|
||||
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
|
||||
COLOR_WIN_INPUT_DELIMITERS);
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s", pos);
|
||||
pos[char_size] = saved_char;
|
||||
pos += char_size;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_draw_text: display text in input buffer, according to color mask
|
||||
* return: offset for cursor position on screen (one UTF-8
|
||||
* char may be displayed on more than 1 char on screen)
|
||||
*/
|
||||
|
||||
int
|
||||
gui_input_draw_text (t_gui_window *window, int input_width)
|
||||
{
|
||||
char *ptr_start, *ptr_next, saved_char;
|
||||
int pos_mask, size, last_color, color, count_cursor, offset_cursor;
|
||||
|
||||
ptr_start = utf8_add_offset (window->buffer->input_buffer,
|
||||
window->buffer->input_buffer_1st_display);
|
||||
pos_mask = ptr_start - window->buffer->input_buffer;
|
||||
last_color = -1;
|
||||
count_cursor = window->buffer->input_buffer_pos -
|
||||
window->buffer->input_buffer_1st_display;
|
||||
offset_cursor = 0;
|
||||
while ((input_width > 0) && ptr_start && ptr_start[0])
|
||||
{
|
||||
ptr_next = utf8_next_char (ptr_start);
|
||||
if (ptr_next)
|
||||
{
|
||||
saved_char = ptr_next[0];
|
||||
ptr_next[0] = '\0';
|
||||
size = ptr_next - ptr_start;
|
||||
if (window->buffer->input_buffer_color_mask[pos_mask] != ' ')
|
||||
color = window->buffer->input_buffer_color_mask[pos_mask] - '0';
|
||||
else
|
||||
color = -1;
|
||||
if (color != last_color)
|
||||
{
|
||||
if (color == -1)
|
||||
gui_window_set_weechat_color (GUI_CURSES(window)->win_input, COLOR_WIN_INPUT);
|
||||
else
|
||||
gui_input_set_color (window, color);
|
||||
}
|
||||
last_color = color;
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s", ptr_start);
|
||||
if (count_cursor > 0)
|
||||
{
|
||||
offset_cursor += utf8_width_screen (ptr_start);
|
||||
count_cursor--;
|
||||
}
|
||||
ptr_next[0] = saved_char;
|
||||
ptr_start = ptr_next;
|
||||
pos_mask += size;
|
||||
}
|
||||
else
|
||||
ptr_start = NULL;
|
||||
input_width--;
|
||||
}
|
||||
return offset_cursor;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_draw: draw input window for a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_draw (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
char format[32];
|
||||
char *ptr_nickname;
|
||||
int prompt_length, display_prompt, offset_cursor;
|
||||
t_irc_dcc *dcc_selected;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (ptr_win->buffer == buffer)
|
||||
{
|
||||
if (erase)
|
||||
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_input, COLOR_WIN_INPUT);
|
||||
|
||||
switch (buffer->type)
|
||||
{
|
||||
case BUFFER_TYPE_STANDARD:
|
||||
if (buffer->has_input)
|
||||
{
|
||||
if (buffer->input_buffer_length == 0)
|
||||
buffer->input_buffer[0] = '\0';
|
||||
|
||||
if (SERVER(buffer))
|
||||
ptr_nickname = (SERVER(buffer)->nick) ?
|
||||
SERVER(buffer)->nick : SERVER(buffer)->nick1;
|
||||
else
|
||||
ptr_nickname = cfg_look_no_nickname;
|
||||
|
||||
prompt_length = gui_input_get_prompt_length (ptr_win, ptr_nickname);
|
||||
|
||||
if (ptr_win->win_input_width - prompt_length < 3)
|
||||
{
|
||||
prompt_length = 0;
|
||||
display_prompt = 0;
|
||||
}
|
||||
else
|
||||
display_prompt = 1;
|
||||
|
||||
if (buffer->input_buffer_pos - buffer->input_buffer_1st_display + 1 >
|
||||
ptr_win->win_input_width - prompt_length)
|
||||
buffer->input_buffer_1st_display = buffer->input_buffer_pos -
|
||||
(ptr_win->win_input_width - prompt_length) + 1;
|
||||
else
|
||||
{
|
||||
if (buffer->input_buffer_pos < buffer->input_buffer_1st_display)
|
||||
buffer->input_buffer_1st_display = buffer->input_buffer_pos;
|
||||
else
|
||||
{
|
||||
if ((buffer->input_buffer_1st_display > 0) &&
|
||||
(buffer->input_buffer_pos -
|
||||
buffer->input_buffer_1st_display + 1)
|
||||
< ptr_win->win_input_width - prompt_length)
|
||||
{
|
||||
buffer->input_buffer_1st_display =
|
||||
buffer->input_buffer_pos -
|
||||
(ptr_win->win_input_width - prompt_length) + 1;
|
||||
if (buffer->input_buffer_1st_display < 0)
|
||||
buffer->input_buffer_1st_display = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (display_prompt)
|
||||
gui_input_draw_prompt (ptr_win, ptr_nickname);
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_input, COLOR_WIN_INPUT);
|
||||
snprintf (format, 32, "%%-%ds", ptr_win->win_input_width - prompt_length);
|
||||
offset_cursor = 0;
|
||||
if (ptr_win == gui_current_window)
|
||||
offset_cursor = gui_input_draw_text (ptr_win,
|
||||
ptr_win->win_input_width - prompt_length);
|
||||
else
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, format, "");
|
||||
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
|
||||
ptr_win->win_input_cursor_x = prompt_length + offset_cursor;
|
||||
if (ptr_win == gui_current_window)
|
||||
move (ptr_win->win_input_y,
|
||||
ptr_win->win_input_x + ptr_win->win_input_cursor_x);
|
||||
}
|
||||
break;
|
||||
case BUFFER_TYPE_DCC:
|
||||
dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
|
||||
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
|
||||
if (dcc_selected)
|
||||
{
|
||||
switch (dcc_selected->status)
|
||||
{
|
||||
case DCC_WAITING:
|
||||
if (DCC_IS_RECV(dcc_selected->type))
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [A] Accept"));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_CONNECTING:
|
||||
case DCC_ACTIVE:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_DONE:
|
||||
case DCC_FAILED:
|
||||
case DCC_ABORTED:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [R] Remove"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [P] Purge old DCC"));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close DCC view"));
|
||||
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
|
||||
ptr_win->win_input_cursor_x = 0;
|
||||
if (ptr_win == gui_current_window)
|
||||
move (ptr_win->win_input_y, ptr_win->win_input_x);
|
||||
break;
|
||||
case BUFFER_TYPE_RAW_DATA:
|
||||
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Clear buffer"));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close raw data view"));
|
||||
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
|
||||
ptr_win->win_input_cursor_x = 0;
|
||||
if (ptr_win == gui_current_window)
|
||||
move (ptr_win->win_input_y, ptr_win->win_input_x);
|
||||
break;
|
||||
}
|
||||
wrefresh (GUI_CURSES(ptr_win)->win_input);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-keyboard.c: keyboard functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/utf8.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
#ifdef PLUGINS
|
||||
#include "../../plugins/plugins.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* gui_keyboard_default_bindings: create default key bindings
|
||||
*/
|
||||
|
||||
void
|
||||
gui_keyboard_default_bindings ()
|
||||
{
|
||||
int i;
|
||||
char key_str[32], command[32];
|
||||
|
||||
/* keys bound with internal functions */
|
||||
gui_keyboard_bind ( /* RC */ "ctrl-M", "return");
|
||||
gui_keyboard_bind ( /* RC */ "ctrl-J", "return");
|
||||
gui_keyboard_bind ( /* tab */ "ctrl-I", "tab");
|
||||
gui_keyboard_bind ( /* s-tab */ "meta2-Z", "tab_previous");
|
||||
gui_keyboard_bind ( /* basckp */ "ctrl-H", "backspace");
|
||||
gui_keyboard_bind ( /* basckp */ "ctrl-?", "backspace");
|
||||
gui_keyboard_bind ( /* del */ "meta2-3~", "delete");
|
||||
gui_keyboard_bind ( /* ^K */ "ctrl-K", "delete_end_line");
|
||||
gui_keyboard_bind ( /* ^U */ "ctrl-U", "delete_beginning_line");
|
||||
gui_keyboard_bind ( /* ^W */ "ctrl-W", "delete_previous_word");
|
||||
gui_keyboard_bind ( /* ^Y */ "ctrl-Y", "clipboard_paste");
|
||||
gui_keyboard_bind ( /* ^T */ "ctrl-T", "transpose_chars");
|
||||
gui_keyboard_bind ( /* home */ "meta2-1~", "home");
|
||||
gui_keyboard_bind ( /* home */ "meta2-H", "home");
|
||||
gui_keyboard_bind ( /* home */ "meta2-7~", "home");
|
||||
gui_keyboard_bind ( /* ^A */ "ctrl-A", "home");
|
||||
gui_keyboard_bind ( /* end */ "meta2-4~", "end");
|
||||
gui_keyboard_bind ( /* end */ "meta2-F", "end");
|
||||
gui_keyboard_bind ( /* end */ "meta2-8~", "end");
|
||||
gui_keyboard_bind ( /* ^E */ "ctrl-E", "end");
|
||||
gui_keyboard_bind ( /* left */ "meta2-D", "left");
|
||||
gui_keyboard_bind ( /* right */ "meta2-C", "right");
|
||||
gui_keyboard_bind ( /* up */ "meta2-A", "up");
|
||||
gui_keyboard_bind ( /* ^up */ "meta-Oa", "up_global");
|
||||
gui_keyboard_bind ( /* down */ "meta2-B", "down");
|
||||
gui_keyboard_bind ( /* ^down */ "meta-Ob", "down_global");
|
||||
gui_keyboard_bind ( /* pgup */ "meta2-5~", "page_up");
|
||||
gui_keyboard_bind ( /* pgdn */ "meta2-6~", "page_down");
|
||||
gui_keyboard_bind ( /* m-pgup */ "meta-meta2-5~", "scroll_up");
|
||||
gui_keyboard_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
|
||||
gui_keyboard_bind ( /* m-home */ "meta-meta2-1~", "scroll_top");
|
||||
gui_keyboard_bind ( /* m-end */ "meta-meta2-4~", "scroll_bottom");
|
||||
gui_keyboard_bind ( /* F10 */ "meta2-21~", "infobar_clear");
|
||||
gui_keyboard_bind ( /* F11 */ "meta2-23~", "nick_page_up");
|
||||
gui_keyboard_bind ( /* F12 */ "meta2-24~", "nick_page_down");
|
||||
gui_keyboard_bind ( /* m-F11 */ "meta-meta2-23~", "nick_beginning");
|
||||
gui_keyboard_bind ( /* m-F12 */ "meta-meta2-24~", "nick_end");
|
||||
gui_keyboard_bind ( /* ^L */ "ctrl-L", "refresh");
|
||||
gui_keyboard_bind ( /* m-a */ "meta-a", "jump_smart");
|
||||
gui_keyboard_bind ( /* m-b */ "meta-b", "previous_word");
|
||||
gui_keyboard_bind ( /* ^left */ "meta-Od", "previous_word");
|
||||
gui_keyboard_bind ( /* m-d */ "meta-d", "delete_next_word");
|
||||
gui_keyboard_bind ( /* m-f */ "meta-f", "next_word");
|
||||
gui_keyboard_bind ( /* ^right */ "meta-Oc", "next_word");
|
||||
gui_keyboard_bind ( /* m-h */ "meta-h", "hotlist_clear");
|
||||
gui_keyboard_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
|
||||
gui_keyboard_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
|
||||
gui_keyboard_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
|
||||
gui_keyboard_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
|
||||
gui_keyboard_bind ( /* m-j,m-r */ "meta-jmeta-r", "jump_raw_data");
|
||||
gui_keyboard_bind ( /* m-k */ "meta-k", "grab_key");
|
||||
gui_keyboard_bind ( /* m-n */ "meta-n", "scroll_next_highlight");
|
||||
gui_keyboard_bind ( /* m-p */ "meta-p", "scroll_previous_highlight");
|
||||
gui_keyboard_bind ( /* m-r */ "meta-r", "delete_line");
|
||||
gui_keyboard_bind ( /* m-s */ "meta-s", "switch_server");
|
||||
gui_keyboard_bind ( /* m-u */ "meta-u", "scroll_unread");
|
||||
|
||||
/* keys bound with commands */
|
||||
gui_keyboard_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
|
||||
gui_keyboard_bind ( /* F5 */ "meta2-15~", "/buffer -1");
|
||||
gui_keyboard_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
|
||||
gui_keyboard_bind ( /* F6 */ "meta2-17~", "/buffer +1");
|
||||
gui_keyboard_bind ( /* F7 */ "meta2-18~", "/window -1");
|
||||
gui_keyboard_bind ( /* F8 */ "meta2-19~", "/window +1");
|
||||
gui_keyboard_bind ( /* m-w,m-up */ "meta-wmeta-meta2-A", "/window up");
|
||||
gui_keyboard_bind ( /* m-w,m-down */ "meta-wmeta-meta2-B", "/window down");
|
||||
gui_keyboard_bind ( /* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
|
||||
gui_keyboard_bind ( /* m-w,m-right */ "meta-wmeta-meta2-C", "/window right");
|
||||
gui_keyboard_bind ( /* m-0 */ "meta-0", "/buffer 10");
|
||||
gui_keyboard_bind ( /* m-1 */ "meta-1", "/buffer 1");
|
||||
gui_keyboard_bind ( /* m-2 */ "meta-2", "/buffer 2");
|
||||
gui_keyboard_bind ( /* m-3 */ "meta-3", "/buffer 3");
|
||||
gui_keyboard_bind ( /* m-4 */ "meta-4", "/buffer 4");
|
||||
gui_keyboard_bind ( /* m-5 */ "meta-5", "/buffer 5");
|
||||
gui_keyboard_bind ( /* m-6 */ "meta-6", "/buffer 6");
|
||||
gui_keyboard_bind ( /* m-7 */ "meta-7", "/buffer 7");
|
||||
gui_keyboard_bind ( /* m-8 */ "meta-8", "/buffer 8");
|
||||
gui_keyboard_bind ( /* m-9 */ "meta-9", "/buffer 9");
|
||||
|
||||
/* bind meta-j + {01..99} to switch to buffers # > 10 */
|
||||
for (i = 1; i < 100; i++)
|
||||
{
|
||||
sprintf (key_str, "meta-j%02d", i);
|
||||
sprintf (command, "/buffer %d", i);
|
||||
gui_keyboard_bind (key_str, command);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_keyboard_grab_end: insert grabbed key in input buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_keyboard_grab_end ()
|
||||
{
|
||||
char *expanded_key;
|
||||
char *buffer_before_key;
|
||||
#ifdef PLUGINS
|
||||
char *expanded_key2;
|
||||
int length;
|
||||
#endif
|
||||
|
||||
/* get expanded name (for example: ^U => ctrl-u) */
|
||||
expanded_key = gui_keyboard_get_expanded_name (gui_key_buffer);
|
||||
|
||||
if (expanded_key)
|
||||
{
|
||||
if (gui_current_window->buffer->has_input)
|
||||
{
|
||||
buffer_before_key =
|
||||
(gui_current_window->buffer->input_buffer) ?
|
||||
strdup (gui_current_window->buffer->input_buffer) : strdup ("");
|
||||
gui_insert_string_input (gui_current_window, expanded_key, -1);
|
||||
gui_current_window->buffer->input_buffer_pos += utf8_strlen (expanded_key);
|
||||
gui_input_draw (gui_current_window->buffer, 1);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
#ifdef PLUGINS
|
||||
length = strlen (expanded_key) + 1 + 1;
|
||||
expanded_key2 = (char *) malloc (length);
|
||||
if (expanded_key2)
|
||||
{
|
||||
snprintf (expanded_key2, length, "*%s", expanded_key);
|
||||
(void) plugin_keyboard_handler_exec (expanded_key2,
|
||||
buffer_before_key,
|
||||
gui_current_window->buffer->input_buffer);
|
||||
free (expanded_key2);
|
||||
}
|
||||
#endif
|
||||
if (buffer_before_key)
|
||||
free (buffer_before_key);
|
||||
}
|
||||
free (expanded_key);
|
||||
}
|
||||
|
||||
/* end grab mode */
|
||||
gui_key_grab = 0;
|
||||
gui_key_grab_count = 0;
|
||||
gui_key_buffer[0] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_keyboard_read: read keyboard chars
|
||||
*/
|
||||
|
||||
void
|
||||
gui_keyboard_read ()
|
||||
{
|
||||
int key, i, insert_ok;
|
||||
char key_str[32];
|
||||
char *buffer_before_key;
|
||||
#ifdef PLUGINS
|
||||
char key_str2[33];
|
||||
#endif
|
||||
|
||||
i = 0;
|
||||
/* do not loop too much here (for example when big paste was made),
|
||||
to read also socket & co */
|
||||
while (i < 8)
|
||||
{
|
||||
if (gui_key_grab && (gui_key_grab_count > 10))
|
||||
gui_keyboard_grab_end ();
|
||||
|
||||
key = getch ();
|
||||
insert_ok = 1;
|
||||
|
||||
if (key == ERR)
|
||||
{
|
||||
if (gui_key_grab && (gui_key_grab_count > 0))
|
||||
gui_keyboard_grab_end ();
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
if (key == KEY_RESIZE)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
gui_last_activity_time = time (NULL);
|
||||
|
||||
if (key < 32)
|
||||
{
|
||||
insert_ok = 0;
|
||||
key_str[0] = '^';
|
||||
key_str[1] = (char) key + '@';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else if (key == 127)
|
||||
{
|
||||
key_str[0] = '^';
|
||||
key_str[1] = '?';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (local_utf8)
|
||||
{
|
||||
/* 1 char: 0vvvvvvv */
|
||||
if (key < 0x80)
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = '\0';
|
||||
}
|
||||
/* 2 chars: 110vvvvv 10vvvvvv */
|
||||
else if ((key & 0xE0) == 0xC0)
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = (char) (getch ());
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
/* 3 chars: 1110vvvv 10vvvvvv 10vvvvvv */
|
||||
else if ((key & 0xF0) == 0xE0)
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = (char) (getch ());
|
||||
key_str[2] = (char) (getch ());
|
||||
key_str[3] = '\0';
|
||||
}
|
||||
/* 4 chars: 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv */
|
||||
else if ((key & 0xF8) == 0xF0)
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = (char) (getch ());
|
||||
key_str[2] = (char) (getch ());
|
||||
key_str[3] = (char) (getch ());
|
||||
key_str[4] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp (key_str, "^") == 0)
|
||||
{
|
||||
key_str[1] = '^';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
|
||||
/*gui_printf (gui_current_window->buffer, "gui_input_read: key = %s (%d)\n", key_str, key);*/
|
||||
|
||||
if ((gui_keyboard_pressed (key_str) != 0) && (insert_ok))
|
||||
{
|
||||
if (strcmp (key_str, "^^") == 0)
|
||||
key_str[1] = '\0';
|
||||
|
||||
switch (gui_current_window->buffer->type)
|
||||
{
|
||||
case BUFFER_TYPE_STANDARD:
|
||||
buffer_before_key =
|
||||
(gui_current_window->buffer->input_buffer) ?
|
||||
strdup (gui_current_window->buffer->input_buffer) : strdup ("");
|
||||
gui_insert_string_input (gui_current_window, key_str, -1);
|
||||
gui_current_window->buffer->input_buffer_pos += utf8_strlen (key_str);
|
||||
gui_input_draw (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
#ifdef PLUGINS
|
||||
snprintf (key_str2, sizeof (key_str2), "*%s", key_str);
|
||||
(void) plugin_keyboard_handler_exec (key_str2,
|
||||
buffer_before_key,
|
||||
gui_current_window->buffer->input_buffer);
|
||||
#endif
|
||||
break;
|
||||
case BUFFER_TYPE_DCC:
|
||||
gui_exec_action_dcc (gui_current_window, key_str);
|
||||
break;
|
||||
case BUFFER_TYPE_RAW_DATA:
|
||||
gui_exec_action_raw_data (gui_current_window, key_str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-main.c: main loop for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/fifo.h"
|
||||
#include "../../common/utf8.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
#ifdef PLUGINS
|
||||
#include "../../plugins/plugins.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* gui_main_loop: main loop for WeeChat with ncurses GUI
|
||||
*/
|
||||
|
||||
void
|
||||
gui_main_loop ()
|
||||
{
|
||||
fd_set read_fd;
|
||||
static struct timeval timeout, tv;
|
||||
static struct timezone tz;
|
||||
t_irc_server *ptr_server;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
int old_day, old_min, old_sec, diff;
|
||||
char text_time[1024];
|
||||
time_t new_time;
|
||||
struct tm *local_time;
|
||||
|
||||
quit_weechat = 0;
|
||||
|
||||
new_time = time (NULL);
|
||||
gui_last_activity_time = new_time;
|
||||
local_time = localtime (&new_time);
|
||||
old_day = local_time->tm_mday;
|
||||
|
||||
old_min = -1;
|
||||
old_sec = -1;
|
||||
check_away = 0;
|
||||
while (!quit_weechat)
|
||||
{
|
||||
/* refresh needed ? */
|
||||
if (gui_refresh_screen_needed)
|
||||
gui_window_refresh_screen (0);
|
||||
|
||||
new_time = time (NULL);
|
||||
local_time = localtime (&new_time);
|
||||
|
||||
/* minute has changed ? => redraw infobar */
|
||||
if (local_time->tm_min != old_min)
|
||||
{
|
||||
old_min = local_time->tm_min;
|
||||
gui_infobar_draw (gui_current_window->buffer, 1);
|
||||
|
||||
if (cfg_look_day_change
|
||||
&& (local_time->tm_mday != old_day))
|
||||
{
|
||||
strftime (text_time, sizeof (text_time),
|
||||
cfg_look_day_change_timestamp, local_time);
|
||||
gui_add_hotlist = 0;
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer;
|
||||
ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
if (ptr_buffer->type == BUFFER_TYPE_STANDARD)
|
||||
gui_printf_nolog_notime (ptr_buffer,
|
||||
_("Day changed to %s\n"),
|
||||
text_time);
|
||||
}
|
||||
gui_add_hotlist = 1;
|
||||
}
|
||||
old_day = local_time->tm_mday;
|
||||
}
|
||||
|
||||
/* second has changed ? */
|
||||
if (local_time->tm_sec != old_sec)
|
||||
{
|
||||
old_sec = local_time->tm_sec;
|
||||
|
||||
if (cfg_look_infobar_seconds)
|
||||
{
|
||||
gui_infobar_draw_time (gui_current_window->buffer);
|
||||
wmove (GUI_CURSES(gui_current_window)->win_input,
|
||||
0, gui_current_window->win_input_cursor_x);
|
||||
wrefresh (GUI_CURSES(gui_current_window)->win_input);
|
||||
}
|
||||
|
||||
/* infobar count down */
|
||||
if (gui_infobar && gui_infobar->remaining_time > 0)
|
||||
{
|
||||
gui_infobar->remaining_time--;
|
||||
if (gui_infobar->remaining_time == 0)
|
||||
{
|
||||
gui_infobar_remove ();
|
||||
gui_infobar_draw (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* away check */
|
||||
if (cfg_irc_away_check != 0)
|
||||
{
|
||||
check_away++;
|
||||
if (check_away >= (cfg_irc_away_check * 60))
|
||||
{
|
||||
check_away = 0;
|
||||
server_check_away ();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PLUGINS
|
||||
/* call timer handlers */
|
||||
plugin_timer_handler_exec ();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* read keyboard */
|
||||
|
||||
/* on GNU/Hurd 2 select() are causing troubles with keyboard */
|
||||
/* waiting for a fix, we use only one select() */
|
||||
#ifndef __GNU__
|
||||
FD_ZERO (&read_fd);
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 8000;
|
||||
|
||||
FD_SET (STDIN_FILENO, &read_fd);
|
||||
|
||||
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
|
||||
{
|
||||
if (FD_ISSET (STDIN_FILENO, &read_fd))
|
||||
{
|
||||
gui_keyboard_read ();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* read sockets (servers, child process when connecting, FIFO pipe) */
|
||||
|
||||
FD_ZERO (&read_fd);
|
||||
|
||||
#ifdef __GNU__
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 10000;
|
||||
FD_SET (STDIN_FILENO, &read_fd);
|
||||
#else
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 2000;
|
||||
#endif
|
||||
|
||||
if (weechat_fifo != -1)
|
||||
FD_SET (weechat_fifo, &read_fd);
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
/* check if reconnection is pending */
|
||||
if ((!ptr_server->is_connected)
|
||||
&& (ptr_server->reconnect_start > 0)
|
||||
&& (new_time >= (ptr_server->reconnect_start + ptr_server->autoreconnect_delay)))
|
||||
server_reconnect (ptr_server);
|
||||
else
|
||||
{
|
||||
if (ptr_server->is_connected)
|
||||
{
|
||||
/* check for lag */
|
||||
if ((ptr_server->lag_check_time.tv_sec == 0)
|
||||
&& (new_time >= ptr_server->lag_next_check))
|
||||
{
|
||||
server_sendf (ptr_server, "PING %s\r\n", ptr_server->address);
|
||||
gettimeofday (&(ptr_server->lag_check_time), &tz);
|
||||
}
|
||||
|
||||
/* lag timeout => disconnect */
|
||||
if ((ptr_server->lag_check_time.tv_sec != 0)
|
||||
&& (cfg_irc_lag_disconnect > 0))
|
||||
{
|
||||
gettimeofday (&tv, &tz);
|
||||
diff = (int) get_timeval_diff (&(ptr_server->lag_check_time), &tv);
|
||||
if (diff / 1000 > cfg_irc_lag_disconnect * 60)
|
||||
{
|
||||
irc_display_prefix (ptr_server, ptr_server->buffer, PREFIX_ERROR);
|
||||
gui_printf (ptr_server->buffer,
|
||||
_("%s lag is high, disconnecting from server...\n"),
|
||||
WEECHAT_WARNING);
|
||||
server_disconnect (ptr_server, 1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ptr_server->is_connected && (ptr_server->child_pid > 0))
|
||||
FD_SET (ptr_server->child_read, &read_fd);
|
||||
else
|
||||
{
|
||||
if (ptr_server->sock >= 0)
|
||||
FD_SET (ptr_server->sock, &read_fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
|
||||
{
|
||||
#ifdef __GNU__
|
||||
if (FD_ISSET (STDIN_FILENO, &read_fd))
|
||||
{
|
||||
gui_keyboard_read ();
|
||||
}
|
||||
#endif
|
||||
if ((weechat_fifo != -1) && (FD_ISSET (weechat_fifo, &read_fd)))
|
||||
{
|
||||
fifo_read ();
|
||||
}
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (!ptr_server->is_connected && (ptr_server->child_pid > 0))
|
||||
{
|
||||
if (FD_ISSET (ptr_server->child_read, &read_fd))
|
||||
server_child_read (ptr_server);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((ptr_server->sock >= 0) &&
|
||||
(FD_ISSET (ptr_server->sock, &read_fd)))
|
||||
server_recv (ptr_server);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* manages active DCC */
|
||||
dcc_handle ();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_main_pre_init: pre-initialize GUI (called before gui_init)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_main_pre_init (int *argc, char **argv[])
|
||||
{
|
||||
/* nothing for Curses interface */
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_main_init: init GUI
|
||||
*/
|
||||
|
||||
void
|
||||
gui_main_init ()
|
||||
{
|
||||
initscr ();
|
||||
|
||||
curs_set (1);
|
||||
noecho ();
|
||||
nodelay (stdscr, TRUE);
|
||||
|
||||
gui_color_init ();
|
||||
|
||||
gui_infobar = NULL;
|
||||
|
||||
gui_ok = ((COLS > WINDOW_MIN_WIDTH) && (LINES > WINDOW_MIN_HEIGHT));
|
||||
|
||||
refresh ();
|
||||
|
||||
/* init clipboard buffer */
|
||||
gui_input_clipboard = NULL;
|
||||
|
||||
/* create new window/buffer */
|
||||
if (gui_window_new (NULL, 0, 0, COLS, LINES, 100, 100))
|
||||
{
|
||||
gui_current_window = gui_windows;
|
||||
gui_buffer_new (gui_windows, NULL, NULL, BUFFER_TYPE_STANDARD, 1);
|
||||
|
||||
if (cfg_look_set_title)
|
||||
gui_window_set_title ();
|
||||
|
||||
gui_init_ok = 1;
|
||||
|
||||
signal (SIGWINCH, gui_window_refresh_screen_sigwinch);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_main_end: GUI end
|
||||
*/
|
||||
|
||||
void
|
||||
gui_main_end ()
|
||||
{
|
||||
/* free clipboard buffer */
|
||||
if (gui_input_clipboard)
|
||||
free (gui_input_clipboard);
|
||||
|
||||
/* delete all panels */
|
||||
while (gui_panels)
|
||||
gui_panel_free (gui_panels);
|
||||
|
||||
/* delete all windows */
|
||||
while (gui_windows)
|
||||
gui_window_free (gui_windows);
|
||||
gui_window_tree_free (&gui_windows_tree);
|
||||
|
||||
/* delete all buffers */
|
||||
while (gui_buffers)
|
||||
gui_buffer_free (gui_buffers, 0);
|
||||
|
||||
/* delete global history */
|
||||
history_global_free ();
|
||||
|
||||
/* delete infobar messages */
|
||||
while (gui_infobar)
|
||||
gui_infobar_remove ();
|
||||
|
||||
/* reset title */
|
||||
if (cfg_look_set_title)
|
||||
gui_window_reset_title ();
|
||||
|
||||
/* end of Curses output */
|
||||
refresh ();
|
||||
endwin ();
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-nicklist.c: nicklist display functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "../../irc/irc.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
|
||||
/*
|
||||
* gui_nicklist_draw: draw nick window for a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
int i, j, x, y, x2, column, max_length, nicks_displayed;
|
||||
char format[32], format_empty[32];
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
if (!gui_ok || !BUFFER_HAS_NICKLIST(buffer))
|
||||
return;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
|
||||
{
|
||||
max_length = nick_get_max_length (CHANNEL(buffer));
|
||||
|
||||
if (calculate_size && (gui_window_calculate_pos_size (ptr_win, 0)))
|
||||
{
|
||||
delwin (GUI_CURSES(ptr_win)->win_chat);
|
||||
delwin (GUI_CURSES(ptr_win)->win_nick);
|
||||
GUI_CURSES(ptr_win)->win_chat = newwin (ptr_win->win_chat_height,
|
||||
ptr_win->win_chat_width,
|
||||
ptr_win->win_chat_y,
|
||||
ptr_win->win_chat_x);
|
||||
GUI_CURSES(ptr_win)->win_nick = newwin (ptr_win->win_nick_height,
|
||||
ptr_win->win_nick_width,
|
||||
ptr_win->win_nick_y,
|
||||
ptr_win->win_nick_x);
|
||||
gui_chat_draw (buffer, 1);
|
||||
erase = 1;
|
||||
}
|
||||
|
||||
if (erase)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
|
||||
|
||||
snprintf (format_empty, 32, "%%-%ds", ptr_win->win_nick_width);
|
||||
for (i = 0; i < ptr_win->win_nick_height; i++)
|
||||
{
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, i, 0, format_empty, " ");
|
||||
}
|
||||
}
|
||||
|
||||
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
|
||||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
|
||||
snprintf (format, 32, "%%.%ds", max_length);
|
||||
else
|
||||
snprintf (format, 32, "%%.%ds",
|
||||
((cfg_look_nicklist_min_size > 0)
|
||||
&& (max_length < cfg_look_nicklist_min_size)) ?
|
||||
cfg_look_nicklist_min_size :
|
||||
(((cfg_look_nicklist_max_size > 0)
|
||||
&& (max_length > cfg_look_nicklist_max_size)) ?
|
||||
cfg_look_nicklist_max_size : max_length));
|
||||
|
||||
if (has_colors ())
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_SEP);
|
||||
switch (cfg_look_nicklist_position)
|
||||
{
|
||||
case CFG_LOOK_NICKLIST_LEFT:
|
||||
mvwvline (GUI_CURSES(ptr_win)->win_nick,
|
||||
0, ptr_win->win_nick_width - 1, ACS_VLINE,
|
||||
ptr_win->win_chat_height);
|
||||
break;
|
||||
case CFG_LOOK_NICKLIST_RIGHT:
|
||||
mvwvline (GUI_CURSES(ptr_win)->win_nick,
|
||||
0, 0, ACS_VLINE,
|
||||
ptr_win->win_chat_height);
|
||||
break;
|
||||
case CFG_LOOK_NICKLIST_TOP:
|
||||
mvwhline (GUI_CURSES(ptr_win)->win_nick,
|
||||
ptr_win->win_nick_height - 1, 0, ACS_HLINE,
|
||||
ptr_win->win_chat_width);
|
||||
break;
|
||||
case CFG_LOOK_NICKLIST_BOTTOM:
|
||||
mvwhline (GUI_CURSES(ptr_win)->win_nick,
|
||||
0, 0, ACS_HLINE,
|
||||
ptr_win->win_chat_width);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
|
||||
x = 0;
|
||||
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0;
|
||||
column = 0;
|
||||
|
||||
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_nick_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++)
|
||||
{
|
||||
if (!ptr_nick)
|
||||
break;
|
||||
ptr_nick = ptr_nick->next_nick;
|
||||
}
|
||||
if (ptr_nick)
|
||||
{
|
||||
for (i = 0; i < nicks_displayed; i++)
|
||||
{
|
||||
switch (cfg_look_nicklist_position)
|
||||
{
|
||||
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_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_MORE);
|
||||
j = (max_length + 1) >= 4 ? 4 : max_length + 1;
|
||||
for (x2 = 1; x2 <= j; x2++)
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x + x2, "+");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ptr_nick->flags & NICK_CHANOWNER)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANOWNER);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "~");
|
||||
x++;
|
||||
}
|
||||
else if (ptr_nick->flags & NICK_CHANADMIN)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANADMIN);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "&");
|
||||
x++;
|
||||
}
|
||||
else if (ptr_nick->flags & NICK_OP)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_OP);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "@");
|
||||
x++;
|
||||
}
|
||||
else if (ptr_nick->flags & NICK_HALFOP)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_HALFOP);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "%%");
|
||||
x++;
|
||||
}
|
||||
else if (ptr_nick->flags & NICK_VOICE)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_VOICE);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "+");
|
||||
x++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, " ");
|
||||
x++;
|
||||
}
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick,
|
||||
((cfg_irc_away_check > 0) && (ptr_nick->flags & NICK_AWAY)) ?
|
||||
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
|
||||
mvwprintw (GUI_CURSES(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
wnoutrefresh (GUI_CURSES(ptr_win)->win_nick);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-panel.c: panel functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../irc/irc.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
|
||||
/*
|
||||
* gui_panel_windows_get_size: get total panel size (window panels) for a position
|
||||
* panel is optional, if not NULL, size is computed
|
||||
* from panel 1 to panel # - 1
|
||||
*/
|
||||
|
||||
int
|
||||
gui_panel_window_get_size (t_gui_panel *panel, t_gui_window *window, int position)
|
||||
{
|
||||
t_gui_panel_window *ptr_panel_win;
|
||||
int total_size;
|
||||
|
||||
total_size = 0;
|
||||
for (ptr_panel_win = GUI_CURSES(window)->panel_windows; ptr_panel_win;
|
||||
ptr_panel_win = ptr_panel_win->next_panel_window)
|
||||
{
|
||||
/* stop before panel */
|
||||
if ((panel) && (ptr_panel_win->panel == panel))
|
||||
return total_size;
|
||||
|
||||
if (ptr_panel_win->panel->position == position)
|
||||
{
|
||||
switch (position)
|
||||
{
|
||||
case GUI_PANEL_TOP:
|
||||
case GUI_PANEL_BOTTOM:
|
||||
total_size += ptr_panel_win->height;
|
||||
break;
|
||||
case GUI_PANEL_LEFT:
|
||||
case GUI_PANEL_RIGHT:
|
||||
total_size += ptr_panel_win->width;
|
||||
break;
|
||||
}
|
||||
if (ptr_panel_win->panel->separator)
|
||||
total_size++;
|
||||
}
|
||||
}
|
||||
return total_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_panel_window_new: create a new "window panel" for a panel, in screen or a window
|
||||
* if window is not NULL, panel window will be in this window
|
||||
*/
|
||||
|
||||
int
|
||||
gui_panel_window_new (t_gui_panel *panel, t_gui_window *window)
|
||||
{
|
||||
t_gui_panel_window *new_panel_win;
|
||||
int x1, y1, x2, y2;
|
||||
int add_top, add_bottom, add_left, add_right;
|
||||
|
||||
if (window)
|
||||
{
|
||||
x1 = window->win_x;
|
||||
y1 = window->win_y + 1;
|
||||
x2 = x1 + window->win_width - 1;
|
||||
y2 = y1 + window->win_height - 1 - 4;
|
||||
add_left = gui_panel_window_get_size (panel, window, GUI_PANEL_LEFT);
|
||||
add_right = gui_panel_window_get_size (panel, window, GUI_PANEL_RIGHT);
|
||||
add_top = gui_panel_window_get_size (panel, window, GUI_PANEL_TOP);
|
||||
add_bottom = gui_panel_window_get_size (panel, window, GUI_PANEL_BOTTOM);
|
||||
}
|
||||
else
|
||||
{
|
||||
x1 = 0;
|
||||
y1 = 0;
|
||||
x2 = gui_window_get_width () - 1;
|
||||
y2 = gui_window_get_height () - 1;
|
||||
add_left = gui_panel_global_get_size (panel, GUI_PANEL_LEFT);
|
||||
add_right = gui_panel_global_get_size (panel, GUI_PANEL_RIGHT);
|
||||
add_top = gui_panel_global_get_size (panel, GUI_PANEL_TOP);
|
||||
add_bottom = gui_panel_global_get_size (panel, GUI_PANEL_BOTTOM);
|
||||
}
|
||||
|
||||
if ((new_panel_win = (t_gui_panel_window *) malloc (sizeof (t_gui_panel_window))))
|
||||
{
|
||||
new_panel_win->panel = panel;
|
||||
if (window)
|
||||
{
|
||||
panel->panel_window = NULL;
|
||||
new_panel_win->next_panel_window = GUI_CURSES(window)->panel_windows;
|
||||
GUI_CURSES(window)->panel_windows = new_panel_win;
|
||||
}
|
||||
else
|
||||
{
|
||||
panel->panel_window = new_panel_win;
|
||||
new_panel_win->next_panel_window = NULL;
|
||||
}
|
||||
switch (panel->position)
|
||||
{
|
||||
case GUI_PANEL_TOP:
|
||||
new_panel_win->x = x1 + add_left;
|
||||
new_panel_win->y = y1 + add_top;
|
||||
new_panel_win->width = x2 - x1 + 1;
|
||||
new_panel_win->height = panel->size;
|
||||
break;
|
||||
case GUI_PANEL_BOTTOM:
|
||||
new_panel_win->x = x1;
|
||||
new_panel_win->y = y2 - panel->size + 1;
|
||||
new_panel_win->width = x2 - x1 + 1;
|
||||
new_panel_win->height = panel->size;
|
||||
break;
|
||||
case GUI_PANEL_LEFT:
|
||||
new_panel_win->x = x1;
|
||||
new_panel_win->y = y1;
|
||||
new_panel_win->width = panel->size;
|
||||
new_panel_win->height = y2 - y1 + 1;
|
||||
break;
|
||||
case GUI_PANEL_RIGHT:
|
||||
new_panel_win->x = x2 - panel->size + 1;
|
||||
new_panel_win->y = y1;
|
||||
new_panel_win->width = panel->size;
|
||||
new_panel_win->height = y2 - y1 + 1;
|
||||
break;
|
||||
}
|
||||
new_panel_win->win_panel = newwin (new_panel_win->height,
|
||||
new_panel_win->width,
|
||||
new_panel_win->y,
|
||||
new_panel_win->x);
|
||||
new_panel_win->win_separator = NULL;
|
||||
if (new_panel_win->panel->separator)
|
||||
{
|
||||
switch (panel->position)
|
||||
{
|
||||
case GUI_PANEL_LEFT:
|
||||
new_panel_win->win_separator = newwin (new_panel_win->height,
|
||||
1,
|
||||
new_panel_win->y,
|
||||
new_panel_win->x + new_panel_win->width);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_panel_window_free: delete a panel window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_panel_window_free (void *panel_win)
|
||||
{
|
||||
t_gui_panel_window *ptr_panel_win;
|
||||
|
||||
ptr_panel_win = (t_gui_panel_window *)panel_win;
|
||||
|
||||
free (ptr_panel_win);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_panel_redraw_buffer: redraw panels for windows displaying a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_panel_redraw_buffer (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_gui_panel_window *ptr_panel_win;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
|
||||
{
|
||||
for (ptr_panel_win = GUI_CURSES(ptr_win)->panel_windows;
|
||||
ptr_panel_win;
|
||||
ptr_panel_win = ptr_panel_win->next_panel_window)
|
||||
{
|
||||
switch (ptr_panel_win->panel->position)
|
||||
{
|
||||
case GUI_PANEL_LEFT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-curses-status.c: status display functions for Curses GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/hotlist.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
|
||||
/*
|
||||
* gui_status_draw: draw status window for a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_weechat_hotlist *ptr_hotlist;
|
||||
char format[32], str_nicks[32], *more;
|
||||
int x, server_pos, server_total;
|
||||
int display_name, names_count;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) buffer;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (erase)
|
||||
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
|
||||
/* display number of buffers */
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, 0, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
(last_gui_buffer) ? last_gui_buffer->number : 0);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
|
||||
|
||||
/* display "<servers>" or current server */
|
||||
if (ptr_win->buffer->all_servers)
|
||||
{
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("<servers>"));
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
|
||||
}
|
||||
else if (SERVER(ptr_win->buffer) && SERVER(ptr_win->buffer)->name)
|
||||
{
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%s", SERVER(ptr_win->buffer)->name);
|
||||
if (SERVER(ptr_win->buffer)->is_away)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("(away)"));
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
|
||||
}
|
||||
|
||||
/* infos about current server buffer */
|
||||
if (SERVER(ptr_win->buffer) && !CHANNEL(ptr_win->buffer))
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
ptr_win->buffer->number);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_CHANNEL);
|
||||
if (SERVER(ptr_win->buffer)->is_connected)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[%s] ",
|
||||
SERVER(ptr_win->buffer)->name);
|
||||
else
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "(%s) ",
|
||||
SERVER(ptr_win->buffer)->name);
|
||||
if (ptr_win->buffer->all_servers)
|
||||
{
|
||||
server_get_number_buffer (SERVER(ptr_win->buffer),
|
||||
&server_pos,
|
||||
&server_total);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d", server_pos);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "/");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d", server_total);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ") ");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* infos about current channel/pv buffer */
|
||||
if (SERVER(ptr_win->buffer) && CHANNEL(ptr_win->buffer))
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
ptr_win->buffer->number);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_CHANNEL);
|
||||
if (((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_CHANNEL)
|
||||
&& (!CHANNEL(ptr_win->buffer)->nicks))
|
||||
|| ((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_DCC_CHAT)
|
||||
&& (CHANNEL(ptr_win->buffer)->dcc_chat)
|
||||
&& (((t_irc_dcc *)(CHANNEL(ptr_win->buffer)->dcc_chat))->sock < 0)))
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "(%s)",
|
||||
CHANNEL(ptr_win->buffer)->name);
|
||||
else
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
|
||||
CHANNEL(ptr_win->buffer)->name);
|
||||
if (ptr_win->buffer == CHANNEL(ptr_win->buffer)->buffer)
|
||||
{
|
||||
/* display channel modes */
|
||||
if (CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
if (CHANNEL(ptr_win->buffer)->modes
|
||||
&& (strcmp (CHANNEL(ptr_win->buffer)->modes, "+") != 0))
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
|
||||
CHANNEL(ptr_win->buffer)->modes);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ")");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
}
|
||||
|
||||
/* display DCC if private is DCC CHAT */
|
||||
if (CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_DCC_CHAT)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_CHANNEL);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "DCC");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ")");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
}
|
||||
}
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, " ");
|
||||
}
|
||||
if (!SERVER(ptr_win->buffer))
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
ptr_win->buffer->number);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_CHANNEL);
|
||||
switch (ptr_win->buffer->type)
|
||||
{
|
||||
case BUFFER_TYPE_STANDARD:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("[not connected] "));
|
||||
break;
|
||||
case BUFFER_TYPE_DCC:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "<DCC> ");
|
||||
break;
|
||||
case BUFFER_TYPE_RAW_DATA:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("<RAW_IRC> "));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* display list of other active windows (if any) with numbers */
|
||||
if (hotlist)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("Act: "));
|
||||
|
||||
names_count = 0;
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist;
|
||||
ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
switch (ptr_hotlist->priority)
|
||||
{
|
||||
case HOTLIST_LOW:
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DATA_OTHER);
|
||||
display_name = ((cfg_look_hotlist_names_level & 1) != 0);
|
||||
break;
|
||||
case HOTLIST_MSG:
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DATA_MSG);
|
||||
display_name = ((cfg_look_hotlist_names_level & 2) != 0);
|
||||
break;
|
||||
case HOTLIST_PRIVATE:
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DATA_PRIVATE);
|
||||
display_name = ((cfg_look_hotlist_names_level & 4) != 0);
|
||||
break;
|
||||
case HOTLIST_HIGHLIGHT:
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
|
||||
display_name = ((cfg_look_hotlist_names_level & 8) != 0);
|
||||
break;
|
||||
default:
|
||||
display_name = 0;
|
||||
break;
|
||||
}
|
||||
switch (ptr_hotlist->buffer->type)
|
||||
{
|
||||
case BUFFER_TYPE_STANDARD:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
ptr_hotlist->buffer->number);
|
||||
|
||||
if (display_name && (cfg_look_hotlist_names_count != 0)
|
||||
&& (names_count < cfg_look_hotlist_names_count))
|
||||
{
|
||||
names_count++;
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
if (cfg_look_hotlist_names_length == 0)
|
||||
snprintf (format, sizeof (format) - 1, "%%s");
|
||||
else
|
||||
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
|
||||
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, format,
|
||||
(ptr_hotlist->server) ?
|
||||
ptr_hotlist->server->name :
|
||||
SERVER(ptr_hotlist->buffer)->name);
|
||||
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|
||||
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
|
||||
}
|
||||
break;
|
||||
case BUFFER_TYPE_DCC:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
ptr_hotlist->buffer->number);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "DCC");
|
||||
break;
|
||||
case BUFFER_TYPE_RAW_DATA:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
ptr_hotlist->buffer->number);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("RAW_IRC"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (ptr_hotlist->next_hotlist)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ",");
|
||||
}
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
|
||||
}
|
||||
|
||||
/* display lag */
|
||||
if (SERVER(ptr_win->buffer))
|
||||
{
|
||||
if (SERVER(ptr_win->buffer)->lag / 1000 >= cfg_irc_lag_min_show)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("Lag: %.1f"),
|
||||
((float)(SERVER(ptr_win->buffer)->lag)) / 1000);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "]");
|
||||
}
|
||||
}
|
||||
|
||||
/* display "-MORE-" (if last line is not displayed) & nicks count */
|
||||
if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
|
||||
{
|
||||
snprintf (str_nicks, sizeof (str_nicks) - 1, "%d", CHANNEL(ptr_win->buffer)->nicks_count);
|
||||
x = ptr_win->win_status_width - strlen (str_nicks) - 4;
|
||||
}
|
||||
else
|
||||
x = ptr_win->win_status_width - 2;
|
||||
more = strdup (_("-MORE-"));
|
||||
x -= strlen (more) - 1;
|
||||
if (x < 0)
|
||||
x = 0;
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_MORE);
|
||||
if (ptr_win->scroll)
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, x, "%s", more);
|
||||
else
|
||||
{
|
||||
snprintf (format, sizeof (format) - 1, "%%-%ds", (int)(strlen (more)));
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, x, format, " ");
|
||||
}
|
||||
if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, " [");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%s", str_nicks);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "]");
|
||||
}
|
||||
free (more);
|
||||
|
||||
wnoutrefresh (GUI_CURSES(ptr_win)->win_status);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_GUI_CURSES_H
|
||||
#define __WEECHAT_GUI_CURSES_H 1
|
||||
|
||||
#ifdef HAVE_NCURSESW_CURSES_H
|
||||
#include <ncursesw/ncurses.h>
|
||||
#elif HAVE_NCURSES_H
|
||||
#include <ncurses.h>
|
||||
#else
|
||||
#include <curses.h>
|
||||
#endif
|
||||
|
||||
/* shift ncurses colors for compatibility with colors
|
||||
in IRC messages (same as other IRC clients) */
|
||||
|
||||
#define WEECHAT_COLOR_BLACK COLOR_BLACK
|
||||
#define WEECHAT_COLOR_RED COLOR_BLUE
|
||||
#define WEECHAT_COLOR_GREEN COLOR_GREEN
|
||||
#define WEECHAT_COLOR_YELLOW COLOR_CYAN
|
||||
#define WEECHAT_COLOR_BLUE COLOR_RED
|
||||
#define WEECHAT_COLOR_MAGENTA COLOR_MAGENTA
|
||||
#define WEECHAT_COLOR_CYAN COLOR_YELLOW
|
||||
#define WEECHAT_COLOR_WHITE COLOR_WHITE
|
||||
|
||||
#define WINDOW_MIN_WIDTH 10
|
||||
#define WINDOW_MIN_HEIGHT 5
|
||||
|
||||
#define GUI_CURSES(window) ((t_gui_curses_objects *)(window->gui_objects))
|
||||
|
||||
typedef struct t_gui_panel_window t_gui_panel_window;
|
||||
|
||||
struct t_gui_panel_window
|
||||
{
|
||||
t_gui_panel *panel; /* pointer to panel */
|
||||
int x, y; /* position of window */
|
||||
int width, height; /* window size */
|
||||
WINDOW *win_panel; /* panel Curses window */
|
||||
WINDOW *win_separator; /* separator (optional) */
|
||||
t_gui_panel_window *next_panel_window;
|
||||
/* link to next panel window */
|
||||
/* (only used if panel is in windows) */
|
||||
};
|
||||
|
||||
typedef struct t_gui_curses_objects t_gui_curses_objects;
|
||||
|
||||
struct t_gui_curses_objects
|
||||
{
|
||||
WINDOW *win_title; /* title window */
|
||||
WINDOW *win_chat; /* chat window (example: channel) */
|
||||
WINDOW *win_nick; /* nick window */
|
||||
WINDOW *win_status; /* status window */
|
||||
WINDOW *win_infobar; /* info bar window */
|
||||
WINDOW *win_input; /* input window */
|
||||
WINDOW *win_separator; /* separation between 2 splited (V) win */
|
||||
t_gui_panel_window *panel_windows; /* panel windows */
|
||||
};
|
||||
|
||||
extern t_gui_color gui_weechat_colors[];
|
||||
extern int gui_irc_colors[GUI_NUM_IRC_COLORS][2];
|
||||
extern int gui_refresh_screen_needed;
|
||||
|
||||
/* color functions */
|
||||
extern int gui_color_get_pair (int);
|
||||
extern void gui_color_init ();
|
||||
|
||||
/* chat functions */
|
||||
extern void gui_chat_calculate_line_diff (t_gui_window *, t_gui_line **, int *, int);
|
||||
|
||||
/* keyboard functions */
|
||||
extern void gui_keyboard_default_bindings ();
|
||||
extern void gui_keyboard_read ();
|
||||
|
||||
/* window functions */
|
||||
extern void gui_window_curses_clear (WINDOW *, int);
|
||||
extern void gui_window_set_weechat_color (WINDOW *, int);
|
||||
extern void gui_window_refresh_screen_sigwinch ();
|
||||
extern void gui_window_set_title ();
|
||||
extern void gui_window_reset_title ();
|
||||
|
||||
/* panel functions */
|
||||
extern int gui_panel_window_get_size (t_gui_panel *, t_gui_window *, int);
|
||||
extern void gui_panel_redraw_buffer (t_gui_buffer *);
|
||||
|
||||
#endif /* gui-curses.h */
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user