From 8115ecca887b839bea7658b18e7f48a8d07606fd Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Mon, 12 Jun 2023 19:53:37 +0100 Subject: [PATCH] Refactor: DECLARE_FINAL GNCAmountEdit < GtkBox --- gnucash/gnome-utils/gnc-amount-edit.c | 6 +++--- gnucash/gnome-utils/gnc-amount-edit.h | 25 +++---------------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/gnucash/gnome-utils/gnc-amount-edit.c b/gnucash/gnome-utils/gnc-amount-edit.c index 492c37999a..4d57bd1122 100644 --- a/gnucash/gnome-utils/gnc-amount-edit.c +++ b/gnucash/gnome-utils/gnc-amount-edit.c @@ -110,7 +110,7 @@ gnc_amount_edit_class_init (GNCAmountEditClass *klass) g_signal_new ("activate", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GNCAmountEditClass, activate), + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, @@ -121,7 +121,7 @@ gnc_amount_edit_class_init (GNCAmountEditClass *klass) g_signal_new ("changed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GNCAmountEditClass, changed), + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, @@ -132,7 +132,7 @@ gnc_amount_edit_class_init (GNCAmountEditClass *klass) g_signal_new ("amount_changed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GNCAmountEditClass, amount_changed), + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, diff --git a/gnucash/gnome-utils/gnc-amount-edit.h b/gnucash/gnome-utils/gnc-amount-edit.h index a26c6e5787..57a7150d7b 100644 --- a/gnucash/gnome-utils/gnc-amount-edit.h +++ b/gnucash/gnome-utils/gnc-amount-edit.h @@ -37,11 +37,9 @@ extern "C" { #endif #define GNC_TYPE_AMOUNT_EDIT (gnc_amount_edit_get_type ()) -#define GNC_AMOUNT_EDIT(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GNC_TYPE_AMOUNT_EDIT, GNCAmountEdit) -#define GNC_AMOUNT_EDIT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GNC_TYPE_AMOUNT_EDIT, GNCAmountEditClass) -#define GNC_IS_AMOUNT_EDIT(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GNC_TYPE_AMOUNT_EDIT) +G_DECLARE_FINAL_TYPE (GNCAmountEdit, gnc_amount_edit, GNC, AMOUNT_EDIT, GtkBox) -typedef struct +struct _GNCAmountEdit { GtkBox box; GtkEntry *entry; @@ -64,24 +62,7 @@ typedef struct gboolean show_warning_symbol; -} GNCAmountEdit; - -typedef struct -{ - GtkBoxClass parent_class; - - /* Signals for notification/filtering of changes */ - void (*activate) (GNCAmountEdit *gae); - void (*changed) (GNCAmountEdit *gae); - void (*amount_changed) (GNCAmountEdit *gae); -} GNCAmountEditClass; - -/** - * gnc_amount_edit_get_type: - * - * Returns the GType for the GNCAmountEdit widget - */ -GType gnc_amount_edit_get_type (void) G_GNUC_CONST; +}; /** * gnc_amount_edit_new: