1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
/*
* uihello.c: sample plugin using "ui" service
*
* Author: Zbigniew Chyla (cyba@gnome.pl)
*/
#include <gnumeric-config.h>
#include <wbc-gtk.h>
#include <gui-util.h>
#include <gnm-plugin.h>
#include <glib/gi18n-lib.h>
GNM_PLUGIN_MODULE_HEADER;
static GOPlugin *uihello_plugin;
G_MODULE_EXPORT void
go_plugin_init (GOPlugin *plugin, GOCmdContext *cc)
{
uihello_plugin = plugin;
}
G_MODULE_EXPORT void
go_plugin_shutdown (GOPlugin *plugin, GOCmdContext *cc)
{
uihello_plugin = NULL;
}
static void
hello_message (GnmAction const *action, WorkbookControl *wbc)
{
char *msg = g_strdup_printf (
_("This is message from the \"%s\" plugin."),
go_plugin_get_name (uihello_plugin));
go_gtk_notice_dialog (wbcg_toplevel (WBC_GTK (wbc)), GTK_MESSAGE_INFO,
"%s", msg);
g_free (msg);
}
ModulePluginUIActions const hello_ui_actions[] = {
{ "HelloMenu", NULL },
{ "HelloWorld", hello_message },
{ NULL }
};
|