mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge Christoph Holterman's 'PR-G_ADD_PRIVATE-clean' into maint.
This commit is contained in:
commit
bc9d83c90f
@ -75,46 +75,14 @@ struct _GNCGeneralSearchPrivate
|
||||
gint component_id;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCGeneralSearch, gnc_general_search, GTK_TYPE_BOX)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_GENERAL_SEARCH, GNCGeneralSearchPrivate))
|
||||
|
||||
static GtkBoxClass *parent_class;
|
||||
static guint general_search_signals[LAST_SIGNAL];
|
||||
|
||||
|
||||
/**
|
||||
* gnc_general_search_get_type:
|
||||
*
|
||||
* Returns the GType for the GNCGeneralSearch widget
|
||||
*/
|
||||
GType
|
||||
gnc_general_search_get_type (void)
|
||||
{
|
||||
static GType general_search_type = 0;
|
||||
|
||||
if (!general_search_type)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GNCGeneralSearchClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_general_search_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GNCGeneralSearch), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_general_search_init,
|
||||
};
|
||||
|
||||
general_search_type = g_type_register_static (GTK_TYPE_BOX,
|
||||
"GNCGeneralSearch",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return general_search_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_general_search_class_init (GNCGeneralSearchClass *klass)
|
||||
{
|
||||
@ -134,8 +102,6 @@ gnc_general_search_class_init (GNCGeneralSearchClass *klass)
|
||||
object_class->destroy = gnc_general_search_destroy;
|
||||
|
||||
klass->changed = NULL;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCGeneralSearchPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -58,40 +58,13 @@ struct _GNCSearchAccountPrivate
|
||||
GtkWindow *parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchAccount, gnc_search_account, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_ACCOUNT, GNCSearchAccountPrivate))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
|
||||
GType
|
||||
gnc_search_account_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchAccountClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_account_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchAccount), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_account_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchAccount",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_account_class_init (GNCSearchAccountClass *klass)
|
||||
{
|
||||
@ -109,8 +82,6 @@ gnc_search_account_class_init (GNCSearchAccountClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchAccountPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -53,39 +53,13 @@ struct _GNCSearchBooleanPrivate
|
||||
gpointer dummy;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchBoolean, gnc_search_boolean, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_BOOLEAN, GNCSearchBooleanPrivate))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
GType
|
||||
gnc_search_boolean_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchBooleanClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_boolean_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchBoolean), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_boolean_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchBoolean",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_boolean_class_init (GNCSearchBooleanClass *klass)
|
||||
{
|
||||
@ -103,8 +77,6 @@ gnc_search_boolean_class_init (GNCSearchBooleanClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchBooleanPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -55,6 +55,8 @@ struct _GNCSearchCoreTypePrivate
|
||||
gpointer dummy;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchCoreType, gnc_search_core_type, G_TYPE_OBJECT)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypePrivate))
|
||||
|
||||
@ -62,32 +64,6 @@ static GObjectClass *parent_class;
|
||||
|
||||
static GHashTable *typeTable = NULL;
|
||||
|
||||
GType
|
||||
gnc_search_core_type_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof (GNCSearchCoreTypeClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc)gnc_search_core_type_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GNCSearchCoreType),
|
||||
0,
|
||||
(GInstanceInitFunc)gnc_search_core_type_init
|
||||
};
|
||||
|
||||
type = g_type_register_static (G_TYPE_OBJECT, "GNCSearchCoreType", &type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_core_type_class_init (GNCSearchCoreTypeClass *klass)
|
||||
{
|
||||
@ -102,8 +78,6 @@ gnc_search_core_type_class_init (GNCSearchCoreTypeClass *klass)
|
||||
klass->validate = validate;
|
||||
klass->grab_focus = grab_focus;
|
||||
klass->editable_enters = editable_enters;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchCoreTypePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -57,39 +57,13 @@ struct _GNCSearchDatePrivate
|
||||
GtkWindow *parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDate, gnc_search_date, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_DATE, GNCSearchDatePrivate))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
GType
|
||||
gnc_search_date_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchDateClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_date_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchDate), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_date_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchDate",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_date_class_init (GNCSearchDateClass *klass)
|
||||
{
|
||||
@ -109,8 +83,6 @@ gnc_search_date_class_init (GNCSearchDateClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchDatePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -57,39 +57,13 @@ struct _GNCSearchDoublePrivate
|
||||
GtkWindow *parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDouble, gnc_search_double, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_DOUBLE, GNCSearchDoublePrivate))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
GType
|
||||
gnc_search_double_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchDoubleClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_double_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchDouble), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_double_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchDouble",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_double_class_init (GNCSearchDoubleClass *klass)
|
||||
{
|
||||
@ -109,8 +83,6 @@ gnc_search_double_class_init (GNCSearchDoubleClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchDoublePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -58,39 +58,13 @@ struct _GNCSearchInt64Private
|
||||
GtkWindow *parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchInt64, gnc_search_int64, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_INT64, GNCSearchInt64Private))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
GType
|
||||
gnc_search_int64_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchInt64Class), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_int64_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchInt64), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_int64_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchInt64",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_int64_class_init (GNCSearchInt64Class *klass)
|
||||
{
|
||||
@ -110,8 +84,6 @@ gnc_search_int64_class_init (GNCSearchInt64Class *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchInt64Private));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -58,39 +58,13 @@ struct _GNCSearchNumericPrivate
|
||||
GtkWindow *parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchNumeric, gnc_search_numeric, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_NUMERIC, GNCSearchNumericPrivate))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
GType
|
||||
gnc_search_numeric_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchNumericClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_numeric_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchNumeric), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_numeric_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchNumeric",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_numeric_class_init (GNCSearchNumericClass *klass)
|
||||
{
|
||||
@ -110,8 +84,6 @@ gnc_search_numeric_class_init (GNCSearchNumericClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchNumericPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -54,39 +54,13 @@ struct _GNCSearchReconciledPrivate
|
||||
gpointer dummy;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchReconciled, gnc_search_reconciled, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_RECONCILED, GNCSearchReconciledPrivate))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
GType
|
||||
gnc_search_reconciled_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchReconciledClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_reconciled_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchReconciled), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_reconciled_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchReconciled",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_reconciled_class_init (GNCSearchReconciledClass *klass)
|
||||
{
|
||||
@ -104,8 +78,6 @@ gnc_search_reconciled_class_init (GNCSearchReconciledClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchReconciledPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -57,39 +57,13 @@ struct _GNCSearchStringPrivate
|
||||
GtkWindow *parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchString, gnc_search_string, GNC_TYPE_SEARCH_CORE_TYPE)
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_STRING, GNCSearchStringPrivate))
|
||||
|
||||
static GNCSearchCoreTypeClass *parent_class;
|
||||
|
||||
GType
|
||||
gnc_search_string_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchStringClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_string_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchString), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_string_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchString",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_string_class_init (GNCSearchStringClass *klass)
|
||||
{
|
||||
@ -109,8 +83,6 @@ gnc_search_string_class_init (GNCSearchStringClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchStringPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -76,34 +76,34 @@ typedef struct GncCombottPrivate
|
||||
} GncCombottPrivate;
|
||||
|
||||
/** Declarations *********************************************************/
|
||||
static void gctt_init (GncCombott *combott);
|
||||
static void gnc_combott_init (GncCombott *combott);
|
||||
|
||||
static void gctt_class_init (GncCombottClass *klass);
|
||||
static void gnc_combott_class_init (GncCombottClass *klass);
|
||||
|
||||
static void gctt_set_property (GObject *object,
|
||||
static void gnc_combott_set_property (GObject *object,
|
||||
guint param_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gctt_get_property (GObject *object,
|
||||
static void gnc_combott_get_property (GObject *object,
|
||||
guint param_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gctt_finalize (GObject *object);
|
||||
static void gnc_combott_finalize (GObject *object);
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,22,0)
|
||||
static void gctt_combott_menu_position (GtkMenu *menu,
|
||||
static void gnc_combott_menu_position (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *push_in,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
|
||||
static void gctt_changed (GncCombott *combott);
|
||||
static void gctt_set_model (GncCombott *combott, GtkTreeModel *model);
|
||||
static void gctt_refresh_menu (GncCombott *combott, GtkTreeModel *model);
|
||||
static void gctt_rebuild_menu (GncCombott *combott, GtkTreeModel *model);
|
||||
static void gnc_combott_changed (GncCombott *combott);
|
||||
static void gnc_combott_set_model (GncCombott *combott, GtkTreeModel *model);
|
||||
static void gnc_combott_refresh_menu (GncCombott *combott, GtkTreeModel *model);
|
||||
static void gnc_combott_rebuild_menu (GncCombott *combott, GtkTreeModel *model);
|
||||
|
||||
static gboolean which_tooltip_cb (GtkWidget *widget, gint x, gint y,
|
||||
gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data);
|
||||
@ -118,47 +118,21 @@ static void menuitem_response_cb (GtkMenuItem *item, gpointer *user_data);
|
||||
/************************************************************/
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_combott_get_type (void)
|
||||
{
|
||||
static GType combott_type = 0;
|
||||
|
||||
if (!combott_type)
|
||||
{
|
||||
static const GTypeInfo combott_info =
|
||||
{
|
||||
sizeof (GncCombottClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gctt_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncCombott),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gctt_init,
|
||||
};
|
||||
|
||||
combott_type = g_type_register_static (GTK_TYPE_BOX,
|
||||
"GncCombott",
|
||||
&combott_info, 0);
|
||||
}
|
||||
return combott_type;
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncCombott, gnc_combott, GTK_TYPE_BOX)
|
||||
|
||||
static void
|
||||
gctt_class_init (GncCombottClass *klass)
|
||||
gnc_combott_class_init (GncCombottClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gctt_set_property;
|
||||
gobject_class->get_property = gctt_get_property;
|
||||
gobject_class->finalize = gctt_finalize;
|
||||
gobject_class->set_property = gnc_combott_set_property;
|
||||
gobject_class->get_property = gnc_combott_get_property;
|
||||
gobject_class->finalize = gnc_combott_finalize;
|
||||
|
||||
klass->changed = gctt_changed;
|
||||
klass->changed = gnc_combott_changed;
|
||||
|
||||
combott_signals[CHANGED] =
|
||||
g_signal_new ("changed",
|
||||
@ -199,13 +173,11 @@ gctt_class_init (GncCombottClass *klass)
|
||||
G_MAXINT,
|
||||
1,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncCombottPrivate));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gctt_init (GncCombott *combott)
|
||||
gnc_combott_init (GncCombott *combott)
|
||||
{
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
@ -268,7 +240,7 @@ gctt_init (GncCombott *combott)
|
||||
|
||||
|
||||
static void
|
||||
gctt_set_property (GObject *object,
|
||||
gnc_combott_set_property (GObject *object,
|
||||
guint param_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
@ -279,7 +251,7 @@ gctt_set_property (GObject *object,
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_MODEL:
|
||||
gctt_set_model (combott, g_value_get_object (value));
|
||||
gnc_combott_set_model (combott, g_value_get_object (value));
|
||||
break;
|
||||
|
||||
case PROP_ACTIVE:
|
||||
@ -292,7 +264,7 @@ gctt_set_property (GObject *object,
|
||||
|
||||
case PROP_TIP_COL:
|
||||
priv->tip_col = g_value_get_int (value);
|
||||
gctt_refresh_menu(combott, priv->model);
|
||||
gnc_combott_refresh_menu(combott, priv->model);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -308,7 +280,7 @@ gctt_set_property (GObject *object,
|
||||
* ref the object when used in get_property().
|
||||
*/
|
||||
static void
|
||||
gctt_get_property (GObject *object,
|
||||
gnc_combott_get_property (GObject *object,
|
||||
guint param_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
@ -342,7 +314,7 @@ gctt_get_property (GObject *object,
|
||||
|
||||
|
||||
static void
|
||||
gctt_finalize (GObject *object)
|
||||
gnc_combott_finalize (GObject *object)
|
||||
{
|
||||
GncCombott *combott;
|
||||
GncCombottPrivate *priv;
|
||||
@ -368,7 +340,7 @@ gctt_finalize (GObject *object)
|
||||
|
||||
|
||||
static void
|
||||
gctt_set_model (GncCombott *combott, GtkTreeModel *model)
|
||||
gnc_combott_set_model (GncCombott *combott, GtkTreeModel *model)
|
||||
{
|
||||
GncCombottPrivate *priv;
|
||||
|
||||
@ -377,7 +349,7 @@ gctt_set_model (GncCombott *combott, GtkTreeModel *model)
|
||||
|
||||
priv = GNC_COMBOTT_GET_PRIVATE (combott);
|
||||
|
||||
gctt_rebuild_menu(combott, model);
|
||||
gnc_combott_rebuild_menu(combott, model);
|
||||
|
||||
priv->model = model;
|
||||
g_object_ref (priv->model);
|
||||
@ -385,7 +357,7 @@ gctt_set_model (GncCombott *combott, GtkTreeModel *model)
|
||||
|
||||
|
||||
static void
|
||||
gctt_rebuild_menu (GncCombott *combott, GtkTreeModel *model)
|
||||
gnc_combott_rebuild_menu (GncCombott *combott, GtkTreeModel *model)
|
||||
{
|
||||
GncCombottPrivate *priv;
|
||||
GtkTreeIter iter;
|
||||
@ -454,17 +426,17 @@ gctt_rebuild_menu (GncCombott *combott, GtkTreeModel *model)
|
||||
|
||||
|
||||
static void
|
||||
gctt_refresh_menu (GncCombott *combott, GtkTreeModel *model)
|
||||
gnc_combott_refresh_menu (GncCombott *combott, GtkTreeModel *model)
|
||||
{
|
||||
g_return_if_fail (GNC_IS_COMBOTT (combott));
|
||||
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
|
||||
|
||||
gctt_rebuild_menu(combott, model);
|
||||
gnc_combott_rebuild_menu(combott, model);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gctt_changed(GncCombott *combott)
|
||||
gnc_combott_changed(GncCombott *combott)
|
||||
{
|
||||
/*
|
||||
g_print("Changed Signal\n");
|
||||
@ -474,7 +446,7 @@ gctt_changed(GncCombott *combott)
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,22,0)
|
||||
static void
|
||||
gctt_combott_menu_position (GtkMenu *menu,
|
||||
gnc_combott_menu_position (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *push_in,
|
||||
@ -599,7 +571,7 @@ button_press_cb (GtkWidget *widget, GdkEvent *event, gpointer *user_data )
|
||||
#else
|
||||
gtk_menu_popup (GTK_MENU (priv->menu),
|
||||
NULL, NULL,
|
||||
gctt_combott_menu_position, combott,
|
||||
gnc_combott_menu_position, combott,
|
||||
bevent->button, bevent->time);
|
||||
#endif
|
||||
|
||||
|
@ -90,43 +90,14 @@ typedef struct _GNCCurrencyEditPrivate
|
||||
gchar *mnemonic;
|
||||
} GNCCurrencyEditPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCCurrencyEdit, gnc_currency_edit, GTK_TYPE_COMBO_BOX)
|
||||
|
||||
#define GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_CURRENCY_EDIT, GNCCurrencyEditPrivate))
|
||||
|
||||
/** @name Basic Object Implementation */
|
||||
/** @{ */
|
||||
|
||||
/* Return the GType for the GNCCurrencyEdit currency selection widget.
|
||||
*/
|
||||
GType
|
||||
gnc_currency_edit_get_type (void)
|
||||
{
|
||||
static GType currency_edit_type = 0;
|
||||
|
||||
if (currency_edit_type == 0)
|
||||
{
|
||||
static const GTypeInfo currency_edit_info =
|
||||
{
|
||||
sizeof (GNCCurrencyEditClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_currency_edit_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GNCCurrencyEdit),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_currency_edit_init,
|
||||
NULL
|
||||
};
|
||||
|
||||
currency_edit_type = g_type_register_static (GTK_TYPE_COMBO_BOX,
|
||||
"GNCCurrencyEdit",
|
||||
¤cy_edit_info, 0);
|
||||
}
|
||||
|
||||
return currency_edit_type;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
@ -184,9 +155,6 @@ gnc_currency_edit_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** Initialize the GncCurrencyEdit class object.
|
||||
*
|
||||
* @internal
|
||||
@ -199,8 +167,6 @@ gnc_currency_edit_class_init (GNCCurrencyEditClass *klass)
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCCurrencyEditPrivate));
|
||||
|
||||
gobject_class->set_property = gnc_currency_edit_set_property;
|
||||
gobject_class->get_property = gnc_currency_edit_get_property;
|
||||
gobject_class->finalize = gnc_currency_edit_finalize;
|
||||
|
@ -53,9 +53,9 @@ enum
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
typedef struct _GNCDateFormatPriv GNCDateFormatPriv;
|
||||
typedef struct _GNCDateFormatPrivate GNCDateFormatPrivate;
|
||||
|
||||
struct _GNCDateFormatPriv
|
||||
struct _GNCDateFormatPrivate
|
||||
{
|
||||
GtkWidget* format_combobox;
|
||||
|
||||
@ -76,7 +76,7 @@ struct _GNCDateFormatPriv
|
||||
};
|
||||
|
||||
#define GNC_DATE_FORMAT_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_DATE_FORMAT, GNCDateFormatPriv))
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_DATE_FORMAT, GNCDateFormatPrivate))
|
||||
|
||||
static guint date_format_signals [LAST_SIGNAL] = { 0 };
|
||||
|
||||
@ -89,40 +89,7 @@ void gnc_ui_date_format_changed_cb(GtkWidget *unused, gpointer user_data);
|
||||
|
||||
static GtkBoxClass *parent_class;
|
||||
|
||||
/**
|
||||
* gnc_date_format_get_type:
|
||||
*
|
||||
* Returns the GType for the GNCDateFormat widget
|
||||
*/
|
||||
GType
|
||||
gnc_date_format_get_type (void)
|
||||
{
|
||||
static GType date_format_type = 0;
|
||||
|
||||
if (!date_format_type)
|
||||
{
|
||||
static const GTypeInfo date_format_info =
|
||||
{
|
||||
sizeof (GNCDateFormatClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_date_format_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GNCDateFormat),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_date_format_init,
|
||||
NULL,
|
||||
};
|
||||
|
||||
date_format_type = g_type_register_static(GTK_TYPE_BOX,
|
||||
"GNCDateFormat",
|
||||
&date_format_info, 0);
|
||||
}
|
||||
|
||||
return date_format_type;
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCDateFormat, gnc_date_format, GTK_TYPE_BOX)
|
||||
|
||||
static void
|
||||
gnc_date_format_class_init (GNCDateFormatClass *klass)
|
||||
@ -133,8 +100,6 @@ gnc_date_format_class_init (GNCDateFormatClass *klass)
|
||||
|
||||
gobject_class->finalize = gnc_date_format_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCDateFormatPriv));
|
||||
|
||||
date_format_signals [FORMAT_CHANGED] =
|
||||
g_signal_new ("format_changed",
|
||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
||||
@ -151,7 +116,7 @@ gnc_date_format_class_init (GNCDateFormatClass *klass)
|
||||
static void
|
||||
gnc_date_format_init (GNCDateFormat *gdf)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *dialog, *table;
|
||||
|
||||
@ -238,7 +203,7 @@ gnc_date_format_new_without_label (void)
|
||||
{
|
||||
GtkWidget *widget = gnc_date_format_new_with_label(NULL);
|
||||
GNCDateFormat *gdf = GNC_DATE_FORMAT(widget);
|
||||
GNCDateFormatPriv *priv = GNC_DATE_FORMAT_GET_PRIVATE(gdf);
|
||||
GNCDateFormatPrivate *priv = GNC_DATE_FORMAT_GET_PRIVATE(gdf);
|
||||
|
||||
gtk_widget_destroy(priv->label);
|
||||
priv->label = NULL;
|
||||
@ -260,7 +225,7 @@ GtkWidget *
|
||||
gnc_date_format_new_with_label (const char *label)
|
||||
{
|
||||
GNCDateFormat *gdf;
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
gdf = g_object_new(GNC_TYPE_DATE_FORMAT, NULL);
|
||||
priv = GNC_DATE_FORMAT_GET_PRIVATE(gdf);
|
||||
@ -276,7 +241,7 @@ gnc_date_format_new_with_label (const char *label)
|
||||
void
|
||||
gnc_date_format_set_format (GNCDateFormat *gdf, QofDateFormat format)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
g_return_if_fail(gdf);
|
||||
g_return_if_fail(GNC_IS_DATE_FORMAT(gdf));
|
||||
@ -290,7 +255,7 @@ gnc_date_format_set_format (GNCDateFormat *gdf, QofDateFormat format)
|
||||
QofDateFormat
|
||||
gnc_date_format_get_format (GNCDateFormat *gdf)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (gdf, QOF_DATE_FORMAT_LOCALE);
|
||||
g_return_val_if_fail (GNC_IS_DATE_FORMAT(gdf), QOF_DATE_FORMAT_LOCALE);
|
||||
@ -303,7 +268,7 @@ gnc_date_format_get_format (GNCDateFormat *gdf)
|
||||
void
|
||||
gnc_date_format_set_months (GNCDateFormat *gdf, GNCDateMonthFormat months)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
GtkWidget *button = NULL;
|
||||
|
||||
g_return_if_fail(gdf);
|
||||
@ -335,7 +300,7 @@ gnc_date_format_set_months (GNCDateFormat *gdf, GNCDateMonthFormat months)
|
||||
GNCDateMonthFormat
|
||||
gnc_date_format_get_months (GNCDateFormat *gdf)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
g_return_val_if_fail(gdf, GNCDATE_MONTH_NUMBER);
|
||||
g_return_val_if_fail(GNC_IS_DATE_FORMAT(gdf), GNCDATE_MONTH_NUMBER);
|
||||
@ -357,7 +322,7 @@ gnc_date_format_get_months (GNCDateFormat *gdf)
|
||||
void
|
||||
gnc_date_format_set_years (GNCDateFormat *gdf, gboolean include_century)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
g_return_if_fail(gdf);
|
||||
g_return_if_fail(GNC_IS_DATE_FORMAT(gdf));
|
||||
@ -372,7 +337,7 @@ gnc_date_format_set_years (GNCDateFormat *gdf, gboolean include_century)
|
||||
gboolean
|
||||
gnc_date_format_get_years (GNCDateFormat *gdf)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
g_return_val_if_fail(gdf, FALSE);
|
||||
g_return_val_if_fail(GNC_IS_DATE_FORMAT(gdf), FALSE);
|
||||
@ -385,7 +350,7 @@ gnc_date_format_get_years (GNCDateFormat *gdf)
|
||||
void
|
||||
gnc_date_format_set_custom (GNCDateFormat *gdf, const char *format)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
g_return_if_fail(gdf);
|
||||
g_return_if_fail(GNC_IS_DATE_FORMAT(gdf));
|
||||
@ -402,7 +367,7 @@ gnc_date_format_set_custom (GNCDateFormat *gdf, const char *format)
|
||||
const char *
|
||||
gnc_date_format_get_custom (GNCDateFormat *gdf)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
g_return_val_if_fail(gdf, "");
|
||||
g_return_val_if_fail(GNC_IS_DATE_FORMAT(gdf), "");
|
||||
@ -424,7 +389,7 @@ gnc_ui_date_format_changed_cb(GtkWidget *unused, gpointer user_data)
|
||||
static void
|
||||
gnc_date_format_enable_month (GNCDateFormat *gdf, gboolean sensitive)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
priv = GNC_DATE_FORMAT_GET_PRIVATE(gdf);
|
||||
gtk_widget_set_sensitive(priv->months_label, sensitive);
|
||||
@ -437,7 +402,7 @@ gnc_date_format_enable_month (GNCDateFormat *gdf, gboolean sensitive)
|
||||
static void
|
||||
gnc_date_format_enable_year (GNCDateFormat *gdf, gboolean sensitive)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
priv = GNC_DATE_FORMAT_GET_PRIVATE(gdf);
|
||||
gtk_widget_set_sensitive(priv->years_label, sensitive);
|
||||
@ -448,7 +413,7 @@ gnc_date_format_enable_year (GNCDateFormat *gdf, gboolean sensitive)
|
||||
static void
|
||||
gnc_date_format_enable_format (GNCDateFormat *gdf, gboolean sensitive)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
|
||||
priv = GNC_DATE_FORMAT_GET_PRIVATE(gdf);
|
||||
gtk_widget_set_sensitive(priv->custom_label, sensitive);
|
||||
@ -459,7 +424,7 @@ gnc_date_format_enable_format (GNCDateFormat *gdf, gboolean sensitive)
|
||||
void
|
||||
gnc_date_format_refresh (GNCDateFormat *gdf)
|
||||
{
|
||||
GNCDateFormatPriv *priv;
|
||||
GNCDateFormatPrivate *priv;
|
||||
int sel_option;
|
||||
gboolean enable_year, enable_month, enable_custom, check_modifiers;
|
||||
static gchar *format, *c;
|
||||
|
@ -50,7 +50,6 @@ static GObjectClass *parent_class = NULL;
|
||||
|
||||
/* Declarations *********************************************************/
|
||||
static void gnc_embedded_window_class_init (GncEmbeddedWindowClass *klass);
|
||||
static void gnc_embedded_window_init (GncEmbeddedWindow *window, GncEmbeddedWindowClass *klass);
|
||||
static void gnc_embedded_window_finalize (GObject *object);
|
||||
static void gnc_embedded_window_dispose (GObject *object);
|
||||
|
||||
@ -58,7 +57,6 @@ static void gnc_window_embedded_window_init (GncWindowIface *iface);
|
||||
|
||||
static void gnc_embedded_window_setup_window (GncEmbeddedWindow *window);
|
||||
|
||||
|
||||
/** The instance private data for an embedded window object. */
|
||||
typedef struct GncEmbeddedWindowPrivate
|
||||
{
|
||||
@ -87,51 +85,14 @@ typedef struct GncEmbeddedWindowPrivate
|
||||
GtkWidget *parent_window;
|
||||
} GncEmbeddedWindowPrivate;
|
||||
|
||||
GNC_DEFINE_TYPE_WITH_CODE(GncEmbeddedWindow, gnc_embedded_window, GTK_TYPE_BOX,
|
||||
G_ADD_PRIVATE(GncEmbeddedWindow)
|
||||
GNC_IMPLEMENT_INTERFACE(GNC_TYPE_WINDOW,
|
||||
gnc_window_embedded_window_init))
|
||||
|
||||
#define GNC_EMBEDDED_WINDOW_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowPrivate))
|
||||
|
||||
|
||||
|
||||
/* Get the type of a gnc embedded window. */
|
||||
GType
|
||||
gnc_embedded_window_get_type (void)
|
||||
{
|
||||
static GType gnc_embedded_window_type = 0;
|
||||
|
||||
if (gnc_embedded_window_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncEmbeddedWindowClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_embedded_window_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncEmbeddedWindow),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_embedded_window_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo plugin_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_window_embedded_window_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_embedded_window_type = g_type_register_static (GTK_TYPE_BOX,
|
||||
"GncEmbeddedWindow",
|
||||
&our_info, 0);
|
||||
g_type_add_interface_static (gnc_embedded_window_type,
|
||||
GNC_TYPE_WINDOW,
|
||||
&plugin_info);
|
||||
}
|
||||
|
||||
return gnc_embedded_window_type;
|
||||
}
|
||||
|
||||
|
||||
/* Display a data plugin page in a window. */
|
||||
void
|
||||
gnc_embedded_window_open_page (GncEmbeddedWindow *window,
|
||||
@ -218,8 +179,7 @@ gnc_embedded_window_class_init (GncEmbeddedWindowClass *klass)
|
||||
|
||||
object_class->finalize = gnc_embedded_window_finalize;
|
||||
object_class->dispose = gnc_embedded_window_dispose;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncEmbeddedWindowPrivate));
|
||||
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
@ -233,20 +193,20 @@ gnc_embedded_window_class_init (GncEmbeddedWindowClass *klass)
|
||||
* @param klass A pointer to the class data structure for this
|
||||
* object. */
|
||||
static void
|
||||
gnc_embedded_window_init (GncEmbeddedWindow *window,
|
||||
GncEmbeddedWindowClass *klass)
|
||||
gnc_embedded_window_init (GncEmbeddedWindow *window, void *data)
|
||||
{
|
||||
GncEmbeddedWindowClass *klass = (GncEmbeddedWindowClass*)data;
|
||||
ENTER("window %p", window);
|
||||
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE(window), GTK_ORIENTATION_VERTICAL);
|
||||
|
||||
// Set the style context for this widget so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(window), "GncEmbededWindow");
|
||||
gnc_widget_set_style_context (GTK_WIDGET(window), "GncEmbeddedWindow");
|
||||
|
||||
gnc_embedded_window_setup_window (window);
|
||||
|
||||
gnc_gobject_tracking_remember(G_OBJECT(window),
|
||||
G_OBJECT_CLASS(klass));
|
||||
G_OBJECT_CLASS(klass));
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,62 @@ void gnc_gobject_tracking_dump (void);
|
||||
|
||||
/** @} */
|
||||
|
||||
/** Some macros derived from glib type macros.
|
||||
* In glib type_name##init function only has one parameter. We need
|
||||
* the 2nd class parameter in certain calls. The main difference is
|
||||
* static void type_name##_init (TypeName *self, void *class);
|
||||
* instead of
|
||||
* static void type_name##_init (TypeName *self);
|
||||
* this code may need updating in future releases as glib changes.
|
||||
**/
|
||||
#define GNC_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) { \
|
||||
const GInterfaceInfo g_implement_interface_info = { \
|
||||
(GInterfaceInitFunc)(void (*)(void *, void *)) iface_init, NULL, NULL \
|
||||
}; \
|
||||
g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
|
||||
}
|
||||
|
||||
#define GNC_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _GNC_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _GNC_DEFINE_TYPE_EXTENDED_END()
|
||||
|
||||
#define _GNC_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \
|
||||
\
|
||||
static void type_name##_init (TypeName *self, void *class); \
|
||||
static void type_name##_class_init (TypeName##Class *klass); \
|
||||
static gpointer type_name##_parent_class = NULL; \
|
||||
static gint TypeName##_private_offset; \
|
||||
\
|
||||
_G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
|
||||
\
|
||||
G_GNUC_UNUSED \
|
||||
static inline gpointer \
|
||||
type_name##_get_instance_private (TypeName *self) \
|
||||
{ \
|
||||
return (G_STRUCT_MEMBER_P (self, TypeName##_private_offset)); \
|
||||
} \
|
||||
\
|
||||
GType \
|
||||
type_name##_get_type (void) \
|
||||
{ \
|
||||
static volatile gsize g_define_type_id__volatile = 0; \
|
||||
if (g_once_init_enter (&g_define_type_id__volatile)) \
|
||||
{ \
|
||||
GType g_define_type_id = \
|
||||
g_type_register_static_simple (TYPE_PARENT, \
|
||||
g_intern_static_string (#TypeName), \
|
||||
sizeof (TypeName##Class), \
|
||||
(GClassInitFunc) type_name##_class_intern_init, \
|
||||
sizeof (TypeName), \
|
||||
(GInstanceInitFunc) type_name##_init, \
|
||||
(GTypeFlags) flags); \
|
||||
{ /* custom code follows */
|
||||
#define _GNC_DEFINE_TYPE_EXTENDED_END() \
|
||||
/* following custom code */ \
|
||||
} \
|
||||
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
|
||||
} \
|
||||
return g_define_type_id__volatile; \
|
||||
} /* closes type_name##_get_type() */
|
||||
|
||||
|
||||
#endif /* GNC_GOBJECT_UTILS_H */
|
||||
/** @} */
|
||||
|
@ -129,7 +129,8 @@ static guint secs_to_save = 0;
|
||||
|
||||
/* Declarations *********************************************************/
|
||||
static void gnc_main_window_class_init (GncMainWindowClass *klass);
|
||||
static void gnc_main_window_init (GncMainWindow *window, GncMainWindowClass *klass);
|
||||
static void gnc_main_window_init (GncMainWindow *window,
|
||||
void *data);
|
||||
static void gnc_main_window_finalize (GObject *object);
|
||||
static void gnc_main_window_destroy (GtkWidget *widget);
|
||||
|
||||
@ -228,6 +229,11 @@ typedef struct GncMainWindowPrivate
|
||||
GHashTable *merged_actions_table;
|
||||
} GncMainWindowPrivate;
|
||||
|
||||
GNC_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_WINDOW,
|
||||
G_ADD_PRIVATE (GncMainWindow)
|
||||
G_IMPLEMENT_INTERFACE (GNC_TYPE_WINDOW,
|
||||
gnc_window_main_window_init))
|
||||
|
||||
#define GNC_MAIN_WINDOW_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_MAIN_WINDOW, GncMainWindowPrivate))
|
||||
|
||||
@ -2456,45 +2462,6 @@ gnc_main_window_tab_entry_key_press_event (GtkWidget *entry,
|
||||
* Widget Implementation *
|
||||
************************************************************/
|
||||
|
||||
/* Get the type of a gnc main window.
|
||||
*/
|
||||
GType
|
||||
gnc_main_window_get_type (void)
|
||||
{
|
||||
static GType gnc_main_window_type = 0;
|
||||
|
||||
if (gnc_main_window_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncMainWindowClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_main_window_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncMainWindow),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_main_window_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo plugin_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_window_main_window_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_main_window_type = g_type_register_static (GTK_TYPE_WINDOW,
|
||||
GNC_MAIN_WINDOW_NAME,
|
||||
&our_info, 0);
|
||||
g_type_add_interface_static (gnc_main_window_type,
|
||||
GNC_TYPE_WINDOW,
|
||||
&plugin_info);
|
||||
}
|
||||
|
||||
return gnc_main_window_type;
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the class for a new gnucash main window. This will set
|
||||
@ -2519,8 +2486,6 @@ gnc_main_window_class_init (GncMainWindowClass *klass)
|
||||
/* GtkWidget signals */
|
||||
gtkwidget_class->destroy = gnc_main_window_destroy;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncMainWindowPrivate));
|
||||
|
||||
/**
|
||||
* GncMainWindow::page_added:
|
||||
* @param window: the #GncMainWindow
|
||||
@ -2588,11 +2553,12 @@ gnc_main_window_class_init (GncMainWindowClass *klass)
|
||||
* @param klass A pointer to the class data structure for this
|
||||
* object. */
|
||||
static void
|
||||
gnc_main_window_init (GncMainWindow *window,
|
||||
GncMainWindowClass *klass)
|
||||
gnc_main_window_init (GncMainWindow *window, void *data)
|
||||
{
|
||||
GncMainWindowPrivate *priv;
|
||||
|
||||
GncMainWindowClass *klass = (GncMainWindowClass*)data;
|
||||
|
||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||
priv->merged_actions_table =
|
||||
g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
|
||||
@ -2613,7 +2579,7 @@ gnc_main_window_init (GncMainWindow *window,
|
||||
|
||||
gnc_main_window_setup_window (window);
|
||||
gnc_gobject_tracking_remember(G_OBJECT(window),
|
||||
G_OBJECT_CLASS(klass));
|
||||
G_OBJECT_CLASS(klass));
|
||||
}
|
||||
|
||||
|
||||
|
@ -502,38 +502,6 @@ gnc_period_select_set_property (GObject *object,
|
||||
/** @name GncPeriodSelect Core Implementation
|
||||
@{ */
|
||||
|
||||
/* Returns the GType of a GncPeriodSelect widget.
|
||||
*/
|
||||
GType
|
||||
gnc_period_select_get_type (void)
|
||||
{
|
||||
static GType period_select_type = 0;
|
||||
|
||||
if (period_select_type == 0)
|
||||
{
|
||||
static const GTypeInfo period_select_info =
|
||||
{
|
||||
sizeof (GncPeriodSelectClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_period_select_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPeriodSelect),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_period_select_init,
|
||||
NULL
|
||||
};
|
||||
|
||||
period_select_type = g_type_register_static(GTK_TYPE_BOX,
|
||||
"GncPeriodSelect",
|
||||
&period_select_info, 0);
|
||||
}
|
||||
|
||||
return period_select_type;
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the class for the a Period Selection widget. This
|
||||
* will set up any function pointers that override functions in the
|
||||
* parent class, and also installs the proprieties that are unique to
|
||||
@ -594,10 +562,9 @@ gnc_period_select_class_init (GncPeriodSelectClass *klass)
|
||||
G_MAXINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPeriodSelectPrivate));
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPeriodSelect, gnc_period_select, GTK_TYPE_BOX)
|
||||
|
||||
/** Initialize a new instance of a gnucash accounting period selection
|
||||
* widget. This function allocates and initializes the object
|
||||
|
@ -518,37 +518,6 @@ gnc_plugin_history_list_changed (gpointer prefs,
|
||||
* Object Implementation *
|
||||
************************************************************/
|
||||
|
||||
/* Get the type of a file history plugin. */
|
||||
GType
|
||||
gnc_plugin_file_history_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_file_history_type = 0;
|
||||
|
||||
if (gnc_plugin_file_history_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginFileHistoryClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_file_history_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginFileHistory),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_file_history_init
|
||||
};
|
||||
|
||||
gnc_plugin_file_history_type =
|
||||
g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginFileHistory",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_file_history_type;
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the file history plugin class. */
|
||||
static void
|
||||
gnc_plugin_file_history_class_init (GncPluginFileHistoryClass *klass)
|
||||
@ -573,10 +542,9 @@ gnc_plugin_file_history_class_init (GncPluginFileHistoryClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginFileHistoryPrivate));
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginFileHistory, gnc_plugin_file_history, GNC_TYPE_PLUGIN)
|
||||
|
||||
/** Initialize an instance of the file history plugin. */
|
||||
static void
|
||||
|
@ -59,34 +59,6 @@ static GncPluginManager *singleton = NULL;
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_manager_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_manager_type = 0;
|
||||
|
||||
if (gnc_plugin_manager_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginManagerClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_manager_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginManager),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_manager_init
|
||||
};
|
||||
|
||||
gnc_plugin_manager_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"GncPluginManager",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_manager_type;
|
||||
}
|
||||
|
||||
GncPluginManager *
|
||||
gnc_plugin_manager_get (void)
|
||||
{
|
||||
@ -179,6 +151,7 @@ gnc_plugin_manager_get_plugin (GncPluginManager *manager,
|
||||
return GNC_PLUGIN (g_hash_table_lookup (priv->plugins_table, name));
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginManager, gnc_plugin_manager, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gnc_plugin_manager_class_init (GncPluginManagerClass *klass)
|
||||
@ -190,8 +163,6 @@ gnc_plugin_manager_class_init (GncPluginManagerClass *klass)
|
||||
object_class->dispose = gnc_plugin_manager_dispose;
|
||||
object_class->finalize = gnc_plugin_manager_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginManagerPrivate));
|
||||
|
||||
signals[PLUGIN_ADDED] = g_signal_new ("plugin-added",
|
||||
G_OBJECT_CLASS_TYPE (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
|
@ -89,33 +89,7 @@ typedef struct _GncPluginMenuAdditionsPerWindow
|
||||
* Object Implementation *
|
||||
************************************************************/
|
||||
|
||||
GType
|
||||
gnc_plugin_menu_additions_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_menu_additions_type = 0;
|
||||
|
||||
if (gnc_plugin_menu_additions_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginMenuAdditionsClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_menu_additions_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginMenuAdditions),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_menu_additions_init
|
||||
};
|
||||
|
||||
gnc_plugin_menu_additions_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginMenuAdditions",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_menu_additions_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginMenuAdditions, gnc_plugin_menu_additions, GNC_TYPE_PLUGIN)
|
||||
|
||||
static void
|
||||
gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass)
|
||||
@ -133,8 +107,6 @@ gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass)
|
||||
/* function overrides */
|
||||
plugin_class->add_to_window = gnc_plugin_menu_additions_add_to_window;
|
||||
plugin_class->remove_from_window = gnc_plugin_menu_additions_remove_from_window;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginMenuAdditionsPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -47,7 +47,7 @@ static gpointer parent_class = NULL;
|
||||
|
||||
static void gnc_plugin_page_class_init (GncPluginPageClass *klass);
|
||||
static void gnc_plugin_page_init (GncPluginPage *plugin_page,
|
||||
GncPluginPageClass *klass);
|
||||
void *data);
|
||||
static void gnc_plugin_page_finalize (GObject *object);
|
||||
static void gnc_plugin_page_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
@ -104,39 +104,12 @@ typedef struct _GncPluginPagePrivate
|
||||
gchar *statusbar_text;
|
||||
} GncPluginPagePrivate;
|
||||
|
||||
GNC_DEFINE_TYPE_WITH_CODE(GncPluginPage, gnc_plugin_page, G_TYPE_OBJECT,
|
||||
G_ADD_PRIVATE(GncPluginPage))
|
||||
|
||||
#define GNC_PLUGIN_PAGE_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPagePrivate))
|
||||
|
||||
GType
|
||||
gnc_plugin_page_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_type = 0;
|
||||
|
||||
if (gnc_plugin_page_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
|
||||
sizeof (GncPluginPageClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_page_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginPage),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_page_init,
|
||||
};
|
||||
|
||||
gnc_plugin_page_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"GncPluginPage",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_type;
|
||||
}
|
||||
|
||||
|
||||
/* Create the display widget that corresponds to this plugin. This
|
||||
* function will be called by the main/embedded window manipulation
|
||||
* code to create a widget that they can display. The returned
|
||||
@ -379,7 +352,6 @@ gnc_plugin_page_unselected (GncPluginPage *plugin_page)
|
||||
g_signal_emit (G_OBJECT (plugin_page), signals[UNSELECTED], 0);
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the class for a new generic plugin page. This will set
|
||||
* up any function pointers that override functions in the parent
|
||||
* class, set up all properties and signals, and also configure the
|
||||
@ -400,8 +372,6 @@ gnc_plugin_page_class_init (GncPluginPageClass *klass)
|
||||
klass->tab_icon = NULL;
|
||||
klass->plugin_name = NULL;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPagePrivate));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_PAGE_NAME,
|
||||
@ -533,9 +503,11 @@ gnc_plugin_page_class_init (GncPluginPageClass *klass)
|
||||
* @param klass A pointer to the class data structure for this
|
||||
* object. */
|
||||
static void
|
||||
gnc_plugin_page_init (GncPluginPage *page, GncPluginPageClass *klass)
|
||||
gnc_plugin_page_init (GncPluginPage *page, void *data)
|
||||
{
|
||||
GncPluginPagePrivate *priv;
|
||||
|
||||
GncPluginPageClass *klass = (GncPluginPageClass*)data;
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
|
||||
priv->page_name = NULL;
|
||||
@ -545,7 +517,8 @@ gnc_plugin_page_init (GncPluginPage *page, GncPluginPageClass *klass)
|
||||
page->window = NULL;
|
||||
page->summarybar = NULL;
|
||||
|
||||
gnc_gobject_tracking_remember(G_OBJECT(page), G_OBJECT_CLASS(klass));
|
||||
gnc_gobject_tracking_remember(G_OBJECT(page),
|
||||
G_OBJECT_CLASS(klass));
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ static gpointer parent_class = NULL;
|
||||
|
||||
static void gnc_plugin_class_init (GncPluginClass *klass);
|
||||
static void gnc_plugin_init (GncPlugin *plugin_page,
|
||||
GncPluginClass *klass);
|
||||
void *data);
|
||||
static void gnc_plugin_finalize (GObject *object);
|
||||
|
||||
|
||||
@ -61,41 +61,12 @@ typedef struct GncPluginPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginPrivate;
|
||||
|
||||
GNC_DEFINE_TYPE_WITH_CODE(GncPlugin, gnc_plugin, G_TYPE_OBJECT,
|
||||
G_ADD_PRIVATE(GncPlugin))
|
||||
|
||||
#define GNC_PLUGIN_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN, GncPluginPrivate))
|
||||
|
||||
|
||||
/** Get the type of a gnc window plugin.
|
||||
*/
|
||||
GType
|
||||
gnc_plugin_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_type = 0;
|
||||
|
||||
if (gnc_plugin_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPlugin),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_init,
|
||||
};
|
||||
|
||||
gnc_plugin_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
GNC_PLUGIN_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_type;
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the class for the new gnucash plugin object. This will
|
||||
* set up any function pointers that override functions in the parent
|
||||
* class, and also installs the proprieties that are unique to this
|
||||
@ -110,8 +81,6 @@ gnc_plugin_class_init (GncPluginClass *klass)
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
gobject_class->finalize = gnc_plugin_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPrivate));
|
||||
}
|
||||
|
||||
|
||||
@ -124,8 +93,10 @@ gnc_plugin_class_init (GncPluginClass *klass)
|
||||
* @param klass A pointer to the class data structure for this
|
||||
* object. */
|
||||
static void
|
||||
gnc_plugin_init (GncPlugin *plugin_page, GncPluginClass *klass)
|
||||
gnc_plugin_init (GncPlugin *plugin_page, void *data)
|
||||
{
|
||||
GncPluginClass *klass = (GncPluginClass*)data;
|
||||
|
||||
gnc_gobject_tracking_remember(G_OBJECT(plugin_page), \
|
||||
G_OBJECT_CLASS(klass));
|
||||
}
|
||||
|
@ -44,16 +44,16 @@ enum
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
typedef struct _GNCQueryViewPriv GNCQueryViewPriv;
|
||||
typedef struct _GNCQueryViewPrivate GNCQueryViewPrivate;
|
||||
|
||||
struct _GNCQueryViewPriv
|
||||
struct _GNCQueryViewPrivate
|
||||
{
|
||||
const QofParam *get_guid;
|
||||
gint component_id;
|
||||
};
|
||||
|
||||
#define GNC_QUERY_VIEW_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_QUERY_VIEW, GNCQueryViewPriv))
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_QUERY_VIEW, GNCQueryViewPrivate))
|
||||
|
||||
/** Static Globals ****************************************************/
|
||||
static GtkTreeViewClass *parent_class = NULL;
|
||||
@ -76,34 +76,6 @@ static void gnc_query_view_fill (GNCQueryView *qview);
|
||||
static void gnc_query_view_set_query_sort (GNCQueryView *qview, gboolean new_column);
|
||||
|
||||
|
||||
GType
|
||||
gnc_query_view_get_type (void)
|
||||
{
|
||||
static GType gnc_query_view_type = 0;
|
||||
|
||||
if (!gnc_query_view_type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCQueryViewClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_query_view_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GNCQueryView), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_query_view_init,
|
||||
};
|
||||
|
||||
gnc_query_view_type = g_type_register_static (GTK_TYPE_TREE_VIEW,
|
||||
"GNCQueryView",
|
||||
&type_info, 0);
|
||||
}
|
||||
return gnc_query_view_type;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_query_view_new *
|
||||
* creates the query view *
|
||||
@ -115,7 +87,7 @@ gnc_query_view_get_type (void)
|
||||
void
|
||||
gnc_query_view_construct (GNCQueryView *qview, GList *param_list, Query *query)
|
||||
{
|
||||
GNCQueryViewPriv *priv;
|
||||
GNCQueryViewPrivate *priv;
|
||||
|
||||
g_return_if_fail (qview);
|
||||
g_return_if_fail (param_list);
|
||||
@ -212,11 +184,12 @@ gnc_query_view_refresh_handler (GHashTable *changes, gpointer user_data)
|
||||
gnc_query_view_set_query_sort (qview, TRUE);
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCQueryView, gnc_query_view, GTK_TYPE_TREE_VIEW)
|
||||
|
||||
static void
|
||||
gnc_query_view_init (GNCQueryView *qview)
|
||||
{
|
||||
GNCQueryViewPriv *priv;
|
||||
GNCQueryViewPrivate *priv;
|
||||
|
||||
// Set the style context for this dialog so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(qview), "GncQueryView");
|
||||
@ -428,8 +401,6 @@ gnc_query_view_class_init (GNCQueryViewClass *klass)
|
||||
|
||||
parent_class = g_type_class_peek (GTK_TYPE_TREE_VIEW);
|
||||
|
||||
g_type_class_add_private (klass, sizeof(GNCQueryViewPriv));
|
||||
|
||||
query_view_signals[COLUMN_TOGGLED] =
|
||||
g_signal_new("column_toggled",
|
||||
G_TYPE_FROM_CLASS (widget_class),
|
||||
@ -543,7 +514,7 @@ static void
|
||||
gnc_query_view_destroy (GtkWidget *widget)
|
||||
{
|
||||
GNCQueryView *qview = GNC_QUERY_VIEW (widget);
|
||||
GNCQueryViewPriv *priv;
|
||||
GNCQueryViewPrivate *priv;
|
||||
|
||||
priv = GNC_QUERY_VIEW_GET_PRIVATE (qview);
|
||||
if (priv->component_id > 0)
|
||||
@ -765,7 +736,7 @@ gnc_query_view_set_query_sort (GNCQueryView *qview, gboolean new_column)
|
||||
static void
|
||||
gnc_query_view_fill (GNCQueryView *qview)
|
||||
{
|
||||
GNCQueryViewPriv *priv;
|
||||
GNCQueryViewPrivate *priv;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
GList *entries, *item;
|
||||
|
@ -61,44 +61,10 @@ typedef struct GncTreeModelAccountTypesPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_model_account_types_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_model_account_types_type = 0;
|
||||
|
||||
if (gnc_tree_model_account_types_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeModelAccountTypesClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_model_account_types_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeModelAccountTypes),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_model_account_types_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo tree_model_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_tree_model_account_types_tree_model_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_tree_model_account_types_type =
|
||||
g_type_register_static (G_TYPE_OBJECT,
|
||||
"GncTreeModelAccountTypes",
|
||||
&our_info, 0);
|
||||
|
||||
g_type_add_interface_static (gnc_tree_model_account_types_type,
|
||||
GTK_TYPE_TREE_MODEL, &tree_model_info);
|
||||
}
|
||||
|
||||
return gnc_tree_model_account_types_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_CODE(GncTreeModelAccountTypes, gnc_tree_model_account_types, G_TYPE_OBJECT,
|
||||
G_ADD_PRIVATE(GncTreeModelAccountTypes)
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
|
||||
gnc_tree_model_account_types_tree_model_init))
|
||||
|
||||
static void
|
||||
gnc_tree_model_account_types_class_init (GncTreeModelAccountTypesClass * klass)
|
||||
@ -108,8 +74,6 @@ gnc_tree_model_account_types_class_init (GncTreeModelAccountTypesClass * klass)
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gnc_tree_model_account_types_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeModelAccountTypesPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -144,44 +144,10 @@ gnc_tree_model_account_update_color (gpointer gsettings, gchar *key, gpointer us
|
||||
/** A pointer to the parent class of an account tree model. */
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_model_account_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_model_account_type = 0;
|
||||
|
||||
if (gnc_tree_model_account_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeModelAccountClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_tree_model_account_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncTreeModelAccount), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_tree_model_account_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo tree_model_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_tree_model_account_tree_model_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_tree_model_account_type = g_type_register_static (GNC_TYPE_TREE_MODEL,
|
||||
GNC_TREE_MODEL_ACCOUNT_NAME,
|
||||
&our_info, 0);
|
||||
|
||||
g_type_add_interface_static (gnc_tree_model_account_type,
|
||||
GTK_TYPE_TREE_MODEL,
|
||||
&tree_model_info);
|
||||
}
|
||||
|
||||
return gnc_tree_model_account_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_CODE (GncTreeModelAccount, gnc_tree_model_account, GNC_TYPE_TREE_MODEL,
|
||||
G_ADD_PRIVATE (GncTreeModelAccount)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
|
||||
gnc_tree_model_account_tree_model_init))
|
||||
|
||||
static void
|
||||
gnc_tree_model_account_class_init (GncTreeModelAccountClass *klass)
|
||||
@ -195,8 +161,6 @@ gnc_tree_model_account_class_init (GncTreeModelAccountClass *klass)
|
||||
/* GObject signals */
|
||||
o_class->finalize = gnc_tree_model_account_finalize;
|
||||
o_class->dispose = gnc_tree_model_account_dispose;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeModelAccountPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -106,44 +106,10 @@ typedef struct GncTreeModelCommodityPrivate
|
||||
/** A pointer to the parent class of a commodity tree model. */
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_model_commodity_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_model_commodity_type = 0;
|
||||
|
||||
if (gnc_tree_model_commodity_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeModelCommodityClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_model_commodity_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeModelCommodity),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_model_commodity_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo tree_model_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_tree_model_commodity_tree_model_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_tree_model_commodity_type = g_type_register_static (GNC_TYPE_TREE_MODEL,
|
||||
GNC_TREE_MODEL_COMMODITY_NAME,
|
||||
&our_info, 0);
|
||||
|
||||
g_type_add_interface_static (gnc_tree_model_commodity_type,
|
||||
GTK_TYPE_TREE_MODEL,
|
||||
&tree_model_info);
|
||||
}
|
||||
|
||||
return gnc_tree_model_commodity_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_CODE(GncTreeModelCommodity, gnc_tree_model_commodity, GNC_TYPE_TREE_MODEL,
|
||||
G_ADD_PRIVATE(GncTreeModelCommodity)
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
|
||||
gnc_tree_model_commodity_tree_model_init))
|
||||
|
||||
static void
|
||||
gnc_tree_model_commodity_class_init (GncTreeModelCommodityClass *klass)
|
||||
@ -154,8 +120,6 @@ gnc_tree_model_commodity_class_init (GncTreeModelCommodityClass *klass)
|
||||
|
||||
o_class->finalize = gnc_tree_model_commodity_finalize;
|
||||
o_class->dispose = gnc_tree_model_commodity_dispose;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeModelCommodityPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -132,45 +132,6 @@ gnc_tree_model_owner_update_color (gpointer gsettings, gchar *key, gpointer user
|
||||
/** A pointer to the parent class of an owner tree model. */
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_model_owner_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_model_owner_type = 0;
|
||||
|
||||
if (gnc_tree_model_owner_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeModelOwnerClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_tree_model_owner_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncTreeModelOwner), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_tree_model_owner_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo tree_model_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_tree_model_owner_tree_model_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_tree_model_owner_type = g_type_register_static (GNC_TYPE_TREE_MODEL,
|
||||
GNC_TREE_MODEL_OWNER_NAME,
|
||||
&our_info, 0);
|
||||
|
||||
g_type_add_interface_static (gnc_tree_model_owner_type,
|
||||
GTK_TYPE_TREE_MODEL,
|
||||
&tree_model_info);
|
||||
}
|
||||
|
||||
return gnc_tree_model_owner_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_tree_model_owner_class_init (GncTreeModelOwnerClass *klass)
|
||||
{
|
||||
@ -183,10 +144,13 @@ gnc_tree_model_owner_class_init (GncTreeModelOwnerClass *klass)
|
||||
/* GObject signals */
|
||||
o_class->finalize = gnc_tree_model_owner_finalize;
|
||||
o_class->dispose = gnc_tree_model_owner_dispose;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeModelOwnerPrivate));
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE(GncTreeModelOwner, gnc_tree_model_owner, GNC_TYPE_TREE_MODEL,
|
||||
G_ADD_PRIVATE(GncTreeModelOwner)
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
|
||||
gnc_tree_model_owner_tree_model_init))
|
||||
|
||||
static void
|
||||
gnc_tree_model_owner_init (GncTreeModelOwner *model)
|
||||
{
|
||||
|
@ -137,44 +137,10 @@ typedef struct GncTreeModelPricePrivate
|
||||
/** A pointer to the parent class of a price tree model. */
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_model_price_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_model_price_type = 0;
|
||||
|
||||
if (gnc_tree_model_price_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeModelPriceClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_model_price_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeModelPrice),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_model_price_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo tree_model_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_tree_model_price_tree_model_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_tree_model_price_type = g_type_register_static (GNC_TYPE_TREE_MODEL,
|
||||
GNC_TREE_MODEL_PRICE_NAME,
|
||||
&our_info, 0);
|
||||
|
||||
g_type_add_interface_static (gnc_tree_model_price_type,
|
||||
GTK_TYPE_TREE_MODEL,
|
||||
&tree_model_info);
|
||||
}
|
||||
|
||||
return gnc_tree_model_price_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_CODE(GncTreeModelPrice, gnc_tree_model_price, GNC_TYPE_TREE_MODEL,
|
||||
G_ADD_PRIVATE(GncTreeModelPrice)
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
|
||||
gnc_tree_model_price_tree_model_init))
|
||||
|
||||
static void
|
||||
gnc_tree_model_price_class_init (GncTreeModelPriceClass *klass)
|
||||
@ -185,8 +151,6 @@ gnc_tree_model_price_class_init (GncTreeModelPriceClass *klass)
|
||||
|
||||
o_class->finalize = gnc_tree_model_price_finalize;
|
||||
o_class->dispose = gnc_tree_model_price_dispose;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeModelPricePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -101,44 +101,10 @@ typedef struct GncTreeModelSelectionPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_model_selection_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_model_selection_type = 0;
|
||||
|
||||
if (gnc_tree_model_selection_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeModelSelectionClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_model_selection_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeModelSelection),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_model_selection_init
|
||||
};
|
||||
|
||||
static const GInterfaceInfo tree_model_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gnc_tree_model_selection_tree_model_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
gnc_tree_model_selection_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"GncTreeModelSelection",
|
||||
&our_info, 0);
|
||||
|
||||
g_type_add_interface_static (gnc_tree_model_selection_type,
|
||||
GTK_TYPE_TREE_MODEL,
|
||||
&tree_model_info);
|
||||
}
|
||||
|
||||
return gnc_tree_model_selection_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_CODE(GncTreeModelSelection, gnc_tree_model_selection, G_TYPE_OBJECT
|
||||
G_ADD_PRIVATE(GncTreeModelSelection)
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
|
||||
gnc_tree_model_selection_tree_model_init))
|
||||
|
||||
static void
|
||||
gnc_tree_model_selection_class_init (GncTreeModelSelectionClass *klass)
|
||||
@ -148,8 +114,6 @@ gnc_tree_model_selection_class_init (GncTreeModelSelectionClass *klass)
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gnc_tree_model_selection_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeModelSelectionPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -37,7 +37,8 @@ static QofLogModule log_module = GNC_MOD_GUI;
|
||||
|
||||
/** Declarations *********************************************************/
|
||||
static void gnc_tree_model_class_init (GncTreeModelClass *klass);
|
||||
static void gnc_tree_model_init (GncTreeModel *model, GncTreeModelClass *klass);
|
||||
static void gnc_tree_model_init (GncTreeModel *model,
|
||||
void *data);
|
||||
static void gnc_tree_model_finalize (GObject *object);
|
||||
|
||||
/** The instance private data for a generic tree model. */
|
||||
@ -46,6 +47,9 @@ typedef struct GncTreeModelPrivate
|
||||
gpointer dummy;
|
||||
} GncTreeModelPrivate;
|
||||
|
||||
GNC_DEFINE_TYPE_WITH_CODE(GncTreeModel, gnc_tree_model, G_TYPE_OBJECT,
|
||||
G_ADD_PRIVATE(GncTreeModel))
|
||||
|
||||
#define GNC_TREE_MODEL_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL, GncTreeModelPrivate))
|
||||
|
||||
@ -57,44 +61,6 @@ typedef struct GncTreeModelPrivate
|
||||
/** A pointer to the parent class of a generic tree model. */
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_model_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_model_type = 0;
|
||||
|
||||
if (gnc_tree_model_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeModelClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_tree_model_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncTreeModel), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_tree_model_init
|
||||
};
|
||||
|
||||
//static const GInterfaceInfo tree_model_info = {
|
||||
// (GInterfaceInitFunc) gnc_tree_model_tree_model_init,
|
||||
// NULL,
|
||||
// NULL
|
||||
//};
|
||||
|
||||
gnc_tree_model_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
GNC_TREE_MODEL_NAME,
|
||||
&our_info, 0);
|
||||
|
||||
//g_type_add_interface_static (gnc_tree_model_type,
|
||||
// GTK_TYPE_TREE_MODEL,
|
||||
// &tree_model_info);
|
||||
}
|
||||
|
||||
return gnc_tree_model_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_tree_model_class_init (GncTreeModelClass *klass)
|
||||
{
|
||||
@ -106,15 +72,16 @@ gnc_tree_model_class_init (GncTreeModelClass *klass)
|
||||
|
||||
/* GObject signals */
|
||||
o_class->finalize = gnc_tree_model_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeModelPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_tree_model_init (GncTreeModel *model, GncTreeModelClass *klass)
|
||||
gnc_tree_model_init (GncTreeModel *model, void *data)
|
||||
{
|
||||
GncTreeModelClass *klass = (GncTreeModelClass*)data;
|
||||
|
||||
ENTER("model %p", model);
|
||||
gnc_gobject_tracking_remember(G_OBJECT(model), G_OBJECT_CLASS(klass));
|
||||
gnc_gobject_tracking_remember(G_OBJECT(model),
|
||||
G_OBJECT_CLASS(klass));
|
||||
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
@ -124,33 +124,7 @@ typedef struct GncTreeViewAccountPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_view_account_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_view_account_type = 0;
|
||||
|
||||
if (gnc_tree_view_account_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeViewAccountClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_view_account_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeViewAccount),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_view_account_init
|
||||
};
|
||||
|
||||
gnc_tree_view_account_type = g_type_register_static (
|
||||
GNC_TYPE_TREE_VIEW, GNC_TREE_VIEW_ACCOUNT_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_tree_view_account_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewAccount, gnc_tree_view_account, GNC_TYPE_TREE_VIEW)
|
||||
|
||||
static void
|
||||
gnc_tree_view_account_class_init (GncTreeViewAccountClass *klass)
|
||||
@ -163,8 +137,6 @@ gnc_tree_view_account_class_init (GncTreeViewAccountClass *klass)
|
||||
o_class = G_OBJECT_CLASS (klass);
|
||||
o_class->finalize = gnc_tree_view_account_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeViewAccountPrivate));
|
||||
|
||||
gnc_hook_add_dangler(HOOK_CURRENCY_CHANGED,
|
||||
(GFunc)gtva_currency_changed_cb, NULL);
|
||||
}
|
||||
|
@ -67,33 +67,7 @@ typedef struct GncTreeViewCommodityPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_view_commodity_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_view_commodity_type = 0;
|
||||
|
||||
if (gnc_tree_view_commodity_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeViewCommodityClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_view_commodity_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeViewCommodity),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_view_commodity_init
|
||||
};
|
||||
|
||||
gnc_tree_view_commodity_type = g_type_register_static (GNC_TYPE_TREE_VIEW,
|
||||
"GncTreeViewCommodity",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_tree_view_commodity_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewCommodity, gnc_tree_view_commodity, GNC_TYPE_TREE_VIEW)
|
||||
|
||||
static void
|
||||
gnc_tree_view_commodity_class_init (GncTreeViewCommodityClass *klass)
|
||||
@ -111,8 +85,6 @@ gnc_tree_view_commodity_class_init (GncTreeViewCommodityClass *klass)
|
||||
|
||||
/* GtkWidget signals */
|
||||
widget_class->destroy = gnc_tree_view_commodity_destroy;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeViewCommodityPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -96,33 +96,7 @@ typedef struct GncTreeViewOwnerPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_view_owner_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_view_owner_type = 0;
|
||||
|
||||
if (gnc_tree_view_owner_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeViewOwnerClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_view_owner_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeViewOwner),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_view_owner_init
|
||||
};
|
||||
|
||||
gnc_tree_view_owner_type = g_type_register_static (
|
||||
GNC_TYPE_TREE_VIEW, GNC_TREE_VIEW_OWNER_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_tree_view_owner_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewOwner, gnc_tree_view_owner, GNC_TYPE_TREE_VIEW)
|
||||
|
||||
static void
|
||||
gnc_tree_view_owner_class_init (GncTreeViewOwnerClass *klass)
|
||||
@ -135,8 +109,6 @@ gnc_tree_view_owner_class_init (GncTreeViewOwnerClass *klass)
|
||||
o_class = G_OBJECT_CLASS (klass);
|
||||
o_class->finalize = gnc_tree_view_owner_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeViewOwnerPrivate));
|
||||
|
||||
gnc_hook_add_dangler(HOOK_CURRENCY_CHANGED,
|
||||
(GFunc)gtvo_currency_changed_cb, NULL);
|
||||
}
|
||||
|
@ -67,33 +67,7 @@ typedef struct GncTreeViewPricePrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_view_price_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_view_price_type = 0;
|
||||
|
||||
if (gnc_tree_view_price_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeViewPriceClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_view_price_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeViewPrice),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_view_price_init
|
||||
};
|
||||
|
||||
gnc_tree_view_price_type = g_type_register_static (GNC_TYPE_TREE_VIEW,
|
||||
"GncTreeViewPrice",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_tree_view_price_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewPrice, gnc_tree_view_price, GNC_TYPE_TREE_VIEW)
|
||||
|
||||
static void
|
||||
gnc_tree_view_price_class_init (GncTreeViewPriceClass *klass)
|
||||
@ -111,8 +85,6 @@ gnc_tree_view_price_class_init (GncTreeViewPriceClass *klass)
|
||||
|
||||
/* GtkWidget signals */
|
||||
widget_class->destroy = gnc_tree_view_price_destroy;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeViewPricePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -305,33 +305,7 @@ struct GncTreeViewSplitRegPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_view_split_reg_get_type(void)
|
||||
{
|
||||
static GType gnc_tree_view_split_reg_type = 0;
|
||||
|
||||
if (gnc_tree_view_split_reg_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeViewSplitRegClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_view_split_reg_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeViewSplitReg),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_view_split_reg_init
|
||||
};
|
||||
|
||||
gnc_tree_view_split_reg_type = g_type_register_static (GNC_TYPE_TREE_VIEW,
|
||||
"GncTreeViewSplitReg",
|
||||
&our_info, 0);
|
||||
}
|
||||
return gnc_tree_view_split_reg_type;
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewSplitReg, gnc_tree_view_split_reg, GNC_TYPE_TREE_VIEW)
|
||||
|
||||
static void
|
||||
gnc_tree_view_split_reg_class_init (GncTreeViewSplitRegClass *klass)
|
||||
@ -345,8 +319,6 @@ gnc_tree_view_split_reg_class_init (GncTreeViewSplitRegClass *klass)
|
||||
o_class->dispose = gnc_tree_view_split_reg_dispose;
|
||||
o_class->finalize = gnc_tree_view_split_reg_finalize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof(GncTreeViewSplitRegPrivate));
|
||||
|
||||
gnc_tree_view_split_reg_signals[UPDATE_SIGNAL] =
|
||||
g_signal_new("update_signal",
|
||||
G_TYPE_FROM_CLASS (o_class),
|
||||
|
@ -63,33 +63,7 @@ typedef struct GncTreeViewSxListPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_tree_view_sx_list_get_type(void)
|
||||
{
|
||||
static GType gnc_tree_view_sx_list_type = 0;
|
||||
|
||||
if (gnc_tree_view_sx_list_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeViewSxListClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_view_sx_list_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeViewSxList),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_view_sx_list_init
|
||||
};
|
||||
|
||||
gnc_tree_view_sx_list_type = g_type_register_static (GNC_TYPE_TREE_VIEW,
|
||||
"GncTreeViewSxList",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_tree_view_sx_list_type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewSxList, gnc_tree_view_sx_list, GNC_TYPE_TREE_VIEW)
|
||||
|
||||
static void
|
||||
gnc_tree_view_sx_list_class_init(GncTreeViewSxListClass *klass)
|
||||
@ -102,8 +76,6 @@ gnc_tree_view_sx_list_class_init(GncTreeViewSxListClass *klass)
|
||||
|
||||
o_class->dispose = gnc_tree_view_sx_list_dispose;
|
||||
o_class->finalize = gnc_tree_view_sx_list_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeViewSxListPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -77,7 +77,8 @@ static QofLogModule log_module = GNC_MOD_GUI;
|
||||
|
||||
/**** Declarations ******************************************************/
|
||||
static void gnc_tree_view_class_init (GncTreeViewClass *klass);
|
||||
static void gnc_tree_view_init (GncTreeView *view, GncTreeViewClass *klass);
|
||||
static void gnc_tree_view_init (GncTreeView *view,
|
||||
void *data);
|
||||
static void gnc_tree_view_finalize (GObject *object);
|
||||
static void gnc_tree_view_destroy (GtkWidget *widget);
|
||||
static void gnc_tree_view_set_property (GObject *object,
|
||||
@ -130,6 +131,9 @@ typedef struct GncTreeViewPrivate
|
||||
gulong size_allocate_cb_id;
|
||||
} GncTreeViewPrivate;
|
||||
|
||||
GNC_DEFINE_TYPE_WITH_CODE(GncTreeView, gnc_tree_view, GTK_TYPE_TREE_VIEW,
|
||||
G_ADD_PRIVATE(GncTreeView))
|
||||
|
||||
#define GNC_TREE_VIEW_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW, GncTreeViewPrivate))
|
||||
|
||||
@ -143,40 +147,6 @@ typedef struct GncTreeViewPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
/** Create a new glib type for the base gnucash tree view.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @return The new type value.
|
||||
*/
|
||||
GType
|
||||
gnc_tree_view_get_type (void)
|
||||
{
|
||||
static GType gnc_tree_view_type = 0;
|
||||
|
||||
if (gnc_tree_view_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncTreeViewClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_tree_view_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncTreeView),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_tree_view_init
|
||||
};
|
||||
|
||||
gnc_tree_view_type = g_type_register_static (GTK_TYPE_TREE_VIEW,
|
||||
GNC_TREE_VIEW_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_tree_view_type;
|
||||
}
|
||||
|
||||
/** Initialize the class for the new base gnucash tree view. This
|
||||
* will set up any function pointers that override functions in the
|
||||
* parent class, and also installs the properties that are unique to
|
||||
@ -200,8 +170,6 @@ gnc_tree_view_class_init (GncTreeViewClass *klass)
|
||||
gobject_class->set_property = gnc_tree_view_set_property;
|
||||
gobject_class->get_property = gnc_tree_view_get_property;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncTreeViewPrivate));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_STATE_SECTION,
|
||||
g_param_spec_string ("state-section",
|
||||
@ -241,14 +209,17 @@ gnc_tree_view_update_grid_lines (gpointer prefs, gchar* pref, gpointer user_data
|
||||
* @internal
|
||||
*/
|
||||
static void
|
||||
gnc_tree_view_init (GncTreeView *view, GncTreeViewClass *klass)
|
||||
gnc_tree_view_init (GncTreeView *view, void *data)
|
||||
{
|
||||
GncTreeViewPrivate *priv;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkWidget *icon;
|
||||
GtkRequisition requisition;
|
||||
|
||||
gnc_gobject_tracking_remember(G_OBJECT(view), G_OBJECT_CLASS(klass));
|
||||
GncTreeViewClass *klass = (GncTreeViewClass*)data;
|
||||
|
||||
gnc_gobject_tracking_remember(G_OBJECT(view),
|
||||
G_OBJECT_CLASS(klass));
|
||||
|
||||
priv = GNC_TREE_VIEW_GET_PRIVATE(view);
|
||||
priv->column_menu = NULL;
|
||||
|
@ -95,32 +95,8 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
||||
#endif
|
||||
|
||||
/* Base class */
|
||||
GType
|
||||
gnc_search_param_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
static GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchParamClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc)gnc_search_param_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof(GNCSearchParam),
|
||||
0,
|
||||
(GInstanceInitFunc)gnc_search_param_init
|
||||
};
|
||||
|
||||
type = g_type_register_static (G_TYPE_OBJECT, "GNCSearchParam",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchParam, gnc_search_param, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gnc_search_param_class_init (GNCSearchParamClass *klass)
|
||||
@ -130,8 +106,6 @@ gnc_search_param_class_init (GNCSearchParamClass *klass)
|
||||
parent_gobject_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gnc_search_param_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchParamPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -149,32 +123,8 @@ gnc_search_param_finalize (GObject *obj)
|
||||
}
|
||||
|
||||
/* subclass for simple searches of a single element */
|
||||
GType
|
||||
gnc_search_param_simple_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
static GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchParamSimpleClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc)gnc_search_param_simple_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof(GNCSearchParamSimple),
|
||||
0,
|
||||
(GInstanceInitFunc)gnc_search_param_simple_init
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_PARAM, "GNCSearchParamSimple",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchParamSimple, gnc_search_param_simple, GNC_TYPE_SEARCH_PARAM)
|
||||
|
||||
static void
|
||||
gnc_search_param_simple_class_init (GNCSearchParamSimpleClass *klass)
|
||||
@ -184,8 +134,6 @@ gnc_search_param_simple_class_init (GNCSearchParamSimpleClass *klass)
|
||||
parent_search_param_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gnc_search_param_simple_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchParamSimplePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -214,32 +162,8 @@ gnc_search_param_simple_finalize (GObject *obj)
|
||||
}
|
||||
|
||||
/* Subclass for compound searches consisting of AND/OR of several elements */
|
||||
GType
|
||||
gnc_search_param_compound_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
static GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchParamCompoundClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc)gnc_search_param_compound_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof(GNCSearchParamCompound),
|
||||
0,
|
||||
(GInstanceInitFunc)gnc_search_param_compound_init
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_PARAM, "GNCSearchParamCompound",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchParamCompound, gnc_search_param_compound, GNC_TYPE_SEARCH_PARAM)
|
||||
|
||||
static void
|
||||
gnc_search_param_compound_class_init (GNCSearchParamCompoundClass *klass)
|
||||
@ -249,8 +173,6 @@ gnc_search_param_compound_class_init (GNCSearchParamCompoundClass *klass)
|
||||
parent_search_param_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gnc_search_param_compound_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchParamCompoundPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -170,11 +170,11 @@ struct GncBudgetViewPrivate
|
||||
Account* rootAcct;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncBudgetView, gnc_budget_view, GTK_TYPE_BOX)
|
||||
|
||||
#define GNC_BUDGET_VIEW_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_BUDGET_VIEW, GncBudgetViewPrivate))
|
||||
|
||||
G_DEFINE_TYPE(GncBudgetView, gnc_budget_view, GTK_TYPE_BOX)
|
||||
|
||||
/** \brief Create new gnc budget view.
|
||||
|
||||
As the name suggests, this creates a new gnc budget view.
|
||||
@ -212,8 +212,6 @@ gnc_budget_view_class_init(GncBudgetViewClass *klass)
|
||||
|
||||
g_signal_new("account-activated", GNC_TYPE_BUDGET_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1, GNC_TYPE_ACCOUNT);
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncBudgetViewPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -73,43 +73,14 @@ typedef struct GncPluginAccountTreePrivate
|
||||
gpointer dummy;
|
||||
} GncPluginAccountTreePrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_ACCOUNT_TREE, GncPluginAccountTreePrivate))
|
||||
|
||||
/** A pointer to the parent class of a plugin page. */
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
/* Get the type of the account tree menu plugin. */
|
||||
GType
|
||||
gnc_plugin_account_tree_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_account_tree_type = 0;
|
||||
|
||||
if (gnc_plugin_account_tree_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginAccountTreeClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_account_tree_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginAccountTree),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_account_tree_init
|
||||
};
|
||||
|
||||
gnc_plugin_account_tree_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginAccountTree",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_account_tree_type;
|
||||
}
|
||||
|
||||
|
||||
/* Create a new account tree menu plugin. */
|
||||
GncPlugin *
|
||||
gnc_plugin_account_tree_new (void)
|
||||
@ -126,7 +97,6 @@ gnc_plugin_account_tree_new (void)
|
||||
return GNC_PLUGIN (plugin);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gnc_plugin_account_tree_main_window_page_changed (GncMainWindow *window,
|
||||
GncPluginPage *plugin_page, gpointer user_data)
|
||||
@ -148,7 +118,6 @@ gnc_plugin_account_tree_main_window_page_changed (GncMainWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the class for a new account tree plugin. This will set
|
||||
* up any function pointers that override functions in the parent
|
||||
* class, and also configure the private data storage for this
|
||||
@ -177,8 +146,6 @@ gnc_plugin_account_tree_class_init (GncPluginAccountTreeClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginAccountTreePrivate));
|
||||
}
|
||||
|
||||
|
||||
|
@ -275,37 +275,6 @@ typedef struct GncPluginBasicCommandsPrivate
|
||||
/** A pointer to the parent class of a plugin page. */
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
/* Get the type of the basic commands menu plugin. */
|
||||
GType
|
||||
gnc_plugin_basic_commands_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_basic_commands_type = 0;
|
||||
|
||||
if (gnc_plugin_basic_commands_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginBasicCommandsClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_basic_commands_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginBasicCommands),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_basic_commands_init
|
||||
};
|
||||
|
||||
gnc_plugin_basic_commands_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginBasicCommands",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_basic_commands_type;
|
||||
}
|
||||
|
||||
|
||||
/** Create a new basic commands menu plugin. */
|
||||
GncPlugin *
|
||||
gnc_plugin_basic_commands_new (void)
|
||||
@ -385,6 +354,8 @@ gnc_plugin_basic_commands_main_window_page_changed(GncMainWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBasicCommands, gnc_plugin_basic_commands, GNC_TYPE_PLUGIN)
|
||||
|
||||
/** Initialize the class for a new basic commands plugin. This will
|
||||
* set up any function pointers that override functions in the parent
|
||||
* class, and also configure the private data storage for this
|
||||
@ -414,8 +385,6 @@ gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass)
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->important_actions = gnc_plugin_important_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginBasicCommandsPrivate));
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,33 +87,6 @@ typedef struct GncPluginBudgetPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_budget_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_budget_type = 0;
|
||||
|
||||
if (!gnc_plugin_budget_type)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginBudgetClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_budget_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginBudget),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_budget_init
|
||||
};
|
||||
|
||||
gnc_plugin_budget_type = g_type_register_static(
|
||||
GNC_TYPE_PLUGIN, "GncPluginBudget", &our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_budget_type;
|
||||
}
|
||||
|
||||
GncPlugin * gnc_plugin_budget_new (void)
|
||||
{
|
||||
GncPluginBudget *plugin;
|
||||
@ -149,6 +122,8 @@ gnc_plugin_budget_main_window_page_changed (GncMainWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBudget, gnc_plugin_budget, GNC_TYPE_PLUGIN)
|
||||
|
||||
static void
|
||||
gnc_plugin_budget_class_init (GncPluginBudgetClass *klass)
|
||||
{
|
||||
@ -168,7 +143,6 @@ gnc_plugin_budget_class_init (GncPluginBudgetClass *klass)
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginBudgetPrivate));
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
|
@ -344,34 +344,6 @@ typedef struct GncPluginBusinessPrivate
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_business_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_business_type = 0;
|
||||
|
||||
if (gnc_plugin_business_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginBusinessClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_business_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginBusiness),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_business_init
|
||||
};
|
||||
|
||||
gnc_plugin_business_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginBusiness",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_business_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_business_new (void)
|
||||
{
|
||||
@ -388,6 +360,8 @@ gnc_plugin_business_new (void)
|
||||
return GNC_PLUGIN (plugin);
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBusiness, gnc_plugin_business, GNC_TYPE_PLUGIN)
|
||||
|
||||
static void
|
||||
gnc_plugin_business_class_init (GncPluginBusinessClass *klass)
|
||||
{
|
||||
@ -409,8 +383,6 @@ gnc_plugin_business_class_init (GncPluginBusinessClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginBusinessPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -368,35 +368,6 @@ static action_toolbar_labels toolbar_labels[] =
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
|
||||
GType
|
||||
gnc_plugin_page_account_tree_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_account_tree_type = 0;
|
||||
|
||||
if (gnc_plugin_page_account_tree_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageAccountTreeClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_account_tree_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageAccountTree),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_account_tree_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_account_tree_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_account_tree_type;
|
||||
}
|
||||
|
||||
GncPluginPage *
|
||||
gnc_plugin_page_account_tree_new (void)
|
||||
{
|
||||
@ -410,6 +381,8 @@ gnc_plugin_page_account_tree_new (void)
|
||||
return GNC_PLUGIN_PAGE (plugin_page);
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageAccountTree, gnc_plugin_page_account_tree, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
static void
|
||||
gnc_plugin_page_account_tree_class_init (GncPluginPageAccountTreeClass *klass)
|
||||
{
|
||||
@ -427,8 +400,6 @@ gnc_plugin_page_account_tree_class_init (GncPluginPageAccountTreeClass *klass)
|
||||
gnc_plugin_class->save_page = gnc_plugin_page_account_tree_save_page;
|
||||
gnc_plugin_class->recreate_page = gnc_plugin_page_account_tree_recreate_page;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageAccountTreePrivate));
|
||||
|
||||
plugin_page_signals[ACCOUNT_SELECTED] =
|
||||
g_signal_new ("account_selected",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
@ -475,10 +446,10 @@ gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page)
|
||||
/* Is this the first accounts page? */
|
||||
page_list =
|
||||
gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME);
|
||||
if (plugin_page == page_list->data)
|
||||
if (!page_list || plugin_page == page_list->data)
|
||||
{
|
||||
g_object_set_data(G_OBJECT(plugin_page), PLUGIN_PAGE_IMMUTABLE,
|
||||
GINT_TO_POINTER(1));
|
||||
GINT_TO_POINTER(1));
|
||||
}
|
||||
|
||||
/* Create menu and toolbar information */
|
||||
|
@ -206,41 +206,13 @@ typedef struct GncPluginPageBudgetPrivate
|
||||
gint sigFigs;
|
||||
} GncPluginPageBudgetPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageBudget, gnc_plugin_page_budget, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
#define GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_BUDGET, GncPluginPageBudgetPrivate))
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
gnc_plugin_page_budget_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_budget_type = 0;
|
||||
|
||||
if (gnc_plugin_page_budget_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageBudgetClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_budget_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageBudget),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_budget_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_budget_type =
|
||||
g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
"GncPluginPageBudget", &our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_budget_type;
|
||||
}
|
||||
|
||||
|
||||
GncPluginPage *
|
||||
gnc_plugin_page_budget_new (GncBudget *budget)
|
||||
{
|
||||
@ -295,8 +267,6 @@ gnc_plugin_page_budget_class_init (GncPluginPageBudgetClass *klass)
|
||||
gnc_plugin_class->destroy_widget = gnc_plugin_page_budget_destroy_widget;
|
||||
gnc_plugin_class->save_page = gnc_plugin_page_budget_save_page;
|
||||
gnc_plugin_class->recreate_page = gnc_plugin_page_budget_recreate_page;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageBudgetPrivate));
|
||||
}
|
||||
|
||||
|
||||
|
@ -283,6 +283,8 @@ typedef struct GncPluginPageInvoicePrivate
|
||||
gint component_manager_id;
|
||||
} GncPluginPageInvoicePrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageInvoice, gnc_plugin_page_invoice, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
#define GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_INVOICE, GncPluginPageInvoicePrivate))
|
||||
|
||||
@ -292,34 +294,6 @@ static GObjectClass *parent_class = NULL;
|
||||
/* Implementation */
|
||||
/************************************************************/
|
||||
|
||||
GType
|
||||
gnc_plugin_page_invoice_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_invoice_type = 0;
|
||||
|
||||
if (gnc_plugin_page_invoice_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageInvoiceClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_invoice_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageInvoice),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_invoice_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_invoice_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
"GncPluginPageInvoice",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_invoice_type;
|
||||
}
|
||||
|
||||
GncPluginPage *
|
||||
gnc_plugin_page_invoice_new (InvoiceWindow *iw)
|
||||
{
|
||||
@ -367,8 +341,6 @@ gnc_plugin_page_invoice_class_init (GncPluginPageInvoiceClass *klass)
|
||||
gnc_plugin_class->save_page = gnc_plugin_page_invoice_save_page;
|
||||
gnc_plugin_class->recreate_page = gnc_plugin_page_invoice_recreate_page;
|
||||
gnc_plugin_class->window_changed = gnc_plugin_page_invoice_window_changed;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageInvoicePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -310,34 +310,6 @@ static action_owners_struct action_owners[] =
|
||||
{ NULL, GNC_OWNER_NONE },
|
||||
};
|
||||
|
||||
GType
|
||||
gnc_plugin_page_owner_tree_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_owner_tree_type = 0;
|
||||
|
||||
if (gnc_plugin_page_owner_tree_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageOwnerTreeClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_owner_tree_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageOwnerTree),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_owner_tree_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_owner_tree_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
GNC_PLUGIN_PAGE_OWNER_TREE_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_owner_tree_type;
|
||||
}
|
||||
|
||||
GncPluginPage *
|
||||
gnc_plugin_page_owner_tree_new (GncOwnerType owner_type)
|
||||
{
|
||||
@ -431,6 +403,7 @@ gnc_plugin_page_owner_main_window_page_changed (GncMainWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageOwnerTree, gnc_plugin_page_owner_tree, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
static void
|
||||
gnc_plugin_page_owner_tree_class_init (GncPluginPageOwnerTreeClass *klass)
|
||||
@ -449,8 +422,6 @@ gnc_plugin_page_owner_tree_class_init (GncPluginPageOwnerTreeClass *klass)
|
||||
gnc_plugin_class->save_page = gnc_plugin_page_owner_tree_save_page;
|
||||
gnc_plugin_class->recreate_page = gnc_plugin_page_owner_tree_recreate_page;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageOwnerTreePrivate));
|
||||
|
||||
plugin_page_signals[OWNER_SELECTED] =
|
||||
g_signal_new ("owner_selected",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
|
@ -588,6 +588,8 @@ typedef struct GncPluginPageRegisterPrivate
|
||||
} fd;
|
||||
} GncPluginPageRegisterPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageRegister, gnc_plugin_page_register, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
#define GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegisterPrivate))
|
||||
|
||||
@ -597,34 +599,6 @@ static GObjectClass *parent_class = NULL;
|
||||
/* Implementation */
|
||||
/************************************************************/
|
||||
|
||||
GType
|
||||
gnc_plugin_page_register_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_register_type = 0;
|
||||
|
||||
if (gnc_plugin_page_register_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageRegisterClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_register_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageRegister),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_register_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_register_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
GNC_PLUGIN_PAGE_REGISTER_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_register_type;
|
||||
}
|
||||
|
||||
static GncPluginPage *
|
||||
gnc_plugin_page_register_new_common (GNCLedgerDisplay *ledger)
|
||||
{
|
||||
@ -762,8 +736,6 @@ gnc_plugin_page_register_class_init (GncPluginPageRegisterClass *klass)
|
||||
gnc_plugin_class->update_edit_menu_actions = gnc_plugin_page_register_update_edit_menu;
|
||||
gnc_plugin_class->finish_pending = gnc_plugin_page_register_finish_pending;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageRegisterPrivate));
|
||||
|
||||
gnc_ui_register_account_destroy_callback (gppr_account_destroy_cb);
|
||||
}
|
||||
|
||||
|
@ -563,34 +563,6 @@ static GObjectClass *parent_class = NULL;
|
||||
/* Implementation */
|
||||
/************************************************************/
|
||||
|
||||
GType
|
||||
gnc_plugin_page_register2_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_register2_type = 0;
|
||||
|
||||
if (gnc_plugin_page_register2_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageRegister2Class),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_register2_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageRegister2),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_register2_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_register2_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
GNC_PLUGIN_PAGE_REGISTER2_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_register2_type;
|
||||
}
|
||||
|
||||
/*#################################################################################*/
|
||||
/*#################################################################################*/
|
||||
static GncPluginPage *
|
||||
@ -714,6 +686,8 @@ gnc_plugin_page_register2_new_ledger (GNCLedgerDisplay2 *ledger)
|
||||
return gnc_plugin_page_register2_new_common (ledger);
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageRegister2, gnc_plugin_page_register2, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
static void
|
||||
gnc_plugin_page_register2_class_init (GncPluginPageRegister2Class *klass)
|
||||
{
|
||||
@ -734,8 +708,6 @@ gnc_plugin_page_register2_class_init (GncPluginPageRegister2Class *klass)
|
||||
gnc_plugin_class->update_edit_menu_actions = gnc_plugin_page_register2_update_edit_menu;
|
||||
gnc_plugin_class->finish_pending = gnc_plugin_page_register2_finish_pending;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageRegister2Private));
|
||||
|
||||
gnc_ui_register_account_destroy_callback (gppr_account_destroy_cb);
|
||||
}
|
||||
|
||||
|
@ -164,36 +164,6 @@ static GtkActionEntry gnc_plugin_page_sx_list_actions [] =
|
||||
/** The number of actions provided by this plugin. */
|
||||
static guint gnc_plugin_page_sx_list_n_actions = G_N_ELEMENTS (gnc_plugin_page_sx_list_actions);
|
||||
|
||||
|
||||
GType
|
||||
gnc_plugin_page_sx_list_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_sx_list_type = 0;
|
||||
|
||||
if (gnc_plugin_page_sx_list_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageSxListClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_sx_list_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageSxList),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_sx_list_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_sx_list_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
GNC_PLUGIN_PAGE_SX_LIST_NAME,
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_sx_list_type;
|
||||
}
|
||||
|
||||
|
||||
GncPluginPage *
|
||||
gnc_plugin_page_sx_list_new (void)
|
||||
{
|
||||
@ -252,6 +222,7 @@ gnc_plugin_page_sx_list_main_window_page_changed (GncMainWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageSxList, gnc_plugin_page_sx_list, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
static void
|
||||
gnc_plugin_page_sx_list_class_init (GncPluginPageSxListClass *klass)
|
||||
@ -270,8 +241,6 @@ gnc_plugin_page_sx_list_class_init (GncPluginPageSxListClass *klass)
|
||||
gnc_plugin_class->destroy_widget = gnc_plugin_page_sx_list_destroy_widget;
|
||||
gnc_plugin_class->save_page = gnc_plugin_page_sx_list_save_page;
|
||||
gnc_plugin_class->recreate_page = gnc_plugin_page_sx_list_recreate_page;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageSxListPrivate));
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,6 +68,8 @@ typedef struct GncPluginRegisterPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginRegisterPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_REGISTER_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REGISTER, GncPluginRegisterPrivate))
|
||||
|
||||
@ -103,34 +105,6 @@ gnc_plugin_register_pref_changed (gpointer prefs, gchar *pref,
|
||||
* Object Implementation *
|
||||
************************************************************/
|
||||
|
||||
GType
|
||||
gnc_plugin_register_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_register_type = 0;
|
||||
|
||||
if (gnc_plugin_register_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginRegisterClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_register_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginRegister),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_register_init
|
||||
};
|
||||
|
||||
gnc_plugin_register_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginRegister",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_register_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_register_new (void)
|
||||
{
|
||||
@ -190,8 +164,6 @@ gnc_plugin_register_class_init (GncPluginRegisterClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginRegisterPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -75,6 +75,8 @@ typedef struct GncPluginRegister2Private
|
||||
gpointer dummy;
|
||||
} GncPluginRegister2Private;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister2, gnc_plugin_register2, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_REGISTER2_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Private))
|
||||
|
||||
@ -110,34 +112,6 @@ gnc_plugin_register2_pref_changed (gpointer prefs, gchar *pref,
|
||||
* Object Implementation *
|
||||
************************************************************/
|
||||
|
||||
GType
|
||||
gnc_plugin_register2_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_register2_type = 0;
|
||||
|
||||
if (gnc_plugin_register2_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginRegister2Class),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_register2_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginRegister2),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_register2_init
|
||||
};
|
||||
|
||||
gnc_plugin_register2_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginRegister2",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_register2_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_register2_new (void)
|
||||
{
|
||||
@ -176,8 +150,6 @@ gnc_plugin_register2_class_init (GncPluginRegister2Class *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginRegister2Private));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -59,6 +59,8 @@ typedef struct _GNCSearchOwnerPrivate
|
||||
GtkWidget * owner_choice;
|
||||
} GNCSearchOwnerPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchOwner, gnc_search_owner, GNC_TYPE_SEARCH_CORE_TYPE);
|
||||
|
||||
#define _PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_OWNER, GNCSearchOwnerPrivate))
|
||||
|
||||
@ -73,34 +75,6 @@ enum
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
#endif
|
||||
|
||||
GType
|
||||
gnc_search_owner_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (!type)
|
||||
{
|
||||
GTypeInfo type_info =
|
||||
{
|
||||
sizeof(GNCSearchOwnerClass), /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc)gnc_search_owner_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof(GNCSearchOwner), /* */
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_search_owner_init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
|
||||
"GNCSearchOwner",
|
||||
&type_info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_owner_class_init (GNCSearchOwnerClass *klass)
|
||||
{
|
||||
@ -118,8 +92,6 @@ gnc_search_owner_class_init (GNCSearchOwnerClass *klass)
|
||||
gnc_search_core_type->get_widget = gncs_get_widget;
|
||||
gnc_search_core_type->get_predicate = gncs_get_predicate;
|
||||
gnc_search_core_type->clone = gncs_clone;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GNCSearchOwnerPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -73,39 +73,13 @@ typedef struct GncPluginCsvExportPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginCsvExportPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_CSV_EXPORT_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_CSV_EXPORT, GncPluginCsvExportPrivate))
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_csv_export_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_csv_export_type = 0;
|
||||
|
||||
if (gnc_plugin_csv_export_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginCsvExportClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_csv_export_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginCsvExport),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_csv_export_init,
|
||||
};
|
||||
|
||||
gnc_plugin_csv_export_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginCsvExport",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_csv_export_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_csv_export_new (void)
|
||||
{
|
||||
@ -130,8 +104,6 @@ gnc_plugin_csv_export_class_init (GncPluginCsvExportClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginCsvExportPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -69,39 +69,13 @@ typedef struct GncPluginCsvImportPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginCsvImportPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_CSV_IMPORT_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_CSV_IMPORT, GncPluginCsvImportPrivate))
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_csv_import_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_csv_import_type = 0;
|
||||
|
||||
if (gnc_plugin_csv_import_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginCsvImportClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_csv_import_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginCsvImport),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_csv_import_init,
|
||||
};
|
||||
|
||||
gnc_plugin_csv_import_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginCsvImport",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_csv_import_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_csv_import_new (void)
|
||||
{
|
||||
@ -126,8 +100,6 @@ gnc_plugin_csv_import_class_init (GncPluginCsvImportClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginCsvImportPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -57,39 +57,13 @@ typedef struct GncPluginLogreplayPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginLogreplayPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogreplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplayPrivate))
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_log_replay_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_log_replay_type = 0;
|
||||
|
||||
if (gnc_plugin_log_replay_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginLogreplayClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_log_replay_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginLogreplay),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_log_replay_init,
|
||||
};
|
||||
|
||||
gnc_plugin_log_replay_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginLogreplay",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_log_replay_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_log_replay_new (void)
|
||||
{
|
||||
@ -114,8 +88,6 @@ gnc_plugin_log_replay_class_init (GncPluginLogreplayClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginLogreplayPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -55,39 +55,13 @@ typedef struct GncPluginOfxPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginOfxPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_OFX_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_OFX, GncPluginOfxPrivate))
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_ofx_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_ofx_type = 0;
|
||||
|
||||
if (gnc_plugin_ofx_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginOfxClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_ofx_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginOfx),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_ofx_init,
|
||||
};
|
||||
|
||||
gnc_plugin_ofx_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginOfx",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_ofx_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_ofx_new (void)
|
||||
{
|
||||
@ -112,8 +86,6 @@ gnc_plugin_ofx_class_init (GncPluginOfxClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginOfxPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -56,39 +56,13 @@ typedef struct GncPluginQifImportPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginQifImportPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN);
|
||||
|
||||
#define GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_QIF_IMPORT, GncPluginQifImportPrivate))
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
gnc_plugin_qif_import_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_qif_import_type = 0;
|
||||
|
||||
if (gnc_plugin_qif_import_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginQifImportClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_qif_import_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginQifImport),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_qif_import_init,
|
||||
};
|
||||
|
||||
gnc_plugin_qif_import_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginQifImport",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_qif_import_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_qif_import_new (void)
|
||||
{
|
||||
@ -113,8 +87,6 @@ gnc_plugin_qif_import_class_init (GncPluginQifImportClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginQifImportPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -132,6 +132,8 @@ typedef struct GncPluginPageReportPrivate
|
||||
GtkContainer *container;
|
||||
} GncPluginPageReportPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageReport, gnc_plugin_page_report, GNC_TYPE_PLUGIN_PAGE)
|
||||
|
||||
#define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_REPORT, GncPluginPageReportPrivate))
|
||||
|
||||
@ -180,34 +182,6 @@ static void gnc_plugin_page_report_print_cb(GtkAction *action, GncPluginPageRepo
|
||||
static void gnc_plugin_page_report_exportpdf_cb(GtkAction *action, GncPluginPageReport *rep);
|
||||
static void gnc_plugin_page_report_copy_cb(GtkAction *action, GncPluginPageReport *rep);
|
||||
|
||||
GType
|
||||
gnc_plugin_page_report_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_page_report_type = 0;
|
||||
|
||||
if (gnc_plugin_page_report_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginPageReportClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_plugin_page_report_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncPluginPageReport),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_plugin_page_report_init
|
||||
};
|
||||
|
||||
gnc_plugin_page_report_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
|
||||
"GncPluginPageReport",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_page_report_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_report_get_property( GObject *obj,
|
||||
guint prop_id,
|
||||
@ -326,8 +300,6 @@ gnc_plugin_page_report_class_init (GncPluginPageReportClass *klass)
|
||||
gnc_plugin_page_class->update_edit_menu_actions = gnc_plugin_page_report_update_edit_menu;
|
||||
gnc_plugin_page_class->finish_pending = gnc_plugin_page_report_finish_pending;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginPageReportPrivate));
|
||||
|
||||
// create the "reportId" property
|
||||
g_object_class_install_property( object_class,
|
||||
PROP_REPORT_ID,
|
||||
|
@ -61,6 +61,8 @@ typedef struct GncPluginStylesheetsPrivate
|
||||
gpointer dummy;
|
||||
} GncPluginStylesheetsPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginStylesheets, gnc_plugin_stylesheets, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_STYLESHEETS_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_STYLESHEETS, GncPluginStylesheetsPrivate))
|
||||
|
||||
@ -70,34 +72,6 @@ static GObjectClass *parent_class = NULL;
|
||||
* Object Implementation *
|
||||
************************************************************/
|
||||
|
||||
GType
|
||||
gnc_plugin_stylesheets_get_type (void)
|
||||
{
|
||||
static GType gnc_plugin_stylesheets_type = 0;
|
||||
|
||||
if (gnc_plugin_stylesheets_type == 0)
|
||||
{
|
||||
static const GTypeInfo our_info =
|
||||
{
|
||||
sizeof (GncPluginStylesheetsClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gnc_plugin_stylesheets_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GncPluginStylesheets),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnc_plugin_stylesheets_init,
|
||||
};
|
||||
|
||||
gnc_plugin_stylesheets_type = g_type_register_static (GNC_TYPE_PLUGIN,
|
||||
"GncPluginStylesheets",
|
||||
&our_info, 0);
|
||||
}
|
||||
|
||||
return gnc_plugin_stylesheets_type;
|
||||
}
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_stylesheets_new (void)
|
||||
{
|
||||
@ -122,8 +96,6 @@ gnc_plugin_stylesheets_class_init (GncPluginStylesheetsClass *klass)
|
||||
plugin_class->actions = gnc_plugin_actions;
|
||||
plugin_class->n_actions = gnc_plugin_n_actions;
|
||||
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(GncPluginStylesheetsPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -252,7 +252,7 @@ mark_account (Account *acc)
|
||||
\********************************************************************/
|
||||
|
||||
/* GObject Initialization */
|
||||
G_DEFINE_TYPE(Account, gnc_account, QOF_TYPE_INSTANCE)
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(Account, gnc_account, QOF_TYPE_INSTANCE)
|
||||
|
||||
static void
|
||||
gnc_account_init(Account* acc)
|
||||
@ -577,8 +577,6 @@ gnc_account_class_init (AccountClass *klass)
|
||||
gobject_class->set_property = gnc_account_set_property;
|
||||
gobject_class->get_property = gnc_account_get_property;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(AccountPrivate));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_NAME,
|
||||
|
@ -58,7 +58,7 @@ typedef struct
|
||||
QofInstanceClass parent_class;
|
||||
} BudgetClass;
|
||||
|
||||
typedef struct BudgetPrivate
|
||||
typedef struct GncBudgetPrivate
|
||||
{
|
||||
/* The name is an arbitrary string assigned by the user. */
|
||||
gchar* name;
|
||||
@ -71,10 +71,10 @@ typedef struct BudgetPrivate
|
||||
|
||||
/* Number of periods */
|
||||
guint num_periods;
|
||||
} BudgetPrivate;
|
||||
} GncBudgetPrivate;
|
||||
|
||||
#define GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_BUDGET, BudgetPrivate))
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_BUDGET, GncBudgetPrivate))
|
||||
|
||||
struct _GncBudgetClass
|
||||
{
|
||||
@ -82,12 +82,12 @@ struct _GncBudgetClass
|
||||
};
|
||||
|
||||
/* GObject Initialization */
|
||||
G_DEFINE_TYPE(GncBudget, gnc_budget, QOF_TYPE_INSTANCE)
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncBudget, gnc_budget, QOF_TYPE_INSTANCE)
|
||||
|
||||
static void
|
||||
gnc_budget_init(GncBudget* budget)
|
||||
{
|
||||
BudgetPrivate* priv;
|
||||
GncBudgetPrivate* priv;
|
||||
GDate *date;
|
||||
|
||||
priv = GET_PRIVATE(budget);
|
||||
@ -120,7 +120,7 @@ gnc_budget_get_property( GObject* object,
|
||||
GParamSpec* pspec)
|
||||
{
|
||||
GncBudget* budget;
|
||||
BudgetPrivate* priv;
|
||||
GncBudgetPrivate* priv;
|
||||
|
||||
g_return_if_fail(GNC_IS_BUDGET(object));
|
||||
|
||||
@ -191,8 +191,6 @@ gnc_budget_class_init(GncBudgetClass* klass)
|
||||
gobject_class->get_property = gnc_budget_get_property;
|
||||
gobject_class->set_property = gnc_budget_set_property;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(BudgetPrivate));
|
||||
|
||||
g_object_class_install_property(
|
||||
gobject_class,
|
||||
PROP_NAME,
|
||||
@ -248,7 +246,7 @@ static void
|
||||
gnc_budget_free(QofInstance *inst)
|
||||
{
|
||||
GncBudget *budget;
|
||||
BudgetPrivate* priv;
|
||||
GncBudgetPrivate* priv;
|
||||
|
||||
if (inst == NULL)
|
||||
return;
|
||||
@ -370,7 +368,7 @@ gnc_budget_clone(const GncBudget* old_b)
|
||||
void
|
||||
gnc_budget_set_name(GncBudget* budget, const gchar* name)
|
||||
{
|
||||
BudgetPrivate* priv;
|
||||
GncBudgetPrivate* priv;
|
||||
|
||||
g_return_if_fail(GNC_IS_BUDGET(budget) && name);
|
||||
|
||||
@ -395,7 +393,7 @@ gnc_budget_get_name(const GncBudget* budget)
|
||||
void
|
||||
gnc_budget_set_description(GncBudget* budget, const gchar* description)
|
||||
{
|
||||
BudgetPrivate* priv;
|
||||
GncBudgetPrivate* priv;
|
||||
|
||||
g_return_if_fail(GNC_IS_BUDGET(budget));
|
||||
g_return_if_fail(description);
|
||||
@ -420,7 +418,7 @@ gnc_budget_get_description(const GncBudget* budget)
|
||||
void
|
||||
gnc_budget_set_recurrence(GncBudget *budget, const Recurrence *r)
|
||||
{
|
||||
BudgetPrivate* priv;
|
||||
GncBudgetPrivate* priv;
|
||||
|
||||
g_return_if_fail(budget && r);
|
||||
priv = GET_PRIVATE(budget);
|
||||
@ -451,7 +449,7 @@ gnc_budget_get_guid(const GncBudget* budget)
|
||||
void
|
||||
gnc_budget_set_num_periods(GncBudget* budget, guint num_periods)
|
||||
{
|
||||
BudgetPrivate* priv;
|
||||
GncBudgetPrivate* priv;
|
||||
|
||||
g_return_if_fail(GNC_IS_BUDGET(budget));
|
||||
|
||||
|
@ -66,7 +66,7 @@ struct gnc_commodity_s
|
||||
QofInstance inst;
|
||||
};
|
||||
|
||||
typedef struct CommodityPrivate
|
||||
typedef struct gnc_commodityPrivate
|
||||
{
|
||||
gnc_commodity_namespace *name_space;
|
||||
|
||||
@ -87,10 +87,10 @@ typedef struct CommodityPrivate
|
||||
|
||||
/* the default display_symbol, set in iso-4217-currencies at start-up */
|
||||
const char * default_symbol;
|
||||
} CommodityPrivate;
|
||||
} gnc_commodityPrivate;
|
||||
|
||||
#define GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_COMMODITY, CommodityPrivate))
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_COMMODITY, gnc_commodityPrivate))
|
||||
|
||||
struct _GncCommodityClass
|
||||
{
|
||||
@ -629,7 +629,7 @@ mark_commodity_dirty (gnc_commodity *cm)
|
||||
}
|
||||
|
||||
static void
|
||||
reset_printname(CommodityPrivate *priv)
|
||||
reset_printname(gnc_commodityPrivate *priv)
|
||||
{
|
||||
g_free(priv->printname);
|
||||
priv->printname = g_strdup_printf("%s (%s)",
|
||||
@ -638,7 +638,7 @@ reset_printname(CommodityPrivate *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
reset_unique_name(CommodityPrivate *priv)
|
||||
reset_unique_name(gnc_commodityPrivate *priv)
|
||||
{
|
||||
gnc_commodity_namespace *ns;
|
||||
|
||||
@ -650,12 +650,12 @@ reset_unique_name(CommodityPrivate *priv)
|
||||
}
|
||||
|
||||
/* GObject Initialization */
|
||||
G_DEFINE_TYPE(gnc_commodity, gnc_commodity, QOF_TYPE_INSTANCE);
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(gnc_commodity, gnc_commodity, QOF_TYPE_INSTANCE);
|
||||
|
||||
static void
|
||||
gnc_commodity_init(gnc_commodity* com)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
priv = GET_PRIVATE(com);
|
||||
|
||||
@ -696,7 +696,7 @@ gnc_commodity_get_property (GObject *object,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
gnc_commodity *commodity;
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
g_return_if_fail(GNC_IS_COMMODITY(object));
|
||||
|
||||
@ -794,8 +794,6 @@ gnc_commodity_class_init(struct _GncCommodityClass* klass)
|
||||
gobject_class->set_property = gnc_commodity_set_property;
|
||||
gobject_class->get_property = gnc_commodity_get_property;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(CommodityPrivate));
|
||||
|
||||
g_object_class_install_property(gobject_class,
|
||||
PROP_NAMESPACE,
|
||||
g_param_spec_object ("namespace",
|
||||
@ -925,7 +923,7 @@ commodity_free(gnc_commodity * cm)
|
||||
{
|
||||
QofBook *book;
|
||||
gnc_commodity_table *table;
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return;
|
||||
|
||||
@ -980,8 +978,8 @@ gnc_commodity_destroy(gnc_commodity * cm)
|
||||
void
|
||||
gnc_commodity_copy(gnc_commodity * dest, const gnc_commodity *src)
|
||||
{
|
||||
CommodityPrivate* src_priv = GET_PRIVATE(src);
|
||||
CommodityPrivate* dest_priv = GET_PRIVATE(dest);
|
||||
gnc_commodityPrivate* src_priv = GET_PRIVATE(src);
|
||||
gnc_commodityPrivate* dest_priv = GET_PRIVATE(dest);
|
||||
|
||||
gnc_commodity_set_fullname (dest, src_priv->fullname);
|
||||
gnc_commodity_set_mnemonic (dest, src_priv->mnemonic);
|
||||
@ -997,8 +995,8 @@ gnc_commodity_copy(gnc_commodity * dest, const gnc_commodity *src)
|
||||
gnc_commodity *
|
||||
gnc_commodity_clone(const gnc_commodity *src, QofBook *dest_book)
|
||||
{
|
||||
CommodityPrivate* src_priv;
|
||||
CommodityPrivate* dest_priv;
|
||||
gnc_commodityPrivate* src_priv;
|
||||
gnc_commodityPrivate* dest_priv;
|
||||
|
||||
gnc_commodity * dest = g_object_new(GNC_TYPE_COMMODITY, NULL);
|
||||
qof_instance_init_data (&dest->inst, GNC_ID_COMMODITY, dest_book);
|
||||
@ -1147,7 +1145,7 @@ gnc_commodity_get_quote_flag(const gnc_commodity *cm)
|
||||
gnc_quote_source*
|
||||
gnc_commodity_get_quote_source(const gnc_commodity *cm)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return NULL;
|
||||
priv = GET_PRIVATE(cm);
|
||||
@ -1233,7 +1231,7 @@ gnc_commodity_get_nice_symbol (const gnc_commodity *cm)
|
||||
void
|
||||
gnc_commodity_set_mnemonic(gnc_commodity * cm, const char * mnemonic)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return;
|
||||
priv = GET_PRIVATE(cm);
|
||||
@ -1259,7 +1257,7 @@ gnc_commodity_set_namespace(gnc_commodity * cm, const char * name_space)
|
||||
QofBook *book;
|
||||
gnc_commodity_table *table;
|
||||
gnc_commodity_namespace *nsp;
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return;
|
||||
priv = GET_PRIVATE(cm);
|
||||
@ -1286,7 +1284,7 @@ gnc_commodity_set_namespace(gnc_commodity * cm, const char * name_space)
|
||||
void
|
||||
gnc_commodity_set_fullname(gnc_commodity * cm, const char * fullname)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return;
|
||||
priv = GET_PRIVATE(cm);
|
||||
@ -1309,7 +1307,7 @@ void
|
||||
gnc_commodity_set_cusip(gnc_commodity * cm,
|
||||
const char * cusip)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return;
|
||||
|
||||
@ -1374,7 +1372,7 @@ gnc_commodity_set_auto_quote_control_flag(gnc_commodity *cm,
|
||||
void
|
||||
gnc_commodity_user_set_quote_flag(gnc_commodity *cm, const gboolean flag)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
ENTER ("(cm=%p, flag=%d)", cm, flag);
|
||||
|
||||
@ -1444,7 +1442,7 @@ gnc_commodity_set_quote_source(gnc_commodity *cm, gnc_quote_source *src)
|
||||
void
|
||||
gnc_commodity_set_quote_tz(gnc_commodity *cm, const char *tz)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return;
|
||||
|
||||
@ -1525,7 +1523,7 @@ gnc_commodity_set_default_symbol(gnc_commodity * cm,
|
||||
void
|
||||
gnc_commodity_increment_usage_count(gnc_commodity *cm)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
ENTER("(cm=%p)", cm);
|
||||
|
||||
@ -1560,7 +1558,7 @@ gnc_commodity_increment_usage_count(gnc_commodity *cm)
|
||||
void
|
||||
gnc_commodity_decrement_usage_count(gnc_commodity *cm)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
ENTER("(cm=%p)", cm);
|
||||
|
||||
@ -1603,8 +1601,8 @@ gnc_commodity_decrement_usage_count(gnc_commodity *cm)
|
||||
gboolean
|
||||
gnc_commodity_equiv(const gnc_commodity * a, const gnc_commodity * b)
|
||||
{
|
||||
CommodityPrivate* priv_a;
|
||||
CommodityPrivate* priv_b;
|
||||
gnc_commodityPrivate* priv_a;
|
||||
gnc_commodityPrivate* priv_b;
|
||||
|
||||
if (a == b) return TRUE;
|
||||
if (!a || !b) return FALSE;
|
||||
@ -1619,8 +1617,8 @@ gnc_commodity_equiv(const gnc_commodity * a, const gnc_commodity * b)
|
||||
gboolean
|
||||
gnc_commodity_equal(const gnc_commodity * a, const gnc_commodity * b)
|
||||
{
|
||||
CommodityPrivate* priv_a;
|
||||
CommodityPrivate* priv_b;
|
||||
gnc_commodityPrivate* priv_a;
|
||||
gnc_commodityPrivate* priv_b;
|
||||
gboolean same_book;
|
||||
|
||||
if (a == b) return TRUE;
|
||||
@ -1935,7 +1933,7 @@ gnc_commodity_table_insert(gnc_commodity_table * table,
|
||||
gnc_commodity_namespace * nsp = NULL;
|
||||
gnc_commodity *c;
|
||||
const char *ns_name;
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
QofBook *book;
|
||||
|
||||
if (!table) return NULL;
|
||||
@ -2015,7 +2013,7 @@ gnc_commodity_table_remove(gnc_commodity_table * table,
|
||||
{
|
||||
gnc_commodity_namespace * nsp;
|
||||
gnc_commodity *c;
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
const char *ns_name;
|
||||
|
||||
if (!table) return;
|
||||
@ -2125,7 +2123,7 @@ gnc_commodity_table_get_namespaces_list(const gnc_commodity_table * table)
|
||||
gboolean
|
||||
gnc_commodity_is_iso(const gnc_commodity * cm)
|
||||
{
|
||||
CommodityPrivate* priv;
|
||||
gnc_commodityPrivate* priv;
|
||||
|
||||
if (!cm) return FALSE;
|
||||
|
||||
@ -2196,7 +2194,7 @@ static void
|
||||
get_quotables_helper1(gpointer key, gpointer value, gpointer data)
|
||||
{
|
||||
gnc_commodity *comm = value;
|
||||
CommodityPrivate* priv = GET_PRIVATE(comm);
|
||||
gnc_commodityPrivate* priv = GET_PRIVATE(comm);
|
||||
GList ** l = data;
|
||||
|
||||
if (!priv->quote_flag ||
|
||||
@ -2209,7 +2207,7 @@ static gboolean
|
||||
get_quotables_helper2 (gnc_commodity *comm, gpointer data)
|
||||
{
|
||||
GList ** l = data;
|
||||
CommodityPrivate* priv = GET_PRIVATE(comm);
|
||||
gnc_commodityPrivate* priv = GET_PRIVATE(comm);
|
||||
|
||||
if (!priv->quote_flag ||
|
||||
!priv->quote_source || !priv->quote_source->supported)
|
||||
|
@ -75,7 +75,7 @@ enum
|
||||
PROP_MARKER, /* Runtime */
|
||||
};
|
||||
|
||||
typedef struct LotPrivate
|
||||
typedef struct GNCLotPrivate
|
||||
{
|
||||
/* Account to which this lot applies. All splits in the lot must
|
||||
* belong to this account.
|
||||
@ -92,22 +92,22 @@ typedef struct LotPrivate
|
||||
|
||||
/* traversal marker, handy for preventing recursion */
|
||||
unsigned char marker;
|
||||
} LotPrivate;
|
||||
} GNCLotPrivate;
|
||||
|
||||
#define GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_LOT, LotPrivate))
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_LOT, GNCLotPrivate))
|
||||
|
||||
#define gnc_lot_set_guid(L,G) qof_instance_set_guid(QOF_INSTANCE(L),&(G))
|
||||
|
||||
/* ============================================================= */
|
||||
|
||||
/* GObject Initialization */
|
||||
G_DEFINE_TYPE(GNCLot, gnc_lot, QOF_TYPE_INSTANCE)
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GNCLot, gnc_lot, QOF_TYPE_INSTANCE)
|
||||
|
||||
static void
|
||||
gnc_lot_init(GNCLot* lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
|
||||
priv = GET_PRIVATE(lot);
|
||||
priv->account = NULL;
|
||||
@ -132,7 +132,7 @@ static void
|
||||
gnc_lot_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
|
||||
{
|
||||
GNCLot* lot;
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
gchar *key;
|
||||
|
||||
g_return_if_fail(GNC_IS_LOT(object));
|
||||
@ -169,7 +169,7 @@ gnc_lot_set_property (GObject* object,
|
||||
GParamSpec* pspec)
|
||||
{
|
||||
GNCLot* lot;
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
gchar *key = NULL;
|
||||
|
||||
g_return_if_fail(GNC_IS_LOT(object));
|
||||
@ -212,8 +212,6 @@ gnc_lot_class_init(GNCLotClass* klass)
|
||||
gobject_class->get_property = gnc_lot_get_property;
|
||||
gobject_class->set_property = gnc_lot_set_property;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(LotPrivate));
|
||||
|
||||
g_object_class_install_property(
|
||||
gobject_class,
|
||||
PROP_IS_CLOSED,
|
||||
@ -277,7 +275,7 @@ static void
|
||||
gnc_lot_free(GNCLot* lot)
|
||||
{
|
||||
GList *node;
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (!lot) return;
|
||||
|
||||
ENTER ("(lot=%p)", lot);
|
||||
@ -364,7 +362,7 @@ gnc_lot_get_book (GNCLot *lot)
|
||||
gboolean
|
||||
gnc_lot_is_closed (GNCLot *lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (!lot) return TRUE;
|
||||
priv = GET_PRIVATE(lot);
|
||||
if (0 > priv->is_closed) gnc_lot_get_balance (lot);
|
||||
@ -374,7 +372,7 @@ gnc_lot_is_closed (GNCLot *lot)
|
||||
Account *
|
||||
gnc_lot_get_account (const GNCLot *lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (!lot) return NULL;
|
||||
priv = GET_PRIVATE(lot);
|
||||
return priv->account;
|
||||
@ -385,7 +383,7 @@ gnc_lot_set_account(GNCLot* lot, Account* account)
|
||||
{
|
||||
if (lot != NULL)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
priv = GET_PRIVATE(lot);
|
||||
priv->account = account;
|
||||
}
|
||||
@ -394,7 +392,7 @@ gnc_lot_set_account(GNCLot* lot, Account* account)
|
||||
void
|
||||
gnc_lot_set_closed_unknown(GNCLot* lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (lot != NULL)
|
||||
{
|
||||
priv = GET_PRIVATE(lot);
|
||||
@ -405,7 +403,7 @@ gnc_lot_set_closed_unknown(GNCLot* lot)
|
||||
SplitList *
|
||||
gnc_lot_get_split_list (const GNCLot *lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (!lot) return NULL;
|
||||
priv = GET_PRIVATE(lot);
|
||||
return priv->splits;
|
||||
@ -413,7 +411,7 @@ gnc_lot_get_split_list (const GNCLot *lot)
|
||||
|
||||
gint gnc_lot_count_splits (const GNCLot *lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (!lot) return 0;
|
||||
priv = GET_PRIVATE(lot);
|
||||
return g_list_length (priv->splits);
|
||||
@ -475,7 +473,7 @@ gnc_lot_set_notes (GNCLot *lot, const char *str)
|
||||
gnc_numeric
|
||||
gnc_lot_get_balance (GNCLot *lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
GList *node;
|
||||
gnc_numeric zero = gnc_numeric_zero();
|
||||
gnc_numeric baln = zero;
|
||||
@ -518,7 +516,7 @@ void
|
||||
gnc_lot_get_balance_before (const GNCLot *lot, const Split *split,
|
||||
gnc_numeric *amount, gnc_numeric *value)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
GList *node;
|
||||
gnc_numeric zero = gnc_numeric_zero();
|
||||
gnc_numeric amt = zero;
|
||||
@ -567,7 +565,7 @@ gnc_lot_get_balance_before (const GNCLot *lot, const Split *split,
|
||||
void
|
||||
gnc_lot_add_split (GNCLot *lot, Split *split)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
Account * acc;
|
||||
if (!lot || !split) return;
|
||||
priv = GET_PRIVATE(lot);
|
||||
@ -619,7 +617,7 @@ gnc_lot_add_split (GNCLot *lot, Split *split)
|
||||
void
|
||||
gnc_lot_remove_split (GNCLot *lot, Split *split)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (!lot || !split) return;
|
||||
priv = GET_PRIVATE(lot);
|
||||
|
||||
@ -646,7 +644,7 @@ gnc_lot_remove_split (GNCLot *lot, Split *split)
|
||||
Split *
|
||||
gnc_lot_get_earliest_split (GNCLot *lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
if (!lot) return NULL;
|
||||
priv = GET_PRIVATE(lot);
|
||||
if (! priv->splits) return NULL;
|
||||
@ -658,7 +656,7 @@ gnc_lot_get_earliest_split (GNCLot *lot)
|
||||
Split *
|
||||
gnc_lot_get_latest_split (GNCLot *lot)
|
||||
{
|
||||
LotPrivate* priv;
|
||||
GNCLotPrivate* priv;
|
||||
SplitList *node;
|
||||
|
||||
if (!lot) return NULL;
|
||||
|
@ -107,7 +107,7 @@ qof_book_option_num_autoreadonly_changed_cb (GObject *gobject,
|
||||
#define PARAM_NAME_NUM_FIELD_SOURCE "split-action-num-field"
|
||||
#define PARAM_NAME_NUM_AUTOREAD_ONLY "autoreadonly-days"
|
||||
|
||||
QOF_GOBJECT_GET_TYPE(QofBook, qof_book, QOF_TYPE_INSTANCE, {});
|
||||
G_DEFINE_TYPE(QofBook, qof_book, QOF_TYPE_INSTANCE);
|
||||
QOF_GOBJECT_DISPOSE(qof_book);
|
||||
QOF_GOBJECT_FINALIZE(qof_book);
|
||||
|
||||
|
@ -114,7 +114,7 @@ typedef struct QofInstancePrivate
|
||||
#define GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), QOF_TYPE_INSTANCE, QofInstancePrivate))
|
||||
|
||||
QOF_GOBJECT_GET_TYPE(QofInstance, qof_instance, G_TYPE_OBJECT, {});
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(QofInstance, qof_instance, G_TYPE_OBJECT);
|
||||
QOF_GOBJECT_FINALIZE(qof_instance);
|
||||
#undef G_PARAM_READWRITE
|
||||
#define G_PARAM_READWRITE static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)
|
||||
@ -136,8 +136,6 @@ static void qof_instance_class_init(QofInstanceClass *klass)
|
||||
object_class->set_property = qof_instance_set_property;
|
||||
object_class->get_property = qof_instance_get_property;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(QofInstancePrivate));
|
||||
|
||||
klass->get_display_name = NULL;
|
||||
klass->refers_to_object = NULL;
|
||||
klass->get_typed_referring_object_list = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user