[ilovegom commit] r88 - in trunk/gom: . xulapp/components/gom/src

3 views
Skip to first unread message

codesite...@google.com

unread,
Sep 1, 2008, 5:05:59 PM9/1/08
to gom-c...@googlegroups.com
Author: ja...@87k.net
Date: Mon Sep 1 14:05:20 2008
New Revision: 88

Added:
trunk/gom/test-gom.sh.in (contents, props changed)
Modified:
trunk/gom/ (props changed)
trunk/gom/ChangeLog
trunk/gom/configure.ac
trunk/gom/xulapp/components/gom/src/xgGObject.cpp
trunk/gom/xulapp/components/gom/src/xgGObject.h
trunk/gom/xulapp/components/gom/src/xgGtkElement.cpp
trunk/gom/xulapp/components/gom/src/xgGtkElement.h

Log:
2008-09-01 jacob berkman <ja...@ilovegom.org>

* xulapp/components/gom/src/xgGtkElement.cpp
(xgGtkElement::DefineProperties): move to xgGtkElement, as simple
xgGObjects get their properties defined dynamically via its
nsIXPCScriptable implementation
(xgGtkElement::Resolve): resolve on nsIAtoms

* xulapp/components/gom/src/xgGObject.cpp
(xgGObject::GetProperty, xgGObject::SetProperty): split into two;
one operates on a JSObject, and a helper operates on a GObject
(xgGObject::Resolve): add variants that operate on jsval property
names
(xgGObject::GetProperty, xgGObject::SetProperty): use static
variants

Modified: trunk/gom/ChangeLog
==============================================================================
--- trunk/gom/ChangeLog (original)
+++ trunk/gom/ChangeLog Mon Sep 1 14:05:20 2008
@@ -1,5 +1,19 @@
2008-09-01 jacob berkman <ja...@ilovegom.org>

+ * xulapp/components/gom/src/xgGtkElement.cpp
+ (xgGtkElement::DefineProperties): move to xgGtkElement, as simple
+ xgGObjects get their properties defined dynamically via its
+ nsIXPCScriptable implementation
+ (xgGtkElement::Resolve): resolve on nsIAtoms
+
+ * xulapp/components/gom/src/xgGObject.cpp
+ (xgGObject::GetProperty, xgGObject::SetProperty): split into two;
+ one operates on a JSObject, and a helper operates on a GObject
+ (xgGObject::Resolve): add variants that operate on jsval property
+ names
+ (xgGObject::GetProperty, xgGObject::SetProperty): use static
+ variants
+
* configure.ac: generate package version number based on svn
revision


Modified: trunk/gom/configure.ac
==============================================================================
--- trunk/gom/configure.ac (original)
+++ trunk/gom/configure.ac Mon Sep 1 14:05:20 2008
@@ -87,6 +87,7 @@

