X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Fnative.c;fp=plugins%2Fnative.c;h=c0a5461369828924a761ab1dc1cb215320cd0009;hb=5b7b5519d955cd0c99d094ba140514e0a2b73083;hp=0000000000000000000000000000000000000000;hpb=8988b3bef0760b4cab8144715cc3d8f55688861c;p=chaz%2Fhomebank diff --git a/plugins/native.c b/plugins/native.c new file mode 100644 index 0000000..c0a5461 --- /dev/null +++ b/plugins/native.c @@ -0,0 +1,57 @@ + +#include + +#include "ext.h" + + +const gchar* metadata[] = { +"NAME: Some Native Plugin", +"VERSION: 0.0105", +"ABSTRACT: Native plugins are also possible.", +"AUTHOR: Charles McGarvey ", +"WEBSITE: http://acme.tld/", +}; + + +G_MODULE_EXPORT void load(void); +G_MODULE_EXPORT void unload(void); +G_MODULE_EXPORT void execute(void); + +G_MODULE_EXPORT void on_create_main_window(GList* args); +G_MODULE_EXPORT void on_enter_main_loop(GList* args); + + +G_MODULE_EXPORT void load() +{ + g_print("loading native plugin....... %p\n", load); +} + +G_MODULE_EXPORT void unload() +{ + g_print("destroy native plugin....... %p\n", unload); +} + +G_MODULE_EXPORT void execute() +{ + g_print("Configuring that native plugin!!!\n"); +} + +static GtkWidget* win = NULL; + +G_MODULE_EXPORT void on_create_main_window(GList* args) +{ + GList* it = g_list_first(args); + win = g_value_get_object(it->data); + /*gtk_window_set_title(GTK_WINDOW(GLOBALS->mainwindow), "This is the native hello-world plugin!");*/ +} + +G_MODULE_EXPORT void on_enter_main_loop(GList* args) +{ + g_print("setting main window title.....\n"); + if (win) { + gtk_window_set_title(GTK_WINDOW(win), "This is the native hello-world plugin!"); + } else { + g_printerr("the main window is not set :(\n"); + } +} +