[gtk+] GtkStyle: make context property readable
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkStyle: make context property readable
- Date: Sat, 4 Dec 2010 15:28:13 +0000 (UTC)
commit ca59b042df53ba792cb33b430c317b68464fa592
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Fri Dec 3 20:30:13 2010 +0100
GtkStyle: make context property readable
gtk/gtkstyle.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 3310ebb..8364556 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -99,6 +99,10 @@ static void gtk_style_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
+static void gtk_style_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
static void gtk_style_realize (GtkStyle *style,
GdkVisual *visual);
@@ -472,6 +476,7 @@ gtk_style_class_init (GtkStyleClass *klass)
object_class->finalize = gtk_style_finalize;
object_class->set_property = gtk_style_set_property;
+ object_class->get_property = gtk_style_get_property;
object_class->constructed = gtk_style_constructed;
klass->clone = gtk_style_real_clone;
@@ -511,7 +516,7 @@ gtk_style_class_init (GtkStyleClass *klass)
P_("Style context"),
P_("GtkStyleContext to get style from"),
GTK_TYPE_STYLE_CONTEXT,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
/**
* GtkStyle::realize:
@@ -651,6 +656,27 @@ gtk_style_set_property (GObject *object,
}
static void
+gtk_style_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GtkStylePrivate *priv;
+
+ priv = GTK_STYLE_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_CONTEXT:
+ g_value_set_object (value, priv->context);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
set_color (GtkStyle *style,
GtkStyleContext *context,
GtkStateType state,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]