Merge Richard Cohen's 'declare-type-gnc-plugin' into stable.

This commit is contained in:
John Ralls 2023-06-16 12:42:42 -07:00
commit 827bfabd69
35 changed files with 152 additions and 559 deletions

View File

@ -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

View File

@ -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.
*

View File

@ -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
{
GncPlugin gnc_plugin;
GHashTable *item_hash;
} GncPluginMenuAdditionsPrivate;
#define GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(o) \
((GncPluginMenuAdditionsPrivate*)gnc_plugin_menu_additions_get_instance_private((GncPluginMenuAdditions*)o))
};
/** 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 ();

View File

@ -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.
*

View File

@ -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.

View File

@ -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;
/** The parent object for this widget */
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_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 *

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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.*/

View File

@ -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;
plugin->last_customer = gncOwnerNew ();
gncOwnerInitCustomer (plugin->last_customer, NULL);
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
priv->last_customer = gncOwnerNew ();
gncOwnerInitCustomer (priv->last_customer, NULL);
plugin->last_vendor = gncOwnerNew ();
gncOwnerInitVendor (plugin->last_vendor, NULL);
priv->last_vendor = gncOwnerNew ();
gncOwnerInitVendor (priv->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);

View File

@ -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);

View File

@ -59,15 +59,12 @@ static const gchar *gnc_plugin_load_ui_items [] =
NULL,
};
typedef struct GncPluginRegisterPrivate
struct _GncPluginRegister
{
gpointer dummy;
} GncPluginRegisterPrivate;
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_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;

View File

@ -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

View File

@ -61,15 +61,12 @@ static const gchar *gnc_plugin_load_ui_items [] =
NULL,
};
typedef struct GncPluginReportSystemPrivate
struct _GncPluginReportSystem
{
gpointer dummy;
} GncPluginReportSystemPrivate;
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginReportSystem, gnc_plugin_report_system, GNC_TYPE_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 *

View File

@ -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

View File

@ -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 *

View File

@ -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
*/

View File

@ -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)
{
}

View File

@ -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

View File

@ -59,15 +59,12 @@ static const gchar *gnc_plugin_load_ui_items [] =
NULL,
};
typedef struct GncPluginCsvExportPrivate
struct _GncPluginCsvExport
{
gpointer dummy;
} GncPluginCsvExportPrivate;
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_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)

View File

@ -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);

View File

@ -58,15 +58,12 @@ static const gchar *gnc_plugin_load_ui_items [] =
NULL,
};
typedef struct GncPluginCsvImportPrivate
struct _GncPluginCsvImport
{
gpointer dummy;
} GncPluginCsvImportPrivate;
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_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)

View File

@ -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);

View File

@ -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)
{
}

View File

@ -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

View File

@ -54,15 +54,12 @@ static const gchar *gnc_plugin_load_ui_items [] =
NULL,
};
typedef struct GncPluginLogreplayPrivate
struct _GncPluginLogReplay
{
gpointer dummy;
} GncPluginLogreplayPrivate;
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogreplay, gnc_plugin_log_replay, GNC_TYPE_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)
{
}

View File

@ -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);

View File

@ -52,15 +52,12 @@ static const gchar *gnc_plugin_load_ui_items [] =
NULL,
};
typedef struct GncPluginOfxPrivate
struct _GncPluginOfx
{
gpointer dummy;
} GncPluginOfxPrivate;
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_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)

View File

@ -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);

View File

@ -54,15 +54,12 @@ static const gchar *gnc_plugin_load_ui_items [] =
NULL,
};
typedef struct GncPluginQifImportPrivate
struct _GncPluginQifImport
{
gpointer dummy;
} GncPluginQifImportPrivate;
GncPlugin gnc_plugin;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_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)

View File

@ -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);

View File

@ -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)
{
}

View File

@ -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