From 18ff3064cf1f889ce050c2e18b5f827e4dd3de7f Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 9 Nov 2013 15:55:11 +0100 Subject: [PATCH] core: add infos "term_width" and "term_height" --- ChangeLog | 1 + doc/de/autogen/plugin_api/infos.txt | 4 ++++ doc/en/autogen/plugin_api/infos.txt | 4 ++++ doc/fr/autogen/plugin_api/infos.txt | 4 ++++ doc/it/autogen/plugin_api/infos.txt | 4 ++++ doc/ja/autogen/plugin_api/infos.txt | 4 ++++ po/cs.po | 8 +++++++- po/de.po | 8 +++++++- po/es.po | 8 +++++++- po/fr.po | 10 ++++++++-- po/hu.po | 8 +++++++- po/it.po | 8 +++++++- po/ja.po | 8 +++++++- po/pl.po | 8 +++++++- po/pt_BR.po | 8 +++++++- po/ru.po | 8 +++++++- po/tr.po | 8 +++++++- po/weechat.pot | 8 +++++++- src/plugins/plugin-api.c | 14 ++++++++++++++ 19 files changed, 120 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e37374088..a0da39296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] == Version 0.4.3 (under dev) +* core: add infos "term_width" and "term_height" * core: add bar item "buffer_zoom", add signals "buffer_{zoomed|unzoomed}" (patch #8204) * core: create .conf file with default options only if the file does not exist diff --git a/doc/de/autogen/plugin_api/infos.txt b/doc/de/autogen/plugin_api/infos.txt index b3d8492ad..2785f50bb 100644 --- a/doc/de/autogen/plugin_api/infos.txt +++ b/doc/de/autogen/plugin_api/infos.txt @@ -42,6 +42,10 @@ | weechat | locale | Lokalisation welche für die übersetzten Nachrichten verwendet werden soll | - +| weechat | term_height | height of terminal | - + +| weechat | term_width | width of terminal | - + | weechat | version | WeeChat Version | - | weechat | version_git | WeeChat Git Version (Ausgabe des Befehls "git describe", ausschließlich für eine Entwicklerversion. Eine stabile Version gibt keine Information zurück) | - diff --git a/doc/en/autogen/plugin_api/infos.txt b/doc/en/autogen/plugin_api/infos.txt index edae6f78b..81aaee62d 100644 --- a/doc/en/autogen/plugin_api/infos.txt +++ b/doc/en/autogen/plugin_api/infos.txt @@ -42,6 +42,10 @@ | weechat | locale | locale used for translating messages | - +| weechat | term_height | height of terminal | - + +| weechat | term_width | width of terminal | - + | weechat | version | WeeChat version | - | weechat | version_git | WeeChat git version (output of command "git describe" for a development version only, empty for a stable release) | - diff --git a/doc/fr/autogen/plugin_api/infos.txt b/doc/fr/autogen/plugin_api/infos.txt index a377bb2a5..bf329af2d 100644 --- a/doc/fr/autogen/plugin_api/infos.txt +++ b/doc/fr/autogen/plugin_api/infos.txt @@ -42,6 +42,10 @@ | weechat | locale | locale utilisée pour la traduction des messages | - +| weechat | term_height | hauteur du terminal | - + +| weechat | term_width | largeur du terminal | - + | weechat | version | version de WeeChat | - | weechat | version_git | version git de WeeChat (sortie de la commande "git describe" pour une version de développement seulement, vide pour une version stable) | - diff --git a/doc/it/autogen/plugin_api/infos.txt b/doc/it/autogen/plugin_api/infos.txt index 315fd2f6b..e303a258a 100644 --- a/doc/it/autogen/plugin_api/infos.txt +++ b/doc/it/autogen/plugin_api/infos.txt @@ -42,6 +42,10 @@ | weechat | locale | locale usato per la traduzione dei messaggi | - +| weechat | term_height | height of terminal | - + +| weechat | term_width | width of terminal | - + | weechat | version | versione di WeeChat | - | weechat | version_git | Versione git di weechat (output del comando "git describe" solo per la versione di sviluppo, vuoto per una release stabile) | - diff --git a/doc/ja/autogen/plugin_api/infos.txt b/doc/ja/autogen/plugin_api/infos.txt index 94d384269..b0ae41a5f 100644 --- a/doc/ja/autogen/plugin_api/infos.txt +++ b/doc/ja/autogen/plugin_api/infos.txt @@ -42,6 +42,10 @@ | weechat | locale | 翻訳メッセージに利用するロケール | - +| weechat | term_height | height of terminal | - + +| weechat | term_width | width of terminal | - + | weechat | version | WeeChat のバージョン | - | weechat | version_git | WeeChat の git バージョン (開発バージョンではコマンド "git describe" の出力、安定版リリースでは空文字が出力されます) | - diff --git a/po/cs.po b/po/cs.po index b4610f197..7583e8f69 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -7786,6 +7786,12 @@ msgstr "1 pokud jsou filtry povoleny" msgid "1 if cursor mode is enabled" msgstr "1 pokud jsou filtry povoleny" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "seznam polí" diff --git a/po/de.po b/po/de.po index ff70cadef..2c0a271b0 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -8657,6 +8657,12 @@ msgstr "1, falls Filter aktiviert sind" msgid "1 if cursor mode is enabled" msgstr "1, falls Cursor-Modus aktiviert ist" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "Auflistung der Bars" diff --git a/po/es.po b/po/es.po index 2080ca07b..bf02aecef 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -8063,6 +8063,12 @@ msgstr "1 si los filtros están habilitados" msgid "1 if cursor mode is enabled" msgstr "1 si el modo cursor está activado" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "lista de barras" diff --git a/po/fr.po b/po/fr.po index 94c60e639..17bc093d0 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" -"PO-Revision-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" +"PO-Revision-Date: 2013-11-09 15:47+0100\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -8420,6 +8420,12 @@ msgstr "1 si les filtres sont activés" msgid "1 if cursor mode is enabled" msgstr "1 si le mode curseur est activé" +msgid "width of terminal" +msgstr "largeur du terminal" + +msgid "height of terminal" +msgstr "hauteur du terminal" + msgid "list of bars" msgstr "liste des barres" diff --git a/po/hu.po b/po/hu.po index cabb375d4..adf674f7e 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -7232,6 +7232,12 @@ msgstr "a felhasználók le lettek tiltva" msgid "1 if cursor mode is enabled" msgstr "a felhasználók le lettek tiltva" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + #, fuzzy msgid "list of bars" msgstr "Aliaszok listája:\n" diff --git a/po/it.po b/po/it.po index 593872911..b77faf469 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -8186,6 +8186,12 @@ msgstr "1 se i filtri sono abilitati" msgid "1 if cursor mode is enabled" msgstr "1 se la modalità cursore è abilitata" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "elenco delle barre" diff --git a/po/ja.po b/po/ja.po index 2bf1d8400..97bbd10a0 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -8093,6 +8093,12 @@ msgstr "フィルタが有効の場合 1" msgid "1 if cursor mode is enabled" msgstr "カーソルモードが有効の場合 1" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "バーのリスト" diff --git a/po/pl.po b/po/pl.po index 77ddaca9e..d3a4698a8 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -8256,6 +8256,12 @@ msgstr "1 jeśli filtry są aktywne" msgid "1 if cursor mode is enabled" msgstr "1 jeśli tryb kursora jest aktywny" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "lista pasków" diff --git a/po/pt_BR.po b/po/pt_BR.po index 070ffb8f7..4706b2ace 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -7459,6 +7459,12 @@ msgstr "1 se os filtros estão habilitados" msgid "1 if cursor mode is enabled" msgstr "1 se o modo cursor está habilitado" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "lista de barras" diff --git a/po/ru.po b/po/ru.po index d7732d03d..0ceab19fe 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:18+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -7261,6 +7261,12 @@ msgstr "команда users отключена" msgid "1 if cursor mode is enabled" msgstr "команда users отключена" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + #, fuzzy msgid "list of bars" msgstr "Список сокращений:\n" diff --git a/po/tr.po b/po/tr.po index cb8211e81..47198948b 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-11-09 10:13+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -6459,6 +6459,12 @@ msgstr "" msgid "1 if cursor mode is enabled" msgstr "" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 8e204174c..0b864ad8f 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-11-09 15:21+0100\n" +"POT-Creation-Date: 2013-11-09 15:46+0100\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: weechat-dev \n" @@ -6421,6 +6421,12 @@ msgstr "" msgid "1 if cursor mode is enabled" msgstr "" +msgid "width of terminal" +msgstr "" + +msgid "height of terminal" +msgstr "" + msgid "list of bars" msgstr "" diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 8406a4e41..3790cf741 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -387,6 +387,16 @@ plugin_api_info_get_internal (void *data, const char *info_name, snprintf (value, sizeof (value), "%d", gui_cursor_mode); return value; } + else if (string_strcasecmp (info_name, "term_width") == 0) + { + snprintf (value, sizeof (value), "%d", gui_window_get_width ()); + return value; + } + else if (string_strcasecmp (info_name, "term_height") == 0) + { + snprintf (value, sizeof (value), "%d", gui_window_get_height ()); + return value; + } /* info not found */ return NULL; @@ -1127,6 +1137,10 @@ plugin_api_init () &plugin_api_info_get_internal, NULL); hook_info (NULL, "cursor_mode", N_("1 if cursor mode is enabled"), NULL, &plugin_api_info_get_internal, NULL); + hook_info (NULL, "term_width", N_("width of terminal"), NULL, + &plugin_api_info_get_internal, NULL); + hook_info (NULL, "term_height", N_("height of terminal"), NULL, + &plugin_api_info_get_internal, NULL); /* WeeChat core infolist hooks */ hook_infolist (NULL, "bar", N_("list of bars"),