Skip to content

Commit aa638cc

Browse files
committed
Refactor: DECLARE_FINAL GOOptionMenu < GtkButton
1 parent 02a9cf6 commit aa638cc

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

borrowed/goffice/go-optionmenu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static void go_option_menu_class_init(GOOptionMenuClass *class)
325325
GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
326326

327327
signals[CHANGED] = g_signal_new("changed", G_OBJECT_CLASS_TYPE(class),
328-
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(GOOptionMenuClass, changed),
328+
G_SIGNAL_RUN_LAST, 0,
329329
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
330330

331331
gobject_class->set_property = go_option_menu_set_property;

borrowed/goffice/go-optionmenu.h

+1-23
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,7 @@
3838
G_BEGIN_DECLS
3939

4040
#define GO_TYPE_OPTION_MENU (go_option_menu_get_type ())
41-
#define GO_OPTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GO_TYPE_OPTION_MENU, GOOptionMenu))
42-
#define GO_OPTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GO_TYPE_OPTION_MENU, GOOptionMenuClass))
43-
#define GO_IS_OPTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GO_TYPE_OPTION_MENU))
44-
#define GO_IS_OPTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GO_TYPE_OPTION_MENU))
45-
#define GO_OPTION_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GO_TYPE_OPTION_MENU, GOOptionMenuClass))
46-
47-
typedef struct _GOOptionMenu GOOptionMenu;
48-
typedef struct _GOOptionMenuClass GOOptionMenuClass;
41+
G_DECLARE_FINAL_TYPE (GOOptionMenu, go_option_menu, GO, OPTION_MENU, GtkButton)
4942

5043
struct _GOOptionMenu
5144
{
@@ -58,21 +51,6 @@ struct _GOOptionMenu
5851
GtkLabel *button_label;
5952
};
6053

61-
struct _GOOptionMenuClass
62-
{
63-
GtkButtonClass parent_class;
64-
65-
void (*changed)(GOOptionMenu *option_menu);
66-
67-
/* Padding for future expansion */
68-
void (*_gtk_reserved1)(void);
69-
void (*_gtk_reserved2)(void);
70-
void (*_gtk_reserved3)(void);
71-
void (*_gtk_reserved4)(void);
72-
};
73-
74-
GType go_option_menu_get_type(void)
75-
G_GNUC_CONST;
7654
GtkWidget* go_option_menu_new(void);
7755
void go_option_menu_set_menu(GOOptionMenu *option_menu, GtkWidget *menu);
7856
void go_option_menu_set_history(GOOptionMenu *option_menu, GSList *selection);

0 commit comments

Comments
 (0)