diff --git a/doc/en/dev/plugin_c_api.en.xml b/doc/en/dev/plugin_c_api.en.xml index c02711127..5e6285551 100644 --- a/doc/en/dev/plugin_c_api.en.xml +++ b/doc/en/dev/plugin_c_api.en.xml @@ -6335,6 +6335,549 @@ struct t_gui_buffer *my_buffer = &my_input_cb, NULL, &my_close_cb, NULL); /* ... */ weechat_buffer_close (my_buffer); + + + + +
+ weechat_buffer_get_integer + + + Prototype: + +int weechat_buffer_integer (struct t_gui_buffer *buffer, const char *property); + + + + Get integer value of a buffer property. + + + Arguments: + + + + : buffer pointer + + + + + : property name: + + + + + Name + Description + + + + + number + number of buffer (1 to # open buffers) + + + notify + notify level on buffer + + + lines_hidden + + 1 if at least one line is hidden on buffer + (filtered), or 0 if all lines are displayed + + + + + + + + + + + Return value: integer value of property. + + + Example: + +weechat_printf (NULL, "my buffer number is: %d", + weechat_buffer_get_integer (my_buffer, "number")); + + +
+ +
+ weechat_buffer_get_string + + + Prototype: + +const char *weechat_buffer_get_string (struct t_gui_buffer *buffer, const char *property); + + + + Get string value of a buffer property. + + + Arguments: + + + + : buffer pointer + + + + + : property name: + + + + + Name + Description + + + + + plugin + + name of plugin which created this buffer ("core" for + WeeChat main buffer) + + + + name + name of buffer + + + short_name + short name of buffer + + + tilte + title of buffer + + + localvar_xxx + + get content of local varialbe "xxx" (replace + "xxx" by the name of variable you want to read) + + + + + + + + + + + Return value: string value of property. + + + Example: + +weechat_printf (NULL, "name / short name of buffer are: %s / %s", + weechat_buffer_get_string (my_buffer, "name"), + weechat_buffer_get_string (my_buffer, "short_name")); + + +
+ +
+ weechat_buffer_get_pointer + + + Prototype: + +const char *weechat_buffer_pointer (struct t_gui_buffer *buffer, const char *property); + + + + Get pointer value of a buffer property. + + + Arguments: + + + + : buffer pointer + + + + + : property name: + + + + + Name + Description + + + + + plugin + plugin pointer + + + + + + + + + + Return value: pointer value of property. + + + Example: + +weechat_printf (NULL, "plugin pointer of my buffer: %lx", + weechat_buffer_get_pointer (my_buffer, "plugin")); + + +
+ +
+ weechat_buffer_set + + + Prototype: + +void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, + const char *value); + + + + Set string value of a buffer property. + + + Arguments: + + + + : buffer pointer + + + + + : property name: + + + + + Name + Value + Description + + + + + hotlist + + "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE, + WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT + + + + "+": enable hotlist (global setting, buffer pointer + is not used) + + + "-": disable hotlist (global setting, buffer pointer + is not used); when hotlist is disabled, messages + printed in buffers does not change hotlist (but + content of current hotlist is not cleared) + + + priority: add buffer to hotlist with this priority + + + + + unread + N/A + + set unread marker on current line for buffer + + + + display + N/A + swtich to this buffer in current window + + + name + any string + set new name for buffer + + + short_name + any string + set new short name for buffer + + + type + "formated" or "free" + + set type for buffer: "formated" (for printing + chat messages), or "free" for free content + + + + notify + "0", "1", "2", "3" + + set notify level for buffer: "0" = never add to hotlist, + "1" = add for highlights only, "2" = add for highlights + and messages, "3" = add for ell messages + + + + title + any string + set new title for buffer + + + nicklist + "0" or "1" + + "0" to remove nicklist for buffer, "1" to add + nicklist for buffer + + + + nicklist_case_sensitive + "0" or "1" + + "0" to have case insensitive nicklist, "1" to have + case sensitive nicklist + + + + nicklist_display_groups + "0" or "1" + + "0" to hide nicklist groups, "1" to display nicklist + groups + + + + highlight_words + "-" or comma separated list of words + + "-" is a special value to disable any highlight on this + buffer, or comma separated list of words to higlkight + in this buffer, for example: "abc,def,ghi" + + + + highlight_tags + comma separated list of tags + + comma separated list of tags to highlight in this + buffer + + + + key_bind_xxx + any string + + bind a new key, specific to this buffer (replace "xxx" + by the key, for example "meta-I" to bind alt+i) ; the + value is text or command to execute + + + + key_bind_xxx + N/A + + unbind a key (which was bound with above property) + + + + input + any string + set new value for buffer input + + + input_get_unknown_commands + "0" or "1" + + "0" to disable unknown commands on this buffer + (default behaviour), "1" to get unknown commands, + for example if user type "/unknowncmd", buffer will + receive it (no error about unknown command) + + + + localvar_set_xxx + any string + + set new value for a local variable (replace "xxx" by + variable name) ; variable is created if it does not + exist + + + + localvar_del_xxx + any string + + remove a local variable (replace "xxx" by variable name) + + + + + + + + + + + Example: + +/* disable hotlist (for all buffers) */ +weechat_buffer_set (NULL, "hotlist", "-"); + +/* enable again hotlist */ +weechat_buffer_set (NULL, "hotlist", "+"); + +/* change buffer name */ +weechat_buffer_set (my_buffer, "name", "my_new_name"); + +/* add new local variable "toto" with value "my_value" */ +weechat_buffer_set (my_buffer, "localvar_set_toto", "my_value"); + +/* remove local variable "toto" */ +weechat_buffer_set (my_buffer, "localvar_del_toto", NULL); + + +
+ +
+ weechat_buffer_set_pointer + + + Prototype: + +void weechat_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property, + void *pointer); + + + + Set pointer value of a buffer property. + + + Arguments: + + + + : buffer pointer + + + + + : property name: + + + + + Name + Value + Description + + + + + close_callback + close callback function + close callback function + + + close_callback_data + close callback data pointer + close callback data pointer + + + input_callback + input callback function + input callback function + + + input_callback_data + input callback data pointer + input callback data pointer + + + + + + + + + + Example: + +int +my_close_cb (void *data, struct t_gui_buffer *buffer) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +weechat_buffer_set_pointer (NULL, "close_callback", &my_close_cb); + + +
+ +
+ weechat_buffer_string_replace_local_var + + + Prototype: + +char *weechat_buffer_string_replace_local_var (struct t_gui_buffer *buffer, + const char *string); + + + + Replace local variables in a string by their value, using buffer local + variables. + + + Arguments: + + + + : buffer pointer + + + + + : string with text and local variables + using format "$var" + + + + + + Return value: string with value for local variables. + + + + Result has to be free by a call to "free" after use. + + + + Example: + +weechat_buffer_set (my_buffer, "localvar_set_toto", "my_value"); + +char *str = weechat_buffer_string_replace_local_var (my_buffer, + "test with $toto"); +/* str contains "test with my_value" */ +/* ... */ +free (str);