summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/en/weechat_plugin_api.en.asciidoc33
-rw-r--r--doc/fr/weechat_plugin_api.fr.asciidoc37
-rw-r--r--doc/it/weechat_plugin_api.it.asciidoc36
-rw-r--r--doc/ja/weechat_plugin_api.ja.asciidoc33
4 files changed, 105 insertions, 34 deletions
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc
index 9bb86f07f..7386e2f37 100644
--- a/doc/en/weechat_plugin_api.en.asciidoc
+++ b/doc/en/weechat_plugin_api.en.asciidoc
@@ -10516,6 +10516,8 @@ Functions to create/query/close buffers.
==== buffer_new
+_Updated in 1.5._
+
Open a new buffer.
Prototype:
@@ -10523,12 +10525,16 @@ Prototype:
[source,C]
----
struct t_gui_buffer *weechat_buffer_new (const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
+ const void *input_callback_pointer,
void *input_callback_data,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
+ const void *close_callback_pointer,
void *close_callback_data);
----
@@ -10537,21 +10543,31 @@ Arguments:
* 'name': name of buffer (must be unique for plugin)
* 'input_callback': function called when input text is entered on buffer,
arguments and return value:
+** 'const void *pointer': pointer
** 'void *data': pointer
** 'struct t_gui_buffer *buffer': buffer pointer
** 'const char *input_data': input data
** return value:
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data': pointer given to callback when it is called by WeeChat
+* 'input_callback_pointer': pointer given to callback when it is called by
+ WeeChat
+* 'input_callback_data': pointer given to callback when it is called by
+ WeeChat; if not NULL, it must have been allocated with malloc (or similar
+ function) and it will be automatically freed when the buffer is closed
* 'close_callback': function called when buffer is closed, arguments and return
value:
+** 'const void *pointer': pointer
** 'void *data': pointer
** 'struct t_gui_buffer *buffer': buffer pointer
** return value:
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data': pointer given to callback when it is called by WeeChat
+* 'close_callback_pointer': pointer given to callback when it is called by
+ WeeChat
+* 'close_callback_data': pointer given to callback when it is called by
+ WeeChat; if not NULL, it must have been allocated with malloc (or similar
+ function) and it will be automatically freed when the buffer is closed
Return value:
@@ -10562,14 +10578,15 @@ C example:
[source,C]
----
int
-my_input_cb (void *data, struct t_gui_buffer *buffer, const char *input_data)
+my_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, const char *input_data)
{
weechat_printf (buffer, "Text: %s", input_data);
return WEECHAT_RC_OK;
}
int
-my_close_cb (void *data, struct t_gui_buffer *buffer)
+my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
weechat_printf (NULL, "Buffer '%s' will be closed!",
weechat_buffer_get_string (buffer, "name"));
@@ -10577,8 +10594,8 @@ my_close_cb (void *data, struct t_gui_buffer *buffer)
}
struct t_gui_buffer *my_buffer = weechat_buffer_new ("my_buffer",
- &my_input_cb, NULL,
- &my_close_cb, NULL);
+ &my_input_cb, NULL, NULL,
+ &my_close_cb, NULL, NULL);
----
Script (Python):
diff --git a/doc/fr/weechat_plugin_api.fr.asciidoc b/doc/fr/weechat_plugin_api.fr.asciidoc
index 86346923e..20b6ac258 100644
--- a/doc/fr/weechat_plugin_api.fr.asciidoc
+++ b/doc/fr/weechat_plugin_api.fr.asciidoc
@@ -10743,6 +10743,8 @@ Fonctions pour créer/interroger/fermer les tampons.
==== buffer_new
+_Mis à jour dans la 1.5._
+
Ouvrir un nouveau tampon.
Prototype :
@@ -10750,12 +10752,16 @@ Prototype :
[source,C]
----
struct t_gui_buffer *weechat_buffer_new (const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
+ const void *input_callback_pointer,
void *input_callback_data,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
+ const void *close_callback_pointer,
void *close_callback_data);
----
@@ -10764,23 +10770,33 @@ Paramètres :
* 'name' : nom du tampon (doit être unique pour l'extension)
* 'input_callback' : fonction appelée lorsque du texte saisi est envoyé au
tampon, paramètres et valeur de retour :
+** 'const void *pointer' : pointeur
** 'void *data' : pointeur
** 'struct t_gui_buffer *buffer' : pointeur vers le tampon
** 'const char *input_data' : données en entrée
** valeur de retour :
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data' : pointeur donné au "callback" lorsqu'il est appelé par
- WeeChat
+* 'input_callback_pointer' : pointeur donné au "callback" lorsqu'il est appelé
+ par WeeChat
+* 'input_callback_data' : pointeur donné au "callback" lorsqu'il est appelé par
+ WeeChat; si non NULL, doit avoir été alloué par malloc (ou une fonction
+ similaire) et sera automatiquement libéré (par free) lorsque le tampon est
+ fermé
* 'close_callback' : fonction appelée lorsque le tampon est fermé, paramètres et
valeur de retour :
+** 'const void *pointer' : pointeur
** 'void *data' : pointeur
** 'struct t_gui_buffer *buffer' : pointeur vers le tampon
** valeur de retour :
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data' : pointeur donné au "callback" lorsqu'il est appelé par
- WeeChat
+* 'close_callback_pointer' : pointeur donné au "callback" lorsqu'il est appelé
+ par WeeChat
+* 'close_callback_data' : pointeur donné au "callback" lorsqu'il est appelé par
+ WeeChat; si non NULL, doit avoir été alloué par malloc (ou une fonction
+ similaire) et sera automatiquement libéré (par free) lorsque le tampon est
+ fermé
Valeur de retour :
@@ -10791,14 +10807,15 @@ Exemple en C :
[source,C]
----
int
-my_input_cb (void *data, struct t_gui_buffer *buffer, const char *input_data)
+my_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, const char *input_data)
{
weechat_printf (buffer, "Texte : %s", input_data);
return WEECHAT_RC_OK;
}
int
-my_close_cb (void *data, struct t_gui_buffer *buffer)
+my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
weechat_printf (NULL, "Le tampon '%s' va être fermé !",
weechat_buffer_get_string (buffer, "name"));
@@ -10806,8 +10823,8 @@ my_close_cb (void *data, struct t_gui_buffer *buffer)
}
struct t_gui_buffer *my_buffer = weechat_buffer_new ("mon_buffer",
- &my_input_cb, NULL,
- &my_close_cb, NULL);
+ &my_input_cb, NULL, NULL,
+ &my_close_cb, NULL, NULL);
----
Script (Python) :
diff --git a/doc/it/weechat_plugin_api.it.asciidoc b/doc/it/weechat_plugin_api.it.asciidoc
index 70237147a..91761b991 100644
--- a/doc/it/weechat_plugin_api.it.asciidoc
+++ b/doc/it/weechat_plugin_api.it.asciidoc
@@ -10878,6 +10878,9 @@ Funzioni per creare/richiedere/chiudere buffer.
==== buffer_new
+// TRANSLATION MISSING
+_Updated in 1.5._
+
Apre un nuovo buffer.
Prototipo:
@@ -10885,12 +10888,16 @@ Prototipo:
[source,C]
----
struct t_gui_buffer *weechat_buffer_new (const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
+ const void *input_callback_pointer,
void *input_callback_data,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
+ const void *close_callback_pointer,
void *close_callback_data);
----
@@ -10899,21 +10906,33 @@ Argomenti:
* 'name': nome del buffer (deve essere unico per il plugin)
* 'input_callback': funzione chiamata quando il testo in input è stato
inserito nel buffer, argomenti e valore restituito:
+** 'const void *pointer': puntatore
** 'void *data': puntatore
** 'struct t_gui_buffer *buffer': puntatore al buffer
** 'const char *input_data': dati in input
** valore restituito:
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data': puntatore fornito alla callback quando chiamata da WeeChat
+* 'input_callback_pointer': puntatore fornito alla callback quando chiamata da
+ WeeChat
+// TRANSLATION MISSING
+* 'input_callback_data': puntatore fornito dalla callback quando chiamata da
+ WeeChat; if not NULL, it must have been allocated with malloc (or similar
+ function) and it will be automatically freed when the buffer is closed
* 'close_callback': funzione chiamata alla chiusura del buffer, argomenti e
valore restituito:
+** 'const void *pointer': puntatore
** 'void *data': puntatore
** 'struct t_gui_buffer *buffer': puntatore al buffer
** valore restituito:
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data': puntatore fornito alla callback quando chiamata da WeeChat
+* 'close_callback_pointer': puntatore fornito alla callback quando chiamata da
+ WeeChat
+// TRANSLATION MISSING
+* 'close_callback_data': puntatore fornito dalla callback quando chiamata da
+ WeeChat; if not NULL, it must have been allocated with malloc (or similar
+ function) and it will be automatically freed when the buffer is closed
Valore restituito:
@@ -10924,14 +10943,15 @@ Esempio in C:
[source,C]
----
int
-my_input_cb (void *data, struct t_gui_buffer *buffer, const char *input_data)
+my_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, const char *input_data)
{
weechat_printf (buffer, "Testo: %s", input_data);
return WEECHAT_RC_OK;
}
int
-my_close_cb (void *data, struct t_gui_buffer *buffer)
+my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
weechat_printf (NULL, "Il buffer '%s' verrà chiuso!",
weechat_buffer_get_string (buffer, "name"));
@@ -10939,8 +10959,8 @@ my_close_cb (void *data, struct t_gui_buffer *buffer)
}
struct t_gui_buffer *my_buffer = weechat_buffer_new ("my_buffer",
- &my_input_cb, NULL,
- &my_close_cb, NULL);
+ &my_input_cb, NULL, NULL,
+ &my_close_cb, NULL, NULL);
----
Script (Python):
diff --git a/doc/ja/weechat_plugin_api.ja.asciidoc b/doc/ja/weechat_plugin_api.ja.asciidoc
index e931e6340..99c173c39 100644
--- a/doc/ja/weechat_plugin_api.ja.asciidoc
+++ b/doc/ja/weechat_plugin_api.ja.asciidoc
@@ -10529,6 +10529,8 @@ weechat.unhook_all()
==== buffer_new
+_バージョン 1.5 で更新。_
+
新しいバッファを開く。
プロトタイプ:
@@ -10536,12 +10538,16 @@ weechat.unhook_all()
[source,C]
----
struct t_gui_buffer *weechat_buffer_new (const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
+ const void *input_callback_pointer,
void *input_callback_data,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
+ const void *close_callback_pointer,
void *close_callback_data);
----
@@ -10550,21 +10556,31 @@ struct t_gui_buffer *weechat_buffer_new (const char *name,
* 'name': バッファの名前 (プラグインに対して固有)
* 'input_callback':
入力テキストをバッファに挿入する際に呼び出す関数、引数と戻り値:
+** 'const void *pointer': ポインタ
** 'void *data': ポインタ
** 'struct t_gui_buffer *buffer': バッファポインタ
** 'const char *input_data': 入力データ
** 戻り値:
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data': WeeChat がコールバックを呼び出す際にコールバックに渡すポインタ
+* 'input_callback_pointer': WeeChat がコールバックを呼び出す際にコールバックに渡すポインタ
+// TRANSLATION MISSING
+* 'input_callback_data': WeeChat がコールバックを呼び出す際にコールバックに渡すポインタ;
+ if not NULL, it must have been allocated with malloc (or similar function)
+ and it will be automatically freed when the buffer is closed
* 'close_callback':
バッファを閉じる際に呼び出す関数、引数と戻り値:
+** 'const void *pointer': ポインタ
** 'void *data': ポインタ
** 'struct t_gui_buffer *buffer': バッファポインタ
** 戻り値:
*** 'WEECHAT_RC_OK'
*** 'WEECHAT_RC_ERROR'
-* 'callback_data': WeeChat がコールバックを呼び出す際にコールバックに渡すポインタ
+* 'close_callback_pointer': WeeChat がコールバックを呼び出す際にコールバックに渡すポインタ
+// TRANSLATION MISSING
+* 'close_callback_data': WeeChat がコールバックを呼び出す際にコールバックに渡すポインタ;
+ if not NULL, it must have been allocated with malloc (or similar function)
+ and it will be automatically freed when the buffer is closed
戻り値:
@@ -10575,14 +10591,15 @@ C 言語での使用例:
[source,C]
----
int
-my_input_cb (void *data, struct t_gui_buffer *buffer, const char *input_data)
+my_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, const char *input_data)
{
weechat_printf (buffer, "Text: %s", input_data);
return WEECHAT_RC_OK;
}
int
-my_close_cb (void *data, struct t_gui_buffer *buffer)
+my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
weechat_printf (NULL, "Buffer '%s' will be closed!",
weechat_buffer_get_string (buffer, "name"));
@@ -10590,8 +10607,8 @@ my_close_cb (void *data, struct t_gui_buffer *buffer)
}
struct t_gui_buffer *my_buffer = weechat_buffer_new ("my_buffer",
- &my_input_cb, NULL,
- &my_close_cb, NULL);
+ &my_input_cb, NULL, NULL,
+ &my_close_cb, NULL, NULL);
----
スクリプト (Python) での使用例: