diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | po/cs.po | 24 | ||||
-rw-r--r-- | po/de.po | 24 | ||||
-rw-r--r-- | po/es.po | 24 | ||||
-rw-r--r-- | po/fr.po | 24 | ||||
-rw-r--r-- | po/hu.po | 24 | ||||
-rw-r--r-- | po/ru.po | 24 | ||||
-rw-r--r-- | po/weechat.pot | 24 | ||||
-rw-r--r-- | src/plugins/plugins-interface.c | 223 | ||||
-rw-r--r-- | src/plugins/plugins.c | 6 | ||||
-rw-r--r-- | src/plugins/weechat-plugin.h | 247 | ||||
-rw-r--r-- | weechat/ChangeLog | 4 | ||||
-rw-r--r-- | weechat/po/cs.po | 24 | ||||
-rw-r--r-- | weechat/po/de.po | 24 | ||||
-rw-r--r-- | weechat/po/es.po | 24 | ||||
-rw-r--r-- | weechat/po/fr.po | 24 | ||||
-rw-r--r-- | weechat/po/hu.po | 24 | ||||
-rw-r--r-- | weechat/po/ru.po | 24 | ||||
-rw-r--r-- | weechat/po/weechat.pot | 24 | ||||
-rw-r--r-- | weechat/src/plugins/plugins-interface.c | 223 | ||||
-rw-r--r-- | weechat/src/plugins/plugins.c | 6 | ||||
-rw-r--r-- | weechat/src/plugins/weechat-plugin.h | 247 |
22 files changed, 928 insertions, 368 deletions
@@ -1,9 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-06-20 +ChangeLog - 2006-06-22 Version 0.2.0 (under dev!): + * 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 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2305,32 +2305,32 @@ msgstr "" "%s funkce \"weechat_plugin_init\" nebyla v pluginu \"%s\" nalezena, načtení " "selhalo\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Inicializuji plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s nemohu načíst plugin \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s nemohu načíst plugin \"%s\" (nedostatek paměti)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) načten.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" odebrán.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s plugin \"%s\" nenalezen\n" @@ -2371,23 +2371,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s server/kanál (%s/%s) nenaleyen pro exec příkaz pluginu\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "bajtů" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Kb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Gb" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "ETA" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n" "Language-Team: <de@li.org>\n" @@ -2312,32 +2312,32 @@ msgstr "" "%s Funktion \"weechat_plugin_init\" nicht in Plugin \"%s\" gefunden Laden " "gescheitert\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Initialisiere Plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s kann das Plugin \"%s\" nicht initialisieren\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s kann das Plugin \"%s\" nicht laden (Speichermangel)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) geladen.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" entladen.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s Plugin \"%s\" nicht gefunden\n" @@ -2378,23 +2378,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s Server/Channel (%s/%s) für den Plugin-Exec-Befehl nicht gefunden\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "Bytes" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "KB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "MB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "GB" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "ETA" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Weechat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Roberto Gonzlez Cardenete <robert.glez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2330,33 +2330,33 @@ msgstr "" "%s funcin \"weechat_plugin_init\" no encontrada en el plugin \"%s\", fall " "al cargar\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Inicializando plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s no ha sido posible inicializar el plugin \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "" "%s no ha sido posible cargar el plugin \"%s\" (no hay suficiente memoria)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) cargado.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" descargado.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s plugin \"%s\" no encontrado\n" @@ -2398,23 +2398,23 @@ msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "" "%s servidor/canal (%s/%s) no encontrado para el plugin de comando exec\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "bytes" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "KB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "MB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "GB" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "Tiempo estimado de llegada" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-06-10 21:27+0200\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2327,32 +2327,32 @@ msgstr "" "%s la fonction \"weechat_plugin_init\" est introuvable dans l'extension \"%s" "\", chec de chargement\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Initialisation de l'extension \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s impossible d'initialiser l'extension \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s impossible de charger l'extension \"%s\" (mmoire insuffisante)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Extension \"%s\" (%s) charge.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Extension \"%s\" dcharge.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s extension \"%s\" non trouve\n" @@ -2395,23 +2395,23 @@ msgstr "" "%s serveur/canal (%s/%s) non trouv pour l'excution de commande de " "l'extension\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "octets" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Ko" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mo" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Go" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "ETA" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2308,32 +2308,32 @@ msgstr "" "%s a \"weechat_plugin_init\" függvény nem található a \"%s\" modulban, " "betöltés sikertelen\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Modul betöltése: \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s nem sikerült a modult betölteni \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s nem sikerült a modult betölteni \"%s\" (nincs elég memória)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "A \"%s\" (%s) modul betöltve.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "A \"%s\" modul eltávolítva.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s a \"%s\" modul nem található\n" @@ -2373,23 +2373,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s (%s/%s) szerver/szoba nem található a modul futtatása parancshoz\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "byte" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Kb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Gb" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Stalwart <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2294,32 +2294,32 @@ msgstr "" "%s функция \"weechat_plugin_init\" не найдена в plugin'е \"%s\", загрузка не " "удалась\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Запускаю plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s не могу инициализировать plugin \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s не могу загрузить plugin \"%s\" (недостаточно памяти)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) загружен.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" выгружен.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s plugin \"%s\" не найден\n" @@ -2360,23 +2360,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s сервер/канал (%s/%s) не найден для команды plug-inа\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "байтов" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Kb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Gb" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "осталось" diff --git a/po/weechat.pot b/po/weechat.pot index 318090f99..421a2476a 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -2168,32 +2168,32 @@ msgid "" "load\n" msgstr "" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "" @@ -2229,23 +2229,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "" diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c index 15bd6d2fd..0347368aa 100644 --- a/src/plugins/plugins-interface.c +++ b/src/plugins/plugins-interface.c @@ -391,7 +391,7 @@ weechat_plugin_exec_command (t_weechat_plugin *plugin, /* * weechat_plugin_get_info: get info about WeeChat - * WARNING: caller should free string returned + * WARNING: caller has to free string returned * by this function after use */ @@ -505,6 +505,8 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server) /* * weechat_plugin_get_dcc_info: get list of DCC files/chats info + * WARNING: caller has to free structure returned + * by this function after use */ t_plugin_dcc_info * @@ -783,6 +785,8 @@ weechat_plugin_set_plugin_config (t_weechat_plugin *plugin, char *option, char * /* * weechat_plugin_get_server_info: get list of server info + * WARNING: caller has to free structure returned + * by this function after use */ t_plugin_server_info * @@ -901,6 +905,8 @@ weechat_plugin_free_server_info (t_weechat_plugin *plugin, t_plugin_server_info /* * weechat_plugin_get_channel_info: get list of channel info from a server + * WARNING: caller has to free structure + * returned by this function after use */ t_plugin_channel_info * @@ -982,6 +988,8 @@ weechat_plugin_free_channel_info (t_weechat_plugin *plugin, t_plugin_channel_inf /* * weechat_plugin_get_nick_info: get list of nick info from a server/channel + * * WARNING: caller has to free structure + * returned by this function after use */ t_plugin_nick_info * @@ -1112,3 +1120,216 @@ weechat_plugin_get_irc_color (t_weechat_plugin *plugin, char *color_name) /* color not found */ return -1; } + +/* + * weechat_plugin_get_window_info: get list of window info + * WARNING: caller has to free structure + * returned by this function after use + */ + +t_plugin_window_info * +weechat_plugin_get_window_info (t_weechat_plugin *plugin) +{ + t_plugin_window_info *window_info, *last_window_info, *new_window_info; + t_gui_window *ptr_window; + + if (!plugin) + return NULL; + + if (gui_windows) + { + window_info = NULL; + last_window_info = NULL; + for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window) + { + new_window_info = (t_plugin_window_info *) malloc (sizeof (t_plugin_window_info)); + if (new_window_info) + { + new_window_info->win_x = ptr_window->win_x; + new_window_info->win_y = ptr_window->win_y; + new_window_info->win_width = ptr_window->win_width; + new_window_info->win_height = ptr_window->win_height; + new_window_info->win_width_pct = ptr_window->win_width_pct; + new_window_info->win_height_pct = ptr_window->win_height_pct; + new_window_info->num_buffer = (ptr_window->buffer) ? ptr_window->buffer->number : 0; + + new_window_info->prev_window = last_window_info; + new_window_info->next_window = NULL; + if (!window_info) + window_info = new_window_info; + else + last_window_info->next_window = new_window_info; + last_window_info = new_window_info; + } + } + + return window_info; + } + + return NULL; +} + +/* + * weechat_plugin_free_window_info: free window info struct list + */ + +void +weechat_plugin_free_window_info (t_weechat_plugin *plugin, t_plugin_window_info *window_info) +{ + t_plugin_window_info *new_window_info; + + if (!plugin || !window_info) + return; + + while (window_info) + { + new_window_info = window_info->next_window; + free (window_info); + window_info = new_window_info; + } +} + +/* + * weechat_plugin_get_buffer_info: get list of buffer info + * WARNING: caller has to free structure + * returned by this function after use + */ + +t_plugin_buffer_info * +weechat_plugin_get_buffer_info (t_weechat_plugin *plugin) +{ + t_plugin_buffer_info *buffer_info, *last_buffer_info, *new_buffer_info; + t_gui_buffer *ptr_buffer; + + if (!plugin) + return NULL; + + if (gui_buffers) + { + buffer_info = NULL; + last_buffer_info = NULL; + for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) + { + new_buffer_info = (t_plugin_buffer_info *) malloc (sizeof (t_plugin_buffer_info)); + if (new_buffer_info) + { + new_buffer_info->type = ptr_buffer->type; + new_buffer_info->number = ptr_buffer->number; + new_buffer_info->num_displayed = ptr_buffer->num_displayed; + new_buffer_info->server_name = (SERVER(ptr_buffer)) ? strdup (SERVER(ptr_buffer)->name) : NULL; + new_buffer_info->channel_name = (CHANNEL(ptr_buffer)) ? strdup (CHANNEL(ptr_buffer)->name) : NULL; + new_buffer_info->notify_level = ptr_buffer->notify_level; + new_buffer_info->log_filename = (ptr_buffer->log_filename) ? strdup (ptr_buffer->log_filename) : NULL; + + new_buffer_info->prev_buffer = last_buffer_info; + new_buffer_info->next_buffer = NULL; + if (!buffer_info) + buffer_info = new_buffer_info; + else + last_buffer_info->next_buffer = new_buffer_info; + last_buffer_info = new_buffer_info; + } + } + + return buffer_info; + } + + return NULL; +} + +/* + * weechat_plugin_free_buffer_info: free buffer info struct list + */ + +void +weechat_plugin_free_buffer_info (t_weechat_plugin *plugin, t_plugin_buffer_info *buffer_info) +{ + t_plugin_buffer_info *new_buffer_info; + + if (!plugin || !buffer_info) + return; + + while (buffer_info) + { + if (buffer_info->server_name) + free (buffer_info->server_name); + if (buffer_info->channel_name) + free (buffer_info->channel_name); + if (buffer_info->log_filename) + free (buffer_info->log_filename); + new_buffer_info = buffer_info->next_buffer; + free (buffer_info); + buffer_info = new_buffer_info; + } +} + +/* + * weechat_plugin_get_buffer_data: get buffer content + * WARNING: caller has to free structure + * returned by this function after use + */ + +t_plugin_buffer_line * +weechat_plugin_get_buffer_data (t_weechat_plugin *plugin, char *server, char *channel) +{ + t_irc_server *ptr_server; + t_irc_channel *ptr_channel; + t_plugin_buffer_line *buffer_line, *last_buffer_line, *new_buffer_line; + t_gui_line *ptr_line; + + if (!plugin) + return NULL; + + plugin_find_server_channel (server, channel, &ptr_server, &ptr_channel); + + if (!ptr_channel || !ptr_channel->buffer) + return NULL; + + buffer_line = NULL; + last_buffer_line = NULL; + for (ptr_line = ptr_channel->buffer->last_line; ptr_line; + ptr_line = ptr_line->prev_line) + { + new_buffer_line = (t_plugin_buffer_line *) malloc (sizeof (t_plugin_buffer_line)); + if (new_buffer_line) + { + new_buffer_line->nick = (ptr_line->nick) ? strdup (ptr_line->nick) : NULL; + new_buffer_line->data = (ptr_line->data) ? + (char *) gui_color_decode ((unsigned char *)(ptr_line->data + ptr_line->ofs_start_message), 0) : NULL; + + new_buffer_line->prev_line = last_buffer_line; + new_buffer_line->next_line = NULL; + if (!buffer_line) + buffer_line = new_buffer_line; + else + last_buffer_line->next_line = new_buffer_line; + last_buffer_line = new_buffer_line; + } + } + + return buffer_line; +} + +/* + * weechat_plugin_free_buffer_data: free buffer data (lines) struct list + */ + +void +weechat_plugin_free_buffer_data (t_weechat_plugin *plugin, t_plugin_buffer_line *buffer_line) +{ + t_plugin_buffer_line *new_buffer_line; + + if (!plugin || !buffer_line) + return; + + while (buffer_line) + { + if (buffer_line->nick) + free (buffer_line->nick); + if (buffer_line->data) + free (buffer_line->data); + new_buffer_line = buffer_line->next_line; + free (buffer_line); + buffer_line = new_buffer_line; + } +} diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index 474d0e478..49e4771b0 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -877,6 +877,12 @@ plugin_load (char *filename) new_plugin->free_nick_info = &weechat_plugin_free_nick_info; new_plugin->input_color = &weechat_plugin_input_color; new_plugin->get_irc_color = &weechat_plugin_get_irc_color; + new_plugin->get_window_info = &weechat_plugin_get_window_info; + new_plugin->free_window_info = &weechat_plugin_free_window_info; + new_plugin->get_buffer_info = &weechat_plugin_get_buffer_info; + new_plugin->free_buffer_info = &weechat_plugin_free_buffer_info; + new_plugin->get_buffer_data = &weechat_plugin_get_buffer_data; + new_plugin->free_buffer_data = &weechat_plugin_free_buffer_data; /* handlers */ new_plugin->handlers = NULL; diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 241356207..6c26ecedb 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -25,16 +25,16 @@ #include <sys/types.h> /* return codes for init function and handlers */ -#define PLUGIN_RC_KO -1 /* function/handler failed */ -#define PLUGIN_RC_OK 0 /* function/handler ok */ +#define PLUGIN_RC_KO -1 /* function/handler failed */ +#define PLUGIN_RC_OK 0 /* function/handler ok */ /* return codes specific to message handlers: messages can be discarded for WeeChat, for plugins, or both */ -#define PLUGIN_RC_OK_IGNORE_WEECHAT 1 /* ignore WeeChat for this message */ -#define PLUGIN_RC_OK_IGNORE_PLUGINS 2 /* ignore other plugins for this msg */ +#define PLUGIN_RC_OK_IGNORE_WEECHAT 1 /* ignore WeeChat for this message */ +#define PLUGIN_RC_OK_IGNORE_PLUGINS 2 /* ignore other plugins for this msg*/ #define PLUGIN_RC_OK_IGNORE_ALL (PLUGIN_RC_OK_IGNORE_WEECHAT \ | PLUGIN_RC_OK_IGNORE_PLUGINS) - /* ignore WeeChat and other plugins */ + /* ignore WeeChat and other plugins */ #define WEECHAT_IRC_COLOR_WHITE 0 #define WEECHAT_IRC_COLOR_BLACK 1 @@ -57,88 +57,126 @@ typedef struct t_plugin_dcc_info t_plugin_dcc_info; struct t_plugin_dcc_info { - char *server; /* irc server */ - char *channel; /* irc channel (for DCC chat only) */ - int type; /* DCC type (send or receive) */ - int status; /* DCC status (waiting, sending, ..) */ - time_t start_time; /* the time when DCC started */ - time_t start_transfer; /* the time when DCC transfer started */ - unsigned long addr; /* IP address */ - int port; /* port */ - char *nick; /* remote nick */ - char *filename; /* filename (given by sender) */ - char *local_filename; /* local filename (with path) */ - int filename_suffix; /* suffix (.1 for ex) if renaming file */ - unsigned long size; /* file size */ - unsigned long pos; /* number of bytes received/sent */ - unsigned long start_resume; /* start of resume (in bytes) */ - unsigned long bytes_per_sec; /* bytes per second */ - t_plugin_dcc_info *prev_dcc; /* link to previous dcc file/chat */ - t_plugin_dcc_info *next_dcc; /* link to next dcc file/chat */ + char *server; /* irc server */ + char *channel; /* irc channel (for DCC chat only) */ + int type; /* DCC type (send or receive) */ + int status; /* DCC status (waiting, sending, ..) */ + time_t start_time; /* the time when DCC started */ + time_t start_transfer; /* the time when DCC transfer started */ + unsigned long addr; /* IP address */ + int port; /* port */ + char *nick; /* remote nick */ + char *filename; /* filename (given by sender) */ + char *local_filename; /* local filename (with path) */ + int filename_suffix; /* suffix (.1 for ex) if renaming file */ + unsigned long size; /* file size */ + unsigned long pos; /* number of bytes received/sent */ + unsigned long start_resume; /* start of resume (in bytes) */ + unsigned long bytes_per_sec; /* bytes per second */ + t_plugin_dcc_info *prev_dcc; /* link to previous dcc file/chat */ + t_plugin_dcc_info *next_dcc; /* link to next dcc file/chat */ }; typedef struct t_plugin_server_info t_plugin_server_info; struct t_plugin_server_info { - char *name; /* name of server (only for display) */ - int autoconnect; /* = 1 if auto connect at startup */ - int autoreconnect; /* = 1 if auto reco when disconnected */ - int autoreconnect_delay; /* delay before trying again reconnect */ - int command_line; /* server was given on command line */ - char *address; /* address of server (IP or name) */ - int port; /* port for server (6667 by default) */ - int ipv6; /* use IPv6 protocol */ - int ssl; /* SSL protocol */ - char *password; /* password for server */ - char *nick1; /* first nickname for the server */ - char *nick2; /* alternate nickname */ - char *nick3; /* 2nd alternate nickname */ - char *username; /* user name */ - char *realname; /* real name */ - char *command; /* command to run once connected */ - int command_delay; /* delay after execution of command */ - char *autojoin; /* channels to automatically join */ - int autorejoin; /* auto rejoin channels when kicked */ - char *notify_levels; /* channels notify levels */ - char *charset_decode_iso; /* channels charsets for decoding ISO */ - char *charset_decode_utf; /* channels charsets for decoding UTF */ - char *charset_encode; /* channels charsets for encoding msgs */ - int is_connected; /* 1 if WeeChat is connected to server */ - int ssl_connected; /* = 1 if connected with SSL */ - char *nick; /* current nickname */ - int is_away; /* 1 is user is marker as away */ - time_t away_time; /* time() when user marking as away */ - int lag; /* lag (in milliseconds) */ - t_plugin_server_info *prev_server; /* link to previous server info */ - t_plugin_server_info *next_server; /* link to next server info */ + char *name; /* name of server (only for display) */ + int autoconnect; /* = 1 if auto connect at startup */ + int autoreconnect; /* = 1 if auto reco when disconnected */ + int autoreconnect_delay; /* delay before trying again reconnect */ + int command_line; /* server was given on command line */ + char *address; /* address of server (IP or name) */ + int port; /* port for server (6667 by default) */ + int ipv6; /* use IPv6 protocol */ + int ssl; /* SSL protocol */ + char *password; /* password for server */ + char *nick1; /* first nickname for the server */ + char *nick2; /* alternate nickname */ + char *nick3; /* 2nd alternate nickname */ + char *username; /* user name */ + char *realname; /* real name */ + char *command; /* command to run once connected */ + int command_delay; /* delay after execution of command */ + char *autojoin; /* channels to automatically join */ + int autorejoin; /* auto rejoin channels when kicked */ + char *notify_levels; /* channels notify levels */ + char *charset_decode_iso; /* channels charsets for decoding ISO */ + char *charset_decode_utf; /* channels charsets for decoding UTF */ + char *charset_encode; /* channels charsets for encoding msgs */ + int is_connected; /* 1 if WeeChat is connected to server */ + int ssl_connected; /* = 1 if connected with SSL */ + char *nick; /* current nickname */ + int is_away; /* 1 is user is marker as away */ + time_t away_time; /* time() when user marking as away */ + int lag; /* lag (in milliseconds) */ + t_plugin_server_info *prev_server; /* link to previous server info */ + t_plugin_server_info *next_server; /* link to next server info */ }; typedef struct t_plugin_channel_info t_plugin_channel_info; struct t_plugin_channel_info { - int type; /* channel type */ - char *name; /* name of channel (exemple: "#abc") */ - char *topic; /* topic of channel (host for private) */ - char *modes; /* channel modes */ - int limit; /* user limit (0 is limit not set) */ - char *key; /* channel key (NULL if no key is set) */ - int nicks_count; /* # nicks on channel (0 if dcc/pv) */ - t_plugin_channel_info *prev_channel; /* link to previous channel info */ - t_plugin_channel_info *next_channel; /* link to next channel info */ + int type; /* channel type */ + char *name; /* name of channel (exemple: "#abc") */ + char *topic; /* topic of channel (host for private) */ + char *modes; /* channel modes */ + int limit; /* user limit (0 is limit not set) */ + char *key; /* channel key (NULL if no key is set) */ + int nicks_count; /* # nicks on channel (0 if dcc/pv) */ + t_plugin_channel_info *prev_channel; /* link to previous channel info */ + t_plugin_channel_info *next_channel; /* link to next channel info */ }; typedef struct t_plugin_nick_info t_plugin_nick_info; struct t_plugin_nick_info { - char *nick; /* nickname */ - int flags; /* chanowner/chanadmin (unrealircd), */ - char *host; /* hostname */ - /* op, halfop, voice, away */ - t_plugin_nick_info *prev_nick; /* link to previous nick */ - t_plugin_nick_info *next_nick; /* link to next nick */ + char *nick; /* nickname */ + int flags; /* chanowner/chanadmin (unrealircd), */ + char *host; /* hostname */ + /* op, halfop, voice, away */ + t_plugin_nick_info *prev_nick; /* link to previous nick */ + t_plugin_nick_info *next_nick; /* link to next nick */ +}; + +typedef struct t_plugin_window_info t_plugin_window_info; + +struct t_plugin_window_info +{ + int win_x, win_y; /* position of window */ + int win_width, win_height; /* window geometry */ + int win_width_pct; /* % of width (compared to term size) */ + int win_height_pct; /* % of height (compared to term size) */ + int num_buffer; /* # of displayed buffer */ + t_plugin_window_info *prev_window; /* link to previous window */ + t_plugin_window_info *next_window; /* link to next window */ +}; + +typedef struct t_plugin_buffer_info t_plugin_buffer_info; + +struct t_plugin_buffer_info +{ + int type; /* buffer type (0=standard,1=dcc,2=raw) */ + int number; /* buffer number */ + int num_displayed; /* number of windows displaying buffer */ + char *server_name; /* server name for buffer (may be NULL) */ + char *channel_name; /* channel name for buffer (may be NULL)*/ + int notify_level; /* notify level for buffer */ + char *log_filename; /* log filename (NULL is disabled) */ + t_plugin_buffer_info *prev_buffer; /* link to previous buffer */ + t_plugin_buffer_info *next_buffer; /* link to next buffer */ +}; + +typedef struct t_plugin_buffer_line t_plugin_buffer_line; + +struct t_plugin_buffer_line +{ + char *nick; /* nick */ + char *data; /* line data */ + t_plugin_buffer_line *prev_line; /* link to previous line */ + t_plugin_buffer_line *next_line; /* link to next line */ }; typedef struct t_weechat_plugin t_weechat_plugin; @@ -151,42 +189,42 @@ typedef enum t_handler_type t_handler_type; enum t_handler_type { - HANDLER_MESSAGE = 0, /* IRC message handler */ - HANDLER_COMMAND, /* command handler */ - HANDLER_TIMER, /* timer handler */ - HANDLER_KEYBOARD /* keyboard handler */ + HANDLER_MESSAGE = 0, /* IRC message handler */ + HANDLER_COMMAND, /* command handler */ + HANDLER_TIMER, /* timer handler */ + HANDLER_KEYBOARD /* keyboard handler */ }; typedef struct t_plugin_handler t_plugin_handler; struct t_plugin_handler { - t_handler_type type; /* handler type */ + t_handler_type type; /* handler type */ /* data for message handler */ - char *irc_command; /* name of IRC command (PRIVMSG, ..) */ + char *irc_command; /* name of IRC command (PRIVMSG, ..) */ /* data for command handler */ - char *command; /* name of command (without first '/') */ - char *description; /* (for /help) short cmd description */ - char *arguments; /* (for /help) command arguments */ - char *arguments_description; /* (for /help) args long description */ - char *completion_template; /* template for completion */ + char *command; /* name of command (without first '/') */ + char *description; /* (for /help) short cmd description */ + char *arguments; /* (for /help) command arguments */ + char *arguments_description; /* (for /help) args long description */ + char *completion_template; /* template for completion */ /* data for timer handler */ - int interval; /* interval between two calls to fct */ - int remaining; /* seconds remaining before next call */ + int interval; /* interval between two calls to fct */ + int remaining; /* seconds remaining before next call */ /* data common to all handlers */ - t_plugin_handler_func *handler; /* pointer to handler */ - char *handler_args; /* arguments sent to handler */ - void *handler_pointer; /* pointer sent to handler */ + t_plugin_handler_func *handler; /* pointer to handler */ + char *handler_args; /* arguments sent to handler */ + void *handler_pointer; /* pointer sent to handler */ /* for internal use */ - int running; /* 1 if currently running */ - /* (used to prevent circular call) */ - t_plugin_handler *prev_handler; /* link to previous handler */ - t_plugin_handler *next_handler; /* link to next handler */ + int running; /* 1 if currently running */ + /* (used to prevent circular call) */ + t_plugin_handler *prev_handler; /* link to previous handler */ + t_plugin_handler *next_handler; /* link to next handler */ }; /* plugin, a WeeChat plugin, which is a dynamic library */ @@ -194,19 +232,19 @@ struct t_plugin_handler struct t_weechat_plugin { /* plugin variables */ - char *filename; /* name of plugin on disk */ - void *handle; /* handle of plugin (given by dlopen) */ - char *name; /* plugin name */ - char *description; /* plugin description */ - char *version; /* plugin version */ + char *filename; /* name of plugin on disk */ + void *handle; /* handle of plugin (given by dlopen) */ + char *name; /* plugin name */ + char *description; /* plugin description */ + char *version; /* plugin version */ /* plugin handlers */ - t_plugin_handler *handlers; /* pointer to first handler */ - t_plugin_handler *last_handler; /* pointer to last handler */ + t_plugin_handler *handlers; /* pointer to first handler */ + t_plugin_handler *last_handler; /* pointer to last handler */ /* links to previous/next plugins */ - t_weechat_plugin *prev_plugin; /* link to previous plugin */ - t_weechat_plugin *next_plugin; /* link to next plugin */ + t_weechat_plugin *prev_plugin; /* link to previous plugin */ + t_weechat_plugin *next_plugin; /* link to next plugin */ /* plugin functions (interface) */ @@ -264,6 +302,13 @@ struct t_weechat_plugin void (*input_color) (t_weechat_plugin *, int, int, int); int (*get_irc_color) (t_weechat_plugin *, char *); + + t_plugin_window_info *(*get_window_info) (t_weechat_plugin *); + void (*free_window_info) (t_weechat_plugin *, t_plugin_window_info *); + t_plugin_buffer_info *(*get_buffer_info) (t_weechat_plugin *); + void (*free_buffer_info) (t_weechat_plugin *, t_plugin_buffer_info *); + t_plugin_buffer_line *(*get_buffer_data) (t_weechat_plugin *, char *, char *); + void (*free_buffer_data) (t_weechat_plugin *, t_plugin_buffer_line *); /* WeeChat developers: ALWAYS add new functions at the end */ }; @@ -321,5 +366,11 @@ extern t_plugin_nick_info *weechat_plugin_get_nick_info (t_weechat_plugin *, cha extern void weechat_plugin_free_nick_info (t_weechat_plugin *, t_plugin_nick_info *); extern void weechat_plugin_input_color (t_weechat_plugin *, int, int, int); extern int weechat_plugin_get_irc_color (t_weechat_plugin *, char *); +extern t_plugin_window_info *weechat_plugin_get_window_info (t_weechat_plugin *); +extern void weechat_plugin_free_window_info (t_weechat_plugin *, t_plugin_window_info *); +extern t_plugin_buffer_info *weechat_plugin_get_buffer_info (t_weechat_plugin *); +extern void weechat_plugin_free_buffer_info (t_weechat_plugin *, t_plugin_buffer_info *); +extern t_plugin_buffer_line *weechat_plugin_get_buffer_data (t_weechat_plugin *, char *, char *); +extern void weechat_plugin_free_buffer_data (t_weechat_plugin *, t_plugin_buffer_line *); #endif /* weechat-plugin.h */ diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 8ab8649d7..109c48eda 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,9 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-06-20 +ChangeLog - 2006-06-22 Version 0.2.0 (under dev!): + * 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 diff --git a/weechat/po/cs.po b/weechat/po/cs.po index f80e2c101..7183d511c 100644 --- a/weechat/po/cs.po +++ b/weechat/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2305,32 +2305,32 @@ msgstr "" "%s funkce \"weechat_plugin_init\" nebyla v pluginu \"%s\" nalezena, načtení " "selhalo\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Inicializuji plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s nemohu načíst plugin \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s nemohu načíst plugin \"%s\" (nedostatek paměti)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) načten.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" odebrán.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s plugin \"%s\" nenalezen\n" @@ -2371,23 +2371,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s server/kanál (%s/%s) nenaleyen pro exec příkaz pluginu\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "bajtů" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Kb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Gb" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "ETA" diff --git a/weechat/po/de.po b/weechat/po/de.po index 1bfde24c3..f734adef1 100644 --- a/weechat/po/de.po +++ b/weechat/po/de.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n" "Language-Team: <de@li.org>\n" @@ -2312,32 +2312,32 @@ msgstr "" "%s Funktion \"weechat_plugin_init\" nicht in Plugin \"%s\" gefunden Laden " "gescheitert\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Initialisiere Plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s kann das Plugin \"%s\" nicht initialisieren\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s kann das Plugin \"%s\" nicht laden (Speichermangel)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) geladen.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" entladen.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s Plugin \"%s\" nicht gefunden\n" @@ -2378,23 +2378,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s Server/Channel (%s/%s) für den Plugin-Exec-Befehl nicht gefunden\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "Bytes" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "KB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "MB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "GB" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "ETA" diff --git a/weechat/po/es.po b/weechat/po/es.po index a20e41e81..43466e0e9 100644 --- a/weechat/po/es.po +++ b/weechat/po/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Weechat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Roberto Gonzlez Cardenete <robert.glez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2330,33 +2330,33 @@ msgstr "" "%s funcin \"weechat_plugin_init\" no encontrada en el plugin \"%s\", fall " "al cargar\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Inicializando plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s no ha sido posible inicializar el plugin \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "" "%s no ha sido posible cargar el plugin \"%s\" (no hay suficiente memoria)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) cargado.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" descargado.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s plugin \"%s\" no encontrado\n" @@ -2398,23 +2398,23 @@ msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "" "%s servidor/canal (%s/%s) no encontrado para el plugin de comando exec\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "bytes" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "KB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "MB" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "GB" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "Tiempo estimado de llegada" diff --git a/weechat/po/fr.po b/weechat/po/fr.po index a64b931da..a0e061d54 100644 --- a/weechat/po/fr.po +++ b/weechat/po/fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-06-10 21:27+0200\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2327,32 +2327,32 @@ msgstr "" "%s la fonction \"weechat_plugin_init\" est introuvable dans l'extension \"%s" "\", chec de chargement\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Initialisation de l'extension \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s impossible d'initialiser l'extension \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s impossible de charger l'extension \"%s\" (mmoire insuffisante)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Extension \"%s\" (%s) charge.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Extension \"%s\" dcharge.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s extension \"%s\" non trouve\n" @@ -2395,23 +2395,23 @@ msgstr "" "%s serveur/canal (%s/%s) non trouv pour l'excution de commande de " "l'extension\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "octets" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Ko" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mo" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Go" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "ETA" diff --git a/weechat/po/hu.po b/weechat/po/hu.po index 2dfec98b5..e388e6e7a 100644 --- a/weechat/po/hu.po +++ b/weechat/po/hu.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2308,32 +2308,32 @@ msgstr "" "%s a \"weechat_plugin_init\" függvény nem található a \"%s\" modulban, " "betöltés sikertelen\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Modul betöltése: \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s nem sikerült a modult betölteni \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s nem sikerült a modult betölteni \"%s\" (nincs elég memória)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "A \"%s\" (%s) modul betöltve.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "A \"%s\" modul eltávolítva.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s a \"%s\" modul nem található\n" @@ -2373,23 +2373,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s (%s/%s) szerver/szoba nem található a modul futtatása parancshoz\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "byte" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Kb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Gb" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "" diff --git a/weechat/po/ru.po b/weechat/po/ru.po index 63a0159b7..994593bb9 100644 --- a/weechat/po/ru.po +++ b/weechat/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.0-cvs\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: 2006-05-25 02:04+0200\n" "Last-Translator: Stalwart <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2294,32 +2294,32 @@ msgstr "" "%s функция \"weechat_plugin_init\" не найдена в plugin'е \"%s\", загрузка не " "удалась\n" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "Запускаю plugin \"%s\" %s\n" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "%s не могу инициализировать plugin \"%s\"\n" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "%s не могу загрузить plugin \"%s\" (недостаточно памяти)\n" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "Plugin \"%s\" (%s) загружен.\n" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "Plugin \"%s\" выгружен.\n" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "%s plugin \"%s\" не найден\n" @@ -2360,23 +2360,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "%s сервер/канал (%s/%s) не найден для команды plug-inа\n" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "байтов" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "Kb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "Mb" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "Gb" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "осталось" diff --git a/weechat/po/weechat.pot b/weechat/po/weechat.pot index 318090f99..421a2476a 100644 --- a/weechat/po/weechat.pot +++ b/weechat/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2006-06-15 15:03+0200\n" +"POT-Creation-Date: 2006-06-22 05:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -2168,32 +2168,32 @@ msgid "" "load\n" msgstr "" -#: src/plugins/plugins.c:896 +#: src/plugins/plugins.c:902 #, c-format msgid "Initializing plugin \"%s\" %s\n" msgstr "" -#: src/plugins/plugins.c:904 +#: src/plugins/plugins.c:910 #, c-format msgid "%s unable to initialize plugin \"%s\"\n" msgstr "" -#: src/plugins/plugins.c:915 +#: src/plugins/plugins.c:921 #, c-format msgid "%s unable to load plugin \"%s\" (not enough memory)\n" msgstr "" -#: src/plugins/plugins.c:923 +#: src/plugins/plugins.c:929 #, c-format msgid "Plugin \"%s\" (%s) loaded.\n" msgstr "" -#: src/plugins/plugins.c:1090 +#: src/plugins/plugins.c:1096 #, c-format msgid "Plugin \"%s\" unloaded.\n" msgstr "" -#: src/plugins/plugins.c:1096 src/common/command.c:3637 +#: src/plugins/plugins.c:1102 src/common/command.c:3637 #, c-format msgid "%s plugin \"%s\" not found\n" msgstr "" @@ -2229,23 +2229,23 @@ msgstr "" msgid "%s server/channel (%s/%s) not found for plugin exec command\n" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "bytes" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Kb" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Mb" msgstr "" -#: src/gui/curses/gui-curses-chat.c:876 +#: src/gui/curses/gui-curses-chat.c:879 msgid "Gb" msgstr "" -#: src/gui/curses/gui-curses-chat.c:994 +#: src/gui/curses/gui-curses-chat.c:997 msgid "ETA" msgstr "" diff --git a/weechat/src/plugins/plugins-interface.c b/weechat/src/plugins/plugins-interface.c index 15bd6d2fd..0347368aa 100644 --- a/weechat/src/plugins/plugins-interface.c +++ b/weechat/src/plugins/plugins-interface.c @@ -391,7 +391,7 @@ weechat_plugin_exec_command (t_weechat_plugin *plugin, /* * weechat_plugin_get_info: get info about WeeChat - * WARNING: caller should free string returned + * WARNING: caller has to free string returned * by this function after use */ @@ -505,6 +505,8 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server) /* * weechat_plugin_get_dcc_info: get list of DCC files/chats info + * WARNING: caller has to free structure returned + * by this function after use */ t_plugin_dcc_info * @@ -783,6 +785,8 @@ weechat_plugin_set_plugin_config (t_weechat_plugin *plugin, char *option, char * /* * weechat_plugin_get_server_info: get list of server info + * WARNING: caller has to free structure returned + * by this function after use */ t_plugin_server_info * @@ -901,6 +905,8 @@ weechat_plugin_free_server_info (t_weechat_plugin *plugin, t_plugin_server_info /* * weechat_plugin_get_channel_info: get list of channel info from a server + * WARNING: caller has to free structure + * returned by this function after use */ t_plugin_channel_info * @@ -982,6 +988,8 @@ weechat_plugin_free_channel_info (t_weechat_plugin *plugin, t_plugin_channel_inf /* * weechat_plugin_get_nick_info: get list of nick info from a server/channel + * * WARNING: caller has to free structure + * returned by this function after use */ t_plugin_nick_info * @@ -1112,3 +1120,216 @@ weechat_plugin_get_irc_color (t_weechat_plugin *plugin, char *color_name) /* color not found */ return -1; } + +/* + * weechat_plugin_get_window_info: get list of window info + * WARNING: caller has to free structure + * returned by this function after use + */ + +t_plugin_window_info * +weechat_plugin_get_window_info (t_weechat_plugin *plugin) +{ + t_plugin_window_info *window_info, *last_window_info, *new_window_info; + t_gui_window *ptr_window; + + if (!plugin) + return NULL; + + if (gui_windows) + { + window_info = NULL; + last_window_info = NULL; + for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window) + { + new_window_info = (t_plugin_window_info *) malloc (sizeof (t_plugin_window_info)); + if (new_window_info) + { + new_window_info->win_x = ptr_window->win_x; + new_window_info->win_y = ptr_window->win_y; + new_window_info->win_width = ptr_window->win_width; + new_window_info->win_height = ptr_window->win_height; + new_window_info->win_width_pct = ptr_window->win_width_pct; + new_window_info->win_height_pct = ptr_window->win_height_pct; + new_window_info->num_buffer = (ptr_window->buffer) ? ptr_window->buffer->number : 0; + + new_window_info->prev_window = last_window_info; + new_window_info->next_window = NULL; + if (!window_info) + window_info = new_window_info; + else + last_window_info->next_window = new_window_info; + last_window_info = new_window_info; + } + } + + return window_info; + } + + return NULL; +} + +/* + * weechat_plugin_free_window_info: free window info struct list + */ + +void +weechat_plugin_free_window_info (t_weechat_plugin *plugin, t_plugin_window_info *window_info) +{ + t_plugin_window_info *new_window_info; + + if (!plugin || !window_info) + return; + + while (window_info) + { + new_window_info = window_info->next_window; + free (window_info); + window_info = new_window_info; + } +} + +/* + * weechat_plugin_get_buffer_info: get list of buffer info + * WARNING: caller has to free structure + * returned by this function after use + */ + +t_plugin_buffer_info * +weechat_plugin_get_buffer_info (t_weechat_plugin *plugin) +{ + t_plugin_buffer_info *buffer_info, *last_buffer_info, *new_buffer_info; + t_gui_buffer *ptr_buffer; + + if (!plugin) + return NULL; + + if (gui_buffers) + { + buffer_info = NULL; + last_buffer_info = NULL; + for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) + { + new_buffer_info = (t_plugin_buffer_info *) malloc (sizeof (t_plugin_buffer_info)); + if (new_buffer_info) + { + new_buffer_info->type = ptr_buffer->type; + new_buffer_info->number = ptr_buffer->number; + new_buffer_info->num_displayed = ptr_buffer->num_displayed; + new_buffer_info->server_name = (SERVER(ptr_buffer)) ? strdup (SERVER(ptr_buffer)->name) : NULL; + new_buffer_info->channel_name = (CHANNEL(ptr_buffer)) ? strdup (CHANNEL(ptr_buffer)->name) : NULL; + new_buffer_info->notify_level = ptr_buffer->notify_level; + new_buffer_info->log_filename = (ptr_buffer->log_filename) ? strdup (ptr_buffer->log_filename) : NULL; + + new_buffer_info->prev_buffer = last_buffer_info; + new_buffer_info->next_buffer = NULL; + if (!buffer_info) + buffer_info = new_buffer_info; + else + last_buffer_info->next_buffer = new_buffer_info; + last_buffer_info = new_buffer_info; + } + } + + return buffer_info; + } + + return NULL; +} + +/* + * weechat_plugin_free_buffer_info: free buffer info struct list + */ + +void +weechat_plugin_free_buffer_info (t_weechat_plugin *plugin, t_plugin_buffer_info *buffer_info) +{ + t_plugin_buffer_info *new_buffer_info; + + if (!plugin || !buffer_info) + return; + + while (buffer_info) + { + if (buffer_info->server_name) + free (buffer_info->server_name); + if (buffer_info->channel_name) + free (buffer_info->channel_name); + if (buffer_info->log_filename) + free (buffer_info->log_filename); + new_buffer_info = buffer_info->next_buffer; + free (buffer_info); + buffer_info = new_buffer_info; + } +} + +/* + * weechat_plugin_get_buffer_data: get buffer content + * WARNING: caller has to free structure + * returned by this function after use + */ + +t_plugin_buffer_line * +weechat_plugin_get_buffer_data (t_weechat_plugin *plugin, char *server, char *channel) +{ + t_irc_server *ptr_server; + t_irc_channel *ptr_channel; + t_plugin_buffer_line *buffer_line, *last_buffer_line, *new_buffer_line; + t_gui_line *ptr_line; + + if (!plugin) + return NULL; + + plugin_find_server_channel (server, channel, &ptr_server, &ptr_channel); + + if (!ptr_channel || !ptr_channel->buffer) + return NULL; + + buffer_line = NULL; + last_buffer_line = NULL; + for (ptr_line = ptr_channel->buffer->last_line; ptr_line; + ptr_line = ptr_line->prev_line) + { + new_buffer_line = (t_plugin_buffer_line *) malloc (sizeof (t_plugin_buffer_line)); + if (new_buffer_line) + { + new_buffer_line->nick = (ptr_line->nick) ? strdup (ptr_line->nick) : NULL; + new_buffer_line->data = (ptr_line->data) ? + (char *) gui_color_decode ((unsigned char *)(ptr_line->data + ptr_line->ofs_start_message), 0) : NULL; + + new_buffer_line->prev_line = last_buffer_line; + new_buffer_line->next_line = NULL; + if (!buffer_line) + buffer_line = new_buffer_line; + else + last_buffer_line->next_line = new_buffer_line; + last_buffer_line = new_buffer_line; + } + } + + return buffer_line; +} + +/* + * weechat_plugin_free_buffer_data: free buffer data (lines) struct list + */ + +void +weechat_plugin_free_buffer_data (t_weechat_plugin *plugin, t_plugin_buffer_line *buffer_line) +{ + t_plugin_buffer_line *new_buffer_line; + + if (!plugin || !buffer_line) + return; + + while (buffer_line) + { + if (buffer_line->nick) + free (buffer_line->nick); + if (buffer_line->data) + free (buffer_line->data); + new_buffer_line = buffer_line->next_line; + free (buffer_line); + buffer_line = new_buffer_line; + } +} diff --git a/weechat/src/plugins/plugins.c b/weechat/src/plugins/plugins.c index 474d0e478..49e4771b0 100644 --- a/weechat/src/plugins/plugins.c +++ b/weechat/src/plugins/plugins.c @@ -877,6 +877,12 @@ plugin_load (char *filename) new_plugin->free_nick_info = &weechat_plugin_free_nick_info; new_plugin->input_color = &weechat_plugin_input_color; new_plugin->get_irc_color = &weechat_plugin_get_irc_color; + new_plugin->get_window_info = &weechat_plugin_get_window_info; + new_plugin->free_window_info = &weechat_plugin_free_window_info; + new_plugin->get_buffer_info = &weechat_plugin_get_buffer_info; + new_plugin->free_buffer_info = &weechat_plugin_free_buffer_info; + new_plugin->get_buffer_data = &weechat_plugin_get_buffer_data; + new_plugin->free_buffer_data = &weechat_plugin_free_buffer_data; /* handlers */ new_plugin->handlers = NULL; diff --git a/weechat/src/plugins/weechat-plugin.h b/weechat/src/plugins/weechat-plugin.h index 241356207..6c26ecedb 100644 --- a/weechat/src/plugins/weechat-plugin.h +++ b/weechat/src/plugins/weechat-plugin.h @@ -25,16 +25,16 @@ #include <sys/types.h> /* return codes for init function and handlers */ -#define PLUGIN_RC_KO -1 /* function/handler failed */ -#define PLUGIN_RC_OK 0 /* function/handler ok */ +#define PLUGIN_RC_KO -1 /* function/handler failed */ +#define PLUGIN_RC_OK 0 /* function/handler ok */ /* return codes specific to message handlers: messages can be discarded for WeeChat, for plugins, or both */ -#define PLUGIN_RC_OK_IGNORE_WEECHAT 1 /* ignore WeeChat for this message */ -#define PLUGIN_RC_OK_IGNORE_PLUGINS 2 /* ignore other plugins for this msg */ +#define PLUGIN_RC_OK_IGNORE_WEECHAT 1 /* ignore WeeChat for this message */ +#define PLUGIN_RC_OK_IGNORE_PLUGINS 2 /* ignore other plugins for this msg*/ #define PLUGIN_RC_OK_IGNORE_ALL (PLUGIN_RC_OK_IGNORE_WEECHAT \ | PLUGIN_RC_OK_IGNORE_PLUGINS) - /* ignore WeeChat and other plugins */ + /* ignore WeeChat and other plugins */ #define WEECHAT_IRC_COLOR_WHITE 0 #define WEECHAT_IRC_COLOR_BLACK 1 @@ -57,88 +57,126 @@ typedef struct t_plugin_dcc_info t_plugin_dcc_info; struct t_plugin_dcc_info { - char *server; /* irc server */ - char *channel; /* irc channel (for DCC chat only) */ - int type; /* DCC type (send or receive) */ - int status; /* DCC status (waiting, sending, ..) */ - time_t start_time; /* the time when DCC started */ - time_t start_transfer; /* the time when DCC transfer started */ - unsigned long addr; /* IP address */ - int port; /* port */ - char *nick; /* remote nick */ - char *filename; /* filename (given by sender) */ - char *local_filename; /* local filename (with path) */ - int filename_suffix; /* suffix (.1 for ex) if renaming file */ - unsigned long size; /* file size */ - unsigned long pos; /* number of bytes received/sent */ - unsigned long start_resume; /* start of resume (in bytes) */ - unsigned long bytes_per_sec; /* bytes per second */ - t_plugin_dcc_info *prev_dcc; /* link to previous dcc file/chat */ - t_plugin_dcc_info *next_dcc; /* link to next dcc file/chat */ + char *server; /* irc server */ + char *channel; /* irc channel (for DCC chat only) */ + int type; /* DCC type (send or receive) */ + int status; /* DCC status (waiting, sending, ..) */ + time_t start_time; /* the time when DCC started */ + time_t start_transfer; /* the time when DCC transfer started */ + unsigned long addr; /* IP address */ + int port; /* port */ + char *nick; /* remote nick */ + char *filename; /* filename (given by sender) */ + char *local_filename; /* local filename (with path) */ + int filename_suffix; /* suffix (.1 for ex) if renaming file */ + unsigned long size; /* file size */ + unsigned long pos; /* number of bytes received/sent */ + unsigned long start_resume; /* start of resume (in bytes) */ + unsigned long bytes_per_sec; /* bytes per second */ + t_plugin_dcc_info *prev_dcc; /* link to previous dcc file/chat */ + t_plugin_dcc_info *next_dcc; /* link to next dcc file/chat */ }; typedef struct t_plugin_server_info t_plugin_server_info; struct t_plugin_server_info { - char *name; /* name of server (only for display) */ - int autoconnect; /* = 1 if auto connect at startup */ - int autoreconnect; /* = 1 if auto reco when disconnected */ - int autoreconnect_delay; /* delay before trying again reconnect */ - int command_line; /* server was given on command line */ - char *address; /* address of server (IP or name) */ - int port; /* port for server (6667 by default) */ - int ipv6; /* use IPv6 protocol */ - int ssl; /* SSL protocol */ - char *password; /* password for server */ - char *nick1; /* first nickname for the server */ - char *nick2; /* alternate nickname */ - char *nick3; /* 2nd alternate nickname */ - char *username; /* user name */ - char *realname; /* real name */ - char *command; /* command to run once connected */ - int command_delay; /* delay after execution of command */ - char *autojoin; /* channels to automatically join */ - int autorejoin; /* auto rejoin channels when kicked */ - char *notify_levels; /* channels notify levels */ - char *charset_decode_iso; /* channels charsets for decoding ISO */ - char *charset_decode_utf; /* channels charsets for decoding UTF */ - char *charset_encode; /* channels charsets for encoding msgs */ - int is_connected; /* 1 if WeeChat is connected to server */ - int ssl_connected; /* = 1 if connected with SSL */ - char *nick; /* current nickname */ - int is_away; /* 1 is user is marker as away */ - time_t away_time; /* time() when user marking as away */ - int lag; /* lag (in milliseconds) */ - t_plugin_server_info *prev_server; /* link to previous server info */ - t_plugin_server_info *next_server; /* link to next server info */ + char *name; /* name of server (only for display) */ + int autoconnect; /* = 1 if auto connect at startup */ + int autoreconnect; /* = 1 if auto reco when disconnected */ + int autoreconnect_delay; /* delay before trying again reconnect */ + int command_line; /* server was given on command line */ + char *address; /* address of server (IP or name) */ + int port; /* port for server (6667 by default) */ + int ipv6; /* use IPv6 protocol */ + int ssl; /* SSL protocol */ + char *password; /* password for server */ + char *nick1; /* first nickname for the server */ + char *nick2; /* alternate nickname */ + char *nick3; /* 2nd alternate nickname */ + char *username; /* user name */ + char *realname; /* real name */ + char *command; /* command to run once connected */ + int command_delay; /* delay after execution of command */ + char *autojoin; /* channels to automatically join */ + int autorejoin; /* auto rejoin channels when kicked */ + char *notify_levels; /* channels notify levels */ + char *charset_decode_iso; /* channels charsets for decoding ISO */ + char *charset_decode_utf; /* channels charsets for decoding UTF */ + char *charset_encode; /* channels charsets for encoding msgs */ + int is_connected; /* 1 if WeeChat is connected to server */ + int ssl_connected; /* = 1 if connected with SSL */ + char *nick; /* current nickname */ + int is_away; /* 1 is user is marker as away */ + time_t away_time; /* time() when user marking as away */ + int lag; /* lag (in milliseconds) */ + t_plugin_server_info *prev_server; /* link to previous server info */ + t_plugin_server_info *next_server; /* link to next server info */ }; typedef struct t_plugin_channel_info t_plugin_channel_info; struct t_plugin_channel_info { - int type; /* channel type */ - char *name; /* name of channel (exemple: "#abc") */ - char *topic; /* topic of channel (host for private) */ - char *modes; /* channel modes */ - int limit; /* user limit (0 is limit not set) */ - char *key; /* channel key (NULL if no key is set) */ - int nicks_count; /* # nicks on channel (0 if dcc/pv) */ - t_plugin_channel_info *prev_channel; /* link to previous channel info */ - t_plugin_channel_info *next_channel; /* link to next channel info */ + int type; /* channel type */ + char *name; /* name of channel (exemple: "#abc") */ + char *topic; /* topic of channel (host for private) */ + char *modes; /* channel modes */ + int limit; /* user limit (0 is limit not set) */ + char *key; /* channel key (NULL if no key is set) */ + int nicks_count; /* # nicks on channel (0 if dcc/pv) */ + t_plugin_channel_info *prev_channel; /* link to previous channel info */ + t_plugin_channel_info *next_channel; /* link to next channel info */ }; typedef struct t_plugin_nick_info t_plugin_nick_info; struct t_plugin_nick_info { - char *nick; /* nickname */ - int flags; /* chanowner/chanadmin (unrealircd), */ - char *host; /* hostname */ - /* op, halfop, voice, away */ - t_plugin_nick_info *prev_nick; /* link to previous nick */ - t_plugin_nick_info *next_nick; /* link to next nick */ + char *nick; /* nickname */ + int flags; /* chanowner/chanadmin (unrealircd), */ + char *host; /* hostname */ + /* op, halfop, voice, away */ + t_plugin_nick_info *prev_nick; /* link to previous nick */ + t_plugin_nick_info *next_nick; /* link to next nick */ +}; + +typedef struct t_plugin_window_info t_plugin_window_info; + +struct t_plugin_window_info +{ + int win_x, win_y; /* position of window */ + int win_width, win_height; /* window geometry */ + int win_width_pct; /* % of width (compared to term size) */ + int win_height_pct; /* % of height (compared to term size) */ + int num_buffer; /* # of displayed buffer */ + t_plugin_window_info *prev_window; /* link to previous window */ + t_plugin_window_info *next_window; /* link to next window */ +}; + +typedef struct t_plugin_buffer_info t_plugin_buffer_info; + +struct t_plugin_buffer_info +{ + int type; /* buffer type (0=standard,1=dcc,2=raw) */ + int number; /* buffer number */ + int num_displayed; /* number of windows displaying buffer */ + char *server_name; /* server name for buffer (may be NULL) */ + char *channel_name; /* channel name for buffer (may be NULL)*/ + int notify_level; /* notify level for buffer */ + char *log_filename; /* log filename (NULL is disabled) */ + t_plugin_buffer_info *prev_buffer; /* link to previous buffer */ + t_plugin_buffer_info *next_buffer; /* link to next buffer */ +}; + +typedef struct t_plugin_buffer_line t_plugin_buffer_line; + +struct t_plugin_buffer_line +{ + char *nick; /* nick */ + char *data; /* line data */ + t_plugin_buffer_line *prev_line; /* link to previous line */ + t_plugin_buffer_line *next_line; /* link to next line */ }; typedef struct t_weechat_plugin t_weechat_plugin; @@ -151,42 +189,42 @@ typedef enum t_handler_type t_handler_type; enum t_handler_type { - HANDLER_MESSAGE = 0, /* IRC message handler */ - HANDLER_COMMAND, /* command handler */ - HANDLER_TIMER, /* timer handler */ - HANDLER_KEYBOARD /* keyboard handler */ + HANDLER_MESSAGE = 0, /* IRC message handler */ + HANDLER_COMMAND, /* command handler */ + HANDLER_TIMER, /* timer handler */ + HANDLER_KEYBOARD /* keyboard handler */ }; typedef struct t_plugin_handler t_plugin_handler; struct t_plugin_handler { - t_handler_type type; /* handler type */ + t_handler_type type; /* handler type */ /* data for message handler */ - char *irc_command; /* name of IRC command (PRIVMSG, ..) */ + char *irc_command; /* name of IRC command (PRIVMSG, ..) */ /* data for command handler */ - char *command; /* name of command (without first '/') */ - char *description; /* (for /help) short cmd description */ - char *arguments; /* (for /help) command arguments */ - char *arguments_description; /* (for /help) args long description */ - char *completion_template; /* template for completion */ + char *command; /* name of command (without first '/') */ + char *description; /* (for /help) short cmd description */ + char *arguments; /* (for /help) command arguments */ + char *arguments_description; /* (for /help) args long description */ + char *completion_template; /* template for completion */ /* data for timer handler */ - int interval; /* interval between two calls to fct */ - int remaining; /* seconds remaining before next call */ + int interval; /* interval between two calls to fct */ + int remaining; /* seconds remaining before next call */ /* data common to all handlers */ - t_plugin_handler_func *handler; /* pointer to handler */ - char *handler_args; /* arguments sent to handler */ - void *handler_pointer; /* pointer sent to handler */ + t_plugin_handler_func *handler; /* pointer to handler */ + char *handler_args; /* arguments sent to handler */ + void *handler_pointer; /* pointer sent to handler */ /* for internal use */ - int running; /* 1 if currently running */ - /* (used to prevent circular call) */ - t_plugin_handler *prev_handler; /* link to previous handler */ - t_plugin_handler *next_handler; /* link to next handler */ + int running; /* 1 if currently running */ + /* (used to prevent circular call) */ + t_plugin_handler *prev_handler; /* link to previous handler */ + t_plugin_handler *next_handler; /* link to next handler */ }; /* plugin, a WeeChat plugin, which is a dynamic library */ @@ -194,19 +232,19 @@ struct t_plugin_handler struct t_weechat_plugin { /* plugin variables */ - char *filename; /* name of plugin on disk */ - void *handle; /* handle of plugin (given by dlopen) */ - char *name; /* plugin name */ - char *description; /* plugin description */ - char *version; /* plugin version */ + char *filename; /* name of plugin on disk */ + void *handle; /* handle of plugin (given by dlopen) */ + char *name; /* plugin name */ + char *description; /* plugin description */ + char *version; /* plugin version */ /* plugin handlers */ - t_plugin_handler *handlers; /* pointer to first handler */ - t_plugin_handler *last_handler; /* pointer to last handler */ + t_plugin_handler *handlers; /* pointer to first handler */ + t_plugin_handler *last_handler; /* pointer to last handler */ /* links to previous/next plugins */ - t_weechat_plugin *prev_plugin; /* link to previous plugin */ - t_weechat_plugin *next_plugin; /* link to next plugin */ + t_weechat_plugin *prev_plugin; /* link to previous plugin */ + t_weechat_plugin *next_plugin; /* link to next plugin */ /* plugin functions (interface) */ @@ -264,6 +302,13 @@ struct t_weechat_plugin void (*input_color) (t_weechat_plugin *, int, int, int); int (*get_irc_color) (t_weechat_plugin *, char *); + + t_plugin_window_info *(*get_window_info) (t_weechat_plugin *); + void (*free_window_info) (t_weechat_plugin *, t_plugin_window_info *); + t_plugin_buffer_info *(*get_buffer_info) (t_weechat_plugin *); + void (*free_buffer_info) (t_weechat_plugin *, t_plugin_buffer_info *); + t_plugin_buffer_line *(*get_buffer_data) (t_weechat_plugin *, char *, char *); + void (*free_buffer_data) (t_weechat_plugin *, t_plugin_buffer_line *); /* WeeChat developers: ALWAYS add new functions at the end */ }; @@ -321,5 +366,11 @@ extern t_plugin_nick_info *weechat_plugin_get_nick_info (t_weechat_plugin *, cha extern void weechat_plugin_free_nick_info (t_weechat_plugin *, t_plugin_nick_info *); extern void weechat_plugin_input_color (t_weechat_plugin *, int, int, int); extern int weechat_plugin_get_irc_color (t_weechat_plugin *, char *); +extern t_plugin_window_info *weechat_plugin_get_window_info (t_weechat_plugin *); +extern void weechat_plugin_free_window_info (t_weechat_plugin *, t_plugin_window_info *); +extern t_plugin_buffer_info *weechat_plugin_get_buffer_info (t_weechat_plugin *); +extern void weechat_plugin_free_buffer_info (t_weechat_plugin *, t_plugin_buffer_info *); +extern t_plugin_buffer_line *weechat_plugin_get_buffer_data (t_weechat_plugin *, char *, char *); +extern void weechat_plugin_free_buffer_data (t_weechat_plugin *, t_plugin_buffer_line *); #endif /* weechat-plugin.h */ |