summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-05-15 14:14:19 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-05-15 14:14:19 +0000
commitcbb2129147ba307557e636dab3f1f5186785123a (patch)
treece5ba0d3d3248fd7288e1d1170fec0ebd152b938
parentee5b82c1bca7b902002b330c6972ce803e9ea943 (diff)
downloadgdk-pixbuf-cbb2129147ba307557e636dab3f1f5186785123a.tar.gz
Apply patch from John Margaglione converting from args to properties.
Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkpreview.c: Apply patch from John Margaglione converting from args to properties. (#51957) * gtk/gtkscale.c (gtk_scale_class_init): Move install property calls to after ->set_property call.
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.pre-2-08
-rw-r--r--ChangeLog.pre-2-108
-rw-r--r--ChangeLog.pre-2-28
-rw-r--r--ChangeLog.pre-2-48
-rw-r--r--ChangeLog.pre-2-68
-rw-r--r--ChangeLog.pre-2-88
-rw-r--r--gtk/gtkpreview.c67
-rw-r--r--gtk/gtkscale.c37
9 files changed, 114 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index a704b6052..c603d6bff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpreview.c: Apply patch from John Margaglione converting
+ from args to properties. (#51957)
+
+ * gtk/gtkscale.c (gtk_scale_class_init): Move install property
+ calls to after ->set_property call.
+
Mon May 14 14:56:21 2001 Owen Taylor <otaylor@redhat.com>
* tests/prop-editor.c: Block against redundant changes.
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index a704b6052..c603d6bff 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,11 @@
+Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpreview.c: Apply patch from John Margaglione converting
+ from args to properties. (#51957)
+
+ * gtk/gtkscale.c (gtk_scale_class_init): Move install property
+ calls to after ->set_property call.
+
Mon May 14 14:56:21 2001 Owen Taylor <otaylor@redhat.com>
* tests/prop-editor.c: Block against redundant changes.
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index a704b6052..c603d6bff 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,11 @@
+Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpreview.c: Apply patch from John Margaglione converting
+ from args to properties. (#51957)
+
+ * gtk/gtkscale.c (gtk_scale_class_init): Move install property
+ calls to after ->set_property call.
+
Mon May 14 14:56:21 2001 Owen Taylor <otaylor@redhat.com>
* tests/prop-editor.c: Block against redundant changes.
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index a704b6052..c603d6bff 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,11 @@
+Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpreview.c: Apply patch from John Margaglione converting
+ from args to properties. (#51957)
+
+ * gtk/gtkscale.c (gtk_scale_class_init): Move install property
+ calls to after ->set_property call.
+
Mon May 14 14:56:21 2001 Owen Taylor <otaylor@redhat.com>
* tests/prop-editor.c: Block against redundant changes.
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index a704b6052..c603d6bff 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,11 @@
+Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpreview.c: Apply patch from John Margaglione converting
+ from args to properties. (#51957)
+
+ * gtk/gtkscale.c (gtk_scale_class_init): Move install property
+ calls to after ->set_property call.
+
Mon May 14 14:56:21 2001 Owen Taylor <otaylor@redhat.com>
* tests/prop-editor.c: Block against redundant changes.
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index a704b6052..c603d6bff 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,11 @@
+Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpreview.c: Apply patch from John Margaglione converting
+ from args to properties. (#51957)
+
+ * gtk/gtkscale.c (gtk_scale_class_init): Move install property
+ calls to after ->set_property call.
+
Mon May 14 14:56:21 2001 Owen Taylor <otaylor@redhat.com>
* tests/prop-editor.c: Block against redundant changes.
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index a704b6052..c603d6bff 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,11 @@
+Tue May 15 10:11:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpreview.c: Apply patch from John Margaglione converting
+ from args to properties. (#51957)
+
+ * gtk/gtkscale.c (gtk_scale_class_init): Move install property
+ calls to after ->set_property call.
+
Mon May 14 14:56:21 2001 Owen Taylor <otaylor@redhat.com>
* tests/prop-editor.c: Block against redundant changes.
diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c
index 5e4da66df..cb0cf0419 100644
--- a/gtk/gtkpreview.c
+++ b/gtk/gtkpreview.c
@@ -35,24 +35,27 @@
#include "gdk/gdkrgb.h"
#include "gtkpreview.h"
#include "gtksignal.h"
+#include "gtkintl.h"
#define PREVIEW_CLASS(w) GTK_PREVIEW_CLASS (GTK_OBJECT (w)->klass)
enum {
- ARG_0,
- ARG_EXPAND
+ PROP_0,
+ PROP_EXPAND
};
static void gtk_preview_class_init (GtkPreviewClass *klass);
static void gtk_preview_init (GtkPreview *preview);
-static void gtk_preview_set_arg (GtkObject *object,
- GtkArg *arg,
- guint arg_id);
-static void gtk_preview_get_arg (GtkObject *object,
- GtkArg *arg,
- guint arg_id);
+static void gtk_preview_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gtk_preview_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
static void gtk_preview_finalize (GObject *object);
static void gtk_preview_realize (GtkWidget *widget);
static void gtk_preview_size_allocate (GtkWidget *widget,
@@ -107,8 +110,8 @@ gtk_preview_class_init (GtkPreviewClass *klass)
gobject_class->finalize = gtk_preview_finalize;
- object_class->set_arg = gtk_preview_set_arg;
- object_class->get_arg = gtk_preview_get_arg;
+ gobject_class->set_property = gtk_preview_set_property;
+ gobject_class->get_property = gtk_preview_get_property;
widget_class->realize = gtk_preview_realize;
widget_class->size_allocate = gtk_preview_size_allocate;
@@ -125,43 +128,51 @@ gtk_preview_class_init (GtkPreviewClass *klass)
klass->info.cmap = gdk_rgb_get_cmap ();
klass->info.visual = gdk_rgb_get_visual ();
- gtk_object_add_arg_type ("GtkPreview::expand",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_EXPAND);
+ g_object_class_install_property (gobject_class,
+ PROP_EXPAND,
+ g_param_spec_boolean ("expand",
+ _("Expand"),
+ _("Whether the preview widget should take up the entire space it is allocated"),
+ FALSE,
+ G_PARAM_READWRITE));
}
static void
-gtk_preview_set_arg (GtkObject *object,
- GtkArg *arg,
- guint arg_id)
+gtk_preview_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GtkPreview *preview = GTK_PREVIEW (object);
- switch (arg_id)
+ switch (prop_id)
{
- case ARG_EXPAND:
- gtk_preview_set_expand (preview, GTK_VALUE_BOOL (*arg));
+ case PROP_EXPAND:
+ gtk_preview_set_expand (preview, g_value_get_boolean (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
-gtk_preview_get_arg (GtkObject *object,
- GtkArg *arg,
- guint arg_id)
+gtk_preview_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GtkPreview *preview;
preview = GTK_PREVIEW (object);
- switch (arg_id)
+ switch (prop_id)
{
- case ARG_EXPAND:
- GTK_VALUE_BOOL (*arg) = preview->expand;
+ case PROP_EXPAND:
+ g_value_set_boolean (value, preview->expand);
break;
default:
- arg->type = GTK_TYPE_INVALID;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@@ -360,6 +371,8 @@ gtk_preview_set_expand (GtkPreview *preview,
{
preview->expand = expand;
gtk_widget_queue_resize (GTK_WIDGET (preview));
+
+ g_object_notify (G_OBJECT (preview), "expand");
}
}
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 74d7056f3..de5c180bc 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -118,6 +118,24 @@ gtk_scale_class_init (GtkScaleClass *class)
parent_class = gtk_type_class (GTK_TYPE_RANGE);
+ gobject_class->set_property = gtk_scale_set_property;
+ gobject_class->get_property = gtk_scale_get_property;
+
+ widget_class->map = gtk_scale_map;
+ widget_class->unmap = gtk_scale_unmap;
+
+ range_class->draw_background = gtk_scale_draw_background;
+
+ signals[FORMAT_VALUE] =
+ g_signal_newc ("format_value",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkScaleClass, format_value),
+ single_string_accumulator, NULL,
+ gtk_marshal_STRING__DOUBLE,
+ G_TYPE_STRING, 1,
+ G_TYPE_DOUBLE);
+
g_object_class_install_property (gobject_class,
PROP_DIGITS,
g_param_spec_int ("digits",
@@ -145,25 +163,6 @@ gtk_scale_class_init (GtkScaleClass *class)
GTK_POS_LEFT,
G_PARAM_READWRITE));
- signals[FORMAT_VALUE] =
- g_signal_newc ("format_value",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GtkScaleClass, format_value),
- single_string_accumulator, NULL,
- gtk_marshal_STRING__DOUBLE,
- G_TYPE_STRING, 1,
- G_TYPE_DOUBLE);
-
-
- gobject_class->set_property = gtk_scale_set_property;
- gobject_class->get_property = gtk_scale_get_property;
-
- widget_class->map = gtk_scale_map;
- widget_class->unmap = gtk_scale_unmap;
-
- range_class->draw_background = gtk_scale_draw_background;
-
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("slider_length",
_("Slider Length"),