aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment-button.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-08-24 23:21:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-08-25 02:37:02 +0800
commitecf3434da05b1f39f793c24b38bfd278e10b5786 (patch)
tree485ed2399920ecb10dbee2b4db4c437c22574a20 /widgets/misc/e-attachment-button.c
parentf1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff)
downloadgsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.bz2
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.lz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.xz
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-attachment-button.c')
-rw-r--r--widgets/misc/e-attachment-button.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c
index a248cf6ca4..3878c1ee8d 100644
--- a/widgets/misc/e-attachment-button.c
+++ b/widgets/misc/e-attachment-button.c
@@ -55,7 +55,10 @@ enum {
PROP_VIEW
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EAttachmentButton,
+ e_attachment_button,
+ GTK_TYPE_HBOX)
static void
attachment_button_menu_deactivate_cb (EAttachmentButton *button)
@@ -435,7 +438,7 @@ attachment_button_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_attachment_button_parent_class)->dispose (object);
}
static void
@@ -445,19 +448,19 @@ attachment_button_style_set (GtkWidget *widget,
EAttachmentButton *button;
/* Chain up to parent's style_set() method. */
- GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
+ GTK_WIDGET_CLASS (e_attachment_button_parent_class)->
+ style_set (widget, previous_style);
button = E_ATTACHMENT_BUTTON (widget);
attachment_button_update_pixbufs (button);
}
static void
-attachment_button_class_init (EAttachmentButtonClass *class)
+e_attachment_button_class_init (EAttachmentButtonClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EAttachmentButtonPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -513,7 +516,7 @@ attachment_button_class_init (EAttachmentButtonClass *class)
}
static void
-attachment_button_init (EAttachmentButton *button)
+e_attachment_button_init (EAttachmentButton *button)
{
GtkCellRenderer *renderer;
GtkCellLayout *cell_layout;
@@ -635,32 +638,6 @@ attachment_button_init (EAttachmentButton *button)
button);
}
-GType
-e_attachment_button_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EAttachmentButtonClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) attachment_button_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EAttachmentButton),
- 0, /* n_preallocs */
- (GInstanceInitFunc) attachment_button_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GTK_TYPE_HBOX, "EAttachmentButton", &type_info, 0);
- }
-
- return type;
-}
-
GtkWidget *
e_attachment_button_new (EAttachmentView *view)
{