diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2007-12-14 17:01:02 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2007-12-14 17:01:02 +0100 |
commit | e62ec5204c7061a83860fa6c6c8204414a2dd057 (patch) | |
tree | 122d8931668748e0bb445d7378be050ebcf22801 /src/plugins/demo | |
parent | 70e44d3c548c9c6856f0fd0d07c22df88817273b (diff) | |
download | weechat-e62ec5204c7061a83860fa6c6c8204414a2dd057.zip |
Improved main loop (less CPU usage), better precision for timers, use of one list by hook type (for fast search in hooks)
Diffstat (limited to 'src/plugins/demo')
-rw-r--r-- | src/plugins/demo/demo.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c index 186f95218..dd3ce4161 100644 --- a/src/plugins/demo/demo.c +++ b/src/plugins/demo/demo.c @@ -82,6 +82,26 @@ demo_printf_command_cb (void *data, void *buffer, int argc, char **argv, } /* + * demo_infobar_command_cb: demo command for infobar + */ + +int +demo_infobar_command_cb (void *data, void *buffer, int argc, char **argv, + char **argv_eol) +{ + /* make C compiler happy */ + (void) data; + (void) buffer; + (void) argv; + + weechat_infobar_printf (10, NULL, + (argc > 1) ? + argv_eol[1] : _("test infobar")); + + return WEECHAT_RC_OK; +} + +/* * demo_buffer_input_data_cb: callback for input data on buffer */ @@ -286,6 +306,14 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) "", &demo_printf_command_cb, NULL); + weechat_hook_command ("demo_infobar", + _("demo command: print a message in infobar for 10 " + "seconds"), + _("[text]"), + _("text: write this text on infobar"), + "", + &demo_infobar_command_cb, NULL); + weechat_hook_command ("demo_buffer", _("open a new buffer"), _("category name"), |