]> Dogcows Code - chaz/homebank/blob - plugins/native.c
add plugin engine (supports C and Perl plugins)
[chaz/homebank] / plugins / native.c
1
2 #include <gmodule.h>
3
4 #include "ext.h"
5
6
7 const gchar* metadata[] = {
8 "NAME: Some Native Plugin",
9 "VERSION: 0.0105",
10 "ABSTRACT: Native plugins are also possible.",
11 "AUTHOR: Charles McGarvey <chazmcgarvey@brokenzipper.com>",
12 "WEBSITE: http://acme.tld/",
13 };
14
15
16 G_MODULE_EXPORT void load(void);
17 G_MODULE_EXPORT void unload(void);
18 G_MODULE_EXPORT void execute(void);
19
20 G_MODULE_EXPORT void on_create_main_window(GList* args);
21 G_MODULE_EXPORT void on_enter_main_loop(GList* args);
22
23
24 G_MODULE_EXPORT void load()
25 {
26 g_print("loading native plugin....... %p\n", load);
27 }
28
29 G_MODULE_EXPORT void unload()
30 {
31 g_print("destroy native plugin....... %p\n", unload);
32 }
33
34 G_MODULE_EXPORT void execute()
35 {
36 g_print("Configuring that native plugin!!!\n");
37 }
38
39 static GtkWidget* win = NULL;
40
41 G_MODULE_EXPORT void on_create_main_window(GList* args)
42 {
43 GList* it = g_list_first(args);
44 win = g_value_get_object(it->data);
45 /*gtk_window_set_title(GTK_WINDOW(GLOBALS->mainwindow), "This is the native hello-world plugin!");*/
46 }
47
48 G_MODULE_EXPORT void on_enter_main_loop(GList* args)
49 {
50 g_print("setting main window title.....\n");
51 if (win) {
52 gtk_window_set_title(GTK_WINDOW(win), "This is the native hello-world plugin!");
53 } else {
54 g_printerr("the main window is not set :(\n");
55 }
56 }
57
This page took 0.04038 seconds and 4 git commands to generate.