api: add new function nicklist_get_next_item

v2.8-utf8proc
Sebastien Helleu 2011-12-06 22:57:21 +01:00
parent 23c70b013b
commit 00a3f990b3
6 changed files with 167 additions and 3 deletions

View File

@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.7-dev, 2011-11-27
v0.3.7-dev, 2011-12-06
Version 0.3.7 (under dev!)
@ -30,7 +30,8 @@ Version 0.3.7 (under dev!)
* core: fix compilation error with "pid_t" on Mac OS X (bug #34639)
* core: enable background process under Cygwin to connect to servers, fix
reconnection problem (bug #34626)
* api: add new functions strcasecmp_range, strncasecmp_range and hdata_char
* api: add new functions strcasecmp_range, strncasecmp_range, hdata_char and
nicklist_get_next_item
* irc: fix crash when signon time in message 317 (whois, idle) is invalid
(too large) (bug #34905)
* irc: do not delete servers added in irc.conf on /reload (bug #34872)

View File

@ -10129,6 +10129,57 @@ weechat.nicklist_remove_all(buffer)
weechat.nicklist_remove_all(my_buffer)
----------------------------------------
weechat_nicklist_get_next_item
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_New in version 0.3.7._
Get next group or nick from nicklist (mainly used to display nicklist).
Prototype:
[source,C]
----------------------------------------
void gui_nicklist_get_next_item (struct t_gui_buffer *buffer,
struct t_gui_nick_group **group,
struct t_gui_nick **nick);
----------------------------------------
Arguments:
* 'buffer': buffer pointer
* 'group': pointer on pointer to group
* 'nick': pointer on pointer to nick
C example:
[source,C]
----------------------------------------
struct t_gui_nick_group *ptr_group;
struct t_gui_nick *ptr_nick;
ptr_group = NULL;
ptr_nick = NULL;
gui_nicklist_get_next_item (buffer, &ptr_group, &ptr_nick);
while (ptr_group || ptr_nick)
{
if (ptr_nick)
{
/* nick */
/* ... */
}
else
{
/* group */
/* ... */
}
gui_nicklist_get_next_item (buffer, &ptr_group, &ptr_nick);
}
----------------------------------------
[NOTE]
This function is not available in scripting API.
weechat_nicklist_group_get_integer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -10304,6 +10304,58 @@ weechat.nicklist_remove_all(buffer)
weechat.nicklist_remove_all(my_buffer)
----------------------------------------
weechat_nicklist_get_next_item
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_Nouveau dans la version 0.3.7._
Retourne le prochain groupe ou pseudo de la liste des pseudos (utilisé
principalement pour afficher la liste des pseudos).
Prototype :
[source,C]
----------------------------------------
void gui_nicklist_get_next_item (struct t_gui_buffer *buffer,
struct t_gui_nick_group **group,
struct t_gui_nick **nick);
----------------------------------------
Paramètres :
* 'buffer' : pointeur vers le tampon
* 'group' : pointeur vers un pointeur sur le groupe
* 'nick' : pointeur vers un pointeur sur le pseudo
Exemple en C :
[source,C]
----------------------------------------
struct t_gui_nick_group *ptr_group;
struct t_gui_nick *ptr_nick;
ptr_group = NULL;
ptr_nick = NULL;
gui_nicklist_get_next_item (buffer, &ptr_group, &ptr_nick);
while (ptr_group || ptr_nick)
{
if (ptr_nick)
{
/* pseudo */
/* ... */
}
else
{
/* groupe */
/* ... */
}
gui_nicklist_get_next_item (buffer, &ptr_group, &ptr_nick);
}
----------------------------------------
[NOTE]
Cette fonction n'est pas disponible dans l'API script.
weechat_nicklist_group_get_integer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -10211,6 +10211,60 @@ weechat.nicklist_remove_all(buffer)
weechat.nicklist_remove_all(my_buffer)
----------------------------------------
weechat_nicklist_get_next_item
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_Novità nella versione 0.3.7._
// TRANSLATION MISSING
Get next group or nick from nicklist (mainly used to display nicklist).
Prototipo:
[source,C]
----------------------------------------
void gui_nicklist_get_next_item (struct t_gui_buffer *buffer,
struct t_gui_nick_group **group,
struct t_gui_nick **nick);
----------------------------------------
Argomenti:
* 'buffer': puntatore al buffer
// TRANSLATION MISSING
* 'group': pointer on pointer to group
// TRANSLATION MISSING
* 'nick': pointer on pointer to nick
Esempio in C:
[source,C]
----------------------------------------
struct t_gui_nick_group *ptr_group;
struct t_gui_nick *ptr_nick;
ptr_group = NULL;
ptr_nick = NULL;
gui_nicklist_get_next_item (buffer, &ptr_group, &ptr_nick);
while (ptr_group || ptr_nick)
{
if (ptr_nick)
{
/* nick */
/* ... */
}
else
{
/* group */
/* ... */
}
gui_nicklist_get_next_item (buffer, &ptr_group, &ptr_nick);
}
----------------------------------------
[NOTE]
Questa funzione non è disponibile nelle API per lo scripting.
weechat_nicklist_group_get_integer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -681,6 +681,7 @@ plugin_load (const char *filename, int argc, char **argv)
new_plugin->nicklist_remove_group = &gui_nicklist_remove_group;
new_plugin->nicklist_remove_nick = &gui_nicklist_remove_nick;
new_plugin->nicklist_remove_all = &gui_nicklist_remove_all;
new_plugin->nicklist_get_next_item = &gui_nicklist_get_next_item;
new_plugin->nicklist_group_get_integer = &gui_nicklist_group_get_integer;
new_plugin->nicklist_group_get_string = &gui_nicklist_group_get_string;
new_plugin->nicklist_group_get_pointer = &gui_nicklist_group_get_pointer;

View File

@ -46,7 +46,7 @@ struct timeval;
*/
/* API version (used to check that plugin has same API and can be loaded) */
#define WEECHAT_PLUGIN_API_VERSION "20111125-01"
#define WEECHAT_PLUGIN_API_VERSION "20111206-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@ -694,6 +694,9 @@ struct t_weechat_plugin
void (*nicklist_remove_nick) (struct t_gui_buffer *buffer,
struct t_gui_nick *nick);
void (*nicklist_remove_all) (struct t_gui_buffer *buffer);
void (*nicklist_get_next_item) (struct t_gui_buffer *buffer,
struct t_gui_nick_group **group,
struct t_gui_nick **nick);
int (*nicklist_group_get_integer) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *group,
const char *property);
@ -1416,6 +1419,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
weechat_plugin->nicklist_remove_nick(__buffer, __nick)
#define weechat_nicklist_remove_all(__buffer) \
weechat_plugin->nicklist_remove_all(__buffer)
#define weechat_nicklist_get_next_item(__buffer, __group, __nick) \
weechat_plugin->nicklist_get_next_item(__buffer, __group, __nick)
#define weechat_nicklist_group_get_integer(__buffer, __group, \
__property) \
weechat_plugin->nicklist_group_get_integer(__buffer, __group, \