summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-03-30 12:08:55 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-03-30 12:08:55 +0000
commit83bdd9791679fbf777b83616fc565876d79b58a5 (patch)
tree3c67da0c8bc9ca609d09b5d800b77dc0c1303242 /src/common
parent56af0e3284abd90ed37ac908cfaa17e4c6cd33fc (diff)
downloadweechat-83bdd9791679fbf777b83616fc565876d79b58a5.zip
Added keyboard handler to plugin API
Diffstat (limited to 'src/common')
-rw-r--r--src/common/command.c43
-rw-r--r--src/common/completion.c9
2 files changed, 52 insertions, 0 deletions
diff --git a/src/common/command.c b/src/common/command.c
index 9f77b2ccb..ffe2f4eb7 100644
--- a/src/common/command.c
+++ b/src/common/command.c
@@ -36,7 +36,10 @@
#include "fifo.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
+
+#ifdef PLUGINS
#include "../plugins/plugins.h"
+#endif
/* WeeChat internal commands */
@@ -2539,6 +2542,44 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (no command handler)\n"));
}
+
+ /* timer handlers */
+ irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ gui_printf (NULL, _(" timer handlers:\n"));
+ handler_found = 0;
+ for (ptr_handler = ptr_plugin->handlers;
+ ptr_handler; ptr_handler = ptr_handler->next_handler)
+ {
+ if (ptr_handler->type == HANDLER_TIMER)
+ {
+ handler_found = 1;
+ irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ gui_printf (NULL, _(" %d seconds\n"),
+ ptr_handler->interval);
+ }
+ }
+ if (!handler_found)
+ {
+ irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ gui_printf (NULL, _(" (no timer handler)\n"));
+ }
+
+ /* keyboard handlers */
+ irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ gui_printf (NULL, _(" keyboard handlers:\n"));
+ handler_found = 0;
+ for (ptr_handler = ptr_plugin->handlers;
+ ptr_handler; ptr_handler = ptr_handler->next_handler)
+ {
+ if (ptr_handler->type == HANDLER_KEYBOARD)
+ handler_found++;
+ }
+ irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ if (!handler_found)
+ gui_printf (NULL, _(" (no keyboard handler)\n"));
+ else
+ gui_printf (NULL, _(" %d defined\n"),
+ handler_found);
}
if (!weechat_plugins)
{
@@ -2583,6 +2624,8 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
"without plugins support.\n"),
"plugin");
/* make gcc happy */
+ (void) server;
+ (void) channel;
(void) argc;
(void) argv;
#endif /* PLUGINS */
diff --git a/src/common/completion.c b/src/common/completion.c
index 0ef9d61ea..1155b785c 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -424,6 +424,9 @@ completion_list_add_plugin_option (t_completion *completion)
&completion->last_completion,
ptr_option->name);
}
+#else
+ /* make gcc happy */
+ (void) completion;
#endif
}
@@ -457,6 +460,9 @@ completion_list_add_plugin (t_completion *completion)
&completion->last_completion,
ptr_plugin->name);
}
+#else
+ /* make gcc happy */
+ (void) completion;
#endif
}
@@ -634,6 +640,9 @@ completion_list_add_plugin_option_value (t_completion *completion)
if (pos)
pos[0] = ' ';
}
+#else
+ /* make gcc happy */
+ (void) completion;
#endif
}