diff --git a/bindings/python/example_scripts/simple_business_create.py b/bindings/python/example_scripts/simple_business_create.py index e0df30bb80..029a4f5300 100644 --- a/bindings/python/example_scripts/simple_business_create.py +++ b/bindings/python/example_scripts/simple_business_create.py @@ -171,7 +171,7 @@ try: invoice_customer.ApplyPayment(None, a6, GncNumeric(7,100), GncNumeric(1), datetime.date.today(), "", "") - vendor_bill_returns = book.BillLoookupByID("7") + vendor_bill_returns = book.BillLookupByID("7") assert( vendor_bill_returns.GetID() == "7" ) vendor_extract = vendor_bill_returns.GetOwner() assert( vendor_extract.GetName() == new_vendor.GetName() ) diff --git a/gnucash/gnome-search/gnc-general-search.c b/gnucash/gnome-search/gnc-general-search.c index 0f1bc37c3d..f4aed242fe 100644 --- a/gnucash/gnome-search/gnc-general-search.c +++ b/gnucash/gnome-search/gnc-general-search.c @@ -78,7 +78,7 @@ struct _GNCGeneralSearchPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCGeneralSearch, gnc_general_search, GTK_TYPE_BOX) #define _PRIVATE(o) \ - ((GNCGeneralSearchPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_GENERAL_SEARCH)) + ((GNCGeneralSearchPrivate*)gnc_general_search_get_instance_private((GNCGeneralSearch*)o)) static GtkBoxClass *parent_class; static guint general_search_signals[LAST_SIGNAL]; diff --git a/gnucash/gnome-search/search-account.c b/gnucash/gnome-search/search-account.c index de41c7676d..ecd1d803ee 100644 --- a/gnucash/gnome-search/search-account.c +++ b/gnucash/gnome-search/search-account.c @@ -61,7 +61,7 @@ struct _GNCSearchAccountPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchAccount, gnc_search_account, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchAccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_ACCOUNT)) + ((GNCSearchAccountPrivate*)gnc_search_account_get_instance_private((GNCSearchAccount*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-search/search-boolean.c b/gnucash/gnome-search/search-boolean.c index ddbb85aa10..496a36d15e 100644 --- a/gnucash/gnome-search/search-boolean.c +++ b/gnucash/gnome-search/search-boolean.c @@ -56,7 +56,7 @@ struct _GNCSearchBooleanPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchBoolean, gnc_search_boolean, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchBooleanPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_BOOLEAN)) + ((GNCSearchBooleanPrivate*)gnc_search_boolean_get_instance_private((GNCSearchBoolean*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-search/search-core-type.c b/gnucash/gnome-search/search-core-type.c index f3bfa5ae71..7d7ff38421 100644 --- a/gnucash/gnome-search/search-core-type.c +++ b/gnucash/gnome-search/search-core-type.c @@ -58,7 +58,7 @@ struct _GNCSearchCoreTypePrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchCoreType, gnc_search_core_type, G_TYPE_OBJECT) #define _PRIVATE(o) \ - ((GNCSearchCoreTypePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_CORE_TYPE)) + ((GNCSearchCoreTypePrivate*)gnc_search_core_type_get_instance_private((GNCSearchCoreType*)o)) static GObjectClass *parent_class; diff --git a/gnucash/gnome-search/search-date.c b/gnucash/gnome-search/search-date.c index 7c55f0f118..7649f7e357 100644 --- a/gnucash/gnome-search/search-date.c +++ b/gnucash/gnome-search/search-date.c @@ -60,7 +60,7 @@ struct _GNCSearchDatePrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDate, gnc_search_date, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchDatePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_DATE)) + ((GNCSearchDatePrivate*)gnc_search_date_get_instance_private((GNCSearchDate*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-search/search-double.c b/gnucash/gnome-search/search-double.c index 9131ef0f1f..991be23a1f 100644 --- a/gnucash/gnome-search/search-double.c +++ b/gnucash/gnome-search/search-double.c @@ -61,7 +61,7 @@ struct _GNCSearchDoublePrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDouble, gnc_search_double, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchDoublePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_DOUBLE)) + ((GNCSearchDoublePrivate*)gnc_search_double_get_instance_private((GNCSearchDouble*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-search/search-int64.c b/gnucash/gnome-search/search-int64.c index 754e10449d..6c129efd81 100644 --- a/gnucash/gnome-search/search-int64.c +++ b/gnucash/gnome-search/search-int64.c @@ -62,7 +62,7 @@ struct _GNCSearchInt64Private G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchInt64, gnc_search_int64, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchInt64Private*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_INT64)) + ((GNCSearchInt64Private*)gnc_search_int64_get_instance_private((GNCSearchInt64*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-search/search-numeric.c b/gnucash/gnome-search/search-numeric.c index f829887219..6b2a6d2d40 100644 --- a/gnucash/gnome-search/search-numeric.c +++ b/gnucash/gnome-search/search-numeric.c @@ -62,7 +62,7 @@ struct _GNCSearchNumericPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchNumeric, gnc_search_numeric, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchNumericPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_NUMERIC)) + ((GNCSearchNumericPrivate*)gnc_search_numeric_get_instance_private((GNCSearchNumeric*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-search/search-reconciled.c b/gnucash/gnome-search/search-reconciled.c index 46dcc4b057..06599aa46f 100644 --- a/gnucash/gnome-search/search-reconciled.c +++ b/gnucash/gnome-search/search-reconciled.c @@ -58,7 +58,7 @@ struct _GNCSearchReconciledPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchReconciled, gnc_search_reconciled, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchReconciledPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_RECONCILED)) + ((GNCSearchReconciledPrivate*)gnc_search_reconciled_get_instance_private((GNCSearchReconciled*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-search/search-string.c b/gnucash/gnome-search/search-string.c index 94f77fbedf..c54513ab0e 100644 --- a/gnucash/gnome-search/search-string.c +++ b/gnucash/gnome-search/search-string.c @@ -60,7 +60,7 @@ struct _GNCSearchStringPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchString, gnc_search_string, GNC_TYPE_SEARCH_CORE_TYPE) #define _PRIVATE(o) \ - ((GNCSearchStringPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_STRING)) + ((GNCSearchStringPrivate*)gnc_search_string_get_instance_private((GNCSearchString*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/gnome-utils/gnc-currency-edit.c b/gnucash/gnome-utils/gnc-currency-edit.c index 9261cca5ac..b2eacb92c8 100644 --- a/gnucash/gnome-utils/gnc-currency-edit.c +++ b/gnucash/gnome-utils/gnc-currency-edit.c @@ -93,7 +93,7 @@ typedef struct _GNCCurrencyEditPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCCurrencyEdit, gnc_currency_edit, GTK_TYPE_COMBO_BOX) #define GET_PRIVATE(o) \ - ((GNCCurrencyEditPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_CURRENCY_EDIT)) + ((GNCCurrencyEditPrivate*)gnc_currency_edit_get_instance_private((GNCCurrencyEdit*)o)) /** @name Basic Object Implementation */ /** @{ */ diff --git a/gnucash/gnome-utils/gnc-date-format.c b/gnucash/gnome-utils/gnc-date-format.c index 6bb01dc82d..c6dc37f6ab 100644 --- a/gnucash/gnome-utils/gnc-date-format.c +++ b/gnucash/gnome-utils/gnc-date-format.c @@ -77,7 +77,7 @@ struct _GNCDateFormatPrivate }; #define GNC_DATE_FORMAT_GET_PRIVATE(o) \ - ((GNCDateFormatPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_DATE_FORMAT)) + ((GNCDateFormatPrivate*)gnc_date_format_get_instance_private((GNCDateFormat*)o)) static guint date_format_signals [LAST_SIGNAL] = { 0 }; diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c index 1e57cbb2e8..e0855f6f5f 100644 --- a/gnucash/gnome-utils/gnc-embedded-window.c +++ b/gnucash/gnome-utils/gnc-embedded-window.c @@ -98,7 +98,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncEmbeddedWindow, gnc_embedded_window, GTK_TYPE_BOX, gnc_window_embedded_window_init)) #define GNC_EMBEDDED_WINDOW_GET_PRIVATE(o) \ - ((GncEmbeddedWindowPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_EMBEDDED_WINDOW)) + ((GncEmbeddedWindowPrivate*)gnc_embedded_window_get_instance_private((GncEmbeddedWindow*)o)) /** A holding place for all the signals generated by the embedded window * code. */ diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c index 165a3393d9..91261d7671 100644 --- a/gnucash/gnome-utils/gnc-main-window.c +++ b/gnucash/gnome-utils/gnc-main-window.c @@ -247,7 +247,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_WINDOW, gnc_window_main_window_init)) #define GNC_MAIN_WINDOW_GET_PRIVATE(o) \ - ((GncMainWindowPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_MAIN_WINDOW)) + ((GncMainWindowPrivate*)gnc_main_window_get_instance_private((GncMainWindow*)o)) /** This data structure maintains information about one action groups * that has been installed in this window. */ diff --git a/gnucash/gnome-utils/gnc-period-select.c b/gnucash/gnome-utils/gnc-period-select.c index b1d5c93067..3d8e03671c 100644 --- a/gnucash/gnome-utils/gnc-period-select.c +++ b/gnucash/gnome-utils/gnc-period-select.c @@ -111,8 +111,10 @@ struct _GncPeriodSelectPrivate GtkWidget *date_label; }; +G_DEFINE_TYPE_WITH_PRIVATE(GncPeriodSelect, gnc_period_select, GTK_TYPE_BOX) + #define GNC_PERIOD_SELECT_GET_PRIVATE(o) \ - ((GncPeriodSelectPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PERIOD_SELECT)) + ((GncPeriodSelectPrivate*)gnc_period_select_get_instance_private((GncPeriodSelect*)o)) /************************************************************/ @@ -560,8 +562,6 @@ gnc_period_select_class_init (GncPeriodSelectClass *klass) G_PARAM_READWRITE)); } -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 * private storage space. diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.c b/gnucash/gnome-utils/gnc-plugin-file-history.c index b7ad7cec3f..00664a16d7 100644 --- a/gnucash/gnome-utils/gnc-plugin-file-history.c +++ b/gnucash/gnome-utils/gnc-plugin-file-history.c @@ -106,7 +106,7 @@ typedef struct GncPluginFileHistoryPrivate #define GNC_PLUGIN_FILE_HISTORY_GET_PRIVATE(o) \ - ((GncPluginFileHistoryPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_FILE_HISTORY)) + ((GncPluginFileHistoryPrivate*)gnc_plugin_file_history_get_instance_private((GncPluginFileHistory*)o)) /************************************************************ * Other Functions * diff --git a/gnucash/gnome-utils/gnc-plugin-manager.c b/gnucash/gnome-utils/gnc-plugin-manager.c index b337303459..7c3b2dd82c 100644 --- a/gnucash/gnome-utils/gnc-plugin-manager.c +++ b/gnucash/gnome-utils/gnc-plugin-manager.c @@ -44,8 +44,10 @@ typedef struct GncPluginManagerPrivate GHashTable *plugins_table; } GncPluginManagerPrivate; +G_DEFINE_TYPE_WITH_PRIVATE(GncPluginManager, gnc_plugin_manager, G_TYPE_OBJECT) + #define GNC_PLUGIN_MANAGER_GET_PRIVATE(o) \ - ((GncPluginManagerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_MANAGER)) + ((GncPluginManagerPrivate*)gnc_plugin_manager_get_instance_private((GncPluginManager*)o)) enum { @@ -151,8 +153,6 @@ 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) { diff --git a/gnucash/gnome-utils/gnc-plugin-menu-additions.c b/gnucash/gnome-utils/gnc-plugin-menu-additions.c index 8114d05988..7573484482 100644 --- a/gnucash/gnome-utils/gnc-plugin-menu-additions.c +++ b/gnucash/gnome-utils/gnc-plugin-menu-additions.c @@ -69,7 +69,7 @@ typedef struct GncPluginMenuAdditionsPrivate } GncPluginMenuAdditionsPrivate; #define GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(o) \ - ((GncPluginMenuAdditionsPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_MENU_ADDITIONS)) + ((GncPluginMenuAdditionsPrivate*)gnc_plugin_menu_additions_get_instance_private((GncPluginMenuAdditions*)o)) /** Per-window private data for this plugin. This plugin is unique in diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c index f72a5b5e16..dec6e88f0c 100644 --- a/gnucash/gnome-utils/gnc-plugin-page.c +++ b/gnucash/gnome-utils/gnc-plugin-page.c @@ -115,7 +115,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncPluginPage, gnc_plugin_page, G_TYPE_OBJECT, G_ADD_PRIVATE(GncPluginPage)) #define GNC_PLUGIN_PAGE_GET_PRIVATE(o) \ - ((GncPluginPagePrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE)) + ((GncPluginPagePrivate*)gnc_plugin_page_get_instance_private((GncPluginPage*)o)) /* Create the display widget that corresponds to this plugin. This * function will be called by the main/embedded window manipulation diff --git a/gnucash/gnome-utils/gnc-plugin.c b/gnucash/gnome-utils/gnc-plugin.c index 2172565159..73c487fbc0 100644 --- a/gnucash/gnome-utils/gnc-plugin.c +++ b/gnucash/gnome-utils/gnc-plugin.c @@ -65,7 +65,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncPlugin, gnc_plugin, G_TYPE_OBJECT, G_ADD_PRIVATE(GncPlugin)) #define GNC_PLUGIN_GET_PRIVATE(o) \ - ((GncPluginPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN)) + ((GncPluginPrivate*)gnc_plugin_get_instance_private((GncPlugin*)o)) /** Initialize the class for the new gnucash plugin object. This will * set up any function pointers that override functions in the parent diff --git a/gnucash/gnome-utils/gnc-query-view.c b/gnucash/gnome-utils/gnc-query-view.c index 9dfcfd358f..e6d5879b32 100644 --- a/gnucash/gnome-utils/gnc-query-view.c +++ b/gnucash/gnome-utils/gnc-query-view.c @@ -52,8 +52,10 @@ struct _GNCQueryViewPrivate gint component_id; }; +G_DEFINE_TYPE_WITH_PRIVATE(GNCQueryView, gnc_query_view, GTK_TYPE_TREE_VIEW) + #define GNC_QUERY_VIEW_GET_PRIVATE(o) \ - ((GNCQueryViewPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_QUERY_VIEW)) + ((GNCQueryViewPrivate*)gnc_query_view_get_instance_private((GNCQueryView*)o)) /** Static Globals ****************************************************/ static GtkTreeViewClass *parent_class = NULL; @@ -185,8 +187,6 @@ 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) { diff --git a/gnucash/gnome-utils/gnc-tree-model-account-types.c b/gnucash/gnome-utils/gnc-tree-model-account-types.c index 6932c8c724..e5f50cd1c2 100644 --- a/gnucash/gnome-utils/gnc-tree-model-account-types.c +++ b/gnucash/gnome-utils/gnc-tree-model-account-types.c @@ -56,7 +56,7 @@ typedef struct GncTreeModelAccountTypesPrivate } GncTreeModelAccountTypesPrivate; #define GNC_TREE_MODEL_ACCOUNT_TYPES_GET_PRIVATE(o) \ - ((GncTreeModelAccountTypesPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_ACCOUNT_TYPES)) + ((GncTreeModelAccountTypesPrivate*)gnc_tree_model_account_types_get_instance_private((GncTreeModelAccountTypes*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome-utils/gnc-tree-model-account.c b/gnucash/gnome-utils/gnc-tree-model-account.c index e04eac9adc..5d5d74aec6 100644 --- a/gnucash/gnome-utils/gnc-tree-model-account.c +++ b/gnucash/gnome-utils/gnc-tree-model-account.c @@ -103,8 +103,14 @@ typedef struct GncTreeModelAccountPrivate } GncTreeModelAccountPrivate; +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)) + #define GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(o) \ - ((GncTreeModelAccountPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_ACCOUNT)) + ((GncTreeModelAccountPrivate*)gnc_tree_model_account_get_instance_private((GncTreeModelAccount*)o)) /************************************************************/ @@ -152,11 +158,6 @@ 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; -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) { diff --git a/gnucash/gnome-utils/gnc-tree-model-commodity.c b/gnucash/gnome-utils/gnc-tree-model-commodity.c index cdb6e297d7..29e1ce9f40 100644 --- a/gnucash/gnome-utils/gnc-tree-model-commodity.c +++ b/gnucash/gnome-utils/gnc-tree-model-commodity.c @@ -102,7 +102,7 @@ typedef struct GncTreeModelCommodityPrivate } GncTreeModelCommodityPrivate; #define GNC_TREE_MODEL_COMMODITY_GET_PRIVATE(o) \ - ((GncTreeModelCommodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_COMMODITY)) + ((GncTreeModelCommodityPrivate*)gnc_tree_model_commodity_get_instance_private((GncTreeModelCommodity*)o)) /** A pointer to the parent class of a commodity tree model. */ static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome-utils/gnc-tree-model-owner.c b/gnucash/gnome-utils/gnc-tree-model-owner.c index 620642fc7f..5075a69b0d 100644 --- a/gnucash/gnome-utils/gnc-tree-model-owner.c +++ b/gnucash/gnome-utils/gnc-tree-model-owner.c @@ -98,8 +98,14 @@ typedef struct GncTreeModelOwnerPrivate const gchar *negative_color; } 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)) + #define GNC_TREE_MODEL_OWNER_GET_PRIVATE(o) \ - ((GncTreeModelOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_OWNER)) + ((GncTreeModelOwnerPrivate*)gnc_tree_model_owner_get_instance_private((GncTreeModelOwner*)o)) /************************************************************/ @@ -146,11 +152,6 @@ gnc_tree_model_owner_class_init (GncTreeModelOwnerClass *klass) o_class->dispose = gnc_tree_model_owner_dispose; } -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) { diff --git a/gnucash/gnome-utils/gnc-tree-model-price.c b/gnucash/gnome-utils/gnc-tree-model-price.c index bca5f30673..3c2e3276cf 100644 --- a/gnucash/gnome-utils/gnc-tree-model-price.c +++ b/gnucash/gnome-utils/gnc-tree-model-price.c @@ -132,7 +132,7 @@ typedef struct GncTreeModelPricePrivate } GncTreeModelPricePrivate; #define GNC_TREE_MODEL_PRICE_GET_PRIVATE(o) \ - ((GncTreeModelPricePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_PRICE)) + ((GncTreeModelPricePrivate*)gnc_tree_model_price_get_instance_private((GncTreeModelPrice*)o)) /** A pointer to the parent class of a price tree model. */ static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome-utils/gnc-tree-model-selection.c b/gnucash/gnome-utils/gnc-tree-model-selection.c index d6734d440a..98b9e2259c 100644 --- a/gnucash/gnome-utils/gnc-tree-model-selection.c +++ b/gnucash/gnome-utils/gnc-tree-model-selection.c @@ -97,7 +97,7 @@ typedef struct GncTreeModelSelectionPrivate } GncTreeModelSelectionPrivate; #define GNC_TREE_MODEL_SELECTION_GET_PRIVATE(o) \ - ((GncTreeModelSelectionPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_SELECTION)) + ((GncTreeModelSelectionPrivate*)gnc_tree_model_selection_get_instance_private((GncTreeModelSelection*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome-utils/gnc-tree-model-split-reg.c b/gnucash/gnome-utils/gnc-tree-model-split-reg.c index 943a43c9c1..c333b48b0d 100644 --- a/gnucash/gnome-utils/gnc-tree-model-split-reg.c +++ b/gnucash/gnome-utils/gnc-tree-model-split-reg.c @@ -220,7 +220,7 @@ gtm_sr_make_iter (GncTreeModelSplitReg *model, gint f, GList *tnode, GList *snod #define GNC_TREE_MODEL_SPLIT_REG_GET_PRIVATE(o) \ - ((GncTreeModelSplitRegPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_SPLIT_REG)) + ((GncTreeModelSplitRegPrivate*)gnc_tree_model_split_reg_get_instance_private((GncTreeModelSplitReg*)o)) /************************************************************/ /* g_object required functions */ diff --git a/gnucash/gnome-utils/gnc-tree-model.c b/gnucash/gnome-utils/gnc-tree-model.c index 645d1efaa1..5ec81fbe08 100644 --- a/gnucash/gnome-utils/gnc-tree-model.c +++ b/gnucash/gnome-utils/gnc-tree-model.c @@ -51,7 +51,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncTreeModel, gnc_tree_model, G_TYPE_OBJECT, G_ADD_PRIVATE(GncTreeModel)) #define GNC_TREE_MODEL_GET_PRIVATE(o) \ - ((GncTreeModelPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL)) + ((GncTreeModelPrivate*)gnc_tree_model_get_instance_private((GncTreeModel*)o)) /************************************************************/ diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c index 03425bf056..b5b106f784 100644 --- a/gnucash/gnome-utils/gnc-tree-view-account.c +++ b/gnucash/gnome-utils/gnc-tree-view-account.c @@ -115,7 +115,7 @@ typedef struct GncTreeViewAccountPrivate } GncTreeViewAccountPrivate; #define GNC_TREE_VIEW_ACCOUNT_GET_PRIVATE(o) \ - ((GncTreeViewAccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_ACCOUNT)) + ((GncTreeViewAccountPrivate*)gnc_tree_view_account_get_instance_private((GncTreeViewAccount*)o)) /************************************************************/ diff --git a/gnucash/gnome-utils/gnc-tree-view-commodity.c b/gnucash/gnome-utils/gnc-tree-view-commodity.c index 83f06b2edd..fc011381df 100644 --- a/gnucash/gnome-utils/gnc-tree-view-commodity.c +++ b/gnucash/gnome-utils/gnc-tree-view-commodity.c @@ -58,7 +58,7 @@ typedef struct GncTreeViewCommodityPrivate } GncTreeViewCommodityPrivate; #define GNC_TREE_VIEW_COMMODITY_GET_PRIVATE(o) \ - ((GncTreeViewCommodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_COMMODITY)) + ((GncTreeViewCommodityPrivate*)gnc_tree_view_commodity_get_instance_private(GncTreeViewCommodity*)o)) /************************************************************/ diff --git a/gnucash/gnome-utils/gnc-tree-view-owner.c b/gnucash/gnome-utils/gnc-tree-view-owner.c index 6baab177b0..8ef9430e5c 100644 --- a/gnucash/gnome-utils/gnc-tree-view-owner.c +++ b/gnucash/gnome-utils/gnc-tree-view-owner.c @@ -87,7 +87,7 @@ typedef struct GncTreeViewOwnerPrivate } GncTreeViewOwnerPrivate; #define GNC_TREE_VIEW_OWNER_GET_PRIVATE(o) \ - ((GncTreeViewOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_OWNER)) + ((GncTreeViewOwnerPrivate*)gnc_tree_view_owner_get_instance_private((GncTreeViewOwner*)o)) /************************************************************/ diff --git a/gnucash/gnome-utils/gnc-tree-view-price.c b/gnucash/gnome-utils/gnc-tree-view-price.c index 06248213b2..77a42457e3 100644 --- a/gnucash/gnome-utils/gnc-tree-view-price.c +++ b/gnucash/gnome-utils/gnc-tree-view-price.c @@ -58,7 +58,7 @@ typedef struct GncTreeViewPricePrivate } GncTreeViewPricePrivate; #define GNC_TREE_VIEW_PRICE_GET_PRIVATE(o) \ - ((GncTreeViewPricePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_PRICE)) + ((GncTreeViewPricePrivate*)gnc_tree_view_price_get_instance_private((GncTreeViewPrice*)o)) /************************************************************/ diff --git a/gnucash/gnome-utils/gnc-tree-view-split-reg.c b/gnucash/gnome-utils/gnc-tree-view-split-reg.c index bc8cd7a8ca..87c0a757f2 100644 --- a/gnucash/gnome-utils/gnc-tree-view-split-reg.c +++ b/gnucash/gnome-utils/gnc-tree-view-split-reg.c @@ -301,7 +301,7 @@ struct GncTreeViewSplitRegPrivate #define SHOW_SYMBOL FALSE #define GNC_TREE_VIEW_SPLIT_REG_GET_PRIVATE(o) \ - ((GncTreeViewSplitRegPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_SPLIT_REG)) + ((GncTreeViewSplitRegPrivate*)gnc_tree_view_split_reg_get_instance_private((GncTreeViewSplitReg*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome-utils/gnc-tree-view-sx-list.c b/gnucash/gnome-utils/gnc-tree-view-sx-list.c index 2bbe164761..a48065e5b2 100644 --- a/gnucash/gnome-utils/gnc-tree-view-sx-list.c +++ b/gnucash/gnome-utils/gnc-tree-view-sx-list.c @@ -59,7 +59,7 @@ typedef struct GncTreeViewSxListPrivate } GncTreeViewSxListPrivate; #define GNC_TREE_VIEW_SX_LIST_GET_PRIVATE(o) \ - ((GncTreeViewSxListPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_SX_LIST)) + ((GncTreeViewSxListPrivate*)gnc_tree_view_sx_list_get_instance_private((GncTreeViewSxList*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome-utils/gnc-tree-view.c b/gnucash/gnome-utils/gnc-tree-view.c index 0de60f8063..201d770e26 100644 --- a/gnucash/gnome-utils/gnc-tree-view.c +++ b/gnucash/gnome-utils/gnc-tree-view.c @@ -132,7 +132,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncTreeView, gnc_tree_view, GTK_TYPE_TREE_VIEW, G_ADD_PRIVATE(GncTreeView)) #define GNC_TREE_VIEW_GET_PRIVATE(o) \ - ((GncTreeViewPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW)) + ((GncTreeViewPrivate*)gnc_tree_view_get_instance_private((GncTreeView*)o)) /************************************************************/ diff --git a/gnucash/gnome-utils/search-param.c b/gnucash/gnome-utils/search-param.c index 18f54e23c5..4524774ffb 100644 --- a/gnucash/gnome-utils/search-param.c +++ b/gnucash/gnome-utils/search-param.c @@ -53,7 +53,7 @@ struct _GNCSearchParamPrivate }; #define GNC_SEARCH_PARAM_GET_PRIVATE(o) \ - ((GNCSearchParamPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM)) + ((GNCSearchParamPrivate*)gnc_search_param_get_instance_private ((GNCSearchParam*)o)) typedef struct _GNCSearchParamSimplePrivate GNCSearchParamSimplePrivate; @@ -67,7 +67,7 @@ struct _GNCSearchParamSimplePrivate }; #define GNC_SEARCH_PARAM_SIMPLE_GET_PRIVATE(o) \ - ((GNCSearchParamSimplePrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM_SIMPLE)) + ((GNCSearchParamSimplePrivate*)gnc_search_param_simple_get_instance_private ((GNCSearchParamSimple*)o)) typedef struct _GNCSearchParamCompoundPrivate GNCSearchParamCompoundPrivate; @@ -80,7 +80,7 @@ struct _GNCSearchParamCompoundPrivate }; #define GNC_SEARCH_PARAM_COMPOUND_GET_PRIVATE(o) \ - ((GNCSearchParamCompoundPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM_COMPOUND)) + ((GNCSearchParamCompoundPrivate*)gnc_search_param_compound_get_instance_private ((GNCSearchParamCompound*)o)) static GObjectClass *parent_gobject_class; static GNCSearchParamClass *parent_search_param_class; diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c index d2bc001ffc..26facbe9d9 100644 --- a/gnucash/gnome/gnc-budget-view.c +++ b/gnucash/gnome/gnc-budget-view.c @@ -178,7 +178,7 @@ struct GncBudgetViewPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncBudgetView, gnc_budget_view, GTK_TYPE_BOX) #define GNC_BUDGET_VIEW_GET_PRIVATE(o) \ - ((GncBudgetViewPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_BUDGET_VIEW)) + ((GncBudgetViewPrivate*)gnc_budget_view_get_instance_private((GncBudgetView*)o)) /** \brief Create new gnc budget view. diff --git a/gnucash/gnome/gnc-plugin-account-tree.c b/gnucash/gnome/gnc-plugin-account-tree.c index fec9c2f4c4..049f4e72e6 100644 --- a/gnucash/gnome/gnc-plugin-account-tree.c +++ b/gnucash/gnome/gnc-plugin-account-tree.c @@ -74,7 +74,7 @@ typedef struct GncPluginAccountTreePrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN) #define GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE(o) \ - ((GncPluginAccountTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_ACCOUNT_TREE)) + ((GncPluginAccountTreePrivate*)gnc_plugin_account_tree_get_instance_private((GncPluginAccountTree*)o)) /** A pointer to the parent class of a plugin page. */ static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c index 2978808412..1f4b83a654 100644 --- a/gnucash/gnome/gnc-plugin-basic-commands.c +++ b/gnucash/gnome/gnc-plugin-basic-commands.c @@ -278,7 +278,7 @@ typedef struct GncPluginBasicCommandsPrivate } GncPluginBasicCommandsPrivate; #define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \ - ((GncPluginBasicCommandsPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BASIC_COMMANDS)) + ((GncPluginBasicCommandsPrivate*)gnc_plugin_basic_commands_get_instance_private((GncPluginBasicCommands*)o)) /** A pointer to the parent class of a plugin page. */ static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-budget.c b/gnucash/gnome/gnc-plugin-budget.c index a186a0406e..55848e2b97 100644 --- a/gnucash/gnome/gnc-plugin-budget.c +++ b/gnucash/gnome/gnc-plugin-budget.c @@ -101,7 +101,7 @@ typedef struct GncPluginBudgetPrivate } GncPluginBudgetPrivate; #define GNC_PLUGIN_BUDGET_GET_PRIVATE(o) \ - ((GncPluginBudgetPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_BUDGET)) + ((GncPluginBudgetPrivate*)gnc_plugin_budget_get_instance_private((GncPluginBudget*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-business.c b/gnucash/gnome/gnc-plugin-business.c index 5497eff327..06d0ecf24c 100644 --- a/gnucash/gnome/gnc-plugin-business.c +++ b/gnucash/gnome/gnc-plugin-business.c @@ -348,7 +348,7 @@ typedef struct GncPluginBusinessPrivate } GncPluginBusinessPrivate; #define GNC_PLUGIN_BUSINESS_GET_PRIVATE(o) \ - ((GncPluginBusinessPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BUSINESS)) + ((GncPluginBusinessPrivate*)gnc_plugin_business_get_instance_private((GncPluginBusiness*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c index 4c43b16122..72d8960d35 100644 --- a/gnucash/gnome/gnc-plugin-page-account-tree.c +++ b/gnucash/gnome/gnc-plugin-page-account-tree.c @@ -116,7 +116,7 @@ typedef struct GncPluginPageAccountTreePrivate } GncPluginPageAccountTreePrivate; #define GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(o) \ - ((GncPluginPageAccountTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE)) + ((GncPluginPageAccountTreePrivate*)gnc_plugin_page_account_tree_get_instance_private((GncPluginPageAccountTree*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-page-budget.c b/gnucash/gnome/gnc-plugin-page-budget.c index b30755688d..8b6722c044 100644 --- a/gnucash/gnome/gnc-plugin-page-budget.c +++ b/gnucash/gnome/gnc-plugin-page-budget.c @@ -283,7 +283,7 @@ typedef struct GncPluginPageBudgetPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageBudget, gnc_plugin_page_budget, GNC_TYPE_PLUGIN_PAGE) #define GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(o) \ - ((GncPluginPageBudgetPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_BUDGET)) + ((GncPluginPageBudgetPrivate*)gnc_plugin_page_budget_get_instance_private((GncPluginPageBudget*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-page-invoice.c b/gnucash/gnome/gnc-plugin-page-invoice.c index badb40347d..596b46900b 100644 --- a/gnucash/gnome/gnc-plugin-page-invoice.c +++ b/gnucash/gnome/gnc-plugin-page-invoice.c @@ -478,7 +478,7 @@ typedef struct GncPluginPageInvoicePrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageInvoice, gnc_plugin_page_invoice, GNC_TYPE_PLUGIN_PAGE) #define GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(o) \ - ((GncPluginPageInvoicePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_INVOICE)) + ((GncPluginPageInvoicePrivate*)gnc_plugin_page_invoice_get_instance_private((GncPluginPageInvoice*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-page-owner-tree.c b/gnucash/gnome/gnc-plugin-page-owner-tree.c index 9c1563617e..7fde41a602 100644 --- a/gnucash/gnome/gnc-plugin-page-owner-tree.c +++ b/gnucash/gnome/gnc-plugin-page-owner-tree.c @@ -87,8 +87,10 @@ typedef struct GncPluginPageOwnerTreePrivate OwnerFilterDialog fd; } GncPluginPageOwnerTreePrivate; +G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageOwnerTree, gnc_plugin_page_owner_tree, GNC_TYPE_PLUGIN_PAGE) + #define GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(o) \ - ((GncPluginPageOwnerTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_OWNER_TREE)) + ((GncPluginPageOwnerTreePrivate*)gnc_plugin_page_owner_tree_get_instance_private((GncPluginPageOwnerTree*)o)) static GObjectClass *parent_class = NULL; @@ -397,8 +399,6 @@ gnc_plugin_page_owner_focus_widget (GncPluginPage *owner_plugin_page) return FALSE; } -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) { diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c index bfa0f671c0..4e23688404 100644 --- a/gnucash/gnome/gnc-plugin-page-register.c +++ b/gnucash/gnome/gnc-plugin-page-register.c @@ -739,7 +739,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GncPluginPageRegister, gnc_plugin_page_register, GNC_TYPE_PLUGIN_PAGE) #define GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(o) \ - ((GncPluginPageRegisterPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_REGISTER)) + ((GncPluginPageRegisterPrivate*)gnc_plugin_page_register_get_instance_private((GncPluginPageRegister*)o)) static GObjectClass* parent_class = NULL; diff --git a/gnucash/gnome/gnc-plugin-page-report.c b/gnucash/gnome/gnc-plugin-page-report.c index fea5c29c6b..1ec7b2b194 100644 --- a/gnucash/gnome/gnc-plugin-page-report.c +++ b/gnucash/gnome/gnc-plugin-page-report.c @@ -135,7 +135,7 @@ typedef struct GncPluginPageReportPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageReport, gnc_plugin_page_report, GNC_TYPE_PLUGIN_PAGE) #define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(o) \ - ((GncPluginPageReportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_REPORT)) + ((GncPluginPageReportPrivate*)gnc_plugin_page_report_get_instance_private((GncPluginPageReport*)o)) static void gnc_plugin_page_report_class_init( GncPluginPageReportClass *klass ); static void gnc_plugin_page_report_init( GncPluginPageReport *plugin_page ); diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c index 218a5e0c3a..4ea5d6e459 100644 --- a/gnucash/gnome/gnc-plugin-page-sx-list.c +++ b/gnucash/gnome/gnc-plugin-page-sx-list.c @@ -99,8 +99,10 @@ typedef struct GncPluginPageSxListPrivate } GncPluginPageSxListPrivate; +G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageSxList, gnc_plugin_page_sx_list, GNC_TYPE_PLUGIN_PAGE) + #define GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(o) \ - ((GncPluginPageSxListPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_SX_LIST)) + ((GncPluginPageSxListPrivate*)gnc_plugin_page_sx_list_get_instance_private((GncPluginPageSxList*)o)) static GObjectClass *parent_class = NULL; @@ -210,8 +212,6 @@ gnc_plugin_page_sx_list_focus_widget (GncPluginPage *sx_plugin_page) return FALSE; } -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) { diff --git a/gnucash/gnome/gnc-plugin-register.c b/gnucash/gnome/gnc-plugin-register.c index 31ea43be00..44e6d8c32b 100644 --- a/gnucash/gnome/gnc-plugin-register.c +++ b/gnucash/gnome/gnc-plugin-register.c @@ -71,7 +71,7 @@ typedef struct GncPluginRegisterPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN) #define GNC_PLUGIN_REGISTER_GET_PRIVATE(o) \ - ((GncPluginRegisterPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_REGISTER)) + ((GncPluginRegisterPrivate*)gnc_plugin_register_get_instance_private((GncPluginRegister*)o)) static GObjectClass *parent_class = NULL; static QofLogModule log_module = GNC_MOD_GUI; diff --git a/gnucash/gnome/search-owner.c b/gnucash/gnome/search-owner.c index 1801a742e4..e8bce2a4e4 100644 --- a/gnucash/gnome/search-owner.c +++ b/gnucash/gnome/search-owner.c @@ -60,7 +60,7 @@ typedef struct _GNCSearchOwnerPrivate G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchOwner, gnc_search_owner, GNC_TYPE_SEARCH_CORE_TYPE); #define _PRIVATE(o) \ - ((GNCSearchOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_OWNER)) + ((GNCSearchOwnerPrivate*)gnc_search_owner_get_instance_private((GNCSearchOwner*)o)) static GNCSearchCoreTypeClass *parent_class; diff --git a/gnucash/html/gnc-html.c b/gnucash/html/gnc-html.c index 4565bdaad2..d1f0feecf5 100644 --- a/gnucash/html/gnc-html.c +++ b/gnucash/html/gnc-html.c @@ -73,7 +73,7 @@ static void gnc_html_dispose( GObject* obj ); static void gnc_html_finalize( GObject* obj ); /* #define GNC_HTML_GET_PRIVATE(o) \ - ((GncHtmlPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_HTML)) + ((GncHtmlPrivate*)gnc_html_get_instance_private((GncHtml*)o)) */ #define GNC_HTML_GET_PRIVATE(o) (GNC_HTML(o)->priv) diff --git a/gnucash/import-export/csv-exp/gnc-plugin-csv-export.c b/gnucash/import-export/csv-exp/gnc-plugin-csv-export.c index 97b1b9f454..000dd947ff 100644 --- a/gnucash/import-export/csv-exp/gnc-plugin-csv-export.c +++ b/gnucash/import-export/csv-exp/gnc-plugin-csv-export.c @@ -77,7 +77,7 @@ typedef struct GncPluginCsvExportPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN) #define GNC_PLUGIN_CSV_EXPORT_GET_PRIVATE(o) \ - ((GncPluginCsvExportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_CSV_EXPORT)) + ((GncPluginCsvExportPrivate*)gnc_plugin_csv_export_get_instance_private((GncPluginCsvExport*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/import-export/csv-imp/gnc-plugin-csv-import.c b/gnucash/import-export/csv-imp/gnc-plugin-csv-import.c index 4257b25947..11a031157b 100644 --- a/gnucash/import-export/csv-imp/gnc-plugin-csv-import.c +++ b/gnucash/import-export/csv-imp/gnc-plugin-csv-import.c @@ -72,7 +72,7 @@ typedef struct GncPluginCsvImportPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN) #define GNC_PLUGIN_CSV_IMPORT_GET_PRIVATE(o) \ - ((GncPluginCsvImportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_CSV_IMPORT)) + ((GncPluginCsvImportPrivate*)gnc_plugin_csv_import_get_instance_private((GncPluginCsvImport*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/import-export/log-replay/gnc-plugin-log-replay.c b/gnucash/import-export/log-replay/gnc-plugin-log-replay.c index 1356caf4e4..31f9809642 100644 --- a/gnucash/import-export/log-replay/gnc-plugin-log-replay.c +++ b/gnucash/import-export/log-replay/gnc-plugin-log-replay.c @@ -60,7 +60,7 @@ typedef struct GncPluginLogreplayPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogreplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN) #define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o) \ - ((GncPluginLogreplayPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_LOG_REPLAY)) + ((GncPluginLogreplayPrivate*)gnc_plugin_log_replay_get_instance_private((GncPluginLogReplay*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/import-export/ofx/gnc-plugin-ofx.c b/gnucash/import-export/ofx/gnc-plugin-ofx.c index be07e1ecd3..94e7c3e4f4 100644 --- a/gnucash/import-export/ofx/gnc-plugin-ofx.c +++ b/gnucash/import-export/ofx/gnc-plugin-ofx.c @@ -58,7 +58,7 @@ typedef struct GncPluginOfxPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN) #define GNC_PLUGIN_OFX_GET_PRIVATE(o) \ - ((GncPluginOfxPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_OFX)) + ((GncPluginOfxPrivate*)gnc_plugin_ofx_get_instance_private((GncPluginOfx*)o)) static GObjectClass *parent_class = NULL; diff --git a/gnucash/import-export/qif-imp/gnc-plugin-qif-import.c b/gnucash/import-export/qif-imp/gnc-plugin-qif-import.c index 4b73538cee..2aed0ae593 100644 --- a/gnucash/import-export/qif-imp/gnc-plugin-qif-import.c +++ b/gnucash/import-export/qif-imp/gnc-plugin-qif-import.c @@ -60,7 +60,7 @@ typedef struct GncPluginQifImportPrivate G_DEFINE_TYPE_WITH_PRIVATE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN); #define GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(o) \ - ((GncPluginQifImportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_QIF_IMPORT)) + ((GncPluginQifImportPrivate*)gnc_plugin_qif_import_get_instance_private((GncPluginQifImport*)o)) static GObjectClass *parent_class = NULL; diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp index a0fcd49e1c..5b80ef5a8f 100644 --- a/libgnucash/engine/Account.cpp +++ b/libgnucash/engine/Account.cpp @@ -138,7 +138,7 @@ enum }; #define GET_PRIVATE(o) \ - ((AccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_ACCOUNT)) + ((AccountPrivate*)gnc_account_get_instance_private((Account*)o)) /* This map contains a set of strings representing the different column types. */ static const std::map gnc_acct_debit_strs = { diff --git a/libgnucash/engine/gnc-budget.cpp b/libgnucash/engine/gnc-budget.cpp index 3600b39102..88847b750f 100644 --- a/libgnucash/engine/gnc-budget.cpp +++ b/libgnucash/engine/gnc-budget.cpp @@ -91,7 +91,7 @@ typedef struct GncBudgetPrivate } GncBudgetPrivate; #define GET_PRIVATE(o) \ - ((GncBudgetPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_BUDGET)) + ((GncBudgetPrivate*)gnc_budget_get_instance_private((GncBudget*)o)) struct _GncBudgetClass { diff --git a/libgnucash/engine/gnc-commodity.c b/libgnucash/engine/gnc-commodity.c index df80a9b342..ac686c4b7b 100644 --- a/libgnucash/engine/gnc-commodity.c +++ b/libgnucash/engine/gnc-commodity.c @@ -94,7 +94,7 @@ static const char* is_unset = "unset"; #define GET_PRIVATE(o) \ - ((gnc_commodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_COMMODITY)) + ((gnc_commodityPrivate*)gnc_commodity_get_instance_private((gnc_commodity*)o)) struct _GncCommodityClass { diff --git a/libgnucash/engine/gnc-lot.c b/libgnucash/engine/gnc-lot.c index 7302ef1362..dd0cec9ddf 100644 --- a/libgnucash/engine/gnc-lot.c +++ b/libgnucash/engine/gnc-lot.c @@ -100,7 +100,7 @@ typedef struct GNCLotPrivate } GNCLotPrivate; #define GET_PRIVATE(o) \ - ((GNCLotPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_LOT)) + ((GNCLotPrivate*)gnc_lot_get_instance_private((GNCLot*)o)) #define gnc_lot_set_guid(L,G) qof_instance_set_guid(QOF_INSTANCE(L),&(G)) @@ -399,8 +399,12 @@ gnc_lot_get_account (const GNCLot *lot) GncInvoice * gnc_lot_get_cached_invoice (const GNCLot *lot) { - if (!lot) return NULL; - return GET_PRIVATE(lot)->cached_invoice; + if (!lot) return NULL; + else + { + GNCLotPrivate *priv = GET_PRIVATE(lot); + return priv->cached_invoice; + } } void diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp index 7f99994a9a..12b7dcbfed 100644 --- a/libgnucash/engine/qofinstance.cpp +++ b/libgnucash/engine/qofinstance.cpp @@ -112,7 +112,7 @@ typedef struct QofInstancePrivate } QofInstancePrivate; #define GET_PRIVATE(o) \ - ((QofInstancePrivate*)g_type_instance_get_private((GTypeInstance*)o, QOF_TYPE_INSTANCE)) + ((QofInstancePrivate*)qof_instance_get_instance_private((QofInstance*)o)) G_DEFINE_TYPE_WITH_PRIVATE(QofInstance, qof_instance, G_TYPE_OBJECT); QOF_GOBJECT_FINALIZE(qof_instance);