GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 <[email protected]>
6  * Copyright (c) 2001 Derek Atkins <[email protected]>
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 [email protected]
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 #include <libguile.h>
35 
36 #include "gnc-hooks.h"
37 #include "gnc-module.h"
38 #include "gnc-module-api.h"
39 
40 #include "gnc-plugin-manager.h"
41 #include "gnc-plugin-example.h"
42 
43 GNC_MODULE_API_DECL(libgncmod_example)
44 
45 /* version of the gnc module system interface we require */
46 int libgncmod_example_gnc_module_system_interface = 0;
47 
48 /* module versioning uses libtool semantics. */
49 int libgncmod_example_gnc_module_current = 0;
50 int libgncmod_example_gnc_module_revision = 0;
51 int libgncmod_example_gnc_module_age = 0;
52 
53 
54 char *
55 libgncmod_example_gnc_module_path (void)
56 {
57  return g_strdup("gnucash/plugins/example");
58 }
59 
60 char *
61 libgncmod_example_gnc_module_description (void)
62 {
63  return g_strdup("The GnuCash example plugin");
64 }
65 
66 int
67 libgncmod_example_gnc_module_init (int refcount)
68 {
69  if (!gnc_module_load ("gnucash/app-utils", 0)) {
70  return FALSE;
71  }
72  if (!gnc_module_load ("gnucash/gnome-utils", 0)) {
73  return FALSE;
74  }
75  if (!gnc_module_load ("gnucash/engine", 0)) {
76  return FALSE;
77  }
78 
79  if (refcount == 0) {
80  /* this is the first time the module is loaded */
81 
84  }
85 
86  return TRUE;
87 }
88 
89 int
90 libgncmod_example_gnc_module_end (int refcount)
91 {
92  if (refcount == 0) {
93  /* this is the last time the module is unloaded */
94  }
95 
96  return TRUE;
97 }
Plugin management functions for the GnuCash UI.
void gnc_plugin_manager_add_plugin(GncPluginManager *manager, GncPlugin *plugin)
GncPlugin * gnc_plugin_example_new(void)
GncPluginManager * gnc_plugin_manager_get(void)