GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gncmod-gnome-search.c
1 /*********************************************************************
2  * gncmod-gnome-search
3  * GNC Module initialization for the Gnome Search UI
4  *
5  * Copyright (c) 2002 Derek Atkins <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, contact:
19  *
20  * Free Software Foundation Voice: +1-617-542-5942
21  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
22  * Boston, MA 02110-1301, USA [email protected]
23  *********************************************************************/
24 
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
28 
29 #include <gtk/gtk.h>
30 #include <gmodule.h>
31 
32 #include "gnc-module.h"
33 #include "gnc-module-api.h"
34 
35 #include "search-core-type.h"
36 
37 GNC_MODULE_API_DECL(libgncmod_gnome_search)
38 
39 /* version of the gnc module system interface we require */
40 int libgncmod_gnome_search_gnc_module_system_interface = 0;
41 
42 /* module versioning uses libtool semantics. */
43 int libgncmod_gnome_search_gnc_module_current = 0;
44 int libgncmod_gnome_search_gnc_module_revision = 0;
45 int libgncmod_gnome_search_gnc_module_age = 0;
46 
47 
48 char *
49 libgncmod_gnome_search_gnc_module_path(void)
50 {
51  return g_strdup("gnucash/gnome-search");
52 }
53 
54 char *
55 libgncmod_gnome_search_gnc_module_description(void)
56 {
57  return g_strdup("The GnuCash Gnome Search UI");
58 }
59 
60 int
61 libgncmod_gnome_search_gnc_module_init(int refcount)
62 {
63  /* load the engine (we depend on it) */
64  if (!gnc_module_load("gnucash/engine", 0))
65  {
66  return FALSE;
67  }
68 
69  if (!gnc_module_load("gnucash/gnome-utils", 0))
70  {
71  return FALSE;
72  }
73 
74  if (refcount == 0)
75  {
76  /* initialize known types */
77  gnc_search_core_initialize ();
78  }
79 
80  return TRUE;
81 }
82 
83 int
84 libgncmod_gnome_search_gnc_module_end(int refcount)
85 {
86  /* XXX Unload the other modules */
87 
88  if (refcount == 0)
89  {
90  /* Shutdown */
91  gnc_search_core_finalize ();
92  }
93 
94  return TRUE;
95 }