[anjuta] class-gen: don't derive from deprecated GtkHBox
- From: Carl-Anton Ingmarsson <carlantoni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] class-gen: don't derive from deprecated GtkHBox
- Date: Tue, 14 May 2013 20:34:15 +0000 (UTC)
commit 1575e87c4504881baa93bcec6426f1a925068470
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date: Tue May 14 17:26:02 2013 +0200
class-gen: don't derive from deprecated GtkHBox
Also use G_DEFINE_TYPE_WITH_CODE() instead of handrolling our own
get_type() function.
plugins/class-gen/combo-flags.c | 62 ++++++--------------------------------
1 files changed, 10 insertions(+), 52 deletions(-)
---
diff --git a/plugins/class-gen/combo-flags.c b/plugins/class-gen/combo-flags.c
index 23b4e59..ddc1248 100644
--- a/plugins/class-gen/combo-flags.c
+++ b/plugins/class-gen/combo-flags.c
@@ -73,10 +73,17 @@ enum {
SELECTED,
LAST_SIGNAL
};
-
-static GtkBoxClass* parent_class = NULL;
static guint combo_flags_signals[LAST_SIGNAL];
+static void cg_combo_flags_cell_layout_init (GtkCellLayoutIface *iface);
+static void cg_combo_flags_cell_editable_init (GtkCellEditableIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (CgComboFlags, cg_combo_flags, GTK_TYPE_BOX,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
+ cg_combo_flags_cell_layout_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_EDITABLE,
+ cg_combo_flags_cell_editable_init));
+
static CgComboFlagsCellInfo *
cg_combo_flags_get_cell_info (CgComboFlags *combo,
GtkCellRenderer *cell)
@@ -599,7 +606,7 @@ cg_combo_flags_finalize (GObject *object)
if (priv->window != NULL)
cg_combo_flags_popdown (combo_flags);
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (cg_combo_flags_parent_class)->finalize (object);
}
static void
@@ -664,7 +671,6 @@ static void
cg_combo_flags_class_init (CgComboFlagsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (CgComboFlagsPrivate));
@@ -846,54 +852,6 @@ cg_combo_flags_selection_type_get_type (void)
return our_type;
}
-GType
-cg_combo_flags_get_type (void)
-{
- static GType our_type = 0;
-
- if(our_type == 0)
- {
- static const GTypeInfo our_info =
- {
- sizeof (CgComboFlagsClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cg_combo_flags_class_init,
- NULL,
- NULL,
- sizeof (CgComboFlags),
- 0,
- (GInstanceInitFunc) cg_combo_flags_init,
- NULL
- };
-
- static const GInterfaceInfo cell_layout_info =
- {
- (GInterfaceInitFunc) cg_combo_flags_cell_layout_init,
- NULL,
- NULL
- };
-
- static const GInterfaceInfo cell_editable_info =
- {
- (GInterfaceInitFunc) cg_combo_flags_cell_editable_init,
- NULL,
- NULL
- };
-
- our_type = g_type_register_static(GTK_TYPE_HBOX, "CgComboFlags",
- &our_info, 0);
-
- g_type_add_interface_static (our_type, GTK_TYPE_CELL_LAYOUT,
- &cell_layout_info);
-
- g_type_add_interface_static (our_type, GTK_TYPE_CELL_EDITABLE,
- &cell_editable_info);
- }
-
- return our_type;
-}
-
GtkWidget *
cg_combo_flags_new (void)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]