GnuCash  5.6-150-g038405b370+
gnc-tree-model.c
1 /*
2  * gnc-tree-model.c -- base implementation for a tree model in
3  * Gnucash. This only implements the object, not
4  * the model interface.
5  *
6  * Copyright (C) 2005 David Hampton <hampton@employees.org>
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 #include <config.h>
27 
28 #include <gtk/gtk.h>
29 #include <string.h>
30 
31 #include "gnc-tree-model.h"
32 #include "gnc-gobject-utils.h"
33 #include "gnc-engine.h"
34 
36 static QofLogModule log_module = GNC_MOD_GUI;
37 
39 static void gnc_tree_model_constructed (GObject *object);
40 static void gnc_tree_model_finalize (GObject *object);
41 
43 typedef struct GncTreeModelPrivate
44 {
45  gpointer dummy;
47 
48 G_DEFINE_TYPE_WITH_CODE(GncTreeModel, gnc_tree_model, G_TYPE_OBJECT,
49  G_ADD_PRIVATE(GncTreeModel))
50 
51 #define GNC_TREE_MODEL_GET_PRIVATE(o) \
52  ((GncTreeModelPrivate*)gnc_tree_model_get_instance_private((GncTreeModel*)o))
53 
54 
55 /************************************************************/
56 /* g_object required functions */
57 /************************************************************/
58 
59 static void
60 gnc_tree_model_class_init (GncTreeModelClass *klass)
61 {
62  GObjectClass *o_class;
63 
64  o_class = G_OBJECT_CLASS (klass);
65 
66  /* GObject signals */
67  o_class->constructed = gnc_tree_model_constructed;
68  o_class->finalize = gnc_tree_model_finalize;
69 }
70 
71 static void
72 gnc_tree_model_init (GncTreeModel *model)
73 {
74 }
75 
82 static void
83 gnc_tree_model_constructed (GObject *obj)
84 {
85  ENTER("model %p", obj);
86 
88 
89  G_OBJECT_CLASS (gnc_tree_model_parent_class)->constructed (obj);
90 
91  LEAVE(" ");
92 }
93 
94 static void
95 gnc_tree_model_finalize (GObject *object)
96 {
97  ENTER("model %p", object);
98  g_return_if_fail (object != NULL);
99  g_return_if_fail (GNC_IS_TREE_MODEL (object));
100 
102 
103  G_OBJECT_CLASS (gnc_tree_model_parent_class)->finalize (object);
104  LEAVE(" ");
105 }
void gnc_gobject_tracking_forget(GObject *object)
Tell gnucash to remember this object in the database.
GtkTreeModel implementation for a generic gnucash tree.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
G_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_APPLICATION_WINDOW, G_IMPLEMENT_INTERFACE(GNC_TYPE_WINDOW, gnc_window_main_window_init)) static guint main_window_signals[LAST_SIGNAL]
A holding place for all the signals generated by the main window code.
void gnc_gobject_tracking_remember(GObject *object)
Tell gnucash to remember this object in the database.
Gobject helper routines.
The instance private data for a generic tree model.
All type declarations for the whole Gnucash engine.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282