summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/de/weechat.de.xml1104
-rw-r--r--doc/de/weechat_commands.xml11
-rw-r--r--doc/en/weechat.en.xml1106
-rw-r--r--doc/en/weechat_commands.xml11
-rw-r--r--doc/fr/weechat.fr.xml1123
-rw-r--r--doc/fr/weechat_commands.xml11
-rw-r--r--weechat/doc/de/weechat.de.xml1104
-rw-r--r--weechat/doc/de/weechat_commands.xml11
-rw-r--r--weechat/doc/en/weechat.en.xml1106
-rw-r--r--weechat/doc/en/weechat_commands.xml11
-rw-r--r--weechat/doc/fr/weechat.fr.xml1123
-rw-r--r--weechat/doc/fr/weechat_commands.xml11
12 files changed, 6502 insertions, 230 deletions
diff --git a/doc/de/weechat.de.xml b/doc/de/weechat.de.xml
index 083ef6294..3f909a737 100644
--- a/doc/de/weechat.de.xml
+++ b/doc/de/weechat.de.xml
@@ -1462,6 +1462,46 @@ if (argv != NULL)
</para>
</section>
+ <section id="secAPI_mkdir_home">
+ <title>mkdir_home</title>
+
+ <para>
+ Prototype:
+ <command>
+ int mkdir_home (t_weechat_plugin *plugin, char *directory)
+ </command>
+ </para>
+ <para>
+ Create a directory in WeeChat home.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>directory</option>: directory to create
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: 1 if directory was successfully created, 0 if an
+ error occurred.
+ </para>
+ <para>
+ Example:
+<screen>
+if (!plugin->mkdir_home (plugin, "temp"))
+ plugin->print_server(plugin, "Failed to create 'temp' directory in WeeChat home.");
+</screen>
+ </para>
+ </section>
+
<section id="secAPI_exec_on_files">
<title>exec_on_files</title>
@@ -3521,6 +3561,606 @@ plugin->set_plugin_config (plugin, "my_var", "value");
</para>
</section>
+ <section id="secAPI_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ int get_irc_color (t_weechat_plugin *plugin,
+ char *color_name)
+ </command>
+ </para>
+ <para>
+ Get IRC color index with name.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color_name</option>: color name
+ Allowed colors are:
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Color name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>white</entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>black</entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>blue</entry>
+ <entry>2</entry>
+ </row>
+ <row>
+ <entry>green</entry>
+ <entry>3</entry>
+ </row>
+ <row>
+ <entry>lightred</entry>
+ <entry>4</entry>
+ </row>
+ <row>
+ <entry>red</entry>
+ <entry>5</entry>
+ </row>
+ <row>
+ <entry>magenta</entry>
+ <entry>6</entry>
+ </row>
+ <row>
+ <entry>brown</entry>
+ <entry>7</entry>
+ </row>
+ <row>
+ <entry>yellow</entry>
+ <entry>8</entry>
+ </row>
+ <row>
+ <entry>lightgreen</entry>
+ <entry>9</entry>
+ </row>
+ <row>
+ <entry>cyan</entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry>lightcyan</entry>
+ <entry>11</entry>
+ </row>
+ <row>
+ <entry>lightblue</entry>
+ <entry>12</entry>
+ </row>
+ <row>
+ <entry>lightmagenta</entry>
+ <entry>13</entry>
+ </row>
+ <row>
+ <entry>gray</entry>
+ <entry>14</entry>
+ </row>
+ <row>
+ <entry>lightgray</entry>
+ <entry>15</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found.
+ </para>
+ <para>
+ Example:
+<screen>
+int color_blue = plugin->get_irc_color (plugin, "blue"); /* return 2 */
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ void input_color (t_weechat_plugin *plugin,
+ int color, int start, int length)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color</option>: color for text (if &lt; 0, then input
+ buffer is refresh, and there's no change in input buffer
+ content)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>start</option>: start position for color (if &lt; 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>length</option>: length for color (if &lt;= 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+<screen>
+plugin->input_color (plugin, plugin->get_irc_color (plugin, "blue"), 10, 5);
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_window_info *get_window_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat windows.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_x</literal></entry>
+ <entry>horizontal position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_y</literal></entry>
+ <entry>vertical position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width</literal></entry>
+ <entry>width of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height</literal></entry>
+ <entry>height of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width_pct</literal></entry>
+ <entry>width % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height_pct</literal></entry>
+ <entry>height % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_buffer</literal></entry>
+ <entry>number of displayed buffer</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>prev_window</literal></entry>
+ <entry>pointer to previous window info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>next_window</literal></entry>
+ <entry>pointer to next window info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_window_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_window_info *window_info, *ptr_window;
+
+window_info = plugin->get_window_info (plugin);
+if (window_info)
+{
+ for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
+ {
+ plugin->print (plugin, NULL, NULL, "--- window info ---");
+ plugin->print (plugin, NULL, NULL, "(%d,%d), size: %dx%d, %%size: %d%%x%d%%",
+ ptr_window->win_x, ptr_window->win_y,
+ ptr_window->win_width, ptr_window->win_height,
+ ptr_window->win_width_pct, ptr_window->win_height_pct);
+ plugin->print (plugin, NULL, NULL, "num_buffer: %d", ptr_window->num_buffer);
+ }
+ plugin->free_window_info (plugin, window_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no window info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_window_info">
+ <title>free_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_window_info (t_weechat_plugin *plugin,
+ t_plugin_window_info *window_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by window info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>window_info</option>: pointer to window info list
+ returned by "get_window_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_window_info (plugin, window_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_info *get_buffer_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat buffers.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>type</literal></entry>
+ <entry>buffer type: 0=standard, 1=dcc, 2=raw IRC data</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>number</literal></entry>
+ <entry>buffer number</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_displayed</literal></entry>
+ <entry>number of windows displaying buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>server_name</literal></entry>
+ <entry>server name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>channel_name</literal></entry>
+ <entry>channel name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>notify_level</literal></entry>
+ <entry>notify level for buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>log_filename</literal></entry>
+ <entry>log filename (NULL means not logging)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>prev_buffer</literal></entry>
+ <entry>pointer to previous buffer info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>next_buffer</literal></entry>
+ <entry>pointer to next buffer info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_info *buffer_info, *ptr_buffer;
+
+buffer_info = plugin->get_buffer_info (plugin);
+if (buffer_info)
+{
+ for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ plugin->print (plugin, NULL, NULL, "--- buffer info ---");
+ plugin->print (plugin, NULL, NULL, "type: %d", ptr_buffer->type);
+ plugin->print (plugin, NULL, NULL, "number: %d", ptr_buffer->number);
+ plugin->print (plugin, NULL, NULL, "num_displayed: %d", ptr_buffer->num_displayed);
+ plugin->print (plugin, NULL, NULL, "server: %s", ptr_buffer->server_name);
+ plugin->print (plugin, NULL, NULL, "channel: %s", ptr_buffer->channel_name);
+ plugin->print (plugin, NULL, NULL, "notify level: %d", ptr_buffer->notify_level);
+ plugin->print (plugin, NULL, NULL, "log filename: %s", ptr_buffer->log_filename);
+ }
+ plugin->free_buffer_info (plugin, buffer_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no buffer info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_info">
+ <title>free_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_info (t_weechat_plugin *plugin,
+ t_plugin_buffer_info *buffer_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_info</option>: pointer to buffer info list
+ returned by "get_buffer_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_info (plugin, buffer_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_data *get_buffer_info (t_weechat_plugin *plugin,
+ char *server, char *channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: channel name
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: buffer content (linked list of lines).
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>nick</literal></entry>
+ <entry>nick</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>data</literal></entry>
+ <entry>line content (color codes are removed)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>prev_line</literal></entry>
+ <entry>pointer to previous line</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>next_line</literal></entry>
+ <entry>pointer to next line</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_data"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_line *buffer_line, *ptr_line;
+
+buffer_line = plugin->get_buffer_data (plugin);
+if (buffer_line)
+{
+ for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
+ {
+ plugin->print (plugin, NULL, NULL, "nick: %s, data: %s", ptr_line->nick, ptr_line->data);
+ }
+ plugin->free_buffer_data (plugin, buffer_line);
+}
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_data">
+ <title>free_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_data (t_weechat_plugin *plugin,
+ t_plugin_buffer_line *buffer_line)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer line list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_line</option>: pointer to buffer line list
+ returned by "get_buffer_data" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_data (plugin, buffer_line);</screen>
+ </para>
+ </section>
+
</section>
<section id="secCompilePlugin">
@@ -3689,7 +4329,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
<section id="secSyntaxByLanguage">
<title>Syntax in den Skriptsprachen</title>
- <section>
+ <section id="secScriptPerl">
<title>Perl</title>
<para>
@@ -3701,7 +4341,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptPython">
<title>Python</title>
<para>
@@ -3717,7 +4357,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptRuby">
<title>Ruby</title>
<para>
@@ -3746,7 +4386,7 @@ end
</section>
- <section>
+ <section id="secScriptLua">
<title>Lua</title>
<para>
@@ -3769,7 +4409,7 @@ end
<section id="secWeeChatScriptsAPI">
<title>WeeChat / Skript-API</title>
- <section>
+ <section id="secScript_register">
<title>register</title>
<para>
@@ -3849,7 +4489,7 @@ weechat.register("test", "1.0", "end_test", "Test script!")
</para>
</section>
- <section>
+ <section id="secScript_print">
<title>print</title>
<para>
@@ -3931,7 +4571,7 @@ weechat.print("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_print_infobar">
<title>print_infobar</title>
<para>
@@ -3997,7 +4637,7 @@ weechat.print_infobar(5, "message")
</para>
</section>
- <section>
+ <section id="secScript_remove_infobar">
<title>remove_infobar</title>
<para>
@@ -4059,7 +4699,7 @@ weechat.remove_infobar(1)
</para>
</section>
- <section>
+ <section id="secScript_log">
<title>log</title>
<para>
@@ -4130,7 +4770,7 @@ weechat.log("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_add_message_handler">
<title>add_message_handler</title>
<para>
@@ -4257,7 +4897,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_command_handler">
<title>add_command_handler</title>
<para>
@@ -4329,7 +4969,7 @@ end
<para>
<option>completion_template</option>:
Vorlage für die Vervollständigung; zum Beispiel bedeutet
- "<code class="literal">abc|%w def|%i</code>", dass das
+ "<literal>abc|%w def|%i</literal>", dass das
erste Argument "abc" oder ein WeeChat-Kommando sein kann
und das zweite Argument "def" oder ein IRC-Kommando.
(siehe <xref linkend="secAPI_cmd_handler_add" />)
@@ -4391,7 +5031,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_timer_handler">
<title>add_timer_handler</title>
<para>
@@ -4493,7 +5133,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_keyboard_handler">
<title>add_keyboard_handler</title>
<para>
@@ -4596,7 +5236,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_remove_handler">
<title>remove_handler</title>
<para>
@@ -4662,7 +5302,7 @@ weechat.remove_handler("command", "my_command")
</para>
</section>
- <section>
+ <section id="secScript_remove_timer_handler">
<title>remove_timer_handler</title>
<para>
@@ -4723,7 +5363,7 @@ weechat.remove_timer_handler("my_timer")
</para>
</section>
- <section>
+ <section id="secScript_remove_keyboard_handler">
<title>remove_keyboard_handler</title>
<para>
@@ -4784,7 +5424,7 @@ weechat.remove_keyboard_handler("my_keyboard")
</para>
</section>
- <section>
+ <section id="secScript_command">
<title>command</title>
<para>
@@ -4865,7 +5505,7 @@ weechat.command("/nick newnick", "", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_info">
<title>get_info</title>
<para>
@@ -4936,7 +5576,7 @@ nick = weechat.get_info("nick", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_dcc_info">
<title>get_dcc_info</title>
<para>
@@ -5041,7 +5681,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_server_info">
<title>get_server_info</title>
<para>
@@ -5146,7 +5786,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_channel_info">
<title>get_channel_info</title>
<para>
@@ -5251,7 +5891,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_nick_info">
<title>get_nick_info</title>
<para>
@@ -5356,7 +5996,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_config">
<title>get_config</title>
<para>
@@ -5421,7 +6061,7 @@ value2 = weechat.get_config("freenode.server_autojoin")
</para>
</section>
- <section>
+ <section id="secScript_set_config">
<title>set_config</title>
<para>
@@ -5491,7 +6131,7 @@ weechat.set_config("freenode.server_autojoin, "#weechat")
</para>
</section>
- <section>
+ <section id="secScript_get_plugin_config">
<title>get_plugin_config</title>
<para>
@@ -5556,7 +6196,7 @@ value = weechat.get_plugin_config("my_var")
</para>
</section>
- <section>
+ <section id="secScript_set_plugin_config">
<title>set_plugin_config</title>
<para>
@@ -5625,6 +6265,416 @@ weechat.set_plugin_config("my_var", "value")
</para>
</section>
+ <section id="secScript_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_irc_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Return IRC color index with name.
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found
+ (see <xref linkend="secAPI_get_irc_color" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $color_blue = weechat::get_irc_color("blue");
+
+# python
+color_blue = weechat.get_irc_color("blue")
+
+# ruby
+color_blue = Weechat.get_irc_color("blue")
+
+-- lua
+color_blue = weechat.get_irc_color("blue")
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_input_color">
+ <title>input_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::input_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+weechat::input_color(weechat::get_irc_color("blue"), 10, 5);
+
+# python
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+
+# ruby
+Weechat.input_color(Weechat.get_irc_color("blue"), 10, 5)
+
+-- lua
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_window_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Return value: list of WeeChat windows
+ (see <xref linkend="secAPI_get_window_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my @wf = weechat::get_window_info();
+if (@wf)
+{
+ weechat::print("**** windows infos ****");
+ foreach my $w (@wf)
+ {
+ while ( my ($key, $value) = each %$w)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no window info ****");
+}
+
+# python
+wf = weechat.get_window_info()
+if wf != None and wf != []:
+ weechat.prnt ("**** windows infos ****")
+ for w in wf:
+ for i in w:
+ weechat.prnt (" > %s => %s" % (i, w[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no window info ****")
+
+# ruby
+wf = Weechat.get_window_info()
+if wf != nil and wf != []
+ Weechat.print("**** windows infos ****")
+ wf.each do |w|
+ w.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no window info ****")
+end
+
+-- lua
+wf = weechat.get_window_info()
+if wf then
+ weechat.print ("**** windows infos ****")
+ w, winfos = next (wf, nil)
+ while (w) do
+ key, value = next (winfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (winfos, key)
+ end
+ weechat.print ("----------------------")
+ w, winfos = next (wf, w)
+ end
+else
+ weechat.print("**** no window info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Return value: list of WeeChat buffers
+ (see <xref linkend="secAPI_get_buffer_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $bf = weechat::get_buffer_info();
+if ($bf)
+{
+ while ( my ($nobuf, $binfos) = each %$bf)
+ {
+ while ( my ($key, $value) = each %$binfos)
+ {
+ weechat::print(" > $key => $value");
+ }
+ }
+}
+else
+{
+ weechat::print("**** no buffer info ****");
+}
+
+# python
+bf = weechat.get_buffer_info()
+if bf != None and bf != {}:
+ for b in bf:
+ weechat.prnt ("**** info for buffer no %d ****" % b)
+ for c in bf[b]:
+ weechat.prnt (" > %s => %s" % (c, bf[b][c]))
+else:
+ weechat.prnt ("**** no buffer info ****")
+
+# ruby
+bf = Weechat.get_buffer_info()
+if bf != nil and bf != {}
+ bf.each do |n, c|
+ Weechat.print("**** info for buffer no #{n} ****")
+ c.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ end
+else
+ Weechat.print("**** no buffer info ****")
+end
+
+-- lua
+bf = weechat.get_buffer_info()
+if bf then
+ b, binfos = next (bf, nil)
+ while (b) do
+ weechat.print("**** info for buffer no " .. b .. " ****")
+ key, value = next (binfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (binfos, key)
+ end
+ b, infos = next (bf, b)
+ end
+else
+ weechat.print("**** no buffer info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_data(server, channel);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Return value: list of lines for buffer
+ (see <xref linkend="secAPI_get_buffer_data" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $server = "freenode";
+my $channel = "#weechat";
+my @bc = weechat::get_buffer_data($server, $channel);
+if (@bc)
+{
+ weechat::print("**** buffer data for $channel@$server ****");
+ foreach my $l (@bc) {
+ while ( my ($key, $value) = each %$l) {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer data ****");
+}
+
+# python
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc != None and bc != []:
+ weechat.prnt ("**** buffer data for %s@%s ****" % (channel, server))
+ for l in bc:
+ for i in l:
+ weechat.prnt (" > %s => %s" % (i, l[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer data ****")
+
+# ruby
+server = "freenode"
+channel = "#weechat"
+bc = Weechat.get_buffer_data(server, channel)
+if bc != nil and bc != []
+ Weechat.print("**** buffer data for #{channel}@#{server} ****")
+ bc.each do |l|
+ l.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer data ****")
+end
+
+-- lua
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc then
+ b, bdatas = next (bc, nil)
+ weechat.print("**** buffer data for " .. channel .. "@" .. server .. " ****")
+ while (b) do
+ key, value = next (chaninfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (bdatas, key)
+ end
+ weechat.print ("----------------------")
+ b, bdatas = next (bc, b)
+ end
+else
+ weechat.print("**** no buffer data ****")
+end
+</screen>
+ </para>
+ </section>
+
</section>
</section>
diff --git a/doc/de/weechat_commands.xml b/doc/de/weechat_commands.xml
index fbda4cde5..a829769c3 100644
--- a/doc/de/weechat_commands.xml
+++ b/doc/de/weechat_commands.xml
@@ -124,17 +124,6 @@ functions: interne Funktionen für Tastenbelegungen auflisten
reset: Standardbelegung wiederherstellen und entferne alle eigenen Belegungen (Vorsicht!)
</programlisting>
-<command>panel [list | add Art Position Größe | resize # Größe | close # | move #1 #2]</command>
-<programlisting>
-Panels verwalten
-
- list: listet allo offenen Panels (Default, kann als Parameter auch weggelassen werden)
- add: fügt ein Panel hinzu, Art ist global|local, Position ist top|bottom|left|right
- resize: setzt die Größe eines Panels neu (kann auch relativ sein, z.B. -1)
- close: schließt das Panel mit der angegebenen Nummer
- move: verschiebt ein Panel zu einer anderen Position (kann auch relativ sein, z.B. -1)
-
-</programlisting>
<command>plugin [load Dateiname] | [autoload] | [reload] | [unload]</command>
<programlisting>
auflisten/laden/entladen von Plugins
diff --git a/doc/en/weechat.en.xml b/doc/en/weechat.en.xml
index d27258cc4..483684140 100644
--- a/doc/en/weechat.en.xml
+++ b/doc/en/weechat.en.xml
@@ -1463,13 +1463,53 @@ if (argv != NULL)
</para>
</section>
+ <section id="secAPI_mkdir_home">
+ <title>mkdir_home</title>
+
+ <para>
+ Prototype:
+ <command>
+ int mkdir_home (t_weechat_plugin *plugin, char *directory)
+ </command>
+ </para>
+ <para>
+ Create a directory in WeeChat home.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>directory</option>: directory to create
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: 1 if directory was successfully created, 0 if an
+ error occurred.
+ </para>
+ <para>
+ Example:
+<screen>
+if (!plugin->mkdir_home (plugin, "temp"))
+ plugin->print_server(plugin, "Failed to create 'temp' directory in WeeChat home.");
+</screen>
+ </para>
+ </section>
+
<section id="secAPI_exec_on_files">
<title>exec_on_files</title>
<para>
Prototype:
<command>
- void exec_on_files (t_weechat_plugin *plugin, char *repertoire,
+ void exec_on_files (t_weechat_plugin *plugin, char *directory,
int (*callback)(t_weechat_plugin *, char *))
</command>
</para>
@@ -3547,13 +3587,613 @@ char *value = plugin->get_plugin_config (plugin, "my_var");
error occurred.
</para>
<para>
- Example :
+ Example:
<screen>
plugin->set_plugin_config (plugin, "my_var", "value");
</screen>
</para>
</section>
+ <section id="secAPI_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ int get_irc_color (t_weechat_plugin *plugin,
+ char *color_name)
+ </command>
+ </para>
+ <para>
+ Get IRC color index with name.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color_name</option>: color name
+ Allowed colors are:
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Color name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>white</entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>black</entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>blue</entry>
+ <entry>2</entry>
+ </row>
+ <row>
+ <entry>green</entry>
+ <entry>3</entry>
+ </row>
+ <row>
+ <entry>lightred</entry>
+ <entry>4</entry>
+ </row>
+ <row>
+ <entry>red</entry>
+ <entry>5</entry>
+ </row>
+ <row>
+ <entry>magenta</entry>
+ <entry>6</entry>
+ </row>
+ <row>
+ <entry>brown</entry>
+ <entry>7</entry>
+ </row>
+ <row>
+ <entry>yellow</entry>
+ <entry>8</entry>
+ </row>
+ <row>
+ <entry>lightgreen</entry>
+ <entry>9</entry>
+ </row>
+ <row>
+ <entry>cyan</entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry>lightcyan</entry>
+ <entry>11</entry>
+ </row>
+ <row>
+ <entry>lightblue</entry>
+ <entry>12</entry>
+ </row>
+ <row>
+ <entry>lightmagenta</entry>
+ <entry>13</entry>
+ </row>
+ <row>
+ <entry>gray</entry>
+ <entry>14</entry>
+ </row>
+ <row>
+ <entry>lightgray</entry>
+ <entry>15</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found.
+ </para>
+ <para>
+ Example:
+<screen>
+int color_blue = plugin->get_irc_color (plugin, "blue"); /* return 2 */
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ void input_color (t_weechat_plugin *plugin,
+ int color, int start, int length)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color</option>: color for text (if &lt; 0, then input
+ buffer is refresh, and there's no change in input buffer
+ content)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>start</option>: start position for color (if &lt; 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>length</option>: length for color (if &lt;= 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+<screen>
+plugin->input_color (plugin, plugin->get_irc_color (plugin, "blue"), 10, 5);
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_window_info *get_window_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat windows.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_x</literal></entry>
+ <entry>horizontal position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_y</literal></entry>
+ <entry>vertical position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width</literal></entry>
+ <entry>width of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height</literal></entry>
+ <entry>height of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width_pct</literal></entry>
+ <entry>width % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height_pct</literal></entry>
+ <entry>height % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_buffer</literal></entry>
+ <entry>number of displayed buffer</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>prev_window</literal></entry>
+ <entry>pointer to previous window info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>next_window</literal></entry>
+ <entry>pointer to next window info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_window_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_window_info *window_info, *ptr_window;
+
+window_info = plugin->get_window_info (plugin);
+if (window_info)
+{
+ for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
+ {
+ plugin->print (plugin, NULL, NULL, "--- window info ---");
+ plugin->print (plugin, NULL, NULL, "(%d,%d), size: %dx%d, %%size: %d%%x%d%%",
+ ptr_window->win_x, ptr_window->win_y,
+ ptr_window->win_width, ptr_window->win_height,
+ ptr_window->win_width_pct, ptr_window->win_height_pct);
+ plugin->print (plugin, NULL, NULL, "num_buffer: %d", ptr_window->num_buffer);
+ }
+ plugin->free_window_info (plugin, window_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no window info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_window_info">
+ <title>free_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_window_info (t_weechat_plugin *plugin,
+ t_plugin_window_info *window_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by window info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>window_info</option>: pointer to window info list
+ returned by "get_window_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_window_info (plugin, window_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_info *get_buffer_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat buffers.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>type</literal></entry>
+ <entry>buffer type: 0=standard, 1=dcc, 2=raw IRC data</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>number</literal></entry>
+ <entry>buffer number</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_displayed</literal></entry>
+ <entry>number of windows displaying buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>server_name</literal></entry>
+ <entry>server name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>channel_name</literal></entry>
+ <entry>channel name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>notify_level</literal></entry>
+ <entry>notify level for buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>log_filename</literal></entry>
+ <entry>log filename (NULL means not logging)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>prev_buffer</literal></entry>
+ <entry>pointer to previous buffer info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>next_buffer</literal></entry>
+ <entry>pointer to next buffer info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_info *buffer_info, *ptr_buffer;
+
+buffer_info = plugin->get_buffer_info (plugin);
+if (buffer_info)
+{
+ for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ plugin->print (plugin, NULL, NULL, "--- buffer info ---");
+ plugin->print (plugin, NULL, NULL, "type: %d", ptr_buffer->type);
+ plugin->print (plugin, NULL, NULL, "number: %d", ptr_buffer->number);
+ plugin->print (plugin, NULL, NULL, "num_displayed: %d", ptr_buffer->num_displayed);
+ plugin->print (plugin, NULL, NULL, "server: %s", ptr_buffer->server_name);
+ plugin->print (plugin, NULL, NULL, "channel: %s", ptr_buffer->channel_name);
+ plugin->print (plugin, NULL, NULL, "notify level: %d", ptr_buffer->notify_level);
+ plugin->print (plugin, NULL, NULL, "log filename: %s", ptr_buffer->log_filename);
+ }
+ plugin->free_buffer_info (plugin, buffer_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no buffer info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_info">
+ <title>free_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_info (t_weechat_plugin *plugin,
+ t_plugin_buffer_info *buffer_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_info</option>: pointer to buffer info list
+ returned by "get_buffer_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_info (plugin, buffer_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_data *get_buffer_info (t_weechat_plugin *plugin,
+ char *server, char *channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: channel name
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: buffer content (linked list of lines).
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>nick</literal></entry>
+ <entry>nick</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>data</literal></entry>
+ <entry>line content (color codes are removed)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>prev_line</literal></entry>
+ <entry>pointer to previous line</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>next_line</literal></entry>
+ <entry>pointer to next line</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_data"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_line *buffer_line, *ptr_line;
+
+buffer_line = plugin->get_buffer_data (plugin);
+if (buffer_line)
+{
+ for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
+ {
+ plugin->print (plugin, NULL, NULL, "nick: %s, data: %s", ptr_line->nick, ptr_line->data);
+ }
+ plugin->free_buffer_data (plugin, buffer_line);
+}
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_data">
+ <title>free_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_data (t_weechat_plugin *plugin,
+ t_plugin_buffer_line *buffer_line)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer line list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_line</option>: pointer to buffer line list
+ returned by "get_buffer_data" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_data (plugin, buffer_line);</screen>
+ </para>
+ </section>
+
</section>
<section id="secCompilePlugin">
@@ -3720,7 +4360,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
<section id="secSyntaxByLanguage">
<title>Syntax by language</title>
- <section>
+ <section id="secScriptPerl">
<title>Perl</title>
<para>
@@ -3732,7 +4372,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptPython">
<title>Python</title>
<para>
@@ -3749,7 +4389,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptRuby">
<title>Ruby</title>
<para>
@@ -3779,7 +4419,7 @@ end
</section>
- <section>
+ <section id="secScriptLua">
<title>Lua</title>
<para>
@@ -3803,7 +4443,7 @@ end
<section id="secWeeChatScriptsAPI">
<title>WeeChat / scripts API</title>
- <section>
+ <section id="secScript_register">
<title>register</title>
<para>
@@ -3883,7 +4523,7 @@ weechat.register("test", "1.0", "end_test", "Test script!")
</para>
</section>
- <section>
+ <section id="secScript_print">
<title>print</title>
<para>
@@ -3965,7 +4605,7 @@ weechat.print("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_print_infobar">
<title>print_infobar</title>
<para>
@@ -4032,7 +4672,7 @@ weechat.print_infobar(5, "message")
</para>
</section>
- <section>
+ <section id="secScript_remove_infobar">
<title>remove_infobar</title>
<para>
@@ -4095,7 +4735,7 @@ weechat.remove_infobar(1)
</para>
</section>
- <section>
+ <section id="secScript_log">
<title>log</title>
<para>
@@ -4168,7 +4808,7 @@ weechat.log("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_add_message_handler">
<title>add_message_handler</title>
<para>
@@ -4298,7 +4938,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_command_handler">
<title>add_command_handler</title>
<para>
@@ -4430,7 +5070,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_timer_handler">
<title>add_timer_handler</title>
<para>
@@ -4529,7 +5169,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_keyboard_handler">
<title>add_keyboard_handler</title>
<para>
@@ -4633,7 +5273,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_remode_handler">
<title>remove_handler</title>
<para>
@@ -4699,7 +5339,7 @@ weechat.remove_handler("command", "my_command")
</para>
</section>
- <section>
+ <section id="secScript_remove_timer_handler">
<title>remove_timer_handler</title>
<para>
@@ -4760,7 +5400,7 @@ weechat.remove_timer_handler("my_timer")
</para>
</section>
- <section>
+ <section id="secScrip_remove_keyboard_handler">
<title>remove_keyboard_handler</title>
<para>
@@ -4821,7 +5461,7 @@ weechat.remove_keyboard_handler("my_keyboard")
</para>
</section>
- <section>
+ <section id="secScript_command">
<title>command</title>
<para>
@@ -4902,7 +5542,7 @@ weechat.command("/nick newnick", "", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_info">
<title>get_info</title>
<para>
@@ -4975,7 +5615,7 @@ nick = weechat.get_info("nick", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_dcc_info">
<title>get_dcc_info</title>
<para>
@@ -5080,7 +5720,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_server_info">
<title>get_server_info</title>
<para>
@@ -5185,7 +5825,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_channel_info">
<title>get_channel_info</title>
<para>
@@ -5290,7 +5930,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_nick_info">
<title>get_nick_info</title>
<para>
@@ -5395,7 +6035,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_config">
<title>get_config</title>
<para>
@@ -5460,7 +6100,7 @@ value2 = weechat.get_config("freenode.server_autojoin")
</para>
</section>
- <section>
+ <section id="secScript_set_config">
<title>set_config</title>
<para>
@@ -5531,7 +6171,7 @@ weechat.set_config("freenode.server_autojoin, "#weechat")
</para>
</section>
- <section>
+ <section id="secScript_get_plugin_config">
<title>get_plugin_config</title>
<para>
@@ -5595,7 +6235,7 @@ value = weechat.get_plugin_config("my_var")
</para>
</section>
- <section>
+ <section id="secScript_set_plugin_config">
<title>set_plugin_config</title>
<para>
@@ -5665,6 +6305,416 @@ weechat.set_plugin_config("my_var", "value")
</para>
</section>
+ <section id="secScript_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_irc_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Return IRC color index with name.
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found
+ (see <xref linkend="secAPI_get_irc_color" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $color_blue = weechat::get_irc_color("blue");
+
+# python
+color_blue = weechat.get_irc_color("blue")
+
+# ruby
+color_blue = Weechat.get_irc_color("blue")
+
+-- lua
+color_blue = weechat.get_irc_color("blue")
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_input_color">
+ <title>input_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::input_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+weechat::input_color(weechat::get_irc_color("blue"), 10, 5);
+
+# python
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+
+# ruby
+Weechat.input_color(Weechat.get_irc_color("blue"), 10, 5)
+
+-- lua
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_window_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Return value: list of WeeChat windows
+ (see <xref linkend="secAPI_get_window_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my @wf = weechat::get_window_info();
+if (@wf)
+{
+ weechat::print("**** windows infos ****");
+ foreach my $w (@wf)
+ {
+ while ( my ($key, $value) = each %$w)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no window info ****");
+}
+
+# python
+wf = weechat.get_window_info()
+if wf != None and wf != []:
+ weechat.prnt ("**** windows infos ****")
+ for w in wf:
+ for i in w:
+ weechat.prnt (" > %s => %s" % (i, w[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no window info ****")
+
+# ruby
+wf = Weechat.get_window_info()
+if wf != nil and wf != []
+ Weechat.print("**** windows infos ****")
+ wf.each do |w|
+ w.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no window info ****")
+end
+
+-- lua
+wf = weechat.get_window_info()
+if wf then
+ weechat.print ("**** windows infos ****")
+ w, winfos = next (wf, nil)
+ while (w) do
+ key, value = next (winfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (winfos, key)
+ end
+ weechat.print ("----------------------")
+ w, winfos = next (wf, w)
+ end
+else
+ weechat.print("**** no window info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Return value: list of WeeChat buffers
+ (see <xref linkend="secAPI_get_buffer_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $bf = weechat::get_buffer_info();
+if ($bf)
+{
+ while ( my ($nobuf, $binfos) = each %$bf)
+ {
+ while ( my ($key, $value) = each %$binfos)
+ {
+ weechat::print(" > $key => $value");
+ }
+ }
+}
+else
+{
+ weechat::print("**** no buffer info ****");
+}
+
+# python
+bf = weechat.get_buffer_info()
+if bf != None and bf != {}:
+ for b in bf:
+ weechat.prnt ("**** info for buffer no %d ****" % b)
+ for c in bf[b]:
+ weechat.prnt (" > %s => %s" % (c, bf[b][c]))
+else:
+ weechat.prnt ("**** no buffer info ****")
+
+# ruby
+bf = Weechat.get_buffer_info()
+if bf != nil and bf != {}
+ bf.each do |n, c|
+ Weechat.print("**** info for buffer no #{n} ****")
+ c.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ end
+else
+ Weechat.print("**** no buffer info ****")
+end
+
+-- lua
+bf = weechat.get_buffer_info()
+if bf then
+ b, binfos = next (bf, nil)
+ while (b) do
+ weechat.print("**** info for buffer no " .. b .. " ****")
+ key, value = next (binfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (binfos, key)
+ end
+ b, infos = next (bf, b)
+ end
+else
+ weechat.print("**** no buffer info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_data(server, channel);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Return value: list of lines for buffer
+ (see <xref linkend="secAPI_get_buffer_data" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $server = "freenode";
+my $channel = "#weechat";
+my @bc = weechat::get_buffer_data($server, $channel);
+if (@bc)
+{
+ weechat::print("**** buffer data for $channel@$server ****");
+ foreach my $l (@bc) {
+ while ( my ($key, $value) = each %$l) {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer data ****");
+}
+
+# python
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc != None and bc != []:
+ weechat.prnt ("**** buffer data for %s@%s ****" % (channel, server))
+ for l in bc:
+ for i in l:
+ weechat.prnt (" > %s => %s" % (i, l[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer data ****")
+
+# ruby
+server = "freenode"
+channel = "#weechat"
+bc = Weechat.get_buffer_data(server, channel)
+if bc != nil and bc != []
+ Weechat.print("**** buffer data for #{channel}@#{server} ****")
+ bc.each do |l|
+ l.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer data ****")
+end
+
+-- lua
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc then
+ b, bdatas = next (bc, nil)
+ weechat.print("**** buffer data for " .. channel .. "@" .. server .. " ****")
+ while (b) do
+ key, value = next (chaninfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (bdatas, key)
+ end
+ weechat.print ("----------------------")
+ b, bdatas = next (bc, b)
+ end
+else
+ weechat.print("**** no buffer data ****")
+end
+</screen>
+ </para>
+ </section>
+
</section>
</section>
diff --git a/doc/en/weechat_commands.xml b/doc/en/weechat_commands.xml
index 033bf33a0..bb4823b66 100644
--- a/doc/en/weechat_commands.xml
+++ b/doc/en/weechat_commands.xml
@@ -123,17 +123,6 @@ functions: list internal functions for key bindings
reset: restore bindings to the default values and delete ALL personal bindings (use carefully!)
</programlisting>
-<command>panel [list | add type position size | resize # size | close # | move #1 #2]</command>
-<programlisting>
-manage panels
-
- list: list open panels (no parameter implies this list)
- add: add a panel, type is global|local, position is top|bottom|left|right
- resize: resize a panel with a new size (may be relative, for example -1)
- close: close a panel by number
- move: move a panel to another number (may be relative, for example -1)
-
-</programlisting>
<command>plugin [load filename] | [autoload] | [reload] | [unload]</command>
<programlisting>
list/load/unload plugins
diff --git a/doc/fr/weechat.fr.xml b/doc/fr/weechat.fr.xml
index c05258ce5..e50765555 100644
--- a/doc/fr/weechat.fr.xml
+++ b/doc/fr/weechat.fr.xml
@@ -1489,6 +1489,47 @@ if (argv != NULL)
</para>
</section>
+ <section id="secAPI_mkdir_home">
+ <title>mkdir_home</title>
+
+ <para>
+ Prototype :
+ <command>
+ int mkdir_home (t_weechat_plugin *plugin, char *repertoire)
+ </command>
+ </para>
+ <para>
+ Créé un répertoire dans le répertoire de base de WeeChat.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>repertoire</option> : répertoire à créer
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : 1 si le répertoire a été créé avec succès,
+ 0 si une erreur s'est produite.
+ </para>
+ <para>
+ Example:
+<screen>
+if (!plugin->mkdir_home (plugin, "temp"))
+ plugin->print_server(plugin, "Impossible de créer le répertoire 'temp' dans la base WeeChat.");
+</screen>
+ </para>
+ </section>
+
<section id="secAPI_exec_on_files">
<title>exec_on_files</title>
@@ -2612,7 +2653,7 @@ plugin->exec_command (plugin, "freenode", "#weechat", "bonjour");
<row>
<entry><literal>weechat_dir</literal></entry>
<entry>
- répertoire maison de WeeChat
+ répertoire de base de WeeChat
(par défaut: ~/.weechat/)
</entry>
</row>
@@ -3636,6 +3677,624 @@ plugin->set_plugin_config (plugin, "ma_variable", "valeur");
</para>
</section>
+ <section id="secAPI_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype :
+ <command>
+ int get_irc_color (t_weechat_plugin *plugin,
+ char *nom_couleur)
+ </command>
+ </para>
+ <para>
+ Renvoie le numéro d'une couleur IRC avec son nom.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>nom_couleur</option> : nom de la couleur
+ Les couleure autorisées sont :
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Nom couleur</entry>
+ <entry>Valeur</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>white</entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>black</entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>blue</entry>
+ <entry>2</entry>
+ </row>
+ <row>
+ <entry>green</entry>
+ <entry>3</entry>
+ </row>
+ <row>
+ <entry>lightred</entry>
+ <entry>4</entry>
+ </row>
+ <row>
+ <entry>red</entry>
+ <entry>5</entry>
+ </row>
+ <row>
+ <entry>magenta</entry>
+ <entry>6</entry>
+ </row>
+ <row>
+ <entry>brown</entry>
+ <entry>7</entry>
+ </row>
+ <row>
+ <entry>yellow</entry>
+ <entry>8</entry>
+ </row>
+ <row>
+ <entry>lightgreen</entry>
+ <entry>9</entry>
+ </row>
+ <row>
+ <entry>cyan</entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry>lightcyan</entry>
+ <entry>11</entry>
+ </row>
+ <row>
+ <entry>lightblue</entry>
+ <entry>12</entry>
+ </row>
+ <row>
+ <entry>lightmagenta</entry>
+ <entry>13</entry>
+ </row>
+ <row>
+ <entry>gray</entry>
+ <entry>14</entry>
+ </row>
+ <row>
+ <entry>lightgray</entry>
+ <entry>15</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : numéro de la couleur IRC, -1 si la couleur
+ n'est pas trouvée.
+ </para>
+ <para>
+ Exemple :
+<screen>
+int color_blue = plugin->get_irc_color (plugin, "blue"); /* retourne 2 */
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype :
+ <command>
+ void input_color (t_weechat_plugin *plugin,
+ int couleur, int debut, int longueur)
+ </command>
+ </para>
+ <para>
+ Ajoute de la couleur dans la zone de saisie.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>couleur</option> : couleur pour le texte (si &lt; 0,
+ alors la zone de saisie est rafraichie, et il n'y a aucun
+ changement dans son contenu)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>debut</option> : position de début pour la coloration
+ (si &lt; 0, alors le masque est réinitialisé)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>longueur</option> : longueur pour la coloration
+ (si &lt;= 0, alors le masque est réinitialisé)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+<screen>
+plugin->input_color (plugin, plugin->get_irc_color (plugin, "blue"), 10, 5);
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype :
+ <command>
+ t_plugin_window_info *get_window_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Retourne la liste des fenêtres WeeChat.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : liste chaînée des fenêtres WeeChat.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Champ</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_x</literal></entry>
+ <entry>position horizontale de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_y</literal></entry>
+ <entry>position verticale de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width</literal></entry>
+ <entry>largeur de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height</literal></entry>
+ <entry>hauteur de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width_pct</literal></entry>
+ <entry>largeur en % (comparé à la fenêtre parent)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height_pct</literal></entry>
+ <entry>hauteur en % (comparé à la fenêtre parent)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_buffer</literal></entry>
+ <entry>numéro du tampon affiché</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>prev_window</literal></entry>
+ <entry>pointeur vers les infos de la fenêtre précédente</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>next_window</literal></entry>
+ <entry>pointeur vers les infos de la fenêtre suivante</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note : le résultat doit être libéré par un appel à la fonction
+ "free_window_info" après utilisation.
+ </para>
+ <para>
+ Exemple :
+<screen>
+t_plugin_window_info *window_info, *ptr_window;
+
+window_info = plugin->get_window_info (plugin);
+if (window_info)
+{
+ for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
+ {
+ plugin->print (plugin, NULL, NULL, "--- info fenêtre ---");
+ plugin->print (plugin, NULL, NULL, "(%d,%d), size: %dx%d, %%size: %d%%x%d%%",
+ ptr_window->win_x, ptr_window->win_y,
+ ptr_window->win_width, ptr_window->win_height,
+ ptr_window->win_width_pct, ptr_window->win_height_pct);
+ plugin->print (plugin, NULL, NULL, "num_buffer: %d", ptr_window->num_buffer);
+ }
+ plugin->free_window_info (plugin, window_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "pas d'info fenêtre !");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_window_info">
+ <title>free_window_info</title>
+
+ <para>
+ Prototype :
+ <command>
+ void free_window_info (t_weechat_plugin *plugin,
+ t_plugin_window_info *window_info)
+ </command>
+ </para>
+ <para>
+ Libère la mémoire utilisée par une liste de fenêtres.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>window_info</option> : pointeur vers la liste des
+ infos fenêtres retournée par la fonction "get_window_info"
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+ <screen>plugin->free_window_info (plugin, window_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype :
+ <command>
+ t_plugin_buffer_info *get_buffer_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Retourne la liste des tampons WeeChat.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : liste chaînée des tampons WeeChat.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Champ</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>type</literal></entry>
+ <entry>
+ type de tampon: 0=standard, 1=dcc,
+ 2=données IRC brutes
+ </entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>number</literal></entry>
+ <entry>numéro de tampon</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_displayed</literal></entry>
+ <entry>nombre de fenêtres affichant ce tampon</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>server_name</literal></entry>
+ <entry>nom du serveur pour le tampon (peut être NULL)</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>channel_name</literal></entry>
+ <entry>nom du canal pout le tampon (peut être NULL)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>notify_level</literal></entry>
+ <entry>niveau de notification du tampon</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>log_filename</literal></entry>
+ <entry>
+ nom du fichier de log (NULL signifie qu'il n'y a
+ pas de log)
+ </entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>prev_buffer</literal></entry>
+ <entry>pointeur vers les infos du tampon précédent</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>next_buffer</literal></entry>
+ <entry>pointeur vers les infos du tampon suivant</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note : le résultat doit être libéré par un appel à la fonction
+ "free_buffer_info" après utilisation.
+ </para>
+ <para>
+ Exemple :
+<screen>
+t_plugin_buffer_info *buffer_info, *ptr_buffer;
+
+buffer_info = plugin->get_buffer_info (plugin);
+if (buffer_info)
+{
+ for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ plugin->print (plugin, NULL, NULL, "--- info tampon ---");
+ plugin->print (plugin, NULL, NULL, "type: %d", ptr_buffer->type);
+ plugin->print (plugin, NULL, NULL, "number: %d", ptr_buffer->number);
+ plugin->print (plugin, NULL, NULL, "num_displayed: %d", ptr_buffer->num_displayed);
+ plugin->print (plugin, NULL, NULL, "server: %s", ptr_buffer->server_name);
+ plugin->print (plugin, NULL, NULL, "channel: %s", ptr_buffer->channel_name);
+ plugin->print (plugin, NULL, NULL, "notify level: %d", ptr_buffer->notify_level);
+ plugin->print (plugin, NULL, NULL, "log filename: %s", ptr_buffer->log_filename);
+ }
+ plugin->free_buffer_info (plugin, buffer_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "pas d'info tampon !");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_info">
+ <title>free_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_info (t_weechat_plugin *plugin,
+ t_plugin_buffer_info *buffer_info)
+ </command>
+ </para>
+ <para>
+ Libère la mémoire utilisée par une liste de tampons.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_info</option> : pointeur vers la liste des
+ infos tampons retournée par la fonction "get_buffer_info"
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+ <screen>plugin->free_buffer_info (plugin, buffer_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_data *get_buffer_info (t_weechat_plugin *plugin,
+ char *serveur, char *canal)
+ </command>
+ </para>
+ <para>
+ Renvoie le contenu du tampon.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>serveur</option> : nom interne du serveur
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>canal</option> : nom du canal
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : contenu du tampon (liste chaînée de lignes).
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Champ</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>nick</literal></entry>
+ <entry>pseudo</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>data</literal></entry>
+ <entry>
+ contenu de la ligne (les codes couleur sont
+ retirés)
+ </entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>prev_line</literal></entry>
+ <entry>pointeur vers la ligne précédente</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>next_line</literal></entry>
+ <entry>pointeur vers la ligne suivante</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note : le résultat doit être libéré par un appel à la fonction
+ "free_buffer_data" après utilisation.
+ </para>
+ <para>
+ Exemple :
+<screen>
+t_plugin_buffer_line *buffer_line, *ptr_line;
+
+buffer_line = plugin->get_buffer_data (plugin);
+if (buffer_line)
+{
+ for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
+ {
+ plugin->print (plugin, NULL, NULL, "pseudo: %s, données: %s", ptr_line->nick, ptr_line->data);
+ }
+ plugin->free_buffer_data (plugin, buffer_line);
+}
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_data">
+ <title>free_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_data (t_weechat_plugin *plugin,
+ t_plugin_buffer_line *buffer_line)
+ </command>
+ </para>
+ <para>
+ Libère la mémoire utilisée par les lignes d'un tampon.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_line</option> : pointeur vers la liste des
+ lignes du tampon retournée par la fonction "get_buffer_data"
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+ <screen>plugin->free_buffer_data (plugin, buffer_line);</screen>
+ </para>
+ </section>
+
</section>
<section id="secCompilerExtension">
@@ -3805,7 +4464,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
<section id="secSyntaxeParLangage">
<title>Syntaxe par langage</title>
- <section>
+ <section id="secScriptPerl">
<title>Perl</title>
<para>
@@ -3817,7 +4476,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptPython">
<title>Python</title>
<para>
@@ -3834,7 +4493,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptRuby">
<title>Ruby</title>
<para>
@@ -3865,7 +4524,7 @@ end
</section>
- <section>
+ <section id="secScriptLua">
<title>Lua</title>
<para>
@@ -3889,7 +4548,7 @@ end
<section id="secInterfaceWeeChatScripts">
<title>Interface WeeChat / scripts</title>
- <section>
+ <section id="sec_script_register">
<title>register</title>
<para>
@@ -3970,7 +4629,7 @@ weechat.register("essai", "1.0", "fin_essai", "Script d'essai !")
</para>
</section>
- <section>
+ <section id="secScript_print">
<title>print</title>
<para>
@@ -4052,7 +4711,7 @@ weechat.print("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_print_infobar">
<title>print_infobar</title>
<para>
@@ -4119,7 +4778,7 @@ weechat.print_infobar(5, "message")
</para>
</section>
- <section>
+ <section id="secScript_remove_infobar">
<title>remove_infobar</title>
<para>
@@ -4182,7 +4841,7 @@ weechat.remove_infobar(1)
</para>
</section>
- <section>
+ <section id="secScript_log">
<title>log</title>
<para>
@@ -4256,7 +4915,7 @@ weechat.log("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_add_message_handler">
<title>add_message_handler</title>
<para>
@@ -4388,7 +5047,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_command_handler">
<title>add_command_handler</title>
<para>
@@ -4520,7 +5179,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_timer_handler">
<title>add_timer_handler</title>
<para>
@@ -4620,7 +5279,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_keyboard_handler">
<title>add_keyboard_handler</title>
<para>
@@ -4725,7 +5384,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_remove_handler">
<title>remove_handler</title>
<para>
@@ -4791,7 +5450,7 @@ weechat.remove_handler("commande", "ma_commande")
</para>
</section>
- <section>
+ <section id="secScript_remove_timer_handler">
<title>remove_timer_handler</title>
<para>
@@ -4852,7 +5511,7 @@ weechat.remove_timer_handler("mon_timer")
</para>
</section>
- <section>
+ <section id="secScript_remove_keyboard_handler">
<title>remove_keyboard_handler</title>
<para>
@@ -4913,7 +5572,7 @@ weechat.remove_keyboard_handler("mon_clavier")
</para>
</section>
- <section>
+ <section id="secScript_command">
<title>command</title>
<para>
@@ -4994,7 +5653,7 @@ weechat.command("/nick newnick", "", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_info">
<title>get_info</title>
<para>
@@ -5067,7 +5726,7 @@ nick = weechat.get_info("nick", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_dcc_info">
<title>get_dcc_info</title>
<para>
@@ -5172,7 +5831,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_server_info">
<title>get_server_info</title>
<para>
@@ -5277,7 +5936,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_channel_info">
<title>get_channel_info</title>
<para>
@@ -5382,7 +6041,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_nick_info">
<title>get_nick_info</title>
<para>
@@ -5487,7 +6146,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_config">
<title>get_config</title>
<para>
@@ -5553,7 +6212,7 @@ valeur2 = weechat.get_config("freenode.server_autojoin")
</para>
</section>
- <section>
+ <section id="secScript_set_config">
<title>set_config</title>
<para>
@@ -5625,7 +6284,7 @@ weechat.set_config("freenode.server_autojoin, "#weechat")
</para>
</section>
- <section>
+ <section id="secScript_get_plugin_config">
<title>get_plugin_config</title>
<para>
@@ -5693,7 +6352,7 @@ valeur = weechat.get_plugin_config("ma_variable")
</para>
</section>
- <section>
+ <section id="secScript_set_plugin_config">
<title>set_plugin_config</title>
<para>
@@ -5767,6 +6426,416 @@ weechat.set_plugin_config("ma_variable", "valeur")
</para>
</section>
+ <section id="secScript_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::get_irc_color(color);
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Renvoie le numéro d'une couleur IRC avec son nom.
+ </para>
+ <para>
+ Valeur renvoyée : numéro de la couleur IRC, -1 si la couleur
+ n'est pas trouvée (voir <xref linkend="secAPI_get_irc_color" />).
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+my $color_blue = weechat::get_irc_color("blue");
+
+# python
+color_blue = weechat.get_irc_color("blue")
+
+# ruby
+color_blue = Weechat.get_irc_color("blue")
+
+-- lua
+color_blue = weechat.get_irc_color("blue")
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::input_color(color);
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Ajoute de la couleur dans la zone de saisie.
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+weechat::input_color(weechat::get_irc_color("blue"), 10, 5);
+
+# python
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+
+# ruby
+Weechat.input_color(Weechat.get_irc_color("blue"), 10, 5)
+
+-- lua
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::get_window_info();
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Renvoie la liste des fenêtres WeeChat.
+ </para>
+ <para>
+ Valeur renvoyée : liste des fenêtres WeeChat
+ (voir <xref linkend="secAPI_get_window_info" />).
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+my @wf = weechat::get_window_info();
+if (@wf)
+{
+ weechat::print("**** infos fenêtres ****");
+ foreach my $w (@wf)
+ {
+ while ( my ($key, $value) = each %$w)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** pas d'info fenêtre ****");
+}
+
+# python
+wf = weechat.get_window_info()
+if wf != None and wf != []:
+ weechat.prnt ("**** infos fenêtres ****")
+ for w in wf:
+ for i in w:
+ weechat.prnt (" > %s => %s" % (i, w[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** pas d'info sur les fenêtres ****")
+
+# ruby
+wf = Weechat.get_window_info()
+if wf != nil and wf != []
+ Weechat.print("**** infos fenêtres ****")
+ wf.each do |w|
+ w.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** pas d'info sur les fenêtres ****")
+end
+
+-- lua
+wf = weechat.get_window_info()
+if wf then
+ weechat.print ("**** infos fenêtres ****")
+ w, winfos = next (wf, nil)
+ while (w) do
+ key, value = next (winfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (winfos, key)
+ end
+ weechat.print ("----------------------")
+ w, winfos = next (wf, w)
+ end
+else
+ weechat.print("**** pas d'info sur les fenêtres ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::get_buffer_info();
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Renvoie la liste des tampons WeeChat.
+ </para>
+ <para>
+ Valeur renvoyée : liste des tampons WeeChat
+ (voir <xref linkend="secAPI_get_buffer_info" />).
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+my $bf = weechat::get_buffer_info();
+if ($bf)
+{
+ while ( my ($nobuf, $binfos) = each %$bf)
+ {
+ while ( my ($key, $value) = each %$binfos)
+ {
+ weechat::print(" > $key => $value");
+ }
+ }
+}
+else
+{
+ weechat::print("**** pas d'info sur les tampons ****");
+}
+
+# python
+bf = weechat.get_buffer_info()
+if bf != None and bf != {}:
+ for b in bf:
+ weechat.prnt ("**** info pour tampon buffer no %d ****" % b)
+ for c in bf[b]:
+ weechat.prnt (" > %s => %s" % (c, bf[b][c]))
+else:
+ weechat.prnt ("**** pas d'info sur les tampons ****")
+
+# ruby
+bf = Weechat.get_buffer_info()
+if bf != nil and bf != {}
+ bf.each do |n, c|
+ Weechat.print("**** info pour tampon no #{n} ****")
+ c.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ end
+else
+ Weechat.print("**** pas d'info sur les tampons ****")
+end
+
+-- lua
+bf = weechat.get_buffer_info()
+if bf then
+ b, binfos = next (bf, nil)
+ while (b) do
+ weechat.print("**** info pour tampon no " .. b .. " ****")
+ key, value = next (binfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (binfos, key)
+ end
+ b, infos = next (bf, b)
+ end
+else
+ weechat.print("**** pas d'info sur les tampons ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_data(server, channel);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Return value: list of lines for buffer
+ (see <xref linkend="secAPI_get_buffer_data" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $server = "freenode";
+my $channel = "#weechat";
+my @bc = weechat::get_buffer_data($server, $channel);
+if (@bc)
+{
+ weechat::print("**** buffer data for $channel@$server ****");
+ foreach my $l (@bc) {
+ while ( my ($key, $value) = each %$l) {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer data ****");
+}
+
+# python
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc != None and bc != []:
+ weechat.prnt ("**** buffer data for %s@%s ****" % (channel, server))
+ for l in bc:
+ for i in l:
+ weechat.prnt (" > %s => %s" % (i, l[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer data ****")
+
+# ruby
+server = "freenode"
+channel = "#weechat"
+bc = Weechat.get_buffer_data(server, channel)
+if bc != nil and bc != []
+ Weechat.print("**** buffer data for #{channel}@#{server} ****")
+ bc.each do |l|
+ l.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer data ****")
+end
+
+-- lua
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc then
+ b, bdatas = next (bc, nil)
+ weechat.print("**** buffer data for " .. channel .. "@" .. server .. " ****")
+ while (b) do
+ key, value = next (chaninfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (bdatas, key)
+ end
+ weechat.print ("----------------------")
+ b, bdatas = next (bc, b)
+ end
+else
+ weechat.print("**** no buffer data ****")
+end
+</screen>
+ </para>
+ </section>
+
</section>
</section>
diff --git a/doc/fr/weechat_commands.xml b/doc/fr/weechat_commands.xml
index 875f8e01c..c9e57bf3b 100644
--- a/doc/fr/weechat_commands.xml
+++ b/doc/fr/weechat_commands.xml
@@ -123,17 +123,6 @@ functions: lister la liste des fonctions internes pour les associations de touch
reset: restaure les touches aux valeurs par défaut et supprime TOUTES les touches personnelles (utiliser avec précaution !)
</programlisting>
-<command>panel [list | add type position taille | resize # taille | close # | move #1 #2]</command>
-<programlisting>
-gestion des panneaux
-
- list: liste les panneaux ouverts (pas de paramètre affiche cette liste)
- add: ajoute un panneau, le type est global|local, la position est top|bottom|left|right
- resize: redimensionne le panneau avec une nouvelle taille (peut être relatif, par exemple -1)
- close: ferme un panneau par son numéro
- move: déplace un panneau à un autre numéro (peut être relatif, par exemple -1)
-
-</programlisting>
<command>plugin [load fichier] | [autoload] | [reload] | [unload]</command>
<programlisting>
liste/charge/décharge des extensions
diff --git a/weechat/doc/de/weechat.de.xml b/weechat/doc/de/weechat.de.xml
index 083ef6294..3f909a737 100644
--- a/weechat/doc/de/weechat.de.xml
+++ b/weechat/doc/de/weechat.de.xml
@@ -1462,6 +1462,46 @@ if (argv != NULL)
</para>
</section>
+ <section id="secAPI_mkdir_home">
+ <title>mkdir_home</title>
+
+ <para>
+ Prototype:
+ <command>
+ int mkdir_home (t_weechat_plugin *plugin, char *directory)
+ </command>
+ </para>
+ <para>
+ Create a directory in WeeChat home.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>directory</option>: directory to create
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: 1 if directory was successfully created, 0 if an
+ error occurred.
+ </para>
+ <para>
+ Example:
+<screen>
+if (!plugin->mkdir_home (plugin, "temp"))
+ plugin->print_server(plugin, "Failed to create 'temp' directory in WeeChat home.");
+</screen>
+ </para>
+ </section>
+
<section id="secAPI_exec_on_files">
<title>exec_on_files</title>
@@ -3521,6 +3561,606 @@ plugin->set_plugin_config (plugin, "my_var", "value");
</para>
</section>
+ <section id="secAPI_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ int get_irc_color (t_weechat_plugin *plugin,
+ char *color_name)
+ </command>
+ </para>
+ <para>
+ Get IRC color index with name.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color_name</option>: color name
+ Allowed colors are:
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Color name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>white</entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>black</entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>blue</entry>
+ <entry>2</entry>
+ </row>
+ <row>
+ <entry>green</entry>
+ <entry>3</entry>
+ </row>
+ <row>
+ <entry>lightred</entry>
+ <entry>4</entry>
+ </row>
+ <row>
+ <entry>red</entry>
+ <entry>5</entry>
+ </row>
+ <row>
+ <entry>magenta</entry>
+ <entry>6</entry>
+ </row>
+ <row>
+ <entry>brown</entry>
+ <entry>7</entry>
+ </row>
+ <row>
+ <entry>yellow</entry>
+ <entry>8</entry>
+ </row>
+ <row>
+ <entry>lightgreen</entry>
+ <entry>9</entry>
+ </row>
+ <row>
+ <entry>cyan</entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry>lightcyan</entry>
+ <entry>11</entry>
+ </row>
+ <row>
+ <entry>lightblue</entry>
+ <entry>12</entry>
+ </row>
+ <row>
+ <entry>lightmagenta</entry>
+ <entry>13</entry>
+ </row>
+ <row>
+ <entry>gray</entry>
+ <entry>14</entry>
+ </row>
+ <row>
+ <entry>lightgray</entry>
+ <entry>15</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found.
+ </para>
+ <para>
+ Example:
+<screen>
+int color_blue = plugin->get_irc_color (plugin, "blue"); /* return 2 */
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ void input_color (t_weechat_plugin *plugin,
+ int color, int start, int length)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color</option>: color for text (if &lt; 0, then input
+ buffer is refresh, and there's no change in input buffer
+ content)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>start</option>: start position for color (if &lt; 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>length</option>: length for color (if &lt;= 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+<screen>
+plugin->input_color (plugin, plugin->get_irc_color (plugin, "blue"), 10, 5);
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_window_info *get_window_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat windows.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_x</literal></entry>
+ <entry>horizontal position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_y</literal></entry>
+ <entry>vertical position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width</literal></entry>
+ <entry>width of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height</literal></entry>
+ <entry>height of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width_pct</literal></entry>
+ <entry>width % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height_pct</literal></entry>
+ <entry>height % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_buffer</literal></entry>
+ <entry>number of displayed buffer</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>prev_window</literal></entry>
+ <entry>pointer to previous window info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>next_window</literal></entry>
+ <entry>pointer to next window info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_window_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_window_info *window_info, *ptr_window;
+
+window_info = plugin->get_window_info (plugin);
+if (window_info)
+{
+ for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
+ {
+ plugin->print (plugin, NULL, NULL, "--- window info ---");
+ plugin->print (plugin, NULL, NULL, "(%d,%d), size: %dx%d, %%size: %d%%x%d%%",
+ ptr_window->win_x, ptr_window->win_y,
+ ptr_window->win_width, ptr_window->win_height,
+ ptr_window->win_width_pct, ptr_window->win_height_pct);
+ plugin->print (plugin, NULL, NULL, "num_buffer: %d", ptr_window->num_buffer);
+ }
+ plugin->free_window_info (plugin, window_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no window info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_window_info">
+ <title>free_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_window_info (t_weechat_plugin *plugin,
+ t_plugin_window_info *window_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by window info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>window_info</option>: pointer to window info list
+ returned by "get_window_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_window_info (plugin, window_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_info *get_buffer_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat buffers.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>type</literal></entry>
+ <entry>buffer type: 0=standard, 1=dcc, 2=raw IRC data</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>number</literal></entry>
+ <entry>buffer number</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_displayed</literal></entry>
+ <entry>number of windows displaying buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>server_name</literal></entry>
+ <entry>server name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>channel_name</literal></entry>
+ <entry>channel name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>notify_level</literal></entry>
+ <entry>notify level for buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>log_filename</literal></entry>
+ <entry>log filename (NULL means not logging)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>prev_buffer</literal></entry>
+ <entry>pointer to previous buffer info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>next_buffer</literal></entry>
+ <entry>pointer to next buffer info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_info *buffer_info, *ptr_buffer;
+
+buffer_info = plugin->get_buffer_info (plugin);
+if (buffer_info)
+{
+ for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ plugin->print (plugin, NULL, NULL, "--- buffer info ---");
+ plugin->print (plugin, NULL, NULL, "type: %d", ptr_buffer->type);
+ plugin->print (plugin, NULL, NULL, "number: %d", ptr_buffer->number);
+ plugin->print (plugin, NULL, NULL, "num_displayed: %d", ptr_buffer->num_displayed);
+ plugin->print (plugin, NULL, NULL, "server: %s", ptr_buffer->server_name);
+ plugin->print (plugin, NULL, NULL, "channel: %s", ptr_buffer->channel_name);
+ plugin->print (plugin, NULL, NULL, "notify level: %d", ptr_buffer->notify_level);
+ plugin->print (plugin, NULL, NULL, "log filename: %s", ptr_buffer->log_filename);
+ }
+ plugin->free_buffer_info (plugin, buffer_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no buffer info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_info">
+ <title>free_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_info (t_weechat_plugin *plugin,
+ t_plugin_buffer_info *buffer_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_info</option>: pointer to buffer info list
+ returned by "get_buffer_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_info (plugin, buffer_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_data *get_buffer_info (t_weechat_plugin *plugin,
+ char *server, char *channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: channel name
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: buffer content (linked list of lines).
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>nick</literal></entry>
+ <entry>nick</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>data</literal></entry>
+ <entry>line content (color codes are removed)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>prev_line</literal></entry>
+ <entry>pointer to previous line</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>next_line</literal></entry>
+ <entry>pointer to next line</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_data"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_line *buffer_line, *ptr_line;
+
+buffer_line = plugin->get_buffer_data (plugin);
+if (buffer_line)
+{
+ for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
+ {
+ plugin->print (plugin, NULL, NULL, "nick: %s, data: %s", ptr_line->nick, ptr_line->data);
+ }
+ plugin->free_buffer_data (plugin, buffer_line);
+}
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_data">
+ <title>free_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_data (t_weechat_plugin *plugin,
+ t_plugin_buffer_line *buffer_line)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer line list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_line</option>: pointer to buffer line list
+ returned by "get_buffer_data" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_data (plugin, buffer_line);</screen>
+ </para>
+ </section>
+
</section>
<section id="secCompilePlugin">
@@ -3689,7 +4329,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
<section id="secSyntaxByLanguage">
<title>Syntax in den Skriptsprachen</title>
- <section>
+ <section id="secScriptPerl">
<title>Perl</title>
<para>
@@ -3701,7 +4341,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptPython">
<title>Python</title>
<para>
@@ -3717,7 +4357,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptRuby">
<title>Ruby</title>
<para>
@@ -3746,7 +4386,7 @@ end
</section>
- <section>
+ <section id="secScriptLua">
<title>Lua</title>
<para>
@@ -3769,7 +4409,7 @@ end
<section id="secWeeChatScriptsAPI">
<title>WeeChat / Skript-API</title>
- <section>
+ <section id="secScript_register">
<title>register</title>
<para>
@@ -3849,7 +4489,7 @@ weechat.register("test", "1.0", "end_test", "Test script!")
</para>
</section>
- <section>
+ <section id="secScript_print">
<title>print</title>
<para>
@@ -3931,7 +4571,7 @@ weechat.print("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_print_infobar">
<title>print_infobar</title>
<para>
@@ -3997,7 +4637,7 @@ weechat.print_infobar(5, "message")
</para>
</section>
- <section>
+ <section id="secScript_remove_infobar">
<title>remove_infobar</title>
<para>
@@ -4059,7 +4699,7 @@ weechat.remove_infobar(1)
</para>
</section>
- <section>
+ <section id="secScript_log">
<title>log</title>
<para>
@@ -4130,7 +4770,7 @@ weechat.log("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_add_message_handler">
<title>add_message_handler</title>
<para>
@@ -4257,7 +4897,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_command_handler">
<title>add_command_handler</title>
<para>
@@ -4329,7 +4969,7 @@ end
<para>
<option>completion_template</option>:
Vorlage für die Vervollständigung; zum Beispiel bedeutet
- "<code class="literal">abc|%w def|%i</code>", dass das
+ "<literal>abc|%w def|%i</literal>", dass das
erste Argument "abc" oder ein WeeChat-Kommando sein kann
und das zweite Argument "def" oder ein IRC-Kommando.
(siehe <xref linkend="secAPI_cmd_handler_add" />)
@@ -4391,7 +5031,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_timer_handler">
<title>add_timer_handler</title>
<para>
@@ -4493,7 +5133,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_keyboard_handler">
<title>add_keyboard_handler</title>
<para>
@@ -4596,7 +5236,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_remove_handler">
<title>remove_handler</title>
<para>
@@ -4662,7 +5302,7 @@ weechat.remove_handler("command", "my_command")
</para>
</section>
- <section>
+ <section id="secScript_remove_timer_handler">
<title>remove_timer_handler</title>
<para>
@@ -4723,7 +5363,7 @@ weechat.remove_timer_handler("my_timer")
</para>
</section>
- <section>
+ <section id="secScript_remove_keyboard_handler">
<title>remove_keyboard_handler</title>
<para>
@@ -4784,7 +5424,7 @@ weechat.remove_keyboard_handler("my_keyboard")
</para>
</section>
- <section>
+ <section id="secScript_command">
<title>command</title>
<para>
@@ -4865,7 +5505,7 @@ weechat.command("/nick newnick", "", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_info">
<title>get_info</title>
<para>
@@ -4936,7 +5576,7 @@ nick = weechat.get_info("nick", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_dcc_info">
<title>get_dcc_info</title>
<para>
@@ -5041,7 +5681,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_server_info">
<title>get_server_info</title>
<para>
@@ -5146,7 +5786,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_channel_info">
<title>get_channel_info</title>
<para>
@@ -5251,7 +5891,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_nick_info">
<title>get_nick_info</title>
<para>
@@ -5356,7 +5996,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_config">
<title>get_config</title>
<para>
@@ -5421,7 +6061,7 @@ value2 = weechat.get_config("freenode.server_autojoin")
</para>
</section>
- <section>
+ <section id="secScript_set_config">
<title>set_config</title>
<para>
@@ -5491,7 +6131,7 @@ weechat.set_config("freenode.server_autojoin, "#weechat")
</para>
</section>
- <section>
+ <section id="secScript_get_plugin_config">
<title>get_plugin_config</title>
<para>
@@ -5556,7 +6196,7 @@ value = weechat.get_plugin_config("my_var")
</para>
</section>
- <section>
+ <section id="secScript_set_plugin_config">
<title>set_plugin_config</title>
<para>
@@ -5625,6 +6265,416 @@ weechat.set_plugin_config("my_var", "value")
</para>
</section>
+ <section id="secScript_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_irc_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Return IRC color index with name.
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found
+ (see <xref linkend="secAPI_get_irc_color" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $color_blue = weechat::get_irc_color("blue");
+
+# python
+color_blue = weechat.get_irc_color("blue")
+
+# ruby
+color_blue = Weechat.get_irc_color("blue")
+
+-- lua
+color_blue = weechat.get_irc_color("blue")
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_input_color">
+ <title>input_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::input_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+weechat::input_color(weechat::get_irc_color("blue"), 10, 5);
+
+# python
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+
+# ruby
+Weechat.input_color(Weechat.get_irc_color("blue"), 10, 5)
+
+-- lua
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_window_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Return value: list of WeeChat windows
+ (see <xref linkend="secAPI_get_window_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my @wf = weechat::get_window_info();
+if (@wf)
+{
+ weechat::print("**** windows infos ****");
+ foreach my $w (@wf)
+ {
+ while ( my ($key, $value) = each %$w)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no window info ****");
+}
+
+# python
+wf = weechat.get_window_info()
+if wf != None and wf != []:
+ weechat.prnt ("**** windows infos ****")
+ for w in wf:
+ for i in w:
+ weechat.prnt (" > %s => %s" % (i, w[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no window info ****")
+
+# ruby
+wf = Weechat.get_window_info()
+if wf != nil and wf != []
+ Weechat.print("**** windows infos ****")
+ wf.each do |w|
+ w.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no window info ****")
+end
+
+-- lua
+wf = weechat.get_window_info()
+if wf then
+ weechat.print ("**** windows infos ****")
+ w, winfos = next (wf, nil)
+ while (w) do
+ key, value = next (winfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (winfos, key)
+ end
+ weechat.print ("----------------------")
+ w, winfos = next (wf, w)
+ end
+else
+ weechat.print("**** no window info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Return value: list of WeeChat buffers
+ (see <xref linkend="secAPI_get_buffer_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $bf = weechat::get_buffer_info();
+if ($bf)
+{
+ while ( my ($nobuf, $binfos) = each %$bf)
+ {
+ while ( my ($key, $value) = each %$binfos)
+ {
+ weechat::print(" > $key => $value");
+ }
+ }
+}
+else
+{
+ weechat::print("**** no buffer info ****");
+}
+
+# python
+bf = weechat.get_buffer_info()
+if bf != None and bf != {}:
+ for b in bf:
+ weechat.prnt ("**** info for buffer no %d ****" % b)
+ for c in bf[b]:
+ weechat.prnt (" > %s => %s" % (c, bf[b][c]))
+else:
+ weechat.prnt ("**** no buffer info ****")
+
+# ruby
+bf = Weechat.get_buffer_info()
+if bf != nil and bf != {}
+ bf.each do |n, c|
+ Weechat.print("**** info for buffer no #{n} ****")
+ c.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ end
+else
+ Weechat.print("**** no buffer info ****")
+end
+
+-- lua
+bf = weechat.get_buffer_info()
+if bf then
+ b, binfos = next (bf, nil)
+ while (b) do
+ weechat.print("**** info for buffer no " .. b .. " ****")
+ key, value = next (binfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (binfos, key)
+ end
+ b, infos = next (bf, b)
+ end
+else
+ weechat.print("**** no buffer info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_data(server, channel);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Return value: list of lines for buffer
+ (see <xref linkend="secAPI_get_buffer_data" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $server = "freenode";
+my $channel = "#weechat";
+my @bc = weechat::get_buffer_data($server, $channel);
+if (@bc)
+{
+ weechat::print("**** buffer data for $channel@$server ****");
+ foreach my $l (@bc) {
+ while ( my ($key, $value) = each %$l) {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer data ****");
+}
+
+# python
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc != None and bc != []:
+ weechat.prnt ("**** buffer data for %s@%s ****" % (channel, server))
+ for l in bc:
+ for i in l:
+ weechat.prnt (" > %s => %s" % (i, l[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer data ****")
+
+# ruby
+server = "freenode"
+channel = "#weechat"
+bc = Weechat.get_buffer_data(server, channel)
+if bc != nil and bc != []
+ Weechat.print("**** buffer data for #{channel}@#{server} ****")
+ bc.each do |l|
+ l.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer data ****")
+end
+
+-- lua
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc then
+ b, bdatas = next (bc, nil)
+ weechat.print("**** buffer data for " .. channel .. "@" .. server .. " ****")
+ while (b) do
+ key, value = next (chaninfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (bdatas, key)
+ end
+ weechat.print ("----------------------")
+ b, bdatas = next (bc, b)
+ end
+else
+ weechat.print("**** no buffer data ****")
+end
+</screen>
+ </para>
+ </section>
+
</section>
</section>
diff --git a/weechat/doc/de/weechat_commands.xml b/weechat/doc/de/weechat_commands.xml
index fbda4cde5..a829769c3 100644
--- a/weechat/doc/de/weechat_commands.xml
+++ b/weechat/doc/de/weechat_commands.xml
@@ -124,17 +124,6 @@ functions: interne Funktionen für Tastenbelegungen auflisten
reset: Standardbelegung wiederherstellen und entferne alle eigenen Belegungen (Vorsicht!)
</programlisting>
-<command>panel [list | add Art Position Größe | resize # Größe | close # | move #1 #2]</command>
-<programlisting>
-Panels verwalten
-
- list: listet allo offenen Panels (Default, kann als Parameter auch weggelassen werden)
- add: fügt ein Panel hinzu, Art ist global|local, Position ist top|bottom|left|right
- resize: setzt die Größe eines Panels neu (kann auch relativ sein, z.B. -1)
- close: schließt das Panel mit der angegebenen Nummer
- move: verschiebt ein Panel zu einer anderen Position (kann auch relativ sein, z.B. -1)
-
-</programlisting>
<command>plugin [load Dateiname] | [autoload] | [reload] | [unload]</command>
<programlisting>
auflisten/laden/entladen von Plugins
diff --git a/weechat/doc/en/weechat.en.xml b/weechat/doc/en/weechat.en.xml
index d27258cc4..483684140 100644
--- a/weechat/doc/en/weechat.en.xml
+++ b/weechat/doc/en/weechat.en.xml
@@ -1463,13 +1463,53 @@ if (argv != NULL)
</para>
</section>
+ <section id="secAPI_mkdir_home">
+ <title>mkdir_home</title>
+
+ <para>
+ Prototype:
+ <command>
+ int mkdir_home (t_weechat_plugin *plugin, char *directory)
+ </command>
+ </para>
+ <para>
+ Create a directory in WeeChat home.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>directory</option>: directory to create
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: 1 if directory was successfully created, 0 if an
+ error occurred.
+ </para>
+ <para>
+ Example:
+<screen>
+if (!plugin->mkdir_home (plugin, "temp"))
+ plugin->print_server(plugin, "Failed to create 'temp' directory in WeeChat home.");
+</screen>
+ </para>
+ </section>
+
<section id="secAPI_exec_on_files">
<title>exec_on_files</title>
<para>
Prototype:
<command>
- void exec_on_files (t_weechat_plugin *plugin, char *repertoire,
+ void exec_on_files (t_weechat_plugin *plugin, char *directory,
int (*callback)(t_weechat_plugin *, char *))
</command>
</para>
@@ -3547,13 +3587,613 @@ char *value = plugin->get_plugin_config (plugin, "my_var");
error occurred.
</para>
<para>
- Example :
+ Example:
<screen>
plugin->set_plugin_config (plugin, "my_var", "value");
</screen>
</para>
</section>
+ <section id="secAPI_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ int get_irc_color (t_weechat_plugin *plugin,
+ char *color_name)
+ </command>
+ </para>
+ <para>
+ Get IRC color index with name.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color_name</option>: color name
+ Allowed colors are:
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Color name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>white</entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>black</entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>blue</entry>
+ <entry>2</entry>
+ </row>
+ <row>
+ <entry>green</entry>
+ <entry>3</entry>
+ </row>
+ <row>
+ <entry>lightred</entry>
+ <entry>4</entry>
+ </row>
+ <row>
+ <entry>red</entry>
+ <entry>5</entry>
+ </row>
+ <row>
+ <entry>magenta</entry>
+ <entry>6</entry>
+ </row>
+ <row>
+ <entry>brown</entry>
+ <entry>7</entry>
+ </row>
+ <row>
+ <entry>yellow</entry>
+ <entry>8</entry>
+ </row>
+ <row>
+ <entry>lightgreen</entry>
+ <entry>9</entry>
+ </row>
+ <row>
+ <entry>cyan</entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry>lightcyan</entry>
+ <entry>11</entry>
+ </row>
+ <row>
+ <entry>lightblue</entry>
+ <entry>12</entry>
+ </row>
+ <row>
+ <entry>lightmagenta</entry>
+ <entry>13</entry>
+ </row>
+ <row>
+ <entry>gray</entry>
+ <entry>14</entry>
+ </row>
+ <row>
+ <entry>lightgray</entry>
+ <entry>15</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found.
+ </para>
+ <para>
+ Example:
+<screen>
+int color_blue = plugin->get_irc_color (plugin, "blue"); /* return 2 */
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype:
+ <command>
+ void input_color (t_weechat_plugin *plugin,
+ int color, int start, int length)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>color</option>: color for text (if &lt; 0, then input
+ buffer is refresh, and there's no change in input buffer
+ content)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>start</option>: start position for color (if &lt; 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>length</option>: length for color (if &lt;= 0,
+ then mask is reinitialized)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+<screen>
+plugin->input_color (plugin, plugin->get_irc_color (plugin, "blue"), 10, 5);
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_window_info *get_window_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat windows.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_x</literal></entry>
+ <entry>horizontal position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_y</literal></entry>
+ <entry>vertical position of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width</literal></entry>
+ <entry>width of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height</literal></entry>
+ <entry>height of window</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width_pct</literal></entry>
+ <entry>width % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height_pct</literal></entry>
+ <entry>height % (compared to parent window)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_buffer</literal></entry>
+ <entry>number of displayed buffer</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>prev_window</literal></entry>
+ <entry>pointer to previous window info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>next_window</literal></entry>
+ <entry>pointer to next window info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_window_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_window_info *window_info, *ptr_window;
+
+window_info = plugin->get_window_info (plugin);
+if (window_info)
+{
+ for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
+ {
+ plugin->print (plugin, NULL, NULL, "--- window info ---");
+ plugin->print (plugin, NULL, NULL, "(%d,%d), size: %dx%d, %%size: %d%%x%d%%",
+ ptr_window->win_x, ptr_window->win_y,
+ ptr_window->win_width, ptr_window->win_height,
+ ptr_window->win_width_pct, ptr_window->win_height_pct);
+ plugin->print (plugin, NULL, NULL, "num_buffer: %d", ptr_window->num_buffer);
+ }
+ plugin->free_window_info (plugin, window_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no window info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_window_info">
+ <title>free_window_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_window_info (t_weechat_plugin *plugin,
+ t_plugin_window_info *window_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by window info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>window_info</option>: pointer to window info list
+ returned by "get_window_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_window_info (plugin, window_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_info *get_buffer_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: linked list of WeeChat buffers.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>type</literal></entry>
+ <entry>buffer type: 0=standard, 1=dcc, 2=raw IRC data</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>number</literal></entry>
+ <entry>buffer number</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_displayed</literal></entry>
+ <entry>number of windows displaying buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>server_name</literal></entry>
+ <entry>server name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>channel_name</literal></entry>
+ <entry>channel name for buffer (may be NULL)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>notify_level</literal></entry>
+ <entry>notify level for buffer</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>log_filename</literal></entry>
+ <entry>log filename (NULL means not logging)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>prev_buffer</literal></entry>
+ <entry>pointer to previous buffer info</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>next_buffer</literal></entry>
+ <entry>pointer to next buffer info</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_info"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_info *buffer_info, *ptr_buffer;
+
+buffer_info = plugin->get_buffer_info (plugin);
+if (buffer_info)
+{
+ for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ plugin->print (plugin, NULL, NULL, "--- buffer info ---");
+ plugin->print (plugin, NULL, NULL, "type: %d", ptr_buffer->type);
+ plugin->print (plugin, NULL, NULL, "number: %d", ptr_buffer->number);
+ plugin->print (plugin, NULL, NULL, "num_displayed: %d", ptr_buffer->num_displayed);
+ plugin->print (plugin, NULL, NULL, "server: %s", ptr_buffer->server_name);
+ plugin->print (plugin, NULL, NULL, "channel: %s", ptr_buffer->channel_name);
+ plugin->print (plugin, NULL, NULL, "notify level: %d", ptr_buffer->notify_level);
+ plugin->print (plugin, NULL, NULL, "log filename: %s", ptr_buffer->log_filename);
+ }
+ plugin->free_buffer_info (plugin, buffer_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no buffer info!");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_info">
+ <title>free_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_info (t_weechat_plugin *plugin,
+ t_plugin_buffer_info *buffer_info)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer info list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_info</option>: pointer to buffer info list
+ returned by "get_buffer_info" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_info (plugin, buffer_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_data *get_buffer_info (t_weechat_plugin *plugin,
+ char *server, char *channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: channel name
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: buffer content (linked list of lines).
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Field</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>nick</literal></entry>
+ <entry>nick</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>data</literal></entry>
+ <entry>line content (color codes are removed)</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>prev_line</literal></entry>
+ <entry>pointer to previous line</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>next_line</literal></entry>
+ <entry>pointer to next line</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note: result has to be free by a call to "free_buffer_data"
+ function after use.
+ </para>
+ <para>
+ Example:
+<screen>
+t_plugin_buffer_line *buffer_line, *ptr_line;
+
+buffer_line = plugin->get_buffer_data (plugin);
+if (buffer_line)
+{
+ for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
+ {
+ plugin->print (plugin, NULL, NULL, "nick: %s, data: %s", ptr_line->nick, ptr_line->data);
+ }
+ plugin->free_buffer_data (plugin, buffer_line);
+}
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_data">
+ <title>free_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_data (t_weechat_plugin *plugin,
+ t_plugin_buffer_line *buffer_line)
+ </command>
+ </para>
+ <para>
+ Free memory used by buffer line list.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_line</option>: pointer to buffer line list
+ returned by "get_buffer_data" function
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+ <screen>plugin->free_buffer_data (plugin, buffer_line);</screen>
+ </para>
+ </section>
+
</section>
<section id="secCompilePlugin">
@@ -3720,7 +4360,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
<section id="secSyntaxByLanguage">
<title>Syntax by language</title>
- <section>
+ <section id="secScriptPerl">
<title>Perl</title>
<para>
@@ -3732,7 +4372,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptPython">
<title>Python</title>
<para>
@@ -3749,7 +4389,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptRuby">
<title>Ruby</title>
<para>
@@ -3779,7 +4419,7 @@ end
</section>
- <section>
+ <section id="secScriptLua">
<title>Lua</title>
<para>
@@ -3803,7 +4443,7 @@ end
<section id="secWeeChatScriptsAPI">
<title>WeeChat / scripts API</title>
- <section>
+ <section id="secScript_register">
<title>register</title>
<para>
@@ -3883,7 +4523,7 @@ weechat.register("test", "1.0", "end_test", "Test script!")
</para>
</section>
- <section>
+ <section id="secScript_print">
<title>print</title>
<para>
@@ -3965,7 +4605,7 @@ weechat.print("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_print_infobar">
<title>print_infobar</title>
<para>
@@ -4032,7 +4672,7 @@ weechat.print_infobar(5, "message")
</para>
</section>
- <section>
+ <section id="secScript_remove_infobar">
<title>remove_infobar</title>
<para>
@@ -4095,7 +4735,7 @@ weechat.remove_infobar(1)
</para>
</section>
- <section>
+ <section id="secScript_log">
<title>log</title>
<para>
@@ -4168,7 +4808,7 @@ weechat.log("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_add_message_handler">
<title>add_message_handler</title>
<para>
@@ -4298,7 +4938,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_command_handler">
<title>add_command_handler</title>
<para>
@@ -4430,7 +5070,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_timer_handler">
<title>add_timer_handler</title>
<para>
@@ -4529,7 +5169,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_keyboard_handler">
<title>add_keyboard_handler</title>
<para>
@@ -4633,7 +5273,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_remode_handler">
<title>remove_handler</title>
<para>
@@ -4699,7 +5339,7 @@ weechat.remove_handler("command", "my_command")
</para>
</section>
- <section>
+ <section id="secScript_remove_timer_handler">
<title>remove_timer_handler</title>
<para>
@@ -4760,7 +5400,7 @@ weechat.remove_timer_handler("my_timer")
</para>
</section>
- <section>
+ <section id="secScrip_remove_keyboard_handler">
<title>remove_keyboard_handler</title>
<para>
@@ -4821,7 +5461,7 @@ weechat.remove_keyboard_handler("my_keyboard")
</para>
</section>
- <section>
+ <section id="secScript_command">
<title>command</title>
<para>
@@ -4902,7 +5542,7 @@ weechat.command("/nick newnick", "", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_info">
<title>get_info</title>
<para>
@@ -4975,7 +5615,7 @@ nick = weechat.get_info("nick", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_dcc_info">
<title>get_dcc_info</title>
<para>
@@ -5080,7 +5720,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_server_info">
<title>get_server_info</title>
<para>
@@ -5185,7 +5825,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_channel_info">
<title>get_channel_info</title>
<para>
@@ -5290,7 +5930,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_nick_info">
<title>get_nick_info</title>
<para>
@@ -5395,7 +6035,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_config">
<title>get_config</title>
<para>
@@ -5460,7 +6100,7 @@ value2 = weechat.get_config("freenode.server_autojoin")
</para>
</section>
- <section>
+ <section id="secScript_set_config">
<title>set_config</title>
<para>
@@ -5531,7 +6171,7 @@ weechat.set_config("freenode.server_autojoin, "#weechat")
</para>
</section>
- <section>
+ <section id="secScript_get_plugin_config">
<title>get_plugin_config</title>
<para>
@@ -5595,7 +6235,7 @@ value = weechat.get_plugin_config("my_var")
</para>
</section>
- <section>
+ <section id="secScript_set_plugin_config">
<title>set_plugin_config</title>
<para>
@@ -5665,6 +6305,416 @@ weechat.set_plugin_config("my_var", "value")
</para>
</section>
+ <section id="secScript_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_irc_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Return IRC color index with name.
+ </para>
+ <para>
+ Return value: IRC color index, -1 if color is not found
+ (see <xref linkend="secAPI_get_irc_color" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $color_blue = weechat::get_irc_color("blue");
+
+# python
+color_blue = weechat.get_irc_color("blue")
+
+# ruby
+color_blue = Weechat.get_irc_color("blue")
+
+-- lua
+color_blue = weechat.get_irc_color("blue")
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_input_color">
+ <title>input_color</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::input_color(color);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Add color in input buffer.
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+weechat::input_color(weechat::get_irc_color("blue"), 10, 5);
+
+# python
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+
+# ruby
+Weechat.input_color(Weechat.get_irc_color("blue"), 10, 5)
+
+-- lua
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_window_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat windows.
+ </para>
+ <para>
+ Return value: list of WeeChat windows
+ (see <xref linkend="secAPI_get_window_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my @wf = weechat::get_window_info();
+if (@wf)
+{
+ weechat::print("**** windows infos ****");
+ foreach my $w (@wf)
+ {
+ while ( my ($key, $value) = each %$w)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no window info ****");
+}
+
+# python
+wf = weechat.get_window_info()
+if wf != None and wf != []:
+ weechat.prnt ("**** windows infos ****")
+ for w in wf:
+ for i in w:
+ weechat.prnt (" > %s => %s" % (i, w[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no window info ****")
+
+# ruby
+wf = Weechat.get_window_info()
+if wf != nil and wf != []
+ Weechat.print("**** windows infos ****")
+ wf.each do |w|
+ w.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no window info ****")
+end
+
+-- lua
+wf = weechat.get_window_info()
+if wf then
+ weechat.print ("**** windows infos ****")
+ w, winfos = next (wf, nil)
+ while (w) do
+ key, value = next (winfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (winfos, key)
+ end
+ weechat.print ("----------------------")
+ w, winfos = next (wf, w)
+ end
+else
+ weechat.print("**** no window info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_info();
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Return list of WeeChat buffers.
+ </para>
+ <para>
+ Return value: list of WeeChat buffers
+ (see <xref linkend="secAPI_get_buffer_info" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $bf = weechat::get_buffer_info();
+if ($bf)
+{
+ while ( my ($nobuf, $binfos) = each %$bf)
+ {
+ while ( my ($key, $value) = each %$binfos)
+ {
+ weechat::print(" > $key => $value");
+ }
+ }
+}
+else
+{
+ weechat::print("**** no buffer info ****");
+}
+
+# python
+bf = weechat.get_buffer_info()
+if bf != None and bf != {}:
+ for b in bf:
+ weechat.prnt ("**** info for buffer no %d ****" % b)
+ for c in bf[b]:
+ weechat.prnt (" > %s => %s" % (c, bf[b][c]))
+else:
+ weechat.prnt ("**** no buffer info ****")
+
+# ruby
+bf = Weechat.get_buffer_info()
+if bf != nil and bf != {}
+ bf.each do |n, c|
+ Weechat.print("**** info for buffer no #{n} ****")
+ c.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ end
+else
+ Weechat.print("**** no buffer info ****")
+end
+
+-- lua
+bf = weechat.get_buffer_info()
+if bf then
+ b, binfos = next (bf, nil)
+ while (b) do
+ weechat.print("**** info for buffer no " .. b .. " ****")
+ key, value = next (binfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (binfos, key)
+ end
+ b, infos = next (bf, b)
+ end
+else
+ weechat.print("**** no buffer info ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_data(server, channel);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Return value: list of lines for buffer
+ (see <xref linkend="secAPI_get_buffer_data" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $server = "freenode";
+my $channel = "#weechat";
+my @bc = weechat::get_buffer_data($server, $channel);
+if (@bc)
+{
+ weechat::print("**** buffer data for $channel@$server ****");
+ foreach my $l (@bc) {
+ while ( my ($key, $value) = each %$l) {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer data ****");
+}
+
+# python
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc != None and bc != []:
+ weechat.prnt ("**** buffer data for %s@%s ****" % (channel, server))
+ for l in bc:
+ for i in l:
+ weechat.prnt (" > %s => %s" % (i, l[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer data ****")
+
+# ruby
+server = "freenode"
+channel = "#weechat"
+bc = Weechat.get_buffer_data(server, channel)
+if bc != nil and bc != []
+ Weechat.print("**** buffer data for #{channel}@#{server} ****")
+ bc.each do |l|
+ l.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer data ****")
+end
+
+-- lua
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc then
+ b, bdatas = next (bc, nil)
+ weechat.print("**** buffer data for " .. channel .. "@" .. server .. " ****")
+ while (b) do
+ key, value = next (chaninfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (bdatas, key)
+ end
+ weechat.print ("----------------------")
+ b, bdatas = next (bc, b)
+ end
+else
+ weechat.print("**** no buffer data ****")
+end
+</screen>
+ </para>
+ </section>
+
</section>
</section>
diff --git a/weechat/doc/en/weechat_commands.xml b/weechat/doc/en/weechat_commands.xml
index 033bf33a0..bb4823b66 100644
--- a/weechat/doc/en/weechat_commands.xml
+++ b/weechat/doc/en/weechat_commands.xml
@@ -123,17 +123,6 @@ functions: list internal functions for key bindings
reset: restore bindings to the default values and delete ALL personal bindings (use carefully!)
</programlisting>
-<command>panel [list | add type position size | resize # size | close # | move #1 #2]</command>
-<programlisting>
-manage panels
-
- list: list open panels (no parameter implies this list)
- add: add a panel, type is global|local, position is top|bottom|left|right
- resize: resize a panel with a new size (may be relative, for example -1)
- close: close a panel by number
- move: move a panel to another number (may be relative, for example -1)
-
-</programlisting>
<command>plugin [load filename] | [autoload] | [reload] | [unload]</command>
<programlisting>
list/load/unload plugins
diff --git a/weechat/doc/fr/weechat.fr.xml b/weechat/doc/fr/weechat.fr.xml
index c05258ce5..e50765555 100644
--- a/weechat/doc/fr/weechat.fr.xml
+++ b/weechat/doc/fr/weechat.fr.xml
@@ -1489,6 +1489,47 @@ if (argv != NULL)
</para>
</section>
+ <section id="secAPI_mkdir_home">
+ <title>mkdir_home</title>
+
+ <para>
+ Prototype :
+ <command>
+ int mkdir_home (t_weechat_plugin *plugin, char *repertoire)
+ </command>
+ </para>
+ <para>
+ Créé un répertoire dans le répertoire de base de WeeChat.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>repertoire</option> : répertoire à créer
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : 1 si le répertoire a été créé avec succès,
+ 0 si une erreur s'est produite.
+ </para>
+ <para>
+ Example:
+<screen>
+if (!plugin->mkdir_home (plugin, "temp"))
+ plugin->print_server(plugin, "Impossible de créer le répertoire 'temp' dans la base WeeChat.");
+</screen>
+ </para>
+ </section>
+
<section id="secAPI_exec_on_files">
<title>exec_on_files</title>
@@ -2612,7 +2653,7 @@ plugin->exec_command (plugin, "freenode", "#weechat", "bonjour");
<row>
<entry><literal>weechat_dir</literal></entry>
<entry>
- répertoire maison de WeeChat
+ répertoire de base de WeeChat
(par défaut: ~/.weechat/)
</entry>
</row>
@@ -3636,6 +3677,624 @@ plugin->set_plugin_config (plugin, "ma_variable", "valeur");
</para>
</section>
+ <section id="secAPI_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype :
+ <command>
+ int get_irc_color (t_weechat_plugin *plugin,
+ char *nom_couleur)
+ </command>
+ </para>
+ <para>
+ Renvoie le numéro d'une couleur IRC avec son nom.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>nom_couleur</option> : nom de la couleur
+ Les couleure autorisées sont :
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Nom couleur</entry>
+ <entry>Valeur</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>white</entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>black</entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>blue</entry>
+ <entry>2</entry>
+ </row>
+ <row>
+ <entry>green</entry>
+ <entry>3</entry>
+ </row>
+ <row>
+ <entry>lightred</entry>
+ <entry>4</entry>
+ </row>
+ <row>
+ <entry>red</entry>
+ <entry>5</entry>
+ </row>
+ <row>
+ <entry>magenta</entry>
+ <entry>6</entry>
+ </row>
+ <row>
+ <entry>brown</entry>
+ <entry>7</entry>
+ </row>
+ <row>
+ <entry>yellow</entry>
+ <entry>8</entry>
+ </row>
+ <row>
+ <entry>lightgreen</entry>
+ <entry>9</entry>
+ </row>
+ <row>
+ <entry>cyan</entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry>lightcyan</entry>
+ <entry>11</entry>
+ </row>
+ <row>
+ <entry>lightblue</entry>
+ <entry>12</entry>
+ </row>
+ <row>
+ <entry>lightmagenta</entry>
+ <entry>13</entry>
+ </row>
+ <row>
+ <entry>gray</entry>
+ <entry>14</entry>
+ </row>
+ <row>
+ <entry>lightgray</entry>
+ <entry>15</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : numéro de la couleur IRC, -1 si la couleur
+ n'est pas trouvée.
+ </para>
+ <para>
+ Exemple :
+<screen>
+int color_blue = plugin->get_irc_color (plugin, "blue"); /* retourne 2 */
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype :
+ <command>
+ void input_color (t_weechat_plugin *plugin,
+ int couleur, int debut, int longueur)
+ </command>
+ </para>
+ <para>
+ Ajoute de la couleur dans la zone de saisie.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>couleur</option> : couleur pour le texte (si &lt; 0,
+ alors la zone de saisie est rafraichie, et il n'y a aucun
+ changement dans son contenu)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>debut</option> : position de début pour la coloration
+ (si &lt; 0, alors le masque est réinitialisé)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>longueur</option> : longueur pour la coloration
+ (si &lt;= 0, alors le masque est réinitialisé)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+<screen>
+plugin->input_color (plugin, plugin->get_irc_color (plugin, "blue"), 10, 5);
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype :
+ <command>
+ t_plugin_window_info *get_window_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Retourne la liste des fenêtres WeeChat.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : liste chaînée des fenêtres WeeChat.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Champ</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_x</literal></entry>
+ <entry>position horizontale de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_y</literal></entry>
+ <entry>position verticale de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width</literal></entry>
+ <entry>largeur de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height</literal></entry>
+ <entry>hauteur de la fenêtre</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_width_pct</literal></entry>
+ <entry>largeur en % (comparé à la fenêtre parent)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>win_height_pct</literal></entry>
+ <entry>hauteur en % (comparé à la fenêtre parent)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_buffer</literal></entry>
+ <entry>numéro du tampon affiché</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>prev_window</literal></entry>
+ <entry>pointeur vers les infos de la fenêtre précédente</entry>
+ </row>
+ <row>
+ <entry>t_plugin_window_info *</entry>
+ <entry><literal>next_window</literal></entry>
+ <entry>pointeur vers les infos de la fenêtre suivante</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note : le résultat doit être libéré par un appel à la fonction
+ "free_window_info" après utilisation.
+ </para>
+ <para>
+ Exemple :
+<screen>
+t_plugin_window_info *window_info, *ptr_window;
+
+window_info = plugin->get_window_info (plugin);
+if (window_info)
+{
+ for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
+ {
+ plugin->print (plugin, NULL, NULL, "--- info fenêtre ---");
+ plugin->print (plugin, NULL, NULL, "(%d,%d), size: %dx%d, %%size: %d%%x%d%%",
+ ptr_window->win_x, ptr_window->win_y,
+ ptr_window->win_width, ptr_window->win_height,
+ ptr_window->win_width_pct, ptr_window->win_height_pct);
+ plugin->print (plugin, NULL, NULL, "num_buffer: %d", ptr_window->num_buffer);
+ }
+ plugin->free_window_info (plugin, window_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "pas d'info fenêtre !");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_window_info">
+ <title>free_window_info</title>
+
+ <para>
+ Prototype :
+ <command>
+ void free_window_info (t_weechat_plugin *plugin,
+ t_plugin_window_info *window_info)
+ </command>
+ </para>
+ <para>
+ Libère la mémoire utilisée par une liste de fenêtres.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>window_info</option> : pointeur vers la liste des
+ infos fenêtres retournée par la fonction "get_window_info"
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+ <screen>plugin->free_window_info (plugin, window_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype :
+ <command>
+ t_plugin_buffer_info *get_buffer_info (t_weechat_plugin *plugin)
+ </command>
+ </para>
+ <para>
+ Retourne la liste des tampons WeeChat.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : liste chaînée des tampons WeeChat.
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Champ</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>int</entry>
+ <entry><literal>type</literal></entry>
+ <entry>
+ type de tampon: 0=standard, 1=dcc,
+ 2=données IRC brutes
+ </entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>number</literal></entry>
+ <entry>numéro de tampon</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>num_displayed</literal></entry>
+ <entry>nombre de fenêtres affichant ce tampon</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>server_name</literal></entry>
+ <entry>nom du serveur pour le tampon (peut être NULL)</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>channel_name</literal></entry>
+ <entry>nom du canal pout le tampon (peut être NULL)</entry>
+ </row>
+ <row>
+ <entry>int</entry>
+ <entry><literal>notify_level</literal></entry>
+ <entry>niveau de notification du tampon</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>log_filename</literal></entry>
+ <entry>
+ nom du fichier de log (NULL signifie qu'il n'y a
+ pas de log)
+ </entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>prev_buffer</literal></entry>
+ <entry>pointeur vers les infos du tampon précédent</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_info *</entry>
+ <entry><literal>next_buffer</literal></entry>
+ <entry>pointeur vers les infos du tampon suivant</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note : le résultat doit être libéré par un appel à la fonction
+ "free_buffer_info" après utilisation.
+ </para>
+ <para>
+ Exemple :
+<screen>
+t_plugin_buffer_info *buffer_info, *ptr_buffer;
+
+buffer_info = plugin->get_buffer_info (plugin);
+if (buffer_info)
+{
+ for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ plugin->print (plugin, NULL, NULL, "--- info tampon ---");
+ plugin->print (plugin, NULL, NULL, "type: %d", ptr_buffer->type);
+ plugin->print (plugin, NULL, NULL, "number: %d", ptr_buffer->number);
+ plugin->print (plugin, NULL, NULL, "num_displayed: %d", ptr_buffer->num_displayed);
+ plugin->print (plugin, NULL, NULL, "server: %s", ptr_buffer->server_name);
+ plugin->print (plugin, NULL, NULL, "channel: %s", ptr_buffer->channel_name);
+ plugin->print (plugin, NULL, NULL, "notify level: %d", ptr_buffer->notify_level);
+ plugin->print (plugin, NULL, NULL, "log filename: %s", ptr_buffer->log_filename);
+ }
+ plugin->free_buffer_info (plugin, buffer_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "pas d'info tampon !");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_info">
+ <title>free_buffer_info</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_info (t_weechat_plugin *plugin,
+ t_plugin_buffer_info *buffer_info)
+ </command>
+ </para>
+ <para>
+ Libère la mémoire utilisée par une liste de tampons.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_info</option> : pointeur vers la liste des
+ infos tampons retournée par la fonction "get_buffer_info"
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+ <screen>plugin->free_buffer_info (plugin, buffer_info);</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ t_plugin_buffer_data *get_buffer_info (t_weechat_plugin *plugin,
+ char *serveur, char *canal)
+ </command>
+ </para>
+ <para>
+ Renvoie le contenu du tampon.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>serveur</option> : nom interne du serveur
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>canal</option> : nom du canal
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : contenu du tampon (liste chaînée de lignes).
+ <informaltable colsep="0" frame="none">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Champ</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>nick</literal></entry>
+ <entry>pseudo</entry>
+ </row>
+ <row>
+ <entry>char *</entry>
+ <entry><literal>data</literal></entry>
+ <entry>
+ contenu de la ligne (les codes couleur sont
+ retirés)
+ </entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>prev_line</literal></entry>
+ <entry>pointeur vers la ligne précédente</entry>
+ </row>
+ <row>
+ <entry>t_plugin_buffer_line *</entry>
+ <entry><literal>next_line</literal></entry>
+ <entry>pointeur vers la ligne suivante</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ Note : le résultat doit être libéré par un appel à la fonction
+ "free_buffer_data" après utilisation.
+ </para>
+ <para>
+ Exemple :
+<screen>
+t_plugin_buffer_line *buffer_line, *ptr_line;
+
+buffer_line = plugin->get_buffer_data (plugin);
+if (buffer_line)
+{
+ for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
+ {
+ plugin->print (plugin, NULL, NULL, "pseudo: %s, données: %s", ptr_line->nick, ptr_line->data);
+ }
+ plugin->free_buffer_data (plugin, buffer_line);
+}
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_free_buffer_data">
+ <title>free_buffer_data</title>
+
+ <para>
+ Prototype:
+ <command>
+ void free_buffer_data (t_weechat_plugin *plugin,
+ t_plugin_buffer_line *buffer_line)
+ </command>
+ </para>
+ <para>
+ Libère la mémoire utilisée par les lignes d'un tampon.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>buffer_line</option> : pointeur vers la liste des
+ lignes du tampon retournée par la fonction "get_buffer_data"
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+ <screen>plugin->free_buffer_data (plugin, buffer_line);</screen>
+ </para>
+ </section>
+
</section>
<section id="secCompilerExtension">
@@ -3805,7 +4464,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
<section id="secSyntaxeParLangage">
<title>Syntaxe par langage</title>
- <section>
+ <section id="secScriptPerl">
<title>Perl</title>
<para>
@@ -3817,7 +4476,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptPython">
<title>Python</title>
<para>
@@ -3834,7 +4493,7 @@ void weechat_plugin_end (t_weechat_plugin *plugin)
</section>
- <section>
+ <section id="secScriptRuby">
<title>Ruby</title>
<para>
@@ -3865,7 +4524,7 @@ end
</section>
- <section>
+ <section id="secScriptLua">
<title>Lua</title>
<para>
@@ -3889,7 +4548,7 @@ end
<section id="secInterfaceWeeChatScripts">
<title>Interface WeeChat / scripts</title>
- <section>
+ <section id="sec_script_register">
<title>register</title>
<para>
@@ -3970,7 +4629,7 @@ weechat.register("essai", "1.0", "fin_essai", "Script d'essai !")
</para>
</section>
- <section>
+ <section id="secScript_print">
<title>print</title>
<para>
@@ -4052,7 +4711,7 @@ weechat.print("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_print_infobar">
<title>print_infobar</title>
<para>
@@ -4119,7 +4778,7 @@ weechat.print_infobar(5, "message")
</para>
</section>
- <section>
+ <section id="secScript_remove_infobar">
<title>remove_infobar</title>
<para>
@@ -4182,7 +4841,7 @@ weechat.remove_infobar(1)
</para>
</section>
- <section>
+ <section id="secScript_log">
<title>log</title>
<para>
@@ -4256,7 +4915,7 @@ weechat.log("message", "#weechat", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_add_message_handler">
<title>add_message_handler</title>
<para>
@@ -4388,7 +5047,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_command_handler">
<title>add_command_handler</title>
<para>
@@ -4520,7 +5179,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_timer_handler">
<title>add_timer_handler</title>
<para>
@@ -4620,7 +5279,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_add_keyboard_handler">
<title>add_keyboard_handler</title>
<para>
@@ -4725,7 +5384,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_remove_handler">
<title>remove_handler</title>
<para>
@@ -4791,7 +5450,7 @@ weechat.remove_handler("commande", "ma_commande")
</para>
</section>
- <section>
+ <section id="secScript_remove_timer_handler">
<title>remove_timer_handler</title>
<para>
@@ -4852,7 +5511,7 @@ weechat.remove_timer_handler("mon_timer")
</para>
</section>
- <section>
+ <section id="secScript_remove_keyboard_handler">
<title>remove_keyboard_handler</title>
<para>
@@ -4913,7 +5572,7 @@ weechat.remove_keyboard_handler("mon_clavier")
</para>
</section>
- <section>
+ <section id="secScript_command">
<title>command</title>
<para>
@@ -4994,7 +5653,7 @@ weechat.command("/nick newnick", "", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_info">
<title>get_info</title>
<para>
@@ -5067,7 +5726,7 @@ nick = weechat.get_info("nick", "freenode")
</para>
</section>
- <section>
+ <section id="secScript_get_dcc_info">
<title>get_dcc_info</title>
<para>
@@ -5172,7 +5831,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_server_info">
<title>get_server_info</title>
<para>
@@ -5277,7 +5936,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_channel_info">
<title>get_channel_info</title>
<para>
@@ -5382,7 +6041,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_nick_info">
<title>get_nick_info</title>
<para>
@@ -5487,7 +6146,7 @@ end
</para>
</section>
- <section>
+ <section id="secScript_get_config">
<title>get_config</title>
<para>
@@ -5553,7 +6212,7 @@ valeur2 = weechat.get_config("freenode.server_autojoin")
</para>
</section>
- <section>
+ <section id="secScript_set_config">
<title>set_config</title>
<para>
@@ -5625,7 +6284,7 @@ weechat.set_config("freenode.server_autojoin, "#weechat")
</para>
</section>
- <section>
+ <section id="secScript_get_plugin_config">
<title>get_plugin_config</title>
<para>
@@ -5693,7 +6352,7 @@ valeur = weechat.get_plugin_config("ma_variable")
</para>
</section>
- <section>
+ <section id="secScript_set_plugin_config">
<title>set_plugin_config</title>
<para>
@@ -5767,6 +6426,416 @@ weechat.set_plugin_config("ma_variable", "valeur")
</para>
</section>
+ <section id="secScript_get_irc_color">
+ <title>get_irc_color</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::get_irc_color(color);
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.get_irc_color(color)
+ </command>
+ </para>
+ <para>
+ Renvoie le numéro d'une couleur IRC avec son nom.
+ </para>
+ <para>
+ Valeur renvoyée : numéro de la couleur IRC, -1 si la couleur
+ n'est pas trouvée (voir <xref linkend="secAPI_get_irc_color" />).
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+my $color_blue = weechat::get_irc_color("blue");
+
+# python
+color_blue = weechat.get_irc_color("blue")
+
+# ruby
+color_blue = Weechat.get_irc_color("blue")
+
+-- lua
+color_blue = weechat.get_irc_color("blue")
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_input_color">
+ <title>input_color</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::input_color(color);
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.input_color(color)
+ </command>
+ </para>
+ <para>
+ Ajoute de la couleur dans la zone de saisie.
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+weechat::input_color(weechat::get_irc_color("blue"), 10, 5);
+
+# python
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+
+# ruby
+Weechat.input_color(Weechat.get_irc_color("blue"), 10, 5)
+
+-- lua
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_window_info">
+ <title>get_window_info</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::get_window_info();
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.get_window_info()
+ </command>
+ </para>
+ <para>
+ Renvoie la liste des fenêtres WeeChat.
+ </para>
+ <para>
+ Valeur renvoyée : liste des fenêtres WeeChat
+ (voir <xref linkend="secAPI_get_window_info" />).
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+my @wf = weechat::get_window_info();
+if (@wf)
+{
+ weechat::print("**** infos fenêtres ****");
+ foreach my $w (@wf)
+ {
+ while ( my ($key, $value) = each %$w)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** pas d'info fenêtre ****");
+}
+
+# python
+wf = weechat.get_window_info()
+if wf != None and wf != []:
+ weechat.prnt ("**** infos fenêtres ****")
+ for w in wf:
+ for i in w:
+ weechat.prnt (" > %s => %s" % (i, w[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** pas d'info sur les fenêtres ****")
+
+# ruby
+wf = Weechat.get_window_info()
+if wf != nil and wf != []
+ Weechat.print("**** infos fenêtres ****")
+ wf.each do |w|
+ w.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** pas d'info sur les fenêtres ****")
+end
+
+-- lua
+wf = weechat.get_window_info()
+if wf then
+ weechat.print ("**** infos fenêtres ****")
+ w, winfos = next (wf, nil)
+ while (w) do
+ key, value = next (winfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (winfos, key)
+ end
+ weechat.print ("----------------------")
+ w, winfos = next (wf, w)
+ end
+else
+ weechat.print("**** pas d'info sur les fenêtres ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_info">
+ <title>get_buffer_info</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::get_buffer_info();
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.get_buffer_info()
+ </command>
+ </para>
+ <para>
+ Renvoie la liste des tampons WeeChat.
+ </para>
+ <para>
+ Valeur renvoyée : liste des tampons WeeChat
+ (voir <xref linkend="secAPI_get_buffer_info" />).
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+my $bf = weechat::get_buffer_info();
+if ($bf)
+{
+ while ( my ($nobuf, $binfos) = each %$bf)
+ {
+ while ( my ($key, $value) = each %$binfos)
+ {
+ weechat::print(" > $key => $value");
+ }
+ }
+}
+else
+{
+ weechat::print("**** pas d'info sur les tampons ****");
+}
+
+# python
+bf = weechat.get_buffer_info()
+if bf != None and bf != {}:
+ for b in bf:
+ weechat.prnt ("**** info pour tampon buffer no %d ****" % b)
+ for c in bf[b]:
+ weechat.prnt (" > %s => %s" % (c, bf[b][c]))
+else:
+ weechat.prnt ("**** pas d'info sur les tampons ****")
+
+# ruby
+bf = Weechat.get_buffer_info()
+if bf != nil and bf != {}
+ bf.each do |n, c|
+ Weechat.print("**** info pour tampon no #{n} ****")
+ c.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ end
+else
+ Weechat.print("**** pas d'info sur les tampons ****")
+end
+
+-- lua
+bf = weechat.get_buffer_info()
+if bf then
+ b, binfos = next (bf, nil)
+ while (b) do
+ weechat.print("**** info pour tampon no " .. b .. " ****")
+ key, value = next (binfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (binfos, key)
+ end
+ b, infos = next (bf, b)
+ end
+else
+ weechat.print("**** pas d'info sur les tampons ****")
+end
+</screen>
+ </para>
+ </section>
+
+ <section id="secScript_get_buffer_data">
+ <title>get_buffer_data</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::get_buffer_data(server, channel);
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.get_buffer_data(server, channel)
+ </command>
+ </para>
+ <para>
+ Return content of buffer.
+ </para>
+ <para>
+ Return value: list of lines for buffer
+ (see <xref linkend="secAPI_get_buffer_data" />).
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+my $server = "freenode";
+my $channel = "#weechat";
+my @bc = weechat::get_buffer_data($server, $channel);
+if (@bc)
+{
+ weechat::print("**** buffer data for $channel@$server ****");
+ foreach my $l (@bc) {
+ while ( my ($key, $value) = each %$l) {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer data ****");
+}
+
+# python
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc != None and bc != []:
+ weechat.prnt ("**** buffer data for %s@%s ****" % (channel, server))
+ for l in bc:
+ for i in l:
+ weechat.prnt (" > %s => %s" % (i, l[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer data ****")
+
+# ruby
+server = "freenode"
+channel = "#weechat"
+bc = Weechat.get_buffer_data(server, channel)
+if bc != nil and bc != []
+ Weechat.print("**** buffer data for #{channel}@#{server} ****")
+ bc.each do |l|
+ l.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer data ****")
+end
+
+-- lua
+server = "freenode"
+channel = "#weechat"
+bc = weechat.get_buffer_data(server, channel)
+if bc then
+ b, bdatas = next (bc, nil)
+ weechat.print("**** buffer data for " .. channel .. "@" .. server .. " ****")
+ while (b) do
+ key, value = next (chaninfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (bdatas, key)
+ end
+ weechat.print ("----------------------")
+ b, bdatas = next (bc, b)
+ end
+else
+ weechat.print("**** no buffer data ****")
+end
+</screen>
+ </para>
+ </section>
+
</section>
</section>
diff --git a/weechat/doc/fr/weechat_commands.xml b/weechat/doc/fr/weechat_commands.xml
index 875f8e01c..c9e57bf3b 100644
--- a/weechat/doc/fr/weechat_commands.xml
+++ b/weechat/doc/fr/weechat_commands.xml
@@ -123,17 +123,6 @@ functions: lister la liste des fonctions internes pour les associations de touch
reset: restaure les touches aux valeurs par défaut et supprime TOUTES les touches personnelles (utiliser avec précaution !)
</programlisting>
-<command>panel [list | add type position taille | resize # taille | close # | move #1 #2]</command>
-<programlisting>
-gestion des panneaux
-
- list: liste les panneaux ouverts (pas de paramètre affiche cette liste)
- add: ajoute un panneau, le type est global|local, la position est top|bottom|left|right
- resize: redimensionne le panneau avec une nouvelle taille (peut être relatif, par exemple -1)
- close: ferme un panneau par son numéro
- move: déplace un panneau à un autre numéro (peut être relatif, par exemple -1)
-
-</programlisting>
<command>plugin [load fichier] | [autoload] | [reload] | [unload]</command>
<programlisting>
liste/charge/décharge des extensions