diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.c b/gnucash/gnome-utils/gnc-plugin-file-history.c index 3ac2bf3ffeb..45174ba0bb2 100644 --- a/gnucash/gnome-utils/gnc-plugin-file-history.c +++ b/gnucash/gnome-utils/gnc-plugin-file-history.c @@ -99,16 +99,11 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -/** The instance private data for a file history plugin. This data - * structure is unused. */ -typedef struct GncPluginFileHistoryPrivate +/** The instance data structure for a file history plugin. */ +struct _GncPluginFileHistory { - gpointer dummy; -} GncPluginFileHistoryPrivate; - - -#define GNC_PLUGIN_FILE_HISTORY_GET_PRIVATE(o) \ - ((GncPluginFileHistoryPrivate*)gnc_plugin_file_history_get_instance_private((GncPluginFileHistory*)o)) + GncPlugin gnc_plugin; +}; /************************************************************ * Other Functions * @@ -546,7 +541,7 @@ gnc_plugin_history_list_changed (gpointer prefs, * Object Implementation * ************************************************************/ -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginFileHistory, gnc_plugin_file_history, GNC_TYPE_PLUGIN) +G_DEFINE_TYPE(GncPluginFileHistory, gnc_plugin_file_history, GNC_TYPE_PLUGIN) /** Initialize the file history plugin class. */ static void diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.h b/gnucash/gnome-utils/gnc-plugin-file-history.h index 24a30a5a76c..8dfb54e8dbc 100644 --- a/gnucash/gnome-utils/gnc-plugin-file-history.h +++ b/gnucash/gnome-utils/gnc-plugin-file-history.h @@ -41,39 +41,13 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_FILE_HISTORY (gnc_plugin_file_history_get_type ()) -#define GNC_PLUGIN_FILE_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_FILE_HISTORY, GncPluginFileHistory)) -#define GNC_PLUGIN_FILE_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_FILE_HISTORY, GncPluginFileHistoryClass)) -#define GNC_IS_PLUGIN_FILE_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_FILE_HISTORY)) -#define GNC_IS_PLUGIN_FILE_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_FILE_HISTORY)) -#define GNC_PLUGIN_FILE_HISTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_FILE_HISTORY, GncPluginFileHistoryClass)) +G_DECLARE_FINAL_TYPE (GncPluginFileHistory, gnc_plugin_file_history, GNC, PLUGIN_FILE_HISTORY, GncPlugin) #define GNC_PLUGIN_FILE_HISTORY_NAME "gnc-plugin-file-history" -/* typedefs & structures */ - -/** The instance data structure for a file history plugin. */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginFileHistory; - - -/** The class data structure for a file history plugin. */ -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginFileHistoryClass; /* function prototypes */ - -/** Get the type of a file history plugin. - * - * @return A GType. - */ -GType gnc_plugin_file_history_get_type (void); - - /** Create a new file history plugin. This plugin attaches the file * history menu to any window that is opened. * diff --git a/gnucash/gnome-utils/gnc-plugin-menu-additions.c b/gnucash/gnome-utils/gnc-plugin-menu-additions.c index 382556b1462..98ef68cb9b3 100644 --- a/gnucash/gnome-utils/gnc-plugin-menu-additions.c +++ b/gnucash/gnome-utils/gnc-plugin-menu-additions.c @@ -60,15 +60,12 @@ static QofLogModule log_module = GNC_MOD_GUI; #define PLUGIN_ACTIONS_NAME "gnc-plugin-menu-additions-actions" -/** Private data for this plugin. This data structure is unused. */ -typedef struct GncPluginMenuAdditionsPrivate +struct _GncPluginMenuAdditions { - GHashTable *item_hash; -} GncPluginMenuAdditionsPrivate; - -#define GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(o) \ - ((GncPluginMenuAdditionsPrivate*)gnc_plugin_menu_additions_get_instance_private((GncPluginMenuAdditions*)o)) + GncPlugin gnc_plugin; + GHashTable *item_hash; +}; /** Per-window private data for this plugin. This plugin is unique in * that it manages its own menu items. */ @@ -96,7 +93,7 @@ static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions); * Object Implementation * ************************************************************/ -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginMenuAdditions, gnc_plugin_menu_additions, GNC_TYPE_PLUGIN) +G_DEFINE_TYPE(GncPluginMenuAdditions, gnc_plugin_menu_additions, GNC_TYPE_PLUGIN) static void gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass) @@ -127,14 +124,11 @@ gnc_plugin_menu_additions_init (GncPluginMenuAdditions *plugin) static void gnc_plugin_menu_additions_finalize (GObject *object) { - GncPluginMenuAdditionsPrivate *priv; g_return_if_fail (GNC_IS_PLUGIN_MENU_ADDITIONS(object)); ENTER("plugin %p", object); - priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(object); - - g_hash_table_destroy (priv->item_hash); + g_hash_table_destroy (GNC_PLUGIN_MENU_ADDITIONS(object)->item_hash); G_OBJECT_CLASS (gnc_plugin_menu_additions_parent_class)->finalize (object); LEAVE(""); @@ -180,10 +174,6 @@ gnc_plugin_menu_additions_action_new_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data) { - GncMainWindowActionData *cb_data = user_data; - GncPlugin *plugin = cb_data->data; - GncPluginMenuAdditionsPrivate *priv; - SCM extension; gsize length; const gchar *action_name; @@ -192,13 +182,13 @@ gnc_plugin_menu_additions_action_new_cb (GSimpleAction *simple, ENTER(""); - priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(plugin); - action_name = g_variant_get_string (parameter, &length); PINFO("action name is '%s'", action_name); - extension = g_hash_table_lookup (priv->item_hash, action_name); + GncMainWindowActionData *cb_data = user_data; + GncPluginMenuAdditions *plugin = GNC_PLUGIN_MENU_ADDITIONS(cb_data->data); + extension = g_hash_table_lookup (plugin->item_hash, action_name); if (extension) { @@ -477,7 +467,6 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type) { - GncPluginMenuAdditionsPrivate *priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(plugin); GncPluginMenuAdditionsPerWindow per_window; static GOnce accel_table_init = G_ONCE_INIT; static GHashTable *table; @@ -487,10 +476,11 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin, ENTER(" "); - if (!priv->item_hash) - priv->item_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + GncPluginMenuAdditions *menu_plugin = GNC_PLUGIN_MENU_ADDITIONS (plugin); + if (!menu_plugin->item_hash) + menu_plugin->item_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - per_window.item_hash = priv->item_hash; + per_window.item_hash = menu_plugin->item_hash; per_window.build_menu_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); per_window.report_menu = g_menu_new (); diff --git a/gnucash/gnome-utils/gnc-plugin-menu-additions.h b/gnucash/gnome-utils/gnc-plugin-menu-additions.h index 5ba45ceb5ff..953f49dfe5d 100644 --- a/gnucash/gnome-utils/gnc-plugin-menu-additions.h +++ b/gnucash/gnome-utils/gnc-plugin-menu-additions.h @@ -44,35 +44,12 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_MENU_ADDITIONS (gnc_plugin_menu_additions_get_type ()) -#define GNC_PLUGIN_MENU_ADDITIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditions)) -#define GNC_PLUGIN_MENU_ADDITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditionsClass)) -#define GNC_IS_PLUGIN_MENU_ADDITIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS)) -#define GNC_IS_PLUGIN_MENU_ADDITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_MENU_ADDITIONS)) -#define GNC_PLUGIN_MENU_ADDITIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditionsClass)) +G_DECLARE_FINAL_TYPE (GncPluginMenuAdditions, gnc_plugin_menu_additions, GNC, PLUGIN_MENU_ADDITIONS, GncPlugin) #define GNC_PLUGIN_MENU_ADDITIONS_NAME "gnc-plugin-menu-additions" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginMenuAdditions; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginMenuAdditionsClass; - /* function prototypes */ - -/** Get the type of an extensions plugin. - * - * @return A GType. - */ -GType gnc_plugin_menu_additions_get_type (void); - - /** Create a new menu_additions plugin. This plugin attaches the menu * items from Scheme code to any window that is opened. * diff --git a/gnucash/gnome-utils/gnc-plugin.h b/gnucash/gnome-utils/gnc-plugin.h index ab4619b86bf..9d7fe5d8b1b 100644 --- a/gnucash/gnome-utils/gnc-plugin.h +++ b/gnucash/gnome-utils/gnc-plugin.h @@ -86,25 +86,14 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN (gnc_plugin_get_type ()) -#define GNC_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN, GncPlugin)) -#define GNC_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN, GncPluginClass)) -#define GNC_IS_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN)) -#define GNC_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN)) -#define GNC_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN, GncPluginClass)) +G_DECLARE_DERIVABLE_TYPE (GncPlugin, gnc_plugin, GNC, PLUGIN, GObject) #define GNC_PLUGIN_NAME "GncPlugin" /* typedefs & structures */ -/** The instance data structure for a menu-only plugin. */ -typedef struct -{ - /** The parent object for this widget */ - GObject gobject; -} GncPlugin; - /** The class data structure for a menu-only plugin. */ -typedef struct +struct _GncPluginClass { /** The parent class for this widget. */ GObjectClass gobject; @@ -163,17 +152,10 @@ typedef struct * window. */ void (* remove_from_window) (GncPlugin *plugin, GncMainWindow *window, GQuark type); -} GncPluginClass; +}; /* function prototypes */ -/** Get the type of a menu-only plugin. - * - * @return A GType. - */ -GType gnc_plugin_get_type (void); - - /** Add the specified plugin to the specified window. This function * will add the page's user interface from the window and call the * plugin to perform any plugin specific actions. diff --git a/gnucash/gnome/gnc-plugin-account-tree.c b/gnucash/gnome/gnc-plugin-account-tree.c index b23e698aafc..ea9aa24310f 100644 --- a/gnucash/gnome/gnc-plugin-account-tree.c +++ b/gnucash/gnome/gnc-plugin-account-tree.c @@ -65,16 +65,14 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -/** The instance private data structure for an account tree plugin. */ -typedef struct GncPluginAccountTreePrivate +/** The instance data structure for an account tree menu plugin. */ +struct _GncPluginAccountTree { - gpointer dummy; -} GncPluginAccountTreePrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN) + /** The parent object for this widget */ + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE(o) \ - ((GncPluginAccountTreePrivate*)gnc_plugin_account_tree_get_instance_private((GncPluginAccountTree*)o)) +G_DEFINE_TYPE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN) /* Create a new account tree menu plugin. */ GncPlugin * diff --git a/gnucash/gnome/gnc-plugin-account-tree.h b/gnucash/gnome/gnc-plugin-account-tree.h index 4c1018cef72..4bd072d9ec4 100644 --- a/gnucash/gnome/gnc-plugin-account-tree.h +++ b/gnucash/gnome/gnc-plugin-account-tree.h @@ -42,38 +42,10 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_ACCOUNT_TREE (gnc_plugin_account_tree_get_type ()) -#define GNC_PLUGIN_ACCOUNT_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_ACCOUNT_TREE, GncPluginAccountTree)) -#define GNC_PLUGIN_ACCOUNT_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_ACCOUNT_TREE, GncPluginAccountTreeClass)) -#define GNC_IS_PLUGIN_ACCOUNT_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_ACCOUNT_TREE)) -#define GNC_IS_PLUGIN_ACCOUNT_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_ACCOUNT_TREE)) -#define GNC_PLUGIN_ACCOUNT_TREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_ACCOUNT_TREE, GncPluginAccountTreeClass)) +G_DECLARE_FINAL_TYPE (GncPluginAccountTree, gnc_plugin_account_tree, GNC, PLUGIN_ACCOUNT_TREE, GncPlugin) #define GNC_PLUGIN_ACCOUNT_TREE_NAME "gnc-plugin-account-tree" -/* typedefs & structures */ - -/** The instance data structure for an account tree menu plugin. */ -typedef struct -{ - /** The parent object for this widget */ - GncPlugin gnc_plugin; -} GncPluginAccountTree; - -/** The class data structure for an account tree menu plugin. */ -typedef struct -{ - /** The parent class for this widget. */ - GncPluginClass gnc_plugin; -} GncPluginAccountTreeClass; - - -/** Get the type of the account tree menu plugin. - * - * @return A GType. - */ -GType gnc_plugin_account_tree_get_type (void); - - /** Create a new account tree menu plugin. * * @return A pointer to the new object. diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c index 64d451ab08f..626648f638c 100644 --- a/gnucash/gnome/gnc-plugin-basic-commands.c +++ b/gnucash/gnome/gnc-plugin-basic-commands.c @@ -175,15 +175,12 @@ static const gchar *dirty_only_active_actions[] = NULL }; -/** The instance private data structure for an basic commands - * plugin. */ -typedef struct GncPluginBasicCommandsPrivate +/** The instance data structure for an basic commands menu plugin. */ +struct _GncPluginBasicCommands { - gpointer dummy; -} GncPluginBasicCommandsPrivate; - -#define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \ - ((GncPluginBasicCommandsPrivate*)gnc_plugin_basic_commands_get_instance_private ((GncPluginBasicCommands*)o)) + /** The parent object for this widget */ + GncPlugin gnc_plugin; +}; /** Create a new basic commands menu plugin. */ GncPlugin * @@ -271,7 +268,7 @@ gnc_plugin_basic_commands_main_window_page_changed (GncMainWindow *window, } } -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBasicCommands, gnc_plugin_basic_commands, GNC_TYPE_PLUGIN) +G_DEFINE_TYPE(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 diff --git a/gnucash/gnome/gnc-plugin-basic-commands.h b/gnucash/gnome/gnc-plugin-basic-commands.h index f2315ad952a..4744ab0aaa9 100644 --- a/gnucash/gnome/gnc-plugin-basic-commands.h +++ b/gnucash/gnome/gnc-plugin-basic-commands.h @@ -41,39 +41,10 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_BASIC_COMMANDS (gnc_plugin_basic_commands_get_type ()) -#define GNC_PLUGIN_BASIC_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_BASIC_COMMANDS, GncPluginBasicCommands)) -#define GNC_PLUGIN_BASIC_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_BASIC_COMMANDS, GncPluginBasicCommandsClass)) -#define GNC_IS_PLUGIN_BASIC_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_BASIC_COMMANDS)) -#define GNC_IS_PLUGIN_BASIC_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_BASIC_COMMANDS)) -#define GNC_PLUGIN_BASIC_COMMANDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_BASIC_COMMANDS, GncPluginBasicCommandsClass)) +G_DECLARE_FINAL_TYPE (GncPluginBasicCommands, gnc_plugin_basic_commands, GNC, PLUGIN_BASIC_COMMANDS, GncPlugin) #define GNC_PLUGIN_BASIC_COMMANDS_NAME "gnc-plugin-basic-commands" -/* typedefs & structures */ - -/** The instance data structure for an basic commands menu plugin. */ -typedef struct -{ - /** The parent object for this widget */ - GncPlugin gnc_plugin; -} GncPluginBasicCommands; - - -/** The class data structure for a basic commands menu plugin. */ -typedef struct -{ - /** The parent class for this widget. */ - GncPluginClass gnc_plugin; -} GncPluginBasicCommandsClass; - - -/** Get the type of the basic commands menu plugin. - * - * @return A GType. - */ -GType gnc_plugin_basic_commands_get_type (void); - - /** Create a new basic commands menu plugin. * * @return A pointer to the new object. diff --git a/gnucash/gnome/gnc-plugin-budget.c b/gnucash/gnome/gnc-plugin-budget.c index a6af81e5891..db821763b6e 100644 --- a/gnucash/gnome/gnc-plugin-budget.c +++ b/gnucash/gnome/gnc-plugin-budget.c @@ -78,13 +78,10 @@ static const gchar *plugin_writeable_actions[] = NULL }; -typedef struct GncPluginBudgetPrivate +struct _GncPluginBudget { - gpointer dummy; -} GncPluginBudgetPrivate; - -#define GNC_PLUGIN_BUDGET_GET_PRIVATE(o) \ - ((GncPluginBudgetPrivate*)gnc_plugin_budget_get_instance_private((GncPluginBudget*)o)) + GncPlugin gnc_plugin; +}; GncPlugin * gnc_plugin_budget_new (void) @@ -124,7 +121,7 @@ remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type) g_signal_handlers_disconnect_by_func (window, G_CALLBACK(page_changed), plugin); } -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBudget, gnc_plugin_budget, GNC_TYPE_PLUGIN) +G_DEFINE_TYPE(GncPluginBudget, gnc_plugin_budget, GNC_TYPE_PLUGIN) static void gnc_plugin_budget_class_init (GncPluginBudgetClass *klass) diff --git a/gnucash/gnome/gnc-plugin-budget.h b/gnucash/gnome/gnc-plugin-budget.h index 8c62938addd..e2ed24038c1 100644 --- a/gnucash/gnome/gnc-plugin-budget.h +++ b/gnucash/gnome/gnc-plugin-budget.h @@ -35,27 +35,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_BUDGET (gnc_plugin_budget_get_type ()) -#define GNC_PLUGIN_BUDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_BUDGET, GncPluginBudget)) -#define GNC_PLUGIN_BUDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_BUDGET, GncPluginBudgetClass)) -#define GNC_IS_PLUGIN_BUDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_BUDGET)) -#define GNC_IS_PLUGIN_BUDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_BUDGET)) -#define GNC_PLUGIN_BUDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_BUDGET, GncPluginBudgetClass)) +G_DECLARE_FINAL_TYPE (GncPluginBudget, gnc_plugin_budget, GNC, PLUGIN_BUDGET, GncPlugin) #define GNC_PLUGIN_BUDGET_NAME "gnc-plugin-budget" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginBudget; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginBudgetClass; - /* function prototypes */ -GType gnc_plugin_budget_get_type (void); GncPlugin *gnc_plugin_budget_new (void); /* Launch the budget list dialog.*/ diff --git a/gnucash/gnome/gnc-plugin-business.c b/gnucash/gnome/gnc-plugin-business.c index 05deefd1bac..fe4c97d30b1 100644 --- a/gnucash/gnome/gnc-plugin-business.c +++ b/gnucash/gnome/gnc-plugin-business.c @@ -174,15 +174,14 @@ static const gchar *gnc_plugin_load_ui_items [] = * Plugin Function Implementation * ************************************************************/ -typedef struct GncPluginBusinessPrivate +struct _GncPluginBusiness { + GncPlugin gnc_plugin; + GncOwner *last_customer; GncOwner *last_vendor; GncOwner *last_employee; -} GncPluginBusinessPrivate; - -#define GNC_PLUGIN_BUSINESS_GET_PRIVATE(o) \ - ((GncPluginBusinessPrivate*)gnc_plugin_business_get_instance_private((GncPluginBusiness*)o)) +}; GncPlugin * gnc_plugin_business_new (void) @@ -200,7 +199,7 @@ gnc_plugin_business_new (void) return GNC_PLUGIN (plugin); } -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBusiness, gnc_plugin_business, GNC_TYPE_PLUGIN) +G_DEFINE_TYPE(GncPluginBusiness, gnc_plugin_business, GNC_TYPE_PLUGIN) static void gnc_plugin_business_class_init (GncPluginBusinessClass *klass) @@ -227,17 +226,14 @@ gnc_plugin_business_class_init (GncPluginBusinessClass *klass) static void gnc_plugin_business_init (GncPluginBusiness *plugin) { - GncPluginBusinessPrivate *priv; - - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - priv->last_customer = gncOwnerNew (); - gncOwnerInitCustomer (priv->last_customer, NULL); + plugin->last_customer = gncOwnerNew (); + gncOwnerInitCustomer (plugin->last_customer, NULL); - priv->last_vendor = gncOwnerNew (); - gncOwnerInitVendor (priv->last_vendor, NULL); + plugin->last_vendor = gncOwnerNew (); + gncOwnerInitVendor (plugin->last_vendor, NULL); - priv->last_employee = gncOwnerNew (); - gncOwnerInitEmployee (priv->last_employee, NULL); + plugin->last_employee = gncOwnerNew (); + gncOwnerInitEmployee (plugin->last_employee, NULL); } static void @@ -297,15 +293,13 @@ gnc_plugin_business_cmd_customer_find_customer (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; GncCustomer*customer; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - customer = gncOwnerGetCustomer (priv->last_customer); + customer = gncOwnerGetCustomer (plugin->last_customer); gnc_customer_search (GTK_WINDOW (mw->window), customer, gnc_get_current_book ()); } @@ -316,15 +310,13 @@ gnc_plugin_business_cmd_customer_new_invoice (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); last_window = mw->window; - gnc_ui_invoice_new (GTK_WINDOW (mw->window), priv->last_customer, gnc_get_current_book ()); + gnc_ui_invoice_new (GTK_WINDOW (mw->window), plugin->last_customer, gnc_get_current_book ()); } static void @@ -334,15 +326,13 @@ gnc_plugin_business_cmd_customer_find_invoice (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); last_window = mw->window; - gnc_invoice_search (GTK_WINDOW (mw->window), NULL, priv->last_customer, gnc_get_current_book ()); + gnc_invoice_search (GTK_WINDOW (mw->window), NULL, plugin->last_customer, gnc_get_current_book ()); } static void @@ -352,14 +342,12 @@ gnc_plugin_business_cmd_customer_new_job (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - gnc_ui_job_new (GTK_WINDOW (mw->window), priv->last_customer, gnc_get_current_book ()); + gnc_ui_job_new (GTK_WINDOW (mw->window), plugin->last_customer, gnc_get_current_book ()); } static void @@ -369,14 +357,12 @@ gnc_plugin_business_cmd_customer_find_job (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - gnc_job_search (GTK_WINDOW (mw->window), NULL, priv->last_customer, gnc_get_current_book ()); + gnc_job_search (GTK_WINDOW (mw->window), NULL, plugin->last_customer, gnc_get_current_book ()); } static void @@ -386,14 +372,12 @@ gnc_plugin_business_cmd_customer_process_payment (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - gnc_ui_payment_new (GTK_WINDOW (mw->window), priv->last_customer, gnc_get_current_book ()); + gnc_ui_payment_new (GTK_WINDOW (mw->window), plugin->last_customer, gnc_get_current_book ()); } static void @@ -430,15 +414,13 @@ gnc_plugin_business_cmd_vendor_find_vendor (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; GncVendor *vendor; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - vendor = gncOwnerGetVendor (priv->last_vendor); + vendor = gncOwnerGetVendor (plugin->last_vendor); gnc_vendor_search (GTK_WINDOW (mw->window), vendor, gnc_get_current_book ()); } @@ -449,15 +431,13 @@ gnc_plugin_business_cmd_vendor_new_bill (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); last_window = mw->window; - gnc_ui_invoice_new (GTK_WINDOW (mw->window), priv->last_vendor, gnc_get_current_book ()); + gnc_ui_invoice_new (GTK_WINDOW (mw->window), plugin->last_vendor, gnc_get_current_book ()); } static void @@ -467,15 +447,13 @@ gnc_plugin_business_cmd_vendor_find_bill (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); last_window = mw->window; - gnc_invoice_search (GTK_WINDOW (mw->window), NULL, priv->last_vendor, gnc_get_current_book ()); + gnc_invoice_search (GTK_WINDOW (mw->window), NULL, plugin->last_vendor, gnc_get_current_book ()); } static void @@ -485,14 +463,12 @@ gnc_plugin_business_cmd_vendor_new_job (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - gnc_ui_job_new (GTK_WINDOW (mw->window), priv->last_vendor, gnc_get_current_book ()); + gnc_ui_job_new (GTK_WINDOW (mw->window), plugin->last_vendor, gnc_get_current_book ()); } static void @@ -502,14 +478,12 @@ gnc_plugin_business_cmd_vendor_find_job (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - gnc_job_search (GTK_WINDOW (mw->window), NULL, priv->last_vendor, gnc_get_current_book ()); + gnc_job_search (GTK_WINDOW (mw->window), NULL, plugin->last_vendor, gnc_get_current_book ()); } static void @@ -519,14 +493,12 @@ gnc_plugin_business_cmd_vendor_process_payment (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - gnc_ui_payment_new (GTK_WINDOW (mw->window), priv->last_vendor, gnc_get_current_book ()); + gnc_ui_payment_new (GTK_WINDOW (mw->window), plugin->last_vendor, gnc_get_current_book ()); } static void @@ -563,15 +535,13 @@ gnc_plugin_business_cmd_employee_find_employee (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; GncEmployee *employee; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - employee = gncOwnerGetEmployee (priv->last_employee); + employee = gncOwnerGetEmployee (plugin->last_employee); gnc_employee_search (GTK_WINDOW (mw->window), employee, gnc_get_current_book ()); } @@ -582,15 +552,13 @@ gnc_plugin_business_cmd_employee_new_expense_voucher (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); last_window = mw->window; - gnc_ui_invoice_new (GTK_WINDOW (mw->window), priv->last_employee, gnc_get_current_book ()); + gnc_ui_invoice_new (GTK_WINDOW (mw->window), plugin->last_employee, gnc_get_current_book ()); } static void @@ -600,15 +568,13 @@ gnc_plugin_business_cmd_employee_find_expense_voucher (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); last_window = mw->window; - gnc_invoice_search (GTK_WINDOW (mw->window), NULL, priv->last_employee, gnc_get_current_book ()); + gnc_invoice_search (GTK_WINDOW (mw->window), NULL, plugin->last_employee, gnc_get_current_book ()); } static void @@ -618,14 +584,12 @@ gnc_plugin_business_cmd_employee_process_payment (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin; - GncPluginBusinessPrivate *priv; g_return_if_fail (mw != NULL); g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data)); plugin = GNC_PLUGIN_BUSINESS (mw->data); - priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin); - gnc_ui_payment_new (GTK_WINDOW (mw->window), priv->last_employee, gnc_get_current_book ()); + gnc_ui_payment_new (GTK_WINDOW (mw->window), plugin->last_employee, gnc_get_current_book ()); } static void @@ -720,7 +684,6 @@ gnc_plugin_business_cmd_assign_payment (GSimpleAction *simple, { GncMainWindowActionData *mw = user_data; GncPluginBusiness *plugin_business; - GncPluginBusinessPrivate *plugin_business_priv; GncPluginPage *plugin_page; GNCSplitReg *gsr; SplitRegister *reg; @@ -754,15 +717,14 @@ gnc_plugin_business_cmd_assign_payment (GSimpleAction *simple, g_return_if_fail(trans); plugin_business = GNC_PLUGIN_BUSINESS (mw->data); - plugin_business_priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin_business); have_owner = gncOwnerGetOwnerFromTxn (trans, &owner); if (have_owner) owner_p = &owner; else if (gnc_ui_payment_is_customer_payment(trans)) - owner_p = plugin_business_priv->last_customer; + owner_p = plugin_business->last_customer; else - owner_p = plugin_business_priv->last_vendor; + owner_p = plugin_business->last_vendor; gnc_business_assign_payment (GTK_WINDOW (mw->window), trans, owner_p); diff --git a/gnucash/gnome/gnc-plugin-business.h b/gnucash/gnome/gnc-plugin-business.h index 73027cd58c5..76f95729e81 100644 --- a/gnucash/gnome/gnc-plugin-business.h +++ b/gnucash/gnome/gnc-plugin-business.h @@ -33,27 +33,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_BUSINESS (gnc_plugin_business_get_type ()) -#define GNC_PLUGIN_BUSINESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_BUSINESS, GncPluginBusiness)) -#define GNC_PLUGIN_BUSINESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_BUSINESS, GncPluginBusinessClass)) -#define GNC_IS_PLUGIN_BUSINESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_BUSINESS)) -#define GNC_IS_PLUGIN_BUSINESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_BUSINESS)) -#define GNC_PLUGIN_BUSINESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_BUSINESS, GncPluginBusinessClass)) +G_DECLARE_FINAL_TYPE (GncPluginBusiness, gnc_plugin_business, GNC, PLUGIN_BUSINESS, GncPlugin) #define GNC_PLUGIN_BUSINESS_NAME "gnc-plugin-business" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginBusiness; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginBusinessClass; - /* function prototypes */ -GType gnc_plugin_business_get_type (void); GncPlugin *gnc_plugin_business_new (void); diff --git a/gnucash/gnome/gnc-plugin-register.c b/gnucash/gnome/gnc-plugin-register.c index 4cae800185c..ba4f3ad10b3 100644 --- a/gnucash/gnome/gnc-plugin-register.c +++ b/gnucash/gnome/gnc-plugin-register.c @@ -59,15 +59,12 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginRegisterPrivate +struct _GncPluginRegister { - gpointer dummy; -} GncPluginRegisterPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN) + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_REGISTER_GET_PRIVATE(o) \ - ((GncPluginRegisterPrivate*)gnc_plugin_register_get_instance_private((GncPluginRegister*)o)) +G_DEFINE_TYPE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN) static QofLogModule log_module = GNC_MOD_GUI; diff --git a/gnucash/gnome/gnc-plugin-register.h b/gnucash/gnome/gnc-plugin-register.h index 7991d273354..d4fdbb526dd 100644 --- a/gnucash/gnome/gnc-plugin-register.h +++ b/gnucash/gnome/gnc-plugin-register.h @@ -31,28 +31,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_REGISTER (gnc_plugin_register_get_type ()) -#define GNC_PLUGIN_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_REGISTER, GncPluginRegister)) -#define GNC_PLUGIN_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_REGISTER, GncPluginRegisterClass)) -#define GNC_IS_PLUGIN_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_REGISTER)) -#define GNC_IS_PLUGIN_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_REGISTER)) -#define GNC_PLUGIN_REGISTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_REGISTER, GncPluginRegisterClass)) +G_DECLARE_FINAL_TYPE (GncPluginRegister, gnc_plugin_register, GNC, PLUGIN_REGISTER, GncPlugin) #define GNC_PLUGIN_REGISTER_NAME "gnc-plugin-register" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginRegister; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginRegisterClass; - /* function prototypes */ -GType gnc_plugin_register_get_type (void); - GncPlugin *gnc_plugin_register_new (void); G_END_DECLS diff --git a/gnucash/gnome/gnc-plugin-report-system.c b/gnucash/gnome/gnc-plugin-report-system.c index 1a70836a5d5..aaf64f7b4aa 100644 --- a/gnucash/gnome/gnc-plugin-report-system.c +++ b/gnucash/gnome/gnc-plugin-report-system.c @@ -61,15 +61,12 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginReportSystemPrivate +struct _GncPluginReportSystem { - gpointer dummy; -} GncPluginReportSystemPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginReportSystem, gnc_plugin_report_system, GNC_TYPE_PLUGIN) + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_REPORT_SYSTEM_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REPORT_SYSTEM, GncPluginReportSystemPrivate)) +G_DEFINE_TYPE(GncPluginReportSystem, gnc_plugin_report_system, GNC_TYPE_PLUGIN) /************************************************************ * Object Implementation * diff --git a/gnucash/gnome/gnc-plugin-report-system.h b/gnucash/gnome/gnc-plugin-report-system.h index b897514ec7a..9f37a7f7c2f 100644 --- a/gnucash/gnome/gnc-plugin-report-system.h +++ b/gnucash/gnome/gnc-plugin-report-system.h @@ -31,27 +31,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_REPORT_SYSTEM (gnc_plugin_report_system_get_type ()) -#define GNC_PLUGIN_REPORT_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_REPORT_SYSTEM, GncPluginReportSystem)) -#define GNC_PLUGIN_REPORT_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_REPORT_SYSTEM, GncPluginReportSystemClass)) -#define GNC_IS_PLUGIN_REPORT_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_REPORT_SYSTEM)) -#define GNC_IS_PLUGIN_REPORT_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_REPORT_SYSTEM)) -#define GNC_PLUGIN_REPORT_SYSTEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_REPORT_SYSTEM, GncPluginReportSystemClass)) +G_DECLARE_FINAL_TYPE (GncPluginReportSystem, gnc_plugin_report_system, GNC, PLUGIN_REPORT_SYSTEM, GncPlugin) #define GNC_PLUGIN_REPORT_SYSTEM_NAME "gnc-plugin-report-system" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginReportSystem; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginReportSystemClass; - /* function prototypes */ -GType gnc_plugin_report_system_get_type (void); void gnc_plugin_report_system_new (void); G_END_DECLS diff --git a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c index b92728b11d7..1f81e69a27d 100644 --- a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c +++ b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c @@ -139,6 +139,11 @@ static GncMainWindow *gnc_main_window = NULL; * Object Implementation * ************************************************************/ +struct _GncPluginAqBanking +{ + GncPlugin gnc_plugin; +}; + G_DEFINE_TYPE(GncPluginAqBanking, gnc_plugin_aqbanking, GNC_TYPE_PLUGIN) GncPlugin * diff --git a/gnucash/import-export/aqb/gnc-plugin-aqbanking.h b/gnucash/import-export/aqb/gnc-plugin-aqbanking.h index b2206cfd141..f31a1961ec9 100644 --- a/gnucash/import-export/aqb/gnc-plugin-aqbanking.h +++ b/gnucash/import-export/aqb/gnc-plugin-aqbanking.h @@ -41,32 +41,12 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_AQBANKING (gnc_plugin_aqbanking_get_type()) -#define GNC_PLUGIN_AQBANKING(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNC_TYPE_PLUGIN_AQBANKING, GncPluginAqBanking)) -#define GNC_PLUGIN_AQBANKING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNC_TYPE_PLUGIN_AQBANKING, GncPluginAqBankingClass)) -#define GNC_IS_PLUGIN_AQBANKING(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNC_TYPE_PLUGIN_AQBANKING)) -#define GNC_IS_PLUGIN_AQBANKING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNC_TYPE_PLUGIN_AQBANKING)) -#define GNC_PLUGIN_AQBANKING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNC_TYPE_PLUGIN_AQBANKING, GncPluginAqBankingClass)) +G_DECLARE_FINAL_TYPE (GncPluginAqBanking, gnc_plugin_aqbanking, GNC, PLUGIN_AQBANKING, GncPlugin) #define GNC_PLUGIN_AQBANKING_NAME "gnc-plugin-aqbanking" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginAqBanking; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginAqBankingClass; - /* function prototypes */ -/** - * @return The glib runtime type of an aqbanking plugin page - **/ -GType gnc_plugin_aqbanking_get_type(void); - /** * @return A new GncPluginAqBanking object */ diff --git a/gnucash/import-export/bi-import/gnc-plugin-bi-import.c b/gnucash/import-export/bi-import/gnc-plugin-bi-import.c index 33afe702480..68a70dbfaaf 100644 --- a/gnucash/import-export/bi-import/gnc-plugin-bi-import.c +++ b/gnucash/import-export/bi-import/gnc-plugin-bi-import.c @@ -51,6 +51,8 @@ static void gnc_plugin_bi_import_cmd_test (GSimpleAction *simple, GVariant *para static GActionEntry gnc_plugin_actions [] = { + // should be "BiImportAction", but "bi_importAction" is already + // used externally in accelerator maps { "bi_importAction", gnc_plugin_bi_import_cmd_test, NULL, NULL, NULL }, }; /** The number of actions provided by this plugin. */ @@ -67,7 +69,12 @@ static const gchar *gnc_plugin_load_ui_items [] = * Object Implementation * ************************************************************/ -G_DEFINE_TYPE(GncPluginbi_import, gnc_plugin_bi_import, GNC_TYPE_PLUGIN) +struct _GncPluginBiImport +{ + GncPlugin gnc_plugin; +}; + +G_DEFINE_TYPE(GncPluginBiImport, gnc_plugin_bi_import, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_bi_import_new (void) @@ -76,7 +83,7 @@ gnc_plugin_bi_import_new (void) } static void -gnc_plugin_bi_import_class_init (GncPluginbi_importClass *klass) +gnc_plugin_bi_import_class_init (GncPluginBiImportClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GncPluginClass *plugin_class = GNC_PLUGIN_CLASS(klass); @@ -95,7 +102,7 @@ gnc_plugin_bi_import_class_init (GncPluginbi_importClass *klass) } static void -gnc_plugin_bi_import_init (GncPluginbi_import *plugin) +gnc_plugin_bi_import_init (GncPluginBiImport *plugin) { } diff --git a/gnucash/import-export/bi-import/gnc-plugin-bi-import.h b/gnucash/import-export/bi-import/gnc-plugin-bi-import.h index 074be3df0fe..298d8bb8faf 100644 --- a/gnucash/import-export/bi-import/gnc-plugin-bi-import.h +++ b/gnucash/import-export/bi-import/gnc-plugin-bi-import.h @@ -38,30 +38,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_BI_IMPORT (gnc_plugin_bi_import_get_type()) -#define GNC_PLUGIN_BI_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNC_TYPE_PLUGIN_BI_IMPORT, GncPluginbi_import)) -#define GNC_PLUGIN_BI_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNC_TYPE_PLUGIN_BI_IMPORT, GncPluginbi_importClass)) -#define GNC_IS_PLUGIN_BI_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNC_TYPE_PLUGIN_BI_IMPORT)) -#define GNC_IS_PLUGIN_BI_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNC_TYPE_PLUGIN_BI_IMPORT)) -#define GNC_PLUGIN_BI_IMPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNC_TYPE_PLUGIN_BI_IMPORT, GncPluginbi_importClass)) +G_DECLARE_FINAL_TYPE (GncPluginBiImport, gnc_plugin_bi_import, GNC, PLUGIN_BI_IMPORT, GncPlugin) #define GNC_PLUGIN_BI_IMPORT_NAME "gnc-plugin-bi-import" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginbi_import; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginbi_importClass; - /* function prototypes */ -/** - * @return The glib runtime type of an bi_import plugin page - **/ -GType gnc_plugin_bi_import_get_type (void); /** * @return A new GncPluginbi_import object 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 acb29827287..57be5d8206b 100644 --- a/gnucash/import-export/csv-exp/gnc-plugin-csv-export.c +++ b/gnucash/import-export/csv-exp/gnc-plugin-csv-export.c @@ -59,15 +59,12 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginCsvExportPrivate +struct _GncPluginCsvExport { - gpointer dummy; -} GncPluginCsvExportPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN) + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_CSV_EXPORT_GET_PRIVATE(o) \ - ((GncPluginCsvExportPrivate*)gnc_plugin_csv_export_get_instance_private((GncPluginCsvExport*)o)) +G_DEFINE_TYPE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_csv_export_new (void) diff --git a/gnucash/import-export/csv-exp/gnc-plugin-csv-export.h b/gnucash/import-export/csv-exp/gnc-plugin-csv-export.h index 82571142f60..affc6b4c462 100644 --- a/gnucash/import-export/csv-exp/gnc-plugin-csv-export.h +++ b/gnucash/import-export/csv-exp/gnc-plugin-csv-export.h @@ -31,28 +31,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_CSV_EXPORT (gnc_plugin_csv_export_get_type ()) -#define GNC_PLUGIN_CSV_EXPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_CSV_EXPORT, GncPluginCsvExport)) -#define GNC_PLUGIN_CSV_EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_CSV_EXPORT, GncPluginCsvExportClass)) -#define GNC_IS_PLUGIN_CSV_EXPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_CSV_EXPORT)) -#define GNC_IS_PLUGIN_CSV_EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_CSV_EXPORT)) -#define GNC_PLUGIN_CSV_EXPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_CSV_EXPORT, GncPluginCsvExportClass)) +G_DECLARE_FINAL_TYPE (GncPluginCsvExport, gnc_plugin_csv_export, GNC, PLUGIN_CSV_EXPORT, GncPlugin) #define GNC_PLUGIN_CSV_EXPORT_NAME "gnc-plugin-csv-export" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginCsvExport; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginCsvExportClass; - /* function prototypes */ -GType gnc_plugin_csv_export_get_type (void); - GncPlugin *gnc_plugin_csv_export_new (void); void gnc_plugin_csv_export_create_plugin (void); 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 cb01075abd4..ea0eea822fa 100644 --- a/gnucash/import-export/csv-imp/gnc-plugin-csv-import.c +++ b/gnucash/import-export/csv-imp/gnc-plugin-csv-import.c @@ -58,15 +58,12 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginCsvImportPrivate +struct _GncPluginCsvImport { - gpointer dummy; -} GncPluginCsvImportPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN) + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_CSV_IMPORT_GET_PRIVATE(o) \ - ((GncPluginCsvImportPrivate*)gnc_plugin_csv_import_get_instance_private((GncPluginCsvImport*)o)) +G_DEFINE_TYPE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_csv_import_new (void) diff --git a/gnucash/import-export/csv-imp/gnc-plugin-csv-import.h b/gnucash/import-export/csv-imp/gnc-plugin-csv-import.h index 7f96f81c4b1..90edfee31a5 100644 --- a/gnucash/import-export/csv-imp/gnc-plugin-csv-import.h +++ b/gnucash/import-export/csv-imp/gnc-plugin-csv-import.h @@ -31,28 +31,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_CSV_IMPORT (gnc_plugin_csv_import_get_type ()) -#define GNC_PLUGIN_CSV_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_CSV_IMPORT, GncPluginCsvImport)) -#define GNC_PLUGIN_CSV_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_CSV_IMPORT, GncPluginCsvImportClass)) -#define GNC_IS_PLUGIN_CSV_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_CSV_IMPORT)) -#define GNC_IS_PLUGIN_CSV_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_CSV_IMPORT)) -#define GNC_PLUGIN_CSV_IMPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_CSV_IMPORT, GncPluginCsvImportClass)) +G_DECLARE_FINAL_TYPE (GncPluginCsvImport, gnc_plugin_csv_import, GNC, PLUGIN_CSV_IMPORT, GncPlugin) #define GNC_PLUGIN_CSV_IMPORT_NAME "gnc-plugin-csv-import" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginCsvImport; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginCsvImportClass; - /* function prototypes */ -GType gnc_plugin_csv_import_get_type (void); - GncPlugin *gnc_plugin_csv_import_new (void); void gnc_plugin_csv_import_create_plugin (void); diff --git a/gnucash/import-export/customer-import/gnc-plugin-customer-import.c b/gnucash/import-export/customer-import/gnc-plugin-customer-import.c index f63a3aedd46..bfd5420928b 100644 --- a/gnucash/import-export/customer-import/gnc-plugin-customer-import.c +++ b/gnucash/import-export/customer-import/gnc-plugin-customer-import.c @@ -49,6 +49,8 @@ static void gnc_plugin_customer_import_cmd_test (GSimpleAction *simple, GVariant static GActionEntry gnc_plugin_actions [] = { + // should be "CustomerImportAction", but "customer_importAction" + // is already used externally in accelerator maps { "customer_importAction", gnc_plugin_customer_import_cmd_test, NULL, NULL, NULL }, }; /** The number of actions provided by this plugin. */ @@ -65,16 +67,21 @@ static const gchar *gnc_plugin_load_ui_items [] = * Object Implementation * ************************************************************/ -G_DEFINE_TYPE(GncPlugincustomer_import, gnc_plugin_customer_import, GNC_TYPE_PLUGIN) +struct _GncPluginCustomerImport +{ + GncPlugin gnc_plugin; +}; + +G_DEFINE_TYPE(GncPluginCustomerImport, gnc_plugin_customer_import, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_customer_import_new (void) { - return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_customer_import, (gchar*) NULL)); + return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_CUSTOMER_IMPORT, (gchar*) NULL)); } static void -gnc_plugin_customer_import_class_init (GncPlugincustomer_importClass *klass) +gnc_plugin_customer_import_class_init (GncPluginCustomerImportClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GncPluginClass *plugin_class = GNC_PLUGIN_CLASS(klass); @@ -82,7 +89,7 @@ gnc_plugin_customer_import_class_init (GncPlugincustomer_importClass *klass) object_class->finalize = gnc_plugin_customer_import_finalize; /* plugin info */ - plugin_class->plugin_name = GNC_PLUGIN_customer_import_NAME; + plugin_class->plugin_name = GNC_PLUGIN_CUSTOMER_IMPORT_NAME; /* widget addition/removal */ plugin_class->actions_name = PLUGIN_ACTIONS_NAME; @@ -93,7 +100,7 @@ gnc_plugin_customer_import_class_init (GncPlugincustomer_importClass *klass) } static void -gnc_plugin_customer_import_init (GncPlugincustomer_import *plugin) +gnc_plugin_customer_import_init (GncPluginCustomerImport *plugin) { } diff --git a/gnucash/import-export/customer-import/gnc-plugin-customer-import.h b/gnucash/import-export/customer-import/gnc-plugin-customer-import.h index 43fde78845f..b1032f49fd6 100644 --- a/gnucash/import-export/customer-import/gnc-plugin-customer-import.h +++ b/gnucash/import-export/customer-import/gnc-plugin-customer-import.h @@ -37,31 +37,12 @@ G_BEGIN_DECLS /* type macros */ -#define GNC_TYPE_PLUGIN_customer_import (gnc_plugin_customer_import_get_type()) -#define GNC_PLUGIN_customer_import(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNC_TYPE_PLUGIN_customer_import, GncPlugincustomer_import)) -#define GNC_PLUGIN_customer_import_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNC_TYPE_PLUGIN_customer_import, GncPlugincustomer_importClass)) -#define GNC_IS_PLUGIN_customer_import(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNC_TYPE_PLUGIN_customer_import)) -#define GNC_IS_PLUGIN_customer_import_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNC_TYPE_PLUGIN_customer_import)) -#define GNC_PLUGIN_customer_import_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNC_TYPE_PLUGIN_customer_import, GncPlugincustomer_importClass)) +#define GNC_TYPE_PLUGIN_CUSTOMER_IMPORT (gnc_plugin_customer_import_get_type()) +G_DECLARE_FINAL_TYPE (GncPluginCustomerImport, gnc_plugin_customer_import, GNC, PLUGIN_CUSTOMER_IMPORT, GncPlugin) -#define GNC_PLUGIN_customer_import_NAME "gnc-plugin-customer-import" - -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPlugincustomer_import; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPlugincustomer_importClass; +#define GNC_PLUGIN_CUSTOMER_IMPORT_NAME "gnc-plugin-customer-import" /* function prototypes */ -/** - * @return The glib runtime type of an customer_import plugin page - **/ -GType gnc_plugin_customer_import_get_type (void); /** * @return A new GncPlugincustomer_import object 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 28b11592bdd..255e2982210 100644 --- a/gnucash/import-export/log-replay/gnc-plugin-log-replay.c +++ b/gnucash/import-export/log-replay/gnc-plugin-log-replay.c @@ -54,15 +54,12 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginLogreplayPrivate +struct _GncPluginLogReplay { - gpointer dummy; -} GncPluginLogreplayPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogreplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN) + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o) \ - ((GncPluginLogreplayPrivate*)gnc_plugin_log_replay_get_instance_private((GncPluginLogReplay*)o)) +G_DEFINE_TYPE(GncPluginLogReplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_log_replay_new (void) @@ -71,7 +68,7 @@ gnc_plugin_log_replay_new (void) } static void -gnc_plugin_log_replay_class_init (GncPluginLogreplayClass *klass) +gnc_plugin_log_replay_class_init (GncPluginLogReplayClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass); @@ -90,7 +87,7 @@ gnc_plugin_log_replay_class_init (GncPluginLogreplayClass *klass) } static void -gnc_plugin_log_replay_init (GncPluginLogreplay *plugin) +gnc_plugin_log_replay_init (GncPluginLogReplay *plugin) { } diff --git a/gnucash/import-export/log-replay/gnc-plugin-log-replay.h b/gnucash/import-export/log-replay/gnc-plugin-log-replay.h index e2f0a8c13a7..bd60484db20 100644 --- a/gnucash/import-export/log-replay/gnc-plugin-log-replay.h +++ b/gnucash/import-export/log-replay/gnc-plugin-log-replay.h @@ -31,28 +31,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_LOG_REPLAY (gnc_plugin_log_replay_get_type ()) -#define GNC_PLUGIN_LOG_REPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplay)) -#define GNC_PLUGIN_LOG_REPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplayClass)) -#define GNC_IS_PLUGIN_LOG_REPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_LOG_REPLAY)) -#define GNC_IS_PLUGIN_LOG_REPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_LOG_REPLAY)) -#define GNC_PLUGIN_LOG_REPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplayClass)) +G_DECLARE_FINAL_TYPE (GncPluginLogReplay, gnc_plugin_log_replay, GNC, PLUGIN_LOG_REPLAY, GncPlugin) #define GNC_PLUGIN_LOG_REPLAY_NAME "gnc-plugin-log-replay" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginLogreplay; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginLogreplayClass; - /* function prototypes */ -GType gnc_plugin_log_replay_get_type (void); - GncPlugin *gnc_plugin_log_replay_new (void); void gnc_plugin_log_replay_create_plugin (void); diff --git a/gnucash/import-export/ofx/gnc-plugin-ofx.c b/gnucash/import-export/ofx/gnc-plugin-ofx.c index 8a1f6265274..937077aa843 100644 --- a/gnucash/import-export/ofx/gnc-plugin-ofx.c +++ b/gnucash/import-export/ofx/gnc-plugin-ofx.c @@ -52,15 +52,12 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginOfxPrivate +struct _GncPluginOfx { - gpointer dummy; -} GncPluginOfxPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN) + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_OFX_GET_PRIVATE(o) \ - ((GncPluginOfxPrivate*)gnc_plugin_ofx_get_instance_private((GncPluginOfx*)o)) +G_DEFINE_TYPE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_ofx_new (void) diff --git a/gnucash/import-export/ofx/gnc-plugin-ofx.h b/gnucash/import-export/ofx/gnc-plugin-ofx.h index 8716eba5605..685ca0779be 100644 --- a/gnucash/import-export/ofx/gnc-plugin-ofx.h +++ b/gnucash/import-export/ofx/gnc-plugin-ofx.h @@ -31,28 +31,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_OFX (gnc_plugin_ofx_get_type ()) -#define GNC_PLUGIN_OFX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_OFX, GncPluginOfx)) -#define GNC_PLUGIN_OFX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_OFX, GncPluginOfxClass)) -#define GNC_IS_PLUGIN_OFX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_OFX)) -#define GNC_IS_PLUGIN_OFX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_OFX)) -#define GNC_PLUGIN_OFX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_OFX, GncPluginOfxClass)) +G_DECLARE_FINAL_TYPE (GncPluginOfx, gnc_plugin_ofx, GNC, PLUGIN_OFX, GncPlugin) #define GNC_PLUGIN_OFX_NAME "gnc-plugin-ofx" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginOfx; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginOfxClass; - /* function prototypes */ -GType gnc_plugin_ofx_get_type (void); - GncPlugin *gnc_plugin_ofx_new (void); void gnc_plugin_ofx_create_plugin (void); 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 b14ccfe50ab..718bd17581c 100644 --- a/gnucash/import-export/qif-imp/gnc-plugin-qif-import.c +++ b/gnucash/import-export/qif-imp/gnc-plugin-qif-import.c @@ -54,15 +54,12 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginQifImportPrivate +struct _GncPluginQifImport { - gpointer dummy; -} GncPluginQifImportPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN) + GncPlugin gnc_plugin; +}; -#define GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(o) \ - ((GncPluginQifImportPrivate*)gnc_plugin_qif_import_get_instance_private((GncPluginQifImport*)o)) +G_DEFINE_TYPE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_qif_import_new (void) diff --git a/gnucash/import-export/qif-imp/gnc-plugin-qif-import.h b/gnucash/import-export/qif-imp/gnc-plugin-qif-import.h index f9d9ca49bb3..2f81f557574 100644 --- a/gnucash/import-export/qif-imp/gnc-plugin-qif-import.h +++ b/gnucash/import-export/qif-imp/gnc-plugin-qif-import.h @@ -32,28 +32,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_QIF_IMPORT (gnc_plugin_qif_import_get_type ()) -#define GNC_PLUGIN_QIF_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_QIF_IMPORT, GncPluginQifImport)) -#define GNC_PLUGIN_QIF_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_QIF_IMPORT, GncPluginQifImportClass)) -#define GNC_IS_PLUGIN_QIF_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_QIF_IMPORT)) -#define GNC_IS_PLUGIN_QIF_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_QIF_IMPORT)) -#define GNC_PLUGIN_QIF_IMPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_QIF_IMPORT, GncPluginQifImportClass)) +G_DECLARE_FINAL_TYPE (GncPluginQifImport, gnc_plugin_qif_import, GNC, PLUGIN_QIF_IMPORT, GncPlugin) #define GNC_PLUGIN_QIF_IMPORT_NAME "gnc-plugin-qif-import" -/* typedefs & structures */ -typedef struct -{ - GncPlugin gnc_plugin; -} GncPluginQifImport; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginQifImportClass; - /* function prototypes */ -GType gnc_plugin_qif_import_get_type (void); - GncPlugin *gnc_plugin_qif_import_new (void); void gnc_plugin_qif_import_create_plugin (void); diff --git a/libgnucash/gnc-module/example/gnc-plugin.example.c b/libgnucash/gnc-module/example/gnc-plugin.example.c index 6a739866f30..85accc98986 100644 --- a/libgnucash/gnc-module/example/gnc-plugin.example.c +++ b/libgnucash/gnc-module/example/gnc-plugin.example.c @@ -55,16 +55,21 @@ static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions); * Object Implementation * ************************************************************/ -G_DEFINE_TYPE(GncPluginexample, gnc_plugin_example, GNC_TYPE_PLUGIN) +struct _GncPluginExample +{ + GncPlugin gnc_plugin; +}; + +G_DEFINE_TYPE(GncPluginExample, gnc_plugin_example, GNC_TYPE_PLUGIN) GncPlugin * gnc_plugin_example_new (void) { - return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_example, (gchar*) NULL)); + return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_EXAMPLE, (gchar*) NULL)); } static void -gnc_plugin_example_class_init (GncPluginexampleClass *klass) +gnc_plugin_example_class_init (GncPluginExampleClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); GncPluginClass *plugin_class = GNC_PLUGIN_CLASS(klass); @@ -82,7 +87,7 @@ gnc_plugin_example_class_init (GncPluginexampleClass *klass) } static void -gnc_plugin_example_init (GncPluginexample *plugin) +gnc_plugin_example_init (GncPluginExample *plugin) { } diff --git a/libgnucash/gnc-module/example/gnc-plugin.example.h b/libgnucash/gnc-module/example/gnc-plugin.example.h index f3c8400a188..f472cf5dbbe 100644 --- a/libgnucash/gnc-module/example/gnc-plugin.example.h +++ b/libgnucash/gnc-module/example/gnc-plugin.example.h @@ -38,28 +38,11 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_example (gnc_plugin_example_get_type()) -#define GNC_PLUGIN_example(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNC_TYPE_PLUGIN_example, GncPluginexample)) -#define GNC_PLUGIN_example_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNC_TYPE_PLUGIN_example, GncPluginexampleClass)) -#define GNC_IS_PLUGIN_example(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNC_TYPE_PLUGIN_example)) -#define GNC_IS_PLUGIN_example_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNC_TYPE_PLUGIN_example)) -#define GNC_PLUGIN_example_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNC_TYPE_PLUGIN_example, GncPluginexampleClass)) +G_DECLARE_FINAL_TYPE (GncPluginExample, gnc_plugin_example, GNC, PLUGIN_EXAMPLE) -#define GNC_PLUGIN_example_NAME "gnc-plugin-example" - -/* typedefs & structures */ -typedef struct { - GncPlugin gnc_plugin; -} GncPluginexample; - -typedef struct { - GncPluginClass gnc_plugin; -} GncPluginexampleClass; +#define GNC_PLUGIN_EXAMPLE_NAME "gnc-plugin-example" /* function prototypes */ -/** - * @return The glib runtime type of an example plugin page - **/ -GType gnc_plugin_example_get_type (void); /** * @return A new GncPluginexample object