Skip to content

Commit

Permalink
Merge Richard Cohwn's 'declare-type-gnc-tree-view' into stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Jun 16, 2023
2 parents eee5f67 + 5ea2e4e commit 915e95e
Show file tree
Hide file tree
Showing 11 changed files with 183 additions and 363 deletions.
225 changes: 92 additions & 133 deletions gnucash/gnome-utils/gnc-tree-view-account.c

Large diffs are not rendered by default.

18 changes: 2 additions & 16 deletions gnucash/gnome-utils/gnc-tree-view-account.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ G_BEGIN_DECLS

/* type macros */
#define GNC_TYPE_TREE_VIEW_ACCOUNT (gnc_tree_view_account_get_type ())
#define GNC_TREE_VIEW_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_ACCOUNT, GncTreeViewAccount))
#define GNC_TREE_VIEW_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_ACCOUNT, GncTreeViewAccountClass))
#define GNC_IS_TREE_VIEW_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_ACCOUNT))
#define GNC_IS_TREE_VIEW_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_ACCOUNT))
#define GNC_TREE_VIEW_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_ACCOUNT, GncTreeViewAccountClass))
G_DECLARE_FINAL_TYPE (GncTreeViewAccount, gnc_tree_view_account, GNC, TREE_VIEW_ACCOUNT, GncTreeView)

#define GNC_TREE_VIEW_ACCOUNT_NAME "GncTreeViewAccount"

/* typedefs & structures */
Expand All @@ -62,17 +59,6 @@ struct AccountViewInfo_s
};


typedef struct
{
GncTreeView gnc_tree_view;
int stamp;
} GncTreeViewAccount;

typedef struct
{
GncTreeViewClass gnc_tree_view;
} GncTreeViewAccountClass;

typedef struct
{
GtkWidget *dialog;
Expand Down
13 changes: 5 additions & 8 deletions gnucash/gnome-utils/gnc-tree-view-commodity.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,17 @@ static QofLogModule log_module = GNC_MOD_GUI;
static void gnc_tree_view_commodity_finalize (GObject *object);
static void gnc_tree_view_commodity_destroy (GtkWidget *widget);

typedef struct GncTreeViewCommodityPrivate
struct _GncTreeViewCommodity
{
gpointer dummy;
} GncTreeViewCommodityPrivate;

#define GNC_TREE_VIEW_COMMODITY_GET_PRIVATE(o) \
((GncTreeViewCommodityPrivate*)gnc_tree_view_commodity_get_instance_private(GncTreeViewCommodity*)o))

GncTreeView gnc_tree_view;
int stamp;
};

/************************************************************/
/* g_object required functions */
/************************************************************/

G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewCommodity, gnc_tree_view_commodity, GNC_TYPE_TREE_VIEW)
G_DEFINE_TYPE(GncTreeViewCommodity, gnc_tree_view_commodity, GNC_TYPE_TREE_VIEW)

static void
gnc_tree_view_commodity_class_init (GncTreeViewCommodityClass *klass)
Expand Down
24 changes: 1 addition & 23 deletions gnucash/gnome-utils/gnc-tree-view-commodity.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,7 @@ G_BEGIN_DECLS

/* type macros */
#define GNC_TYPE_TREE_VIEW_COMMODITY (gnc_tree_view_commodity_get_type ())
#define GNC_TREE_VIEW_COMMODITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodity))
#define GNC_TREE_VIEW_COMMODITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodityClass))
#define GNC_IS_TREE_VIEW_COMMODITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_COMMODITY))
#define GNC_IS_TREE_VIEW_COMMODITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_COMMODITY))
#define GNC_TREE_VIEW_COMMODITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodityClass))

/* typedefs & structures */
typedef struct
{
GncTreeView gnc_tree_view;
int stamp;
} GncTreeViewCommodity;

typedef struct
{
GncTreeViewClass gnc_tree_view;
} GncTreeViewCommodityClass;



/* Get the GType for an GncTreeViewCommodity object. */
GType gnc_tree_view_commodity_get_type (void);

G_DECLARE_FINAL_TYPE (GncTreeViewCommodity, gnc_tree_view_commodity, GNC, TREE_VIEW_COMMODITY, GncTreeView)

/** @name Commodity Tree View Constructors
@{ */
Expand Down

0 comments on commit 915e95e

Please sign in to comment.