Skip to content

Commit

Permalink
Refactor: DECLARE_DERIVABLE GncPlugin < GObject
Browse files Browse the repository at this point in the history
  • Loading branch information
richardcohen committed Jun 14, 2023
1 parent 853791c commit 422b01a
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions gnucash/gnome-utils/gnc-plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 422b01a

Please sign in to comment.