]> Pileus Git - ~andy/gtk/commitdiff
Add "name" as a construct-only property. (#125475, Murray Cumming)
authorMatthias Clasen <maclas@gmx.de>
Sat, 25 Oct 2003 21:34:24 +0000 (21:34 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 25 Oct 2003 21:34:24 +0000 (21:34 +0000)
Sat Oct 25 23:30:13 2003  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name"
as a construct-only property.  (#125475, Murray Cumming)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkactiongroup.c

index 31d7304880cc86e311f5e5042bf6fb927774921d..2fb31ae9ef97f7a48d960dd1f3774b78279d3393 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Oct 25 23:30:13 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" 
+       as a construct-only property.  (#125475, Murray Cumming)
+
 Thu Oct 23 21:55:10 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        Fix bug 116297 and 125472
index 31d7304880cc86e311f5e5042bf6fb927774921d..2fb31ae9ef97f7a48d960dd1f3774b78279d3393 100644 (file)
@@ -1,3 +1,8 @@
+Sat Oct 25 23:30:13 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" 
+       as a construct-only property.  (#125475, Murray Cumming)
+
 Thu Oct 23 21:55:10 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        Fix bug 116297 and 125472
index 31d7304880cc86e311f5e5042bf6fb927774921d..2fb31ae9ef97f7a48d960dd1f3774b78279d3393 100644 (file)
@@ -1,3 +1,8 @@
+Sat Oct 25 23:30:13 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" 
+       as a construct-only property.  (#125475, Murray Cumming)
+
 Thu Oct 23 21:55:10 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        Fix bug 116297 and 125472
index 31d7304880cc86e311f5e5042bf6fb927774921d..2fb31ae9ef97f7a48d960dd1f3774b78279d3393 100644 (file)
@@ -1,3 +1,8 @@
+Sat Oct 25 23:30:13 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" 
+       as a construct-only property.  (#125475, Murray Cumming)
+
 Thu Oct 23 21:55:10 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        Fix bug 116297 and 125472
index 31d7304880cc86e311f5e5042bf6fb927774921d..2fb31ae9ef97f7a48d960dd1f3774b78279d3393 100644 (file)
@@ -1,3 +1,8 @@
+Sat Oct 25 23:30:13 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" 
+       as a construct-only property.  (#125475, Murray Cumming)
+
 Thu Oct 23 21:55:10 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        Fix bug 116297 and 125472
index f58a44273e500196bcafaf4cf852a7c9858e5304..afbebc61b1d3d440491934cafc105e56d71a9dc1 100644 (file)
@@ -48,9 +48,23 @@ struct _GtkActionGroupPrivate
   GtkDestroyNotify translate_notify;   
 };
 
+enum 
+{
+  PROP_0,
+  PROP_NAME
+};
+
 static void       gtk_action_group_init            (GtkActionGroup      *self);
 static void       gtk_action_group_class_init      (GtkActionGroupClass *class);
 static void       gtk_action_group_finalize        (GObject             *object);
+static void       gtk_action_group_set_property    (GObject             *object,
+                                                   guint                prop_id,
+                                                   const GValue        *value,
+                                                   GParamSpec          *pspec);
+static void       gtk_action_group_get_property    (GObject             *object,
+                                                   guint                prop_id,
+                                                   GValue              *value,
+                                                   GParamSpec          *pspec);
 static GtkAction *gtk_action_group_real_get_action (GtkActionGroup      *self,
                                                    const gchar         *name);
 
@@ -93,8 +107,18 @@ gtk_action_group_class_init (GtkActionGroupClass *klass)
   parent_class = g_type_class_peek_parent (klass);
 
   gobject_class->finalize = gtk_action_group_finalize;
+  gobject_class->set_property = gtk_action_group_set_property;
+  gobject_class->get_property = gtk_action_group_get_property;
   klass->get_action = gtk_action_group_real_get_action;
 
+  g_object_class_install_property (gobject_class,
+                                  PROP_NAME,
+                                  g_param_spec_string ("name",
+                                                       _("Name"),
+                                                       _("A name for the action group."),
+                                                       NULL,
+                                                       G_PARAM_READWRITE |
+                                                       G_PARAM_CONSTRUCT_ONLY));
   g_type_class_add_private (gobject_class, sizeof (GtkActionGroupPrivate));
 }
 
@@ -154,6 +178,51 @@ gtk_action_group_finalize (GObject *object)
     (* parent_class->finalize) (object);
 }
 
+static void
+gtk_action_group_set_property (GObject         *object,
+                              guint            prop_id,
+                              const GValue    *value,
+                              GParamSpec      *pspec)
+{
+  GtkActionGroup *self;
+  gchar *tmp;
+  
+  self = GTK_ACTION_GROUP (object);
+
+  switch (prop_id)
+    {
+    case PROP_NAME:
+      tmp = self->private_data->name;
+      self->private_data->name = g_value_dup_string (value);
+      g_free (tmp);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+gtk_action_group_get_property (GObject    *object,
+                              guint       prop_id,
+                              GValue     *value,
+                              GParamSpec *pspec)
+{
+  GtkActionGroup *self;
+  
+  self = GTK_ACTION_GROUP (object);
+
+  switch (prop_id)
+    {
+    case PROP_NAME:
+      g_value_set_string (value, self->private_data->name);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
 static GtkAction *
 gtk_action_group_real_get_action (GtkActionGroup *self,
                                  const gchar    *action_name)