GnuCash c935c2f+
Loading...
Searching...
No Matches
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
36static QofLogModule log_module = GNC_MOD_GUI;
37
39static void gnc_tree_model_constructed (GObject *object);
40static void gnc_tree_model_finalize (GObject *object);
41
43typedef struct GncTreeModelPrivate
44{
45 gpointer dummy;
47
48G_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
59static void
60gnc_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
71static void
72gnc_tree_model_init (GncTreeModel *model)
73{
74}
75
82static void
83gnc_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
94static void
95gnc_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}
All type declarations for the whole Gnucash engine.
Gobject helper routines.
GtkTreeModel implementation for a generic gnucash tree.
void gnc_gobject_tracking_remember(GObject *object)
Tell gnucash to remember this object in the database.
void gnc_gobject_tracking_forget(GObject *object)
Tell gnucash to remember this object in the database.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition qoflog.h:282
#define ENTER(format, args...)
Print a function entry debugging message.
Definition qoflog.h:272
The instance private data for a generic tree model.