api: add infos "term_colors" and "term_color_pairs"

v2.8-utf8proc
Sébastien Helleu 2019-08-25 19:10:32 +02:00
parent f0685dd1b1
commit 68d6f1b415
23 changed files with 190 additions and 14 deletions

View File

@ -22,6 +22,7 @@ New features::
* core: add support of 32767 color pairs (issue #1343, issue #1345)
* core: add option "close" in command /window (issue #853)
* api: add infos "term_colors" and "term_color_pairs"
* api: add function list_user_data (issue #666)
* api: add argument "strip_items" in function string_split
* buflist: add infolist "buflist" with list of buffer pointers (issue #1375)

View File

@ -108,6 +108,10 @@
| weechat | pid | WeeChat PID (Prozess-ID) | -
| weechat | term_color_pairs | number of color pairs supported in terminal | -
| weechat | term_colors | number of colors supported in terminal | -
| weechat | term_height | Höhe des Terminals | -
| weechat | term_width | Breite des Terminals | -

View File

@ -108,6 +108,10 @@
| weechat | pid | WeeChat PID (process ID) | -
| weechat | term_color_pairs | number of color pairs supported in terminal | -
| weechat | term_colors | number of colors supported in terminal | -
| weechat | term_height | height of terminal | -
| weechat | term_width | width of terminal | -

View File

@ -108,6 +108,10 @@
| weechat | pid | PID (ID de processus) de WeeChat | -
| weechat | term_color_pairs | nombre de paires de couleurs supportées dans le terminal | -
| weechat | term_colors | nombre de couleurs supportées dans le terminal | -
| weechat | term_height | hauteur du terminal | -
| weechat | term_width | largeur du terminal | -

View File

@ -108,6 +108,10 @@
| weechat | pid | WeeChat PID (process ID) | -
| weechat | term_color_pairs | number of color pairs supported in terminal | -
| weechat | term_colors | number of colors supported in terminal | -
| weechat | term_height | height of terminal | -
| weechat | term_width | width of terminal | -

View File

@ -108,6 +108,10 @@
| weechat | pid | WeeChat の PID (プロセス ID) | -
| weechat | term_color_pairs | number of color pairs supported in terminal | -
| weechat | term_colors | number of colors supported in terminal | -
| weechat | term_height | 端末の高さ | -
| weechat | term_width | 端末の幅 | -

View File

@ -108,6 +108,10 @@
| weechat | pid | WeeChat PID (ID procesu) | -
| weechat | term_color_pairs | number of color pairs supported in terminal | -
| weechat | term_colors | number of colors supported in terminal | -
| weechat | term_height | wysokość terminala | -
| weechat | term_width | szerokość terminala | -

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -10116,6 +10116,14 @@ msgstr "šířka terminálu"
msgid "height of terminal"
msgstr "výška terminálu"
#, fuzzy
msgid "number of colors supported in terminal"
msgstr "Terminál nepodporuje barvy."
#, fuzzy
msgid "number of color pairs supported in terminal"
msgstr "Terminál nepodporuje barvy."
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr "Rozšířené POSIX regulární výrazy k hledání ANSI escape kodů"

View File

@ -24,7 +24,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-08-24 08:05+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@ -11936,6 +11936,14 @@ msgstr "Breite des Terminals"
msgid "height of terminal"
msgstr "Höhe des Terminals"
#, fuzzy
msgid "number of colors supported in terminal"
msgstr "keine Farbunterstützung durch Terminal."
#, fuzzy
msgid "number of color pairs supported in terminal"
msgstr "keine Farbunterstützung durch Terminal."
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr "erweiterte reguläre POSIX Ausdrücke um ANSI Escapesequenz zu suchen"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -10429,6 +10429,14 @@ msgstr ""
msgid "height of terminal"
msgstr ""
#, fuzzy
msgid "number of colors supported in terminal"
msgstr "No hay soporte para color en la terminal."
#, fuzzy
msgid "number of color pairs supported in terminal"
msgstr "No hay soporte para color en la terminal."
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"PO-Revision-Date: 2019-08-24 07:09+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-08-25 19:08+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -11664,6 +11664,12 @@ msgstr "largeur du terminal"
msgid "height of terminal"
msgstr "hauteur du terminal"
msgid "number of colors supported in terminal"
msgstr "nombre de couleurs supportées dans le terminal"
msgid "number of color pairs supported in terminal"
msgstr "nombre de paires de couleurs supportées dans le terminal"
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""
"expression régulière POSIX étendue pour chercher les codes ANSI échappés"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -9479,6 +9479,12 @@ msgstr ""
msgid "height of terminal"
msgstr ""
msgid "number of colors supported in terminal"
msgstr ""
msgid "number of color pairs supported in terminal"
msgstr ""
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -10611,6 +10611,14 @@ msgstr ""
msgid "height of terminal"
msgstr ""
#, fuzzy
msgid "number of colors supported in terminal"
msgstr "Nessun supporto al colore nel terminale."
#, fuzzy
msgid "number of color pairs supported in terminal"
msgstr "Nessun supporto al colore nel terminale."
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-06-22 08:40+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@ -11236,6 +11236,14 @@ msgstr "端末の幅"
msgid "height of terminal"
msgstr "端末の高さ"
#, fuzzy
msgid "number of colors supported in terminal"
msgstr "端末では色はサポートされていません。"
#, fuzzy
msgid "number of color pairs supported in terminal"
msgstr "端末では色はサポートされていません。"
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr "ANSI エスケープコードを検索する POSIX 拡張正規表現"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-06-22 08:40+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@ -11402,6 +11402,14 @@ msgstr "szerokość terminala"
msgid "height of terminal"
msgstr "wysokość terminala"
#, fuzzy
msgid "number of colors supported in terminal"
msgstr "Brak wsparcia dla kolorów w terminalu."
#, fuzzy
msgid "number of color pairs supported in terminal"
msgstr "Brak wsparcia dla kolorów w terminalu."
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""
"Rozszerzone wyrażenia regularne POSIX do wyszukiwania kodów escapującyhc ANSI"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@ -11074,6 +11074,14 @@ msgstr "largura do terminal"
msgid "height of terminal"
msgstr "altura do terminal"
#, fuzzy
msgid "number of colors supported in terminal"
msgstr "O terminal não tem suporte de cor."
#, fuzzy
msgid "number of color pairs supported in terminal"
msgstr "O terminal não tem suporte de cor."
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr "expressão regular POSIX estendida para procurar códigos de escape ANSI"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -9919,6 +9919,12 @@ msgstr "largura do terminal"
msgid "height of terminal"
msgstr "altura do terminal"
msgid "number of colors supported in terminal"
msgstr ""
msgid "number of color pairs supported in terminal"
msgstr ""
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -9515,6 +9515,12 @@ msgstr ""
msgid "height of terminal"
msgstr ""
msgid "number of colors supported in terminal"
msgstr ""
msgid "number of color pairs supported in terminal"
msgstr ""
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -8645,6 +8645,12 @@ msgstr ""
msgid "height of terminal"
msgstr ""
msgid "number of colors supported in terminal"
msgstr ""
msgid "number of color pairs supported in terminal"
msgstr ""
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-08-24 07:05+0200\n"
"POT-Creation-Date: 2019-08-25 17:27+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -8508,6 +8508,12 @@ msgstr ""
msgid "height of terminal"
msgstr ""
msgid "number of colors supported in terminal"
msgstr ""
msgid "number of color pairs supported in terminal"
msgstr ""
msgid "POSIX extended regular expression to search ANSI escape codes"
msgstr ""

View File

@ -285,6 +285,16 @@ gui_color_get_term_colors ()
return gui_color_term_colors;
}
/*
* Gets number of color pairs supported by terminal.
*/
int
gui_color_get_term_color_pairs ()
{
return gui_color_term_color_pairs;
}
/*
* Gets current pairs as arrays (one array for foregrounds, another for
* backgrounds).

View File

@ -207,6 +207,7 @@ extern int gui_color_assign_by_diff (int *color, const char *color_name,
int diff);
extern int gui_color_get_weechat_colors_number ();
extern int gui_color_get_term_colors ();
extern int gui_color_get_term_color_pairs ();
extern const char *gui_color_get_name (int num_color);
extern void gui_color_free_vars ();
extern void gui_color_init_weechat ();

View File

@ -484,6 +484,48 @@ plugin_api_info_term_height_cb (const void *pointer, void *data,
return strdup (value);
}
/*
* Returns WeeChat info "term_colors".
*/
char *
plugin_api_info_term_colors_cb (const void *pointer, void *data,
const char *info_name,
const char *arguments)
{
char value[32];
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
(void) arguments;
snprintf (value, sizeof (value), "%d", gui_color_get_term_colors ());
return strdup (value);
}
/*
* Returns WeeChat info "term_color_pairs".
*/
char *
plugin_api_info_term_color_pairs_cb (const void *pointer, void *data,
const char *info_name,
const char *arguments)
{
char value[32];
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
(void) arguments;
snprintf (value, sizeof (value), "%d", gui_color_get_term_color_pairs ());
return strdup (value);
}
/*
* Returns WeeChat info "color_ansi_regex".
*/
@ -1718,6 +1760,12 @@ plugin_api_info_init ()
hook_info (NULL, "term_height",
N_("height of terminal"),
NULL, &plugin_api_info_term_height_cb, NULL, NULL);
hook_info (NULL, "term_colors",
N_("number of colors supported in terminal"),
NULL, &plugin_api_info_term_colors_cb, NULL, NULL);
hook_info (NULL, "term_color_pairs",
N_("number of color pairs supported in terminal"),
NULL, &plugin_api_info_term_color_pairs_cb, NULL, NULL);
hook_info (NULL, "color_ansi_regex",
N_("POSIX extended regular expression to search ANSI escape "
"codes"),