2 * Claws Mail -- a GTK based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2012 the Claws Mail Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include <glib/gi18n.h>
33 #define PLUGIN_NAME (_("Demo"))
35 gboolean
my_log_hook(gpointer source
, gpointer data
)
37 LogText
*logtext
= (LogText
*)source
;
39 g_print("*** Demo Plugin log: %s\n", logtext
->text
);
44 static gulong hook_id
= HOOK_NONE
;
46 gint
plugin_init(gchar
**error
)
48 if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
49 VERSION_NUMERIC
, PLUGIN_NAME
, error
))
52 hook_id
= hooks_register_hook(LOG_APPEND_TEXT_HOOKLIST
, my_log_hook
, NULL
);
53 if (hook_id
== HOOK_NONE
) {
54 *error
= g_strdup(_("Failed to register log text hook"));
58 g_print("Demo plugin loaded\n");
63 gboolean
plugin_done(void)
65 hooks_unregister_hook(LOG_APPEND_TEXT_HOOKLIST
, hook_id
);
67 g_print("Demo plugin unloaded\n");
71 const gchar
*plugin_name(void)
76 const gchar
*plugin_desc(void)
78 return _("This plugin is only a demo of how to write plugins for Claws Mail. "
79 "It installs a hook for new log output and writes it to stdout."
81 "It is not really useful.");
84 const gchar
*plugin_type(void)
89 const gchar
*plugin_licence(void)
94 const gchar
*plugin_version(void)
99 struct PluginFeature
*plugin_provides(void)
101 static struct PluginFeature features
[] =
102 { {PLUGIN_OTHER
, N_("Demo")},
103 {PLUGIN_NOTHING
, NULL
}};