[gjs/wip/js24: 5/11] update to c++ api for JSHandle* Objects
- From: Tim Lunn <timl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/js24: 5/11] update to c++ api for JSHandle* Objects
- Date: Wed, 25 Sep 2013 21:29:27 +0000 (UTC)
commit c545527f39c956d356e21f9797de62ecc5e54e71
Author: Tim Lunn <tim feathertop org>
Date: Mon Sep 23 10:24:59 2013 +1000
update to c++ api for JSHandle* Objects
gi/boxed.cpp | 16 ++++++++--------
gi/object.cpp | 16 ++++++++--------
gi/param.cpp | 10 +++++-----
3 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 049451e..87999e6 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -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))
@@ -818,10 +818,10 @@ boxed_field_setter (JSContext *context,
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 9b22aa1..cc5fa10 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -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;
@@ -327,12 +327,12 @@ object_instance_set_prop(JSContext *context,
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 9efca4c..27c4bbb 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -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, type_info, &arg, TRUE))
goto out;
success = JS_TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]