api: add "_chat_line" (line pointer) in hashtable of hook_focus

v2.8-utf8proc
Sébastien Helleu 2015-04-19 10:22:53 +02:00
parent 074f2dc778
commit df31147e16
6 changed files with 373 additions and 120 deletions

View File

@ -28,6 +28,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* core: add option "-s" in command /eval to split expression before evaluating
it (no more split by default) (closes #324)
* core: add priority in plugins to initialize them in order
* api: add "_chat_line" (line pointer) in hashtable of hook_focus
* irc: add support of SHA-256 and SHA-512 algorithms in server option
"ssl_fingerprint" (closes #281)
* irc: add option "-noswitch" in command /query (closes #394)

View File

@ -9866,36 +9866,98 @@ Content of hashtable sent to callback (keys and values are of type "string"):
[width="100%",cols="5m,5,8,3",options="header"]
|===
| Key ^(1)^ | Description | Value examples | Value if N/A
| _x | Column on screen 2+| "0" ... "n"
| _y | Line on screen 2+| "0" ... "n"
| _key | Key or mouse event 2+| "button1", "button2-gesture-left", ...
| _window | Pointer to window | "0x12345678" | ""
| _window_number | Number of window | "1" ... "n" | "*"
| _buffer | Pointer to buffer | "0x12345678" | ""
| _buffer_number | Number of buffer | "1" ... "n" | "-1"
| _buffer_plugin | Plugin name of buffer | "core", "irc", ... | ""
| _buffer_name | Name of buffer | "weechat", "freenode.#weechat", ... | ""
| _buffer_full_name | Full name of buffer | "core.weechat", "irc.freenode.#weechat", ... | ""
| _buffer_localvar_XXX ^(2)^ | Local variables of buffer | any value | not set
| _chat | Chat area indicator | "0" or "1" | "0"
| _chat_line_x | Column in line ^(3)^ | "0" ... "n" | "-1"
| _chat_line_y | Line number ^(3)^ | "0" ... "n" | "-1"
| _chat_line_date | Line date/time | "1313237175" | "0"
| _chat_line_date_printed | Line date/time ^(4)^ | "1313237175" | "0"
| _chat_line_time | Time displayed | "14:06:15" | ""
| _chat_line_tags | Tags of line | "irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | Nick of line | "FlashCode" | ""
| _chat_line_prefix | Prefix of line | "@FlashCode" | ""
| _chat_line_message | Message of line | "Hello world!" | ""
| _chat_word | Word at (x,y) | "Hello" | ""
| _chat_bol | Beginning of line ⇒ (x-1,y) | "He" | ""
| _chat_eol | (x,y) ⇒ end of line | "llo world!" | ""
| _bar_name | Name of bar | "title", "nicklist", ... | ""
| _bar_filling | Filling of bar | "horizontal", "vertical", ... | ""
| _bar_item_name | Name of bar item | "buffer_nicklist", "hotlist", ... | ""
| _bar_item_line | Line in bar item | "0" ... "n" | "-1"
| _bar_item_col | Column in bar item | "0" ... "n" | "-1"
| Key ^(1)^ | Description | Value examples | Value if N/A
| _x | Column on screen |
"0" ... "n" |
| _y | Line on screen |
"0" ... "n" |
| _key | Key or mouse event |
"button1", "button2-gesture-left", ... |
| _window | Pointer to window |
"0x12345678" | ""
| _window_number | Number of window |
"1" ... "n" | "*"
| _buffer | Pointer to buffer |
"0x12345678" | ""
| _buffer_number | Number of buffer |
"1" ... "n" | "-1"
| _buffer_plugin | Plugin name of buffer |
"core", "irc", ... | ""
| _buffer_name | Name of buffer |
"weechat", "freenode.#weechat", ... | ""
| _buffer_full_name | Full name of buffer |
"core.weechat", "irc.freenode.#weechat", ... | ""
| _buffer_localvar_XXX ^(2)^ | Local variables of buffer |
any value | not set
| _chat | Chat area indicator |
"0" or "1" | "0"
| _chat_line | Pointer to line +
_(WeeChat ≥ 1.2)_ |
"0x12345678" | ""
| _chat_line_x | Column in line ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_y | Line number ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_date | Line date/time |
"1313237175" | "0"
| _chat_line_date_printed | Line date/time ^(4)^ |
"1313237175" | "0"
| _chat_line_time | Time displayed |
"14:06:15" | ""
| _chat_line_tags | Tags of line |
"irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | Nick of line |
"FlashCode" | ""
| _chat_line_prefix | Prefix of line |
"@FlashCode" | ""
| _chat_line_message | Message of line |
"Hello world!" | ""
| _chat_word | Word at (x,y) |
"Hello" | ""
| _chat_bol | Beginning of line ⇒ (x-1,y) |
"He" | ""
| _chat_eol | (x,y) ⇒ end of line |
"llo world!" | ""
| _bar_name | Name of bar |
"title", "nicklist", ... | ""
| _bar_filling | Filling of bar |
"horizontal", "vertical", ... | ""
| _bar_item_name | Name of bar item |
"buffer_nicklist", "hotlist", ... | ""
| _bar_item_line | Line in bar item |
"0" ... "n" | "-1"
| _bar_item_col | Column in bar item |
"0" ... "n" | "-1"
|===
[NOTE]

View File

@ -10064,36 +10064,98 @@ de type "string") :
[width="100%",cols="5m,5,8,3",options="header"]
|===
| Clé ^(1)^ | Description | Exemples de valeur | Valeur si non applicable
| _x | Colonne sur l'écran 2+| "0" ... "n"
| _y | Ligne sur l'écran 2+| "0" ... "n"
| _key | Touche ou évènement souris 2+| "button1", "button2-gesture-left", ...
| _window | Pointeur vers la fenêtre | "0x12345678" | ""
| _window_number | Numéro de la fenêtre | "1" ... "n" | "*"
| _buffer | Pointeur vers le tampon | "0x12345678" | ""
| _buffer_number | Numéro du tampon | "1" ... "n" | "-1"
| _buffer_plugin | Nom d'extension du tampon | "core", "irc", ... | ""
| _buffer_name | Nom du tampon | "weechat", "freenode.#weechat", ... | ""
| _buffer_full_name | Nom complet du tampon | "core.weechat", "irc.freenode.#weechat", ... | ""
| _buffer_localvar_XXX ^(2)^ | Variables locales du tampon | toute chaîne | non défini
| _chat | Indicateur zone "chat" | "0" ou "1" | "0"
| _chat_line_x | Colonne de la ligne ^(3)^ | "0" ... "n" | "-1"
| _chat_line_y | Numéro de ligne ^(3)^ | "0" ... "n" | "-1"
| _chat_line_date | Date/heure de la ligne | "1313237175" | "0"
| _chat_line_date_printed | Date/heure de la ligne ^(4)^ | "1313237175" | "0"
| _chat_line_time | Heure affichée | "14:06:15" | ""
| _chat_line_tags | Étiquettes de la ligne | "irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | Pseudo de la ligne | "FlashCode" | ""
| _chat_line_prefix | Préfixe de la ligne | "@FlashCode" | ""
| _chat_line_message | Message de la ligne | "Hello world!" | ""
| _chat_word | Mot à la position (x,y) | "Hello" | ""
| _chat_bol | Début de ligne ⇒ (x-1,y) | "He" | ""
| _chat_eol | (x,y) ⇒ fin de ligne | "llo world!" | ""
| _bar_name | Nom de la barre | "title", "nicklist", ... | ""
| _bar_filling | Remplissage de la barre | "horizontal", "vertical", ... | ""
| _bar_item_name | Nom de l'objet de barre | "buffer_nicklist", "hotlist", ... | ""
| _bar_item_line | Ligne dans l'objet de barre | "0" ... "n" | "-1"
| _bar_item_col | Colonne dans l'objet de barre | "0" ... "n" | "-1"
| Clé ^(1)^ | Description | Exemples de valeur | Valeur si non applicable
| _x | Colonne sur l'écran |
"0" ... "n" |
| _y | Ligne sur l'écran |
"0" ... "n" |
| _key | Touche ou évènement souris |
"button1", "button2-gesture-left", ... |
| _window | Pointeur vers la fenêtre |
"0x12345678" | ""
| _window_number | Numéro de la fenêtre |
"1" ... "n" | "*"
| _buffer | Pointeur vers le tampon |
"0x12345678" | ""
| _buffer_number | Numéro du tampon |
"1" ... "n" | "-1"
| _buffer_plugin | Nom d'extension du tampon |
"core", "irc", ... | ""
| _buffer_name | Nom du tampon |
"weechat", "freenode.#weechat", ... | ""
| _buffer_full_name | Nom complet du tampon |
"core.weechat", "irc.freenode.#weechat", ... | ""
| _buffer_localvar_XXX ^(2)^ | Variables locales du tampon |
toute chaîne | non défini
| _chat | Indicateur zone "chat" |
"0" ou "1" | "0"
| _chat_line | Pointeur vers la ligne +
_(WeeChat ≥ 1.2)_ |
"0x12345678" | ""
| _chat_line_x | Colonne de la ligne ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_y | Numéro de ligne ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_date | Date/heure de la ligne |
"1313237175" | "0"
| _chat_line_date_printed | Date/heure de la ligne ^(4)^ |
"1313237175" | "0"
| _chat_line_time | Heure affichée |
"14:06:15" | ""
| _chat_line_tags | Étiquettes de la ligne |
"irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | Pseudo de la ligne |
"FlashCode" | ""
| _chat_line_prefix | Préfixe de la ligne |
"@FlashCode" | ""
| _chat_line_message | Message de la ligne |
"Hello world!" | ""
| _chat_word | Mot à la position (x,y) |
"Hello" | ""
| _chat_bol | Début de ligne ⇒ (x-1,y) |
"He" | ""
| _chat_eol | (x,y) ⇒ fin de ligne |
"llo world!" | ""
| _bar_name | Nom de la barre |
"title", "nicklist", ... | ""
| _bar_filling | Remplissage de la barre |
"horizontal", "vertical", ... | ""
| _bar_item_name | Nom de l'objet de barre |
"buffer_nicklist", "hotlist", ... | ""
| _bar_item_line | Ligne dans l'objet de barre |
"0" ... "n" | "-1"
| _bar_item_col | Colonne dans l'objet de barre |
"0" ... "n" | "-1"
|===
[NOTE]

View File

@ -10153,36 +10153,99 @@ Contenuto della tabella hash inviata alla callback (tasti e valori sono di tipo
[width="100%",cols="5m,5,8,3",options="header"]
|===
| Key ^(1)^ | Descrizione | Valori di esempio | Valore se N/D
| _x | Colonna sullo schermo 2+| "0" ... "n"
| _y | Riga sullo schermo 2+| "0" ... "n"
| _key | Evento tasto o mouse 2+| "button1", "button2-gesture-left", ...
| _window | Puntatore alla finestra | "0x12345678" | ""
| _window_number | Numero della finestra | "1" ... "n" | "*"
| _buffer | Puntatore al buffer | "0x12345678" | ""
| _buffer_number | Numero del buffer | "1" ... "n" | "-1"
| _buffer_plugin | Nome plugin del buffer | "core", "irc", ... | ""
| _buffer_name | Nome del buffer | "weechat", "freenode.#weechat", ... | ""
| _buffer_full_name | Nome completo del buffer | "core.weechat", "irc.freenode.#weechat", ... | ""
| _buffer_localvar_XXX ^(2)^ | Variabili locali del buffer | qualsiasi valore | non impostato
| _chat | Indicatore area di chat | "0" o "1" | "0"
| _chat_line_x | Colonna nella riga ^(3)^ | "0" ... "n" | "-1"
| _chat_line_y | Numero della riga ^(3)^ | "0" ... "n" | "-1"
| _chat_line_date | Riga con data/ora | "1313237175" | "0"
| _chat_line_date_printed | Riga con data/ora ^(4)^ | "1313237175" | "0"
| _chat_line_time | Ora visualizzata | "14:06:15" | ""
| _chat_line_tags | Tag della riga | "irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | Nick della riga | "FlashCode" | ""
| _chat_line_prefix | Prefisso della riga | "@FlashCode" | ""
| _chat_line_message | Messaggio della riga | "Hello world!" | ""
| _chat_word | Parola a (x,y) | "Hello" | ""
| _chat_bol | Inizio della riga ⇒ (x-1,y) | "He" | ""
| _chat_eol | (x,y) ⇒ fine della riga | "llo world!" | ""
| _bar_name | Nome della barra | "title", "nicklist", ... | ""
| _bar_filling | Riempimento della barra | "horizontal", "vertical", ... | ""
| _bar_item_name | Nome dell'elemento barra | "buffer_nicklist", "hotlist", ... | ""
| _bar_item_line | Riga nell'elemento barra | "0" ... "n" | "-1"
| _bar_item_col | Colonna nell'elemento barra | "0" ... "n" | "-1"
| Key ^(1)^ | Descrizione | Valori di esempio | Valore se N/D
| _x | Colonna sullo schermo |
"0" ... "n" |
| _y | Riga sullo schermo |
"0" ... "n" |
| _key | Evento tasto o mouse |
"button1", "button2-gesture-left", ... |
| _window | Puntatore alla finestra |
"0x12345678" | ""
| _window_number | Numero della finestra |
"1" ... "n" | "*"
| _buffer | Puntatore al buffer |
"0x12345678" | ""
| _buffer_number | Numero del buffer |
"1" ... "n" | "-1"
| _buffer_plugin | Nome plugin del buffer |
"core", "irc", ... | ""
| _buffer_name | Nome del buffer |
"weechat", "freenode.#weechat", ... | ""
| _buffer_full_name | Nome completo del buffer |
"core.weechat", "irc.freenode.#weechat", ... | ""
| _buffer_localvar_XXX ^(2)^ | Variabili locali del buffer |
qualsiasi valore | non impostato
| _chat | Indicatore area di chat |
"0" o "1" | "0"
// TRANSLATION MISSING
| _chat_line | Pointer to line +
_(WeeChat ≥ 1.2)_ |
"0x12345678" | ""
| _chat_line_x | Colonna nella riga ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_y | Numero della riga ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_date | Riga con data/ora |
"1313237175" | "0"
| _chat_line_date_printed | Riga con data/ora ^(4)^ |
"1313237175" | "0"
| _chat_line_time | Ora visualizzata |
"14:06:15" | ""
| _chat_line_tags | Tag della riga |
"irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | Nick della riga |
"FlashCode" | ""
| _chat_line_prefix | Prefisso della riga |
"@FlashCode" | ""
| _chat_line_message | Messaggio della riga |
"Hello world!" | ""
| _chat_word | Parola a (x,y) |
"Hello" | ""
| _chat_bol | Inizio della riga ⇒ (x-1,y) |
"He" | ""
| _chat_eol | (x,y) ⇒ fine della riga |
"llo world!" | ""
| _bar_name | Nome della barra |
"title", "nicklist", ... | ""
| _bar_filling | Riempimento della barra |
"horizontal", "vertical", ... | ""
| _bar_item_name | Nome dell'elemento barra |
"buffer_nicklist", "hotlist", ... | ""
| _bar_item_line | Riga nell'elemento barra |
"0" ... "n" | "-1"
| _bar_item_col | Colonna nell'elemento barra |
"0" ... "n" | "-1"
|===
[NOTE]

View File

@ -9863,36 +9863,99 @@ info を使う前にエリアが一致していることを確認して下さい
[width="100%",cols="5m,5,8,3",options="header"]
|===
| キー ^(1)^ | 説明 | 値の例 | 定義できない場合の値
| _x | スクリーン上での列座標 2+| "0" ... "n"
| _y | スクリーン上での行座標 2+| "0" ... "n"
| _key | キーまたはマウスイベント 2+| "button1"、"button2-gesture-left"、...
| _window | ウィンドウへのポインタ | "0x12345678" | ""
| _window_number | ウィンドウの番号 | "1" ... "n" | "*"
| _buffer | バッファへのポインタ | "0x12345678" | ""
| _buffer_number | バッファの番号 | "1" ... "n" | "-1"
| _buffer_plugin | バッファのプラグイン名 | "core"、"irc"、... | ""
| _buffer_name | バッファの名前 | "weechat"、"freenode.#weechat"、... | ""
| _buffer_full_name | バッファの完全な名前 | "core.weechat"、"irc.freenode.#weechat"、... | ""
| _buffer_localvar_XXX ^(2)^ | バッファのローカル変数 | 任意の値 | 未定義
| _chat | チャットエリアインジケータ | "0" または "1" | "0"
| _chat_line_x | 行中の列番号 ^(3)^ | "0" ... "n" | "-1"
| _chat_line_y | 行番号 ^(3)^ | "0" ... "n" | "-1"
| _chat_line_date | 日付/時間の行 | "1313237175" | "0"
| _chat_line_date_printed | 日付/時間の行 ^(4)^ | "1313237175" | "0"
| _chat_line_time | 表示された時間 | "14:06:15" | ""
| _chat_line_tags | 行に設定されたタグ | "irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | 行を発言したニックネーム | "FlashCode" | ""
| _chat_line_prefix | 行のプレフィックス | "@FlashCode" | ""
| _chat_line_message | 行のメッセージ部分 | "Hello world!" | ""
| _chat_word | (x,y) の位置にある単語 | "Hello" | ""
| _chat_bol | 行頭から (x-1,y) まで | "He" | ""
| _chat_eol | (x,y) から行末まで | "llo world!" | ""
| _bar_name | バーの名前 | "title"、"nicklist"、... | ""
| _bar_filling | バーのフィリング | "horizontal"、"vertical"、... | ""
| _bar_item_name | バー要素の名前 | "buffer_nicklist"、"hotlist"、... | ""
| _bar_item_line | バー要素中の行座標 | "0" ... "n" | "-1"
| _bar_item_col | バー要素中の列座標 | "0" ... "n" | "-1"
| キー ^(1)^ | 説明 | 値の例 | 定義できない場合の値
| _x | スクリーン上での列座標 |
"0" ... "n" |
| _y | スクリーン上での行座標 |
"0" ... "n" |
| _key | キーまたはマウスイベント |
"button1"、"button2-gesture-left"、... |
| _window | ウィンドウへのポインタ |
"0x12345678" | ""
| _window_number | ウィンドウの番号 |
"1" ... "n" | "*"
| _buffer | バッファへのポインタ |
"0x12345678" | ""
| _buffer_number | バッファの番号 |
"1" ... "n" | "-1"
| _buffer_plugin | バッファのプラグイン名 |
"core"、"irc"、... | ""
| _buffer_name | バッファの名前 |
"weechat"、"freenode.#weechat"、... | ""
| _buffer_full_name | バッファの完全な名前 |
"core.weechat"、"irc.freenode.#weechat"、... | ""
| _buffer_localvar_XXX ^(2)^ | バッファのローカル変数 |
任意の値 | 未定義
| _chat | チャットエリアインジケータ |
"0" または "1" | "0"
// TRANSLATION MISSING
| _chat_line | Pointer to line +
_(WeeChat ≥ 1.2)_ |
"0x12345678" | ""
| _chat_line_x | 行中の列番号 ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_y | 行番号 ^(3)^ |
"0" ... "n" | "-1"
| _chat_line_date | 日付/時間の行 |
"1313237175" | "0"
| _chat_line_date_printed | 日付/時間の行 ^(4)^ |
"1313237175" | "0"
| _chat_line_time | 表示された時間 |
"14:06:15" | ""
| _chat_line_tags | 行に設定されたタグ |
"irc_privmsg,nick_flashy,log1" | ""
| _chat_line_nick | 行を発言したニックネーム |
"FlashCode" | ""
| _chat_line_prefix | 行のプレフィックス |
"@FlashCode" | ""
| _chat_line_message | 行のメッセージ部分 |
"Hello world!" | ""
| _chat_word | (x,y) の位置にある単語 |
"Hello" | ""
| _chat_bol | 行頭から (x-1,y) まで |
"He" | ""
| _chat_eol | (x,y) から行末まで |
"llo world!" | ""
| _bar_name | バーの名前 |
"title"、"nicklist"、... | ""
| _bar_filling | バーのフィリング |
"horizontal"、"vertical"、... | ""
| _bar_item_name | バー要素の名前 |
"buffer_nicklist"、"hotlist"、... | ""
| _bar_item_line | バー要素中の行座標 |
"0" ... "n" | "-1"
| _bar_item_col | バー要素中の列座標 |
"0" ... "n" | "-1"
|===
[NOTE]

View File

@ -225,6 +225,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key)
str_tags = string_build_with_split_string ((const char **)((focus_info->chat_line)->data)->tags_array, ",");
str_message = gui_color_decode (((focus_info->chat_line)->data)->message, NULL);
nick = gui_line_get_nick_tag (focus_info->chat_line);
FOCUS_PTR("_chat_line", focus_info->chat_line);
FOCUS_INT("_chat_line_x", focus_info->chat_line_x);
FOCUS_INT("_chat_line_y", ((focus_info->chat_line)->data)->y);
FOCUS_TIME("_chat_line_date", ((focus_info->chat_line)->data)->date);
@ -245,6 +246,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key)
}
else
{
FOCUS_PTR("_chat_line", NULL);
FOCUS_STR("_chat_line_x", "-1");
FOCUS_STR("_chat_line_y", "-1");
FOCUS_STR("_chat_line_date", "-1");