AC_CONFIG_FILES([
Makefile
+test-gom.sh
xulapp/app/application.ini
xulapp/confvars.sh
xulapp/mozconfig

Added: trunk/gom/test-gom.sh.in
==============================================================================
--- (empty file)
+++ trunk/gom/test-gom.sh.in Mon Sep 1 14:05:20 2008
@@ -0,0 +1,2 @@
+#!/bin/bash
+@XULSDK@/bin/xulrunner mozilla.obj/dist/bin/application.ini $@

Modified: trunk/gom/xulapp/components/gom/src/xgGObject.cpp
==============================================================================
--- trunk/gom/xulapp/components/gom/src/xgGObject.cpp (original)
+++ trunk/gom/xulapp/components/gom/src/xgGObject.cpp Mon Sep 1 14:05:20
2008
@@ -74,69 +74,12 @@
}


-nsresult
-xgGObject::DefineProperties (JSContext *jscx, nsISupports *aCOMObj)
-{
- nsresult rv;
-
- nsCOMPtr<nsIXPConnect> xpc (do_GetService
("@mozilla.org/js/xpc/XPConnect;1", &rv));
- NS_ENSURE_SUCCESS (rv, rv);
-
- nsCOMPtr<nsIXPConnectJSObjectHolder> jswrapper;
- rv = xpc->WrapNative (jscx, JS_GetGlobalObject (jscx), aCOMObj,
NS_GET_IID (nsISupports), getter_AddRefs (jswrapper));
- NS_ENSURE_SUCCESS (rv, rv);
-
-#if 0
- nsCOMPtr<nsIXPConnectWrappedNative> wrapper (do_QueryInterface
(jswrapper, &rv));
- NS_ENSURE_SUCCESS (rv, rv);
- nsDOMClassInfo::PreserveNodeWrapper(wrapper);
-#endif
-
- JSObject *jsobj;
- rv = jswrapper->GetJSObject (&jsobj);
- NS_ENSURE_SUCCESS (rv, rv);
-
- g_message (GOM_LOC ("Got JSObject: %p"), (void *)jsobj);
-
- guint n_properties;
- GParamSpec **props = g_object_class_list_properties
(G_OBJECT_GET_CLASS (mObject), &n_properties);
- g_message (GOM_LOC ("Adding %d properties from %s"), n_properties,
G_OBJECT_TYPE_NAME (mObject));
-
- JS_BeginRequest (jscx);
-
- const char *camelName;
- for (guint i = 0; i < n_properties; i++) {
- camelName = gom_camel_case (props[i]->name);
- if (!JS_DefineProperty (jscx, jsobj, camelName, JSVAL_VOID,
- xgGObject::GetProperty,
- xgGObject::SetProperty,
- JSPROP_ENUMERATE | JSPROP_PERMANENT)) {
- g_printerr ("Could not define a property for %s\n", camelName);
- } else {
- g_print (GOM_LOC ("Defined property: %s.%s\n"),
- G_OBJECT_TYPE_NAME (mObject), camelName);
- }
- GOM_CAMEL_FREE (camelName, props[i]->name);
- }
-
- JS_EndRequest (jscx);
-
- return NS_OK;
-}
-
// static
JSBool
-xgGObject::GetProperty (JSContext *cx,
- JSObject *obj,
- jsval id,
- jsval *vp)
+xgGObject::GetProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
- if (JSVAL_IS_INT (id)) {
- return JS_TRUE;
- }
-
+ //g_print (GOM_LOC ("Entered\n"));
nsresult rv;
-
nsCOMPtr<nsISupports> native;
rv = GetNative (cx, obj, getter_AddRefs (native));
NS_ENSURE_SUCCESS (rv, JS_FALSE);
@@ -149,12 +92,17 @@
NS_ENSURE_SUCCESS (rv, rv);
NS_ENSURE_TRUE (G_IS_OBJECT (gobj), NS_ERROR_UNEXPECTED);

- const char *name = JSVAL_CHARS (id);
+ return GetProperty (cx, gobj, id, vp);
+}
+
+// static
+JSBool
+xgGObject::GetProperty (JSContext *cx, GObject *gobj, jsval id, jsval *vp)
+{
+ //g_print (GOM_LOC ("Entered\n"));
GParamSpec *spec;
guint signal_id;
-
- g_print (GOM_LOC (""));
- if (!Resolve (G_TYPE_FROM_INSTANCE (gobj), name, &spec, &signal_id)) {
+ if (!Resolve (G_TYPE_FROM_INSTANCE (gobj), id, &spec, &signal_id)) {
return JS_TRUE;
}

@@ -181,21 +129,14 @@
return JS_FALSE;
}
g_value_unset (&gval);
-
return JS_TRUE;
}

// static
JSBool
-xgGObject::SetProperty (JSContext *cx,
- JSObject *obj,
- jsval id,
- jsval *vp)
+xgGObject::SetProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
- if (JSVAL_IS_INT (id)) {
- return JS_TRUE;
- }
-
+ //g_print (GOM_LOC ("Entered\n"));
nsresult rv;

nsCOMPtr<nsISupports> native;
@@ -210,12 +151,17 @@
NS_ENSURE_SUCCESS (rv, rv);
NS_ENSURE_TRUE (G_IS_OBJECT (gobj), NS_ERROR_UNEXPECTED);

