From 02a9cf6ec3dc7cf85007c6e063977fba335fd925 Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Sat, 20 May 2023 13:29:53 +0100 Subject: [PATCH] Refactor: DECLARE_FINAL GOCharmapSel < GtkBox --- borrowed/goffice/go-charmap-sel.c | 11 +---------- borrowed/goffice/go-charmap-sel.h | 6 +----- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/borrowed/goffice/go-charmap-sel.c b/borrowed/goffice/go-charmap-sel.c index d94fc918cb..1c60787abb 100644 --- a/borrowed/goffice/go-charmap-sel.c +++ b/borrowed/goffice/go-charmap-sel.c @@ -261,15 +261,6 @@ struct _GOCharmapSel GOCharmapSelTestDirection test; }; -typedef struct -{ - GtkBoxClass parent_class; - - gboolean (*charmap_changed)(GOCharmapSel *cs, char const *new_charmap); -} GOCharmapSelClass; - -typedef GOCharmapSel Cs; -typedef GOCharmapSelClass CsClass; /* Signals we emit */ enum @@ -471,7 +462,7 @@ static void go_charmap_sel_class_init(GOCharmapSelClass *klass) cs_signals[CHARMAP_CHANGED] = g_signal_new("charmap_changed", GO_TYPE_CHARMAP_SEL, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GOCharmapSelClass, charmap_changed), + 0, NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); diff --git a/borrowed/goffice/go-charmap-sel.h b/borrowed/goffice/go-charmap-sel.h index e9b931a4ad..6c25cea681 100644 --- a/borrowed/goffice/go-charmap-sel.h +++ b/borrowed/goffice/go-charmap-sel.h @@ -30,10 +30,7 @@ G_BEGIN_DECLS #define GO_TYPE_CHARMAP_SEL (go_charmap_sel_get_type ()) -#define GO_CHARMAP_SEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GO_TYPE_CHARMAP_SEL, GOCharmapSel)) -#define GO_IS_CHARMAP_SEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GO_TYPE_CHARMAP_SEL)) - -typedef struct _GOCharmapSel GOCharmapSel; +G_DECLARE_FINAL_TYPE (GOCharmapSel, go_charmap_sel, GO, CHARMAP_SEL, GtkBox); typedef enum { @@ -41,7 +38,6 @@ typedef enum GO_CHARMAP_SEL_FROM_UTF8 } GOCharmapSelTestDirection; -GType go_charmap_sel_get_type(void); GtkWidget * go_charmap_sel_new(GOCharmapSelTestDirection test); gchar const *go_charmap_sel_get_encoding(GOCharmapSel *cs);