GnuCash  5.6-150-g038405b370+
gncmod-example.c
1 /*********************************************************************
2  * gncmod-example.c
3  * module definition/initialization for the example GNOME UI module
4  *
5  * Copyright (c) 2009 Sebastian Held <sebastian.held@gmx.de>
6  * Copyright (c) 2001 Derek Atkins <warlord@MIT.EDU>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, contact:
20  *
21  * Free Software Foundation Voice: +1-617-542-5942
22  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
23  * Boston, MA 02110-1301, USA gnu@gnu.org
24  *
25  *********************************************************************/
26 
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30 
31 #include <gmodule.h>
32 #include <gtk/gtk.h>
33 #include <glib/gi18n.h>
34 
35 #include "gnc-hooks.h"
36 #include "gnc-module.h"
37 #include "gnc-module-api.h"
38 
39 #include "gnc-plugin-manager.h"
40 #include "gnc-plugin-example.h"
41 
42 GNC_MODULE_API_DECL(libgncmod_example)
43 
44 /* version of the gnc module system interface we require */
45 int libgncmod_example_gnc_module_system_interface = 0;
46 
47 /* module versioning uses libtool semantics. */
48 int libgncmod_example_gnc_module_current = 0;
49 int libgncmod_example_gnc_module_revision = 0;
50 int libgncmod_example_gnc_module_age = 0;
51 
52 
53 char *
54 libgncmod_example_gnc_module_path (void)
55 {
56  return g_strdup("gnucash/plugins/example");
57 }
58 
59 char *
60 libgncmod_example_gnc_module_description (void)
61 {
62  return g_strdup("The GnuCash example plugin");
63 }
64 
65 int
66 libgncmod_example_gnc_module_init (int refcount)
67 {
68  if (refcount == 0) {
69  /* this is the first time the module is loaded */
70 
73  }
74 
75  return TRUE;
76 }
77 
78 int
79 libgncmod_example_gnc_module_end (int refcount)
80 {
81  if (refcount == 0) {
82  /* this is the last time the module is unloaded */
83  }
84 
85  return TRUE;
86 }
Plugin management functions for the GnuCash UI.
void gnc_plugin_manager_add_plugin(GncPluginManager *manager, GncPlugin *plugin)
Add a plugin to the list maintained by the plugin manager.
GncPlugin * gnc_plugin_example_new(void)
GncPluginManager * gnc_plugin_manager_get(void)
Retrieve a pointer to the plugin manager.