[gjs] update to c++ types and api for JSHandle* Objects
- From: Tim Lunn <timl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] update to c++ types and api for JSHandle* Objects
- Date: Tue, 29 Oct 2013 02:46:59 +0000 (UTC)
commit 9daff9c44e9ade55ae1d0c02ba81219914bcf72a
Author: Tim Lunn <tim feathertop org>
Date: Mon Sep 23 10:24:59 2013 +1000
update to c++ types and api for JSHandle* Objects
https://bugzilla.gnome.org/show_bug.cgi?id=710878
gi/boxed.cpp | 34 +++++++++++++++++-----------------
gi/object.cpp | 34 +++++++++++++++++-----------------
gi/param.cpp | 18 +++++++++---------
3 files changed, 43 insertions(+), 43 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 049451e..4e2c7d5 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -628,10 +628,10 @@ get_nested_interface_object (JSContext *context,
}
static JSBool
-boxed_field_getter (JSContext *context,
- JSHandleObject obj,
- JSHandleId id,
- JSMutableHandleValue value)
+boxed_field_getter (JSContext *context,
+ JS::HandleObject obj,
+ JS::HandleId id,
+ JS::MutableHandleValue value)
{
Boxed *priv;
GIFieldInfo *field_info;
@@ -639,11 +639,11 @@ boxed_field_getter (JSContext *context,
GArgument arg;
gboolean success = FALSE;
- priv = priv_from_js(context, *obj._);
+ priv = priv_from_js(context, obj);
if (!priv)
return JS_FALSE;
- field_info = get_field_info(context, priv, *id._);
+ field_info = get_field_info(context, priv, id);
if (!field_info)
return JS_FALSE;
@@ -664,9 +664,9 @@ boxed_field_getter (JSContext *context,
if (g_base_info_get_type (interface_info) == GI_INFO_TYPE_STRUCT ||
g_base_info_get_type (interface_info) == GI_INFO_TYPE_BOXED) {
- success = get_nested_interface_object (context, *obj._, priv,
+ success = get_nested_interface_object (context, obj, priv,
field_info, type_info, interface_info,
- value._);
+ value.address());
g_base_info_unref ((GIBaseInfo *)interface_info);
@@ -683,7 +683,7 @@ boxed_field_getter (JSContext *context,
goto out;
}
- if (!gjs_value_from_g_argument (context, value._,
+ if (!gjs_value_from_g_argument (context, value.address(),
type_info,
&arg,
TRUE))
@@ -808,20 +808,20 @@ out:
}
static JSBool
-boxed_field_setter (JSContext *context,
- JSHandleObject obj,
- JSHandleId id,
- JSBool strict,
- JSMutableHandleValue value)
+boxed_field_setter (JSContext *context,
+ JS::HandleObject obj,
+ JS::HandleId id,
+ JSBool strict,
+ JS::MutableHandleValue value)
{
Boxed *priv;
GIFieldInfo *field_info;
gboolean success = FALSE;
- priv = priv_from_js(context, *obj._);
+ priv = priv_from_js(context, obj);
if (!priv)
return JS_FALSE;
- field_info = get_field_info(context, priv, *id._);
+ field_info = get_field_info(context, priv, id);
if (!field_info)
return JS_FALSE;
@@ -832,7 +832,7 @@ boxed_field_setter (JSContext *context,
goto out;
}
- success = boxed_set_field_from_value (context, priv, field_info, *value._);
+ success = boxed_set_field_from_value (context, priv, field_info, value);
out:
g_base_info_unref ((GIBaseInfo *)field_info);
diff --git a/gi/object.cpp b/gi/object.cpp
index 79e9193..c0c4bcc 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -247,10 +247,10 @@ proto_priv_from_js(JSContext *context,
* Return value is JS_FALSE on OOM/exception.
*/
static JSBool
-object_instance_get_prop(JSContext *context,
- JSHandleObject obj,
- JSHandleId id,
- JSMutableHandleValue value_p)
+object_instance_get_prop(JSContext *context,
+ JS::HandleObject obj,
+ JS::HandleId id,
+ JS::MutableHandleValue value_p)
{
ObjectInstance *priv;
char *name;
@@ -259,12 +259,12 @@ object_instance_get_prop(JSContext *context,
GValue gvalue = { 0, };
JSBool ret = JS_TRUE;
- if (!gjs_get_string_id(context, *id._, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
- priv = priv_from_js(context, *obj._);
+ priv = priv_from_js(context, obj);
gjs_debug_jsprop(GJS_DEBUG_GOBJECT,
- "Get prop '%s' hook obj %p priv %p", name, *obj._, priv);
+ "Get prop '%s' hook obj %p priv %p", name, obj, priv);
if (priv == NULL) {
/* If we reach this point, either object_instance_new_resolve
@@ -300,7 +300,7 @@ object_instance_get_prop(JSContext *context,
g_value_init(&gvalue, G_PARAM_SPEC_VALUE_TYPE(param));
g_object_get_property(priv->gobj, param->name,
&gvalue);
- if (!gjs_value_from_g_value(context, value_p._, &gvalue)) {
+ if (!gjs_value_from_g_value(context, value_p.address(), &gvalue)) {
g_value_unset(&gvalue);
ret = JS_FALSE;
goto out;
@@ -316,23 +316,23 @@ object_instance_get_prop(JSContext *context,
* be set. Return value is JS_FALSE on OOM/exception.
*/
static JSBool
-object_instance_set_prop(JSContext *context,
- JSHandleObject obj,
- JSHandleId id,
- JSBool strict,
- JSMutableHandleValue value_p)
+object_instance_set_prop(JSContext *context,
+ JS::HandleObject obj,
+ JS::HandleId id,
+ JSBool strict,
+ JS::MutableHandleValue value_p)
{
ObjectInstance *priv;
char *name;
GParameter param = { NULL, { 0, }};
JSBool ret = JS_TRUE;
- if (!gjs_get_string_id(context, *id._, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
- priv = priv_from_js(context, *obj._);
+ priv = priv_from_js(context, obj);
gjs_debug_jsprop(GJS_DEBUG_GOBJECT,
- "Set prop '%s' hook obj %p priv %p", name, *obj._, priv);
+ "Set prop '%s' hook obj %p priv %p", name, obj, priv);
if (priv == NULL) {
/* see the comment in object_instance_get_prop() on this */
@@ -342,7 +342,7 @@ object_instance_set_prop(JSContext *context,
goto out;
switch (init_g_param_from_property(context, name,
- *value_p._,
+ value_p,
G_TYPE_FROM_INSTANCE(priv->gobj),
¶m,
FALSE /* constructing */)) {
diff --git a/gi/param.cpp b/gi/param.cpp
index ee1a7af..8197115 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -68,10 +68,10 @@ find_field_info(GIObjectInfo *info,
* Return value is JS_FALSE on OOM/exception.
*/
static JSBool
-param_get_prop(JSContext *context,
- JSHandleObject obj,
- JSHandleId id,
- JSMutableHandleValue value_p)
+param_get_prop(JSContext *context,
+ JS::HandleObject obj,
+ JS::HandleId id,
+ JS::MutableHandleValue value_p)
{
JSBool success;
Param *priv;
@@ -83,10 +83,10 @@ param_get_prop(JSContext *context,
GITypeInfo *type_info = NULL;
GIArgument arg;
- if (!gjs_get_string_id(context, *id._, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not something we affect, but no error */
- priv = priv_from_js(context, *obj._);
+ priv = priv_from_js(context, obj);
if (priv == NULL) {
g_free(name);
@@ -101,7 +101,7 @@ param_get_prop(JSContext *context,
if (info == NULL) {
/* We may have a non-introspectable GParamSpec subclass here. Just return VOID. */
- *value_p._ = JSVAL_VOID;
+ value_p.set(JSVAL_VOID);
success = JS_TRUE;
goto out;
}
@@ -116,7 +116,7 @@ param_get_prop(JSContext *context,
}
if (field_info == NULL) {
- *value_p._ = JSVAL_VOID;
+ value_p.set(JSVAL_VOID);
success = JS_TRUE;
goto out;
}
@@ -130,7 +130,7 @@ param_get_prop(JSContext *context,
goto out;
}
- if (!gjs_value_from_g_argument(context, value_p._, type_info, &arg, TRUE))
+ if (!gjs_value_from_g_argument(context, value_p.address(), type_info, &arg, TRUE))
goto out;
success = JS_TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]