From 39352101ae8718017cbfe41e82ea58760bcb9656 Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Sun, 11 Jun 2023 22:42:03 +0100 Subject: [PATCH] Refactor: DECLARE_FINAL GncReportCombo < GtkBox --- gnucash/gnome-utils/gnc-report-combo.c | 2 +- gnucash/gnome-utils/gnc-report-combo.h | 35 +++++++------------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/gnucash/gnome-utils/gnc-report-combo.c b/gnucash/gnome-utils/gnc-report-combo.c index 75c3fefed6..152e30c78a 100644 --- a/gnucash/gnome-utils/gnc-report-combo.c +++ b/gnucash/gnome-utils/gnc-report-combo.c @@ -126,7 +126,7 @@ gnc_report_combo_class_init (GncReportComboClass *klass) g_signal_new ("changed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GncReportComboClass, changed), + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, diff --git a/gnucash/gnome-utils/gnc-report-combo.h b/gnucash/gnome-utils/gnc-report-combo.h index cc2b0792e1..6d82fb39b6 100644 --- a/gnucash/gnome-utils/gnc-report-combo.h +++ b/gnucash/gnome-utils/gnc-report-combo.h @@ -25,25 +25,19 @@ #ifndef GNC_REPORT_COMBO_H #define GNC_REPORT_COMBO_H -#define GNC_TYPE_REPORT_COMBO (gnc_report_combo_get_type()) -#define GNC_REPORT_COMBO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_REPORT_COMBO, GncReportCombo)) -#define GNC_REPORT_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_REPORT_COMBO, GncReportComboClass)) -#define GNC_IS_REPORT_COMBO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_REPORT_COMBO)) -#define GNC_IS_REPORT_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GNC_TYPE_REPORT_COMBO)) -#define GNC_REPORT_COMBO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_REPORT_COMBO, GncReportComboClass)) +#ifdef __cplusplus +extern "C" +{ +#endif -typedef struct +#define GNC_TYPE_REPORT_COMBO (gnc_report_combo_get_type()) +G_DECLARE_FINAL_TYPE (GncReportCombo, gnc_report_combo, GNC, REPORT_COMBO, GtkBox) + +struct _GncReportCombo { GtkBox box; -} GncReportCombo; - -typedef struct -{ - GtkBoxClass parent_class; - void (*changed) (GncReportCombo *grc); - -} GncReportComboClass; +}; typedef struct { @@ -51,17 +45,6 @@ typedef struct char *report_name; } ReportListEntry; -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Return the GType for the GncReportCombo widget. - * - * @return A GType value. - */ -GType gnc_report_combo_get_type (void) G_GNUC_CONST; - /** Create a new GncReportCombo widget which can be used to provide * a list of reports and select one. *