diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-08-24 23:21:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-08-25 02:37:02 +0800 |
commit | ecf3434da05b1f39f793c24b38bfd278e10b5786 (patch) | |
tree | 485ed2399920ecb10dbee2b4db4c437c22574a20 /widgets/misc/e-menu-tool-action.c | |
parent | f1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff) | |
download | gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.zst gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.zip |
GObject boilerplate cleanup.
Prefer thread-safe G_DEFINE_TYPE and G_DEFINE_INTERFACE macros over
manual GType registration.
This is just a start... lots more to do.
Diffstat (limited to 'widgets/misc/e-menu-tool-action.c')
-rw-r--r-- | widgets/misc/e-menu-tool-action.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/widgets/misc/e-menu-tool-action.c b/widgets/misc/e-menu-tool-action.c index 2cfe2783db..6a6505bf0e 100644 --- a/widgets/misc/e-menu-tool-action.c +++ b/widgets/misc/e-menu-tool-action.c @@ -21,43 +21,23 @@ #include "e-menu-tool-action.h" -static gpointer parent_class; +G_DEFINE_TYPE ( + EMenuToolAction, + e_menu_tool_action, + GTK_TYPE_ACTION) static void -menu_tool_action_class_init (EMenuToolActionClass *class) +e_menu_tool_action_class_init (EMenuToolActionClass *class) { GtkActionClass *action_class; - parent_class = g_type_class_peek_parent (class); - action_class = GTK_ACTION_CLASS (class); action_class->toolbar_item_type = GTK_TYPE_MENU_TOOL_BUTTON; } -GType -e_menu_tool_action_get_type (void) +static void +e_menu_tool_action_init (EMenuToolAction *action) { - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EMenuToolActionClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) menu_tool_action_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMenuToolAction), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - NULL /* value_table */ - }; - - type = g_type_register_static ( - GTK_TYPE_ACTION, "EMenuToolAction", &type_info, 0); - } - - return type; } EMenuToolAction * |