GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gncmod-report-gnome.c
1 /*********************************************************************
2  * gncmod-report-gnome.c
3  * module definition/initialization for the gnome report infrastructure
4  *
5  * Copyright (c) 2001 Linux Developers Group, Inc.
6  *********************************************************************/
7 
8 #ifdef HAVE_CONFIG_H
9 #include <config.h>
10 #endif
11 
12 #include <gmodule.h>
13 #include <gtk/gtk.h>
14 #include <libguile.h>
15 
16 #include "gnc-module.h"
17 #include "gnc-module-api.h"
18 
19 #include "window-report.h"
20 
21 GNC_MODULE_API_DECL(libgncmod_report_gnome)
22 
23 /* version of the gnc module system interface we require */
24 int libgncmod_report_gnome_gnc_module_system_interface = 0;
25 
26 /* module versioning uses libtool semantics. */
27 int libgncmod_report_gnome_gnc_module_current = 0;
28 int libgncmod_report_gnome_gnc_module_revision = 0;
29 int libgncmod_report_gnome_gnc_module_age = 0;
30 
31 
32 char *
33 libgncmod_report_gnome_gnc_module_path(void)
34 {
35  return g_strdup("gnucash/report/report-gnome");
36 }
37 
38 char *
39 libgncmod_report_gnome_gnc_module_description(void)
40 {
41  return g_strdup("Gnome component of GnuCash report generation system");
42 }
43 
44 static void
45 lmod(char * mn)
46 {
47  char * form = g_strdup_printf("(use-modules %s)\n", mn);
48  scm_c_eval_string(form);
49  g_free(form);
50 }
51 extern SCM scm_init_sw_report_gnome_module(void);
52 
53 int
54 libgncmod_report_gnome_gnc_module_init(int refcount)
55 {
56  if (!gnc_module_load("gnucash/app-utils", 0))
57  {
58  return FALSE;
59  }
60 
61  if (!gnc_module_load("gnucash/gnome-utils", 0))
62  {
63  return FALSE;
64  }
65 
66  if (!gnc_module_load("gnucash/report/report-system", 0))
67  {
68  return FALSE;
69  }
70  scm_init_sw_report_gnome_module();
71 
72  lmod ("(sw_report_gnome)");
73  lmod ("(gnucash report report-gnome)");
74 
75  if (refcount == 0)
76  gnc_report_init ();
77 
78  return TRUE;
79 }
80 
81 int
82 libgncmod_report_gnome_gnc_module_end(int refcount)
83 {
84  return TRUE;
85 }