- const char *name = JSVAL_CHARS (id);
+ return SetProperty (cx, gobj, id, vp);
+}
+
+// static
+JSBool
+xgGObject::SetProperty (JSContext *cx, GObject *gobj, jsval id, jsval *vp)
+{
+ //g_print (GOM_LOC ("Entered\n"));
GParamSpec *spec;
guint signal_id;
-
- g_print (GOM_LOC (""));
- if (!Resolve (G_TYPE_FROM_INSTANCE (gobj), name, &spec, &signal_id)) {
+ if (!Resolve (G_TYPE_FROM_INSTANCE (gobj), id, &spec, &signal_id)) {
return JS_TRUE;
}

@@ -260,23 +206,37 @@
return JS_TRUE;
}

-gboolean
-xgGObject::Resolve (const char *name,
- GParamSpec **spec,
- guint *signal_id)
+JSBool
+xgGObject::Resolve (const char *name, GParamSpec **spec, guint *signal_id)
{
return Resolve (G_TYPE_FROM_INSTANCE (mObject), name, spec, signal_id);
}

+JSBool
+xgGObject::Resolve (jsval id, GParamSpec **spec, guint *signal_id)
+{
+ return Resolve (G_TYPE_FROM_INSTANCE (mObject), id, spec, signal_id);
+}
+
+// static
+JSBool
+xgGObject::Resolve (GType aType, jsval id, GParamSpec **spec, guint
*signal_id)
+{
+ if (JSVAL_IS_INT (id)) {
+ return JS_FALSE;
+ }
+ return Resolve (aType, JSVAL_CHARS (id), spec, signal_id);
+}
+
// static
-gboolean
+JSBool
xgGObject::Resolve (GType aType,
const char *name,
GParamSpec **spec,
guint *signal_id)
{
+ //g_print (GOM_LOC ("Entered\n"));
const char *n;
-
n = gom_camel_uncase (name);

if (n[0] == 'o' && n[1] == 'n' &&
@@ -321,6 +281,7 @@
JSObject *
xgGObject::GetNewOrUsed (JSContext *cx, GObject *gobj)
{
+ //g_print (GOM_LOC ("Looking up JSObject for %s"), G_OBJECT_TYPE_NAME
(gobj));
nsCOMPtr<xgIGObjectHolder> holder (static_cast<xgIGObjectHolder
*>(g_object_get_data (gobj, "XG_GOBJECT")));
if (!holder) {
xgGObject *obj = new xgGObject ();
@@ -328,7 +289,6 @@
if (NS_FAILED (obj->Init (gobj))) {
return NULL;
}
- obj->DefineProperties (cx, holder);
}

nsresult rv;
@@ -385,24 +345,6 @@
xgGObject::AddProperty (nsIXPConnectWrappedNative *wrapper,
JSContext *cx, JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
{
-#if 0
- if (JSVAL_IS_INT (id)) {
- *_retval = PR_TRUE;
- return NS_OK;
- }
-
- const char *name = JSVAL_CHARS (id);
- GParamSpec *spec;
- guint signal_id;
-
-#if 1
- g_print (GOM_LOC (""));
-#endif
- if (!Resolve (name, &spec, &signal_id)) {
- *_retval = PR_TRUE;
- return NS_OK;
- }
-#endif
*_retval = PR_TRUE;
return NS_OK;
}
@@ -418,111 +360,16 @@
xgGObject::GetProperty (nsIXPConnectWrappedNative *wrapper,
JSContext * cx, JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
{
- if (JSVAL_IS_INT (id)) {
- *_retval = PR_TRUE;
- return NS_OK;
- }
-
- const char *name = JSVAL_CHARS (id);
- GParamSpec *spec;
- guint signal_id;
-
-#if 1
- g_print (GOM_LOC (""));
-#endif
- if (!Resolve (name, &spec, &signal_id)) {
- *_retval = PR_TRUE;
- return NS_OK;
- }
-
-#if 0
- if (signal_id) {
- closure = gom_js_object_get_closure_prop (gobj, signal_id);
- g_print ("closure: %p\n", closure);
- *vp = closure ? OBJECT_TO_JSVAL (JS_GetFunctionObject
(closure->fun)) : JSVAL_VOID;
- return JS_TRUE;
- }
-#endif
-
- g_assert (spec);
-
- GValue gval = { 0 };
- g_value_init (&gval, G_PARAM_SPEC_VALUE_TYPE (spec));
- g_object_get_property (mObject, spec->name, &gval);
-
- GError *error = NULL;
- if (!gom_jsval (cx, vp, &gval, &error)) {
- g_printerr ("Could not get jsval: %s\n", error->message);
- g_value_unset (&gval);
- g_error_free (error);
- *_retval = PR_FALSE;
- return NS_OK;
- }
- g_value_unset (&gval);
-
- *_retval = PR_TRUE;
+ *_retval = GetProperty (cx, mObject, id, vp);
return NS_OK;
}

/* PRBool setProperty (in nsIXPConnectWrappedNative wrapper, in
JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
-NS_IMETHODIMP xgGObject::SetProperty(nsIXPConnectWrappedNative *wrapper,
JSContext * cx, JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
+NS_IMETHODIMP
+xgGObject::SetProperty (nsIXPConnectWrappedNative *wrapper,
+ JSContext * cx, JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
{
- g_message (GOM_LOC ("well, got here?"));
- if (JSVAL_IS_INT (id)) {
- *_retval = PR_TRUE;
- return NS_OK;
- }
-
- const char *name = JSVAL_CHARS (id);
- GParamSpec *spec;
- guint signal_id;
-
- g_print (GOM_LOC (""));
- if (!Resolve (name, &spec, &signal_id)) {
- *_retval = PR_TRUE;
- return NS_OK;
- }
-
-#if 0
- GomJSClosure *closure;
- if (signal_id) {
- JSFunction *fun;
- if (!JSVAL_IS_OBJECT (*vp) ||
- !JS_ObjectIsFunction (cx, JSVAL_TO_OBJECT (*vp))) {
- g_printerr ("jsval is not a function. sucka.\n");
- return JS_FALSE;
- }
- fun = JS_ValueToFunction (cx, *vp);
- if (!fun) {
- g_printerr ("could not get function from value\n");
- return JS_FALSE;
- }
- closure = gom_js_object_get_closure_prop (gobj, signal_id);
- if (closure) {
- closure->fun = fun;
- } else {
- closure = (GomJSClosure *)gom_js_closure_new (cx, obj, fun);
- gom_js_object_set_closure_prop (gobj, signal_id, closure);
- g_signal_connect_closure_by_id (gobj, signal_id, 0,
&closure->closure, FALSE);
- }
- return JS_TRUE;
- }
-#endif
- g_assert (spec);
-
- GValue gval = { 0 };
- GError *error = NULL;
- if (!gom_g_value (cx, &gval, *vp, &error)) {
- g_printerr ("Could not get GValue: %s\n", error->message);
- g_error_free (error);
- *_retval = PR_FALSE;
- return NS_OK;
- }
-
- g_object_set_property (mObject, spec->name, &gval);
- g_value_unset (&gval);
-
- *_retval = PR_TRUE;
+ *_retval = SetProperty (cx, mObject, id, vp);
return NS_OK;
}

@@ -543,22 +390,12 @@
xgGObject::NewResolve (nsIXPConnectWrappedNative *wrapper,
JSContext *cx, JSObject *obj, jsval id, PRUint32 flags, JSObject
**objp, PRBool *_retval)
{
- if (JSVAL_IS_INT (id)) {
- *objp = NULL;
- *_retval = PR_TRUE;
- return NS_OK;
- }
- const char *name = JSVAL_CHARS (id);
+ //g_print (GOM_LOC ("Entered\n"));
GParamSpec *spec;
- guint signal_id;
-
- g_print (GOM_LOC (""));
- if (!Resolve (name, &spec, &signal_id)) {
+ guint signal_id;
+ if (!Resolve (id, &spec, &signal_id)) {
*objp = NULL;
- *_retval = PR_TRUE;
- return NS_OK;
}
-
*_retval = PR_TRUE;
return NS_OK;
}

Modified: trunk/gom/xulapp/components/gom/src/xgGObject.h
==============================================================================
--- trunk/gom/xulapp/components/gom/src/xgGObject.h (original)
+++ trunk/gom/xulapp/components/gom/src/xgGObject.h Mon Sep 1 14:05:20 2008
@@ -41,17 +41,21 @@
xgGObject();
nsresult Init (GObject *aObject);

- gboolean Resolve (const char *name, GParamSpec **spec, guint
*signal_id);
-
- nsresult DefineProperties (JSContext *cx, nsISupports *aComObj);
+ JSBool Resolve (const char *name, GParamSpec **spec, guint *signal_id);
+ JSBool Resolve (jsval id, GParamSpec **spec, guint *signal_id);

static JSObject *GetNewOrUsed (JSContext *cx, GObject *gobj);
- static nsresult GetNative (JSContext *cx, JSObject *obj, nsISupports
**_retval);
+ static nsresult GetNative (JSContext *cx, JSObject *obj, nsISupports
**_retval);

protected:
- static gboolean Resolve (GType aType, const char *name, GParamSpec
**spec, guint *signal_id);
+ static JSBool Resolve (GType aType, jsval id, GParamSpec **spec, guint
*signal_id);
+ static JSBool Resolve (GType aType, const char *name, GParamSpec
**spec, guint *signal_id);
+
static JSBool GetProperty (JSContext *cx, JSObject *obj, jsval id,
jsval *vp);
+ static JSBool GetProperty (JSContext *cx, GObject *obj, jsval id,
jsval *vp);
+
static JSBool SetProperty (JSContext *cx, JSObject *obj, jsval id,
jsval *vp);
+ static JSBool SetProperty (JSContext *cx, GObject *obj, jsval id,
jsval *vp);

GObject *mObject;


Modified: trunk/gom/xulapp/components/gom/src/xgGtkElement.cpp
==============================================================================
--- trunk/gom/xulapp/components/gom/src/xgGtkElement.cpp (original)
+++ trunk/gom/xulapp/components/gom/src/xgGtkElement.cpp Mon Sep 1
14:05:20 2008
@@ -32,6 +32,7 @@
#include "gom/gomcamel.h"
#include "gommacros.h"

+#include <jsapi.h>
#include <nsIAtom.h>
#include <nsIAtomService.h>
#include <nsIDocument.h>
@@ -63,8 +64,10 @@
xgGtkElement::Init (GType aType)
{
nsresult rv;
+ NS_ENSURE_TRUE (g_type_is_a (aType, GTK_TYPE_WIDGET),
NS_ERROR_INVALID_ARG);
g_print (GOM_LOC ("Creating new <%s>...\n"), g_type_name (aType));
GObject *obj = (GObject *)g_object_new (aType, NULL);
+ NS_ENSURE_TRUE (obj, NS_ERROR_OUT_OF_MEMORY);
rv = xgGObject::Init (obj);
g_object_unref (obj);
return rv;
@@ -148,11 +151,8 @@
rv = mWrapper->GetElementNode (getter_AddRefs (elem));
NS_ENSURE_SUCCESS (rv, rv);

- JSContext *jscx;
- rv = GetJSContext (&jscx);
- NS_ENSURE_SUCCESS (rv, rv);
-
- rv = DefineProperties (jscx, elem);
+ // need to do this as XTF won't QI us for nsIXPCScriptable
+ rv = DefineProperties ();
NS_ENSURE_SUCCESS (rv, rv);

if (GTK_IS_ENTRY (mObject)) {
@@ -439,11 +439,9 @@
NS_IMETHODIMP
xgGtkElement::HandlesAttribute (nsIAtom *name, PRBool *_retval)
{
- GOM_ATOM_TO_GSTRING_RETURN (prop, name, NS_ERROR_INVALID_ARG);
GParamSpec *spec;
guint signal_id;
- *_retval = Resolve (prop, &spec, &signal_id) ? PR_TRUE : PR_FALSE;
- g_print (GOM_LOC ("%s -> %d\n"), prop, *_retval);
+ *_retval = Resolve (name, &spec, &signal_id) ? PR_TRUE : PR_FALSE;
return NS_OK;
}

@@ -451,12 +449,11 @@
NS_IMETHODIMP
xgGtkElement::SetAttribute (nsIAtom *name, const nsAString &newValue)
{
- GOM_ATOM_TO_GSTRING_RETURN (prop, name, NS_ERROR_INVALID_ARG);
GOM_ASTRING_TO_GSTRING_RETURN (value, newValue, NS_ERROR_INVALID_ARG);

GParamSpec *spec;
guint signal_id;
- if (!Resolve (prop, &spec, &signal_id)) {
+ if (!Resolve (name, &spec, &signal_id)) {
return NS_ERROR_FAILURE;
}
if (!spec) {
@@ -467,7 +464,7 @@
GValue gval = { 0 };
if (G_TYPE_FUNDAMENTAL (G_PARAM_SPEC_VALUE_TYPE (spec)) ==
G_TYPE_OBJECT) {
g_warning (GOM_LOC ("Attribute %s.%s is a %s, which a string cannot be
converted to"),
- G_OBJECT_TYPE_NAME (mObject), prop,
+ G_OBJECT_TYPE_NAME (mObject), spec->name,
g_type_name (G_PARAM_SPEC_VALUE_TYPE (spec)));
return NS_ERROR_FAILURE;
} else if (gtk_builder_value_from_string (NULL, spec, value, &gval,
&error)) {
@@ -491,11 +488,9 @@
NS_IMETHODIMP
xgGtkElement::GetAttribute (nsIAtom *name, nsAString &_retval)
{
- GOM_ATOM_TO_GSTRING_RETURN (prop, name, NS_ERROR_INVALID_ARG);
-
GParamSpec *spec;
guint signal_id;
- if (!Resolve (prop, &spec, &signal_id)) {
+ if (!Resolve (name, &spec, &signal_id)) {
return NS_ERROR_FAILURE;
}
if (!spec) {
@@ -522,8 +517,7 @@

GParamSpec *spec;
guint signal_id;
- *_retval = Resolve (prop, &spec, &signal_id);
-
+ *_retval = xgGObject::Resolve (prop, &spec, &signal_id);
return NS_OK;
}

@@ -570,4 +564,66 @@
NS_ENSURE_TRUE (*jscx, NS_ERROR_UNEXPECTED);

return NS_OK;
+}
+
+nsresult
+xgGtkElement::DefineProperties ()
+{
+ nsresult rv;
+
+ JSContext *jscx;
+ rv = GetJSContext (&jscx);
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ nsCOMPtr<nsIXPConnect> xpc (do_GetService
("@mozilla.org/js/xpc/XPConnect;1", &rv));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ nsCOMPtr<nsIDOMElement> elem;
+ rv = mWrapper->GetElementNode (getter_AddRefs (elem));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ nsCOMPtr<nsIXPConnectJSObjectHolder> jswrapper;
+ rv = xpc->WrapNative (jscx, JS_GetGlobalObject (jscx), elem,
+ NS_GET_IID (nsISupports),
+ getter_AddRefs (jswrapper));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ JSObject *jsobj;
+ rv = jswrapper->GetJSObject (&jsobj);
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ g_message (GOM_LOC ("Got JSObject: %p"), (void *)jsobj);
+
+ guint n_properties;
+ GParamSpec **props = g_object_class_list_properties
(G_OBJECT_GET_CLASS (mObject), &n_properties);
+ g_message (GOM_LOC ("Adding %d properties from %s"), n_properties,
G_OBJECT_TYPE_NAME (mObject));
+
+ JS_BeginRequest (jscx);
+
+ const char *camelName;
+ for (guint i = 0; i < n_properties; i++) {
+ camelName = gom_camel_case (props[i]->name);
+ if (!JS_DefineProperty (jscx, jsobj, camelName, JSVAL_VOID,
+ xgGObject::GetProperty,
+ xgGObject::SetProperty,
+ JSPROP_ENUMERATE | JSPROP_PERMANENT)) {
+ g_printerr ("Could not define a property for %s\n", camelName);
+ } else {
+ g_print (GOM_LOC ("Defined property: %s.%s\n"),
+ G_OBJECT_TYPE_NAME (mObject), camelName);
+ }
+ GOM_CAMEL_FREE (camelName, props[i]->name);
+ }
+
+ JS_EndRequest (jscx);
+
+ return NS_OK;
+}
+
+JSBool
+xgGtkElement::Resolve (nsIAtom *name, GParamSpec **spec, guint *signal_id)
+{
+ g_print (GOM_LOC ("Entered\n"));
+ GOM_ATOM_TO_GSTRING_RETURN (prop, name, NS_ERROR_INVALID_ARG);
+ return xgGObject::Resolve (prop, spec, signal_id);
}

Modified: trunk/gom/xulapp/components/gom/src/xgGtkElement.h
==============================================================================
--- trunk/gom/xulapp/components/gom/src/xgGtkElement.h (original)
+++ trunk/gom/xulapp/components/gom/src/xgGtkElement.h Mon Sep 1 14:05:20
2008
@@ -34,6 +34,8 @@
#include <glib-object.h>
#include <gtk/gtk.h>

+class nsIAtom;
+
class xgGtkElement : public xgGObject,
public nsIXTFAttributeHandler,
public nsIXTFElement
@@ -48,6 +50,8 @@
nsresult Init (GType aType);

protected:
+ JSBool Resolve (nsIAtom *name, GParamSpec **spec, guint *signal_id);
+ nsresult DefineProperties ();
nsresult GetJSContext (JSContext **jscx);
nsCOMPtr<nsIXTFElementWrapper> mWrapper;

Reply all
Reply to author
Forward
0 new messages