[gjs/wip/package: 7/8] Add missing GParamSpec constructors
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/package: 7/8] Add missing GParamSpec constructors
- Date: Sun, 10 Mar 2013 18:18:38 +0000 (UTC)
commit a28929715c2c737fb177845190574a378d358846
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sat Feb 23 00:00:27 2013 +0100
Add missing GParamSpec constructors
For boxed and object properties.
gi/param.c | 6 +++---
modules/overrides/GObject.js | 10 ++++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gi/param.c b/gi/param.c
index e4e5d71..e64780f 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -389,16 +389,16 @@ param_new_internal(JSContext *cx,
}
break;
case G_TYPE_PARAM:
- pspec = g_param_spec_param(prop_name, nick, blurb, prop_type, flags);
+ pspec = g_param_spec_param(prop_name, nick, blurb, prop_gtype, flags);
break;
case G_TYPE_BOXED:
- pspec = g_param_spec_boxed(prop_name, nick, blurb, prop_type, flags);
+ pspec = g_param_spec_boxed(prop_name, nick, blurb, prop_gtype, flags);
break;
case G_TYPE_POINTER:
pspec = g_param_spec_pointer(prop_name, nick, blurb, flags);
break;
case G_TYPE_OBJECT:
- pspec = g_param_spec_object(prop_name, nick, blurb, prop_type, flags);
+ pspec = g_param_spec_object(prop_name, nick, blurb, prop_gtype, flags);
break;
default:
gjs_throw(cx,
diff --git a/modules/overrides/GObject.js b/modules/overrides/GObject.js
index 7902abc..1000d71 100644
--- a/modules/overrides/GObject.js
+++ b/modules/overrides/GObject.js
@@ -234,6 +234,16 @@ function _init() {
nick, blurb, flags, default_value);
};
+ this.ParamSpec.boxed = function(name, nick, blurb, flags, gtype) {
+ return GObject.ParamSpec._new_internal(name, gtype,
+ nick, blurb, flags);
+ },
+
+ this.ParamSpec.object = function(name, nick, blurb, flags, gtype) {
+ return GObject.ParamSpec._new_internal(name, gtype,
+ nick, blurb, flags);
+ },
+
this.Class = GObjectMeta;
this.Object.prototype.__metaclass__ = this.Class;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]