From ceb21a6acefcc0c5c5c3e605b04ad445e58be93c Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Mon, 12 Jun 2023 19:54:26 +0100 Subject: [PATCH] Refactor: DECLARE_FINAL GNCDateFormat < GtkBox --- gnucash/gnome-utils/gnc-date-format.c | 2 +- gnucash/gnome-utils/gnc-date-format.h | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/gnucash/gnome-utils/gnc-date-format.c b/gnucash/gnome-utils/gnc-date-format.c index 26edea0ded..21b1f747f6 100644 --- a/gnucash/gnome-utils/gnc-date-format.c +++ b/gnucash/gnome-utils/gnc-date-format.c @@ -99,7 +99,7 @@ gnc_date_format_class_init (GNCDateFormatClass *klass) g_signal_new ("format_changed", G_OBJECT_CLASS_TYPE (gobject_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GNCDateFormatClass, format_changed), + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, diff --git a/gnucash/gnome-utils/gnc-date-format.h b/gnucash/gnome-utils/gnc-date-format.h index a0d02dbb4d..1ab1bff854 100644 --- a/gnucash/gnome-utils/gnc-date-format.h +++ b/gnucash/gnome-utils/gnc-date-format.h @@ -36,24 +36,14 @@ extern "C" { #endif #define GNC_TYPE_DATE_FORMAT (gnc_date_format_get_type ()) -#define GNC_DATE_FORMAT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnc_date_format_get_type(), GNCDateFormat) -#define GNC_DATE_FORMAT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnc_date_format_get_type(), GNCDateFormatClass) -#define GNC_IS_DATE_FORMAT(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnc_date_format_get_type ()) +G_DECLARE_FINAL_TYPE (GNCDateFormat, gnc_date_format, GNC, DATE_FORMAT, GtkBox) /** **/ -typedef struct +struct _GNCDateFormat { GtkBox hbox; -} GNCDateFormat; - -typedef struct -{ - GtkBoxClass hbox_class; - void (*format_changed) (GNCDateFormat *gdf); -} GNCDateFormatClass; - -GType gnc_date_format_get_type (void); +}; GtkWidget *gnc_date_format_new (void); GtkWidget *gnc_date_format_new_without_label (void);