2010-04-26 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Apr 2010 05:01:44 +0000 (05:01 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Apr 2010 05:01:44 +0000 (05:01 +0000)
        Reviewed by Eric Seidel.

        Add ObjC and GObject to run-bindings-test
        https://bugs.webkit.org/show_bug.cgi?id=38168

        Added expected results.

        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Added.
        (WebKit::kit):
        (webkit_dom_test_obj_void_method):
        (webkit_dom_test_obj_void_method_with_args):
        (webkit_dom_test_obj_int_method):
        (webkit_dom_test_obj_int_method_with_args):
        (webkit_dom_test_obj_obj_method):
        (webkit_dom_test_obj_obj_method_with_args):
        (webkit_dom_test_obj_method_with_exception):
        (webkit_dom_test_obj_method_with_optional_arg):
        (webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg):
        (webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args):
        (webkit_dom_test_obj_get_read_only_int_attr):
        (webkit_dom_test_obj_get_read_only_string_attr):
        (webkit_dom_test_obj_get_read_only_test_obj_attr):
        (webkit_dom_test_obj_get_int_attr):
        (webkit_dom_test_obj_set_int_attr):
        (webkit_dom_test_obj_get_string_attr):
        (webkit_dom_test_obj_set_string_attr):
        (webkit_dom_test_obj_get_test_obj_attr):
        (webkit_dom_test_obj_set_test_obj_attr):
        (webkit_dom_test_obj_get_attr_with_exception):
        (webkit_dom_test_obj_set_attr_with_exception):
        (webkit_dom_test_obj_get_attr_with_setter_exception):
        (webkit_dom_test_obj_set_attr_with_setter_exception):
        (webkit_dom_test_obj_get_attr_with_getter_exception):
        (webkit_dom_test_obj_set_attr_with_getter_exception):
        (WebKit::wrapTestObj):
        (WebKit::core):
        (webkit_dom_test_obj_finalize):
        (webkit_dom_test_obj_set_property):
        (webkit_dom_test_obj_get_property):
        (webkit_dom_test_obj_class_init):
        (webkit_dom_test_obj_init):
        * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Added.
        * bindings/scripts/test/GObject/WebKitDOMTestObjPrivate.h: Added.
        * bindings/scripts/test/ObjC/DOMTestObj.h: Added.
        * bindings/scripts/test/ObjC/DOMTestObj.mm: Added.
        (-[DOMTestObj dealloc]):
        (-[DOMTestObj finalize]):
        (-[DOMTestObj readOnlyIntAttr]):
        (-[DOMTestObj readOnlyStringAttr]):
        (-[DOMTestObj readOnlyTestObjAttr]):
        (-[DOMTestObj intAttr]):
        (-[DOMTestObj setIntAttr:]):
        (-[DOMTestObj stringAttr]):
        (-[DOMTestObj setStringAttr:]):
        (-[DOMTestObj testObjAttr]):
        (-[DOMTestObj setTestObjAttr:]):
        (-[DOMTestObj attrWithException]):
        (-[DOMTestObj setAttrWithException:]):
        (-[DOMTestObj attrWithSetterException]):
        (-[DOMTestObj setAttrWithSetterException:]):
        (-[DOMTestObj attrWithGetterException]):
        (-[DOMTestObj setAttrWithGetterException:]):
        (-[DOMTestObj customAttr]):
        (-[DOMTestObj setCustomAttr:]):
        (-[DOMTestObj voidMethod]):
        (-[DOMTestObj voidMethodWithArgs:strArg:objArg:]):
        (-[DOMTestObj intMethod]):
        (-[DOMTestObj intMethodWithArgs:strArg:objArg:]):
        (-[DOMTestObj objMethod]):
        (-[DOMTestObj objMethodWithArgs:strArg:objArg:]):
        (-[DOMTestObj methodWithException]):
        (-[DOMTestObj customMethod]):
        (-[DOMTestObj customMethodWithArgs:strArg:objArg:]):
        (-[DOMTestObj methodWithOptionalArg:]):
        (-[DOMTestObj methodWithNonOptionalArgAndOptionalArg:opt:]):
        (-[DOMTestObj methodWithNonOptionalArgAndTwoOptionalArgs:opt1:opt2:]):
        (core):
        (kit):
        * bindings/scripts/test/ObjC/DOMTestObjInternal.h: Added.
2010-04-26  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Add ObjC and GObject to run-bindings-test
        https://bugs.webkit.org/show_bug.cgi?id=38168

        * Scripts/run-bindings-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58289 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp [new file with mode: 0644]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h [new file with mode: 0644]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObjPrivate.h [new file with mode: 0644]
WebCore/bindings/scripts/test/ObjC/DOMTestObj.h [new file with mode: 0644]
WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm [new file with mode: 0644]
WebCore/bindings/scripts/test/ObjC/DOMTestObjInternal.h [new file with mode: 0644]
WebKitTools/ChangeLog
WebKitTools/Scripts/run-bindings-tests

index 62cb979..858fe6d 100644 (file)
@@ -2,6 +2,88 @@
 
         Reviewed by Eric Seidel.
 
+        Add ObjC and GObject to run-bindings-test
+        https://bugs.webkit.org/show_bug.cgi?id=38168
+
+        Added expected results.
+
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Added.
+        (WebKit::kit):
+        (webkit_dom_test_obj_void_method):
+        (webkit_dom_test_obj_void_method_with_args):
+        (webkit_dom_test_obj_int_method):
+        (webkit_dom_test_obj_int_method_with_args):
+        (webkit_dom_test_obj_obj_method):
+        (webkit_dom_test_obj_obj_method_with_args):
+        (webkit_dom_test_obj_method_with_exception):
+        (webkit_dom_test_obj_method_with_optional_arg):
+        (webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg):
+        (webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args):
+        (webkit_dom_test_obj_get_read_only_int_attr):
+        (webkit_dom_test_obj_get_read_only_string_attr):
+        (webkit_dom_test_obj_get_read_only_test_obj_attr):
+        (webkit_dom_test_obj_get_int_attr):
+        (webkit_dom_test_obj_set_int_attr):
+        (webkit_dom_test_obj_get_string_attr):
+        (webkit_dom_test_obj_set_string_attr):
+        (webkit_dom_test_obj_get_test_obj_attr):
+        (webkit_dom_test_obj_set_test_obj_attr):
+        (webkit_dom_test_obj_get_attr_with_exception):
+        (webkit_dom_test_obj_set_attr_with_exception):
+        (webkit_dom_test_obj_get_attr_with_setter_exception):
+        (webkit_dom_test_obj_set_attr_with_setter_exception):
+        (webkit_dom_test_obj_get_attr_with_getter_exception):
+        (webkit_dom_test_obj_set_attr_with_getter_exception):
+        (WebKit::wrapTestObj):
+        (WebKit::core):
+        (webkit_dom_test_obj_finalize):
+        (webkit_dom_test_obj_set_property):
+        (webkit_dom_test_obj_get_property):
+        (webkit_dom_test_obj_class_init):
+        (webkit_dom_test_obj_init):
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Added.
+        * bindings/scripts/test/GObject/WebKitDOMTestObjPrivate.h: Added.
+        * bindings/scripts/test/ObjC/DOMTestObj.h: Added.
+        * bindings/scripts/test/ObjC/DOMTestObj.mm: Added.
+        (-[DOMTestObj dealloc]):
+        (-[DOMTestObj finalize]):
+        (-[DOMTestObj readOnlyIntAttr]):
+        (-[DOMTestObj readOnlyStringAttr]):
+        (-[DOMTestObj readOnlyTestObjAttr]):
+        (-[DOMTestObj intAttr]):
+        (-[DOMTestObj setIntAttr:]):
+        (-[DOMTestObj stringAttr]):
+        (-[DOMTestObj setStringAttr:]):
+        (-[DOMTestObj testObjAttr]):
+        (-[DOMTestObj setTestObjAttr:]):
+        (-[DOMTestObj attrWithException]):
+        (-[DOMTestObj setAttrWithException:]):
+        (-[DOMTestObj attrWithSetterException]):
+        (-[DOMTestObj setAttrWithSetterException:]):
+        (-[DOMTestObj attrWithGetterException]):
+        (-[DOMTestObj setAttrWithGetterException:]):
+        (-[DOMTestObj customAttr]):
+        (-[DOMTestObj setCustomAttr:]):
+        (-[DOMTestObj voidMethod]):
+        (-[DOMTestObj voidMethodWithArgs:strArg:objArg:]):
+        (-[DOMTestObj intMethod]):
+        (-[DOMTestObj intMethodWithArgs:strArg:objArg:]):
+        (-[DOMTestObj objMethod]):
+        (-[DOMTestObj objMethodWithArgs:strArg:objArg:]):
+        (-[DOMTestObj methodWithException]):
+        (-[DOMTestObj customMethod]):
+        (-[DOMTestObj customMethodWithArgs:strArg:objArg:]):
+        (-[DOMTestObj methodWithOptionalArg:]):
+        (-[DOMTestObj methodWithNonOptionalArgAndOptionalArg:opt:]):
+        (-[DOMTestObj methodWithNonOptionalArgAndTwoOptionalArgs:opt1:opt2:]):
+        (core):
+        (kit):
+        * bindings/scripts/test/ObjC/DOMTestObjInternal.h: Added.
+
+2010-04-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
         Add testing infrastructure for JSC bindings generator
         https://bugs.webkit.org/show_bug.cgi?id=38167
 
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
new file mode 100644 (file)
index 0000000..e264da6
--- /dev/null
@@ -0,0 +1,587 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include <glib-object.h>
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+#include "ExceptionCode.h"
+#include "TestObj.h"
+#include "WebKitDOMBinding.h"
+#include "gobject/ConvertToUTF8String.h"
+#include "webkit/WebKitDOMTestObj.h"
+#include "webkit/WebKitDOMTestObjPrivate.h"
+#include "webkitmarshal.h"
+#include "webkitprivate.h"
+
+namespace WebKit {
+    
+gpointer kit(WebCore::TestObj* obj)
+{
+    g_return_val_if_fail(obj != 0, 0);
+
+    if (gpointer ret = DOMObjectCache::get(obj))
+        return ret;
+
+    return DOMObjectCache::put(obj, WebKit::wrapTestObj(obj));
+}
+    
+} // namespace WebKit //
+
+void
+webkit_dom_test_obj_void_method (WebKitDOMTestObj *self)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->voidMethod();
+
+}
+
+void
+webkit_dom_test_obj_void_method_with_args (WebKitDOMTestObj *self, glong int_arg, gchar*  str_arg, WebKitDOMTestObj*  obj_arg)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    g_return_if_fail (str_arg);
+    g_return_if_fail (obj_arg);
+    WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
+    WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
+    g_return_if_fail (_g_obj_arg);
+    item->voidMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg);
+
+}
+
+glong
+webkit_dom_test_obj_int_method (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    glong res = item->intMethod();
+    return res;
+
+}
+
+glong
+webkit_dom_test_obj_int_method_with_args (WebKitDOMTestObj *self, glong int_arg, gchar*  str_arg, WebKitDOMTestObj*  obj_arg)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    g_return_val_if_fail (str_arg, 0);
+    g_return_val_if_fail (obj_arg, 0);
+    WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
+    WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
+    g_return_val_if_fail (_g_obj_arg, 0);
+    glong res = item->intMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg);
+    return res;
+
+}
+
+WebKitDOMTestObj* 
+webkit_dom_test_obj_obj_method (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethod());
+    WebKitDOMTestObj*  res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+    return res;
+
+}
+
+WebKitDOMTestObj* 
+webkit_dom_test_obj_obj_method_with_args (WebKitDOMTestObj *self, glong int_arg, gchar*  str_arg, WebKitDOMTestObj*  obj_arg)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    g_return_val_if_fail (str_arg, 0);
+    g_return_val_if_fail (obj_arg, 0);
+    WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
+    WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
+    g_return_val_if_fail (_g_obj_arg, 0);
+    PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg));
+    WebKitDOMTestObj*  res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+    return res;
+
+}
+
+void
+webkit_dom_test_obj_method_with_exception (WebKitDOMTestObj *self, GError **error)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    WebCore::ExceptionCode ec = 0;
+    item->methodWithException(ec);
+    if (ec) {
+        WebCore::ExceptionCodeDescription ecdesc;
+        WebCore::getExceptionCodeDescription(ec, ecdesc);
+        g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+    }
+
+}
+
+void
+webkit_dom_test_obj_method_with_optional_arg (WebKitDOMTestObj *self, glong opt)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->methodWithOptionalArg(opt);
+
+}
+
+void
+webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg (WebKitDOMTestObj *self, glong non_opt, glong opt)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->methodWithNonOptionalArgAndOptionalArg(non_opt, opt);
+
+}
+
+void
+webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args (WebKitDOMTestObj *self, glong non_opt, glong opt1, glong opt2)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->methodWithNonOptionalArgAndTwoOptionalArgs(non_opt, opt1, opt2);
+
+}
+
+glong
+webkit_dom_test_obj_get_read_only_int_attr (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    glong res = item->readOnlyIntAttr();
+    return res;
+
+}
+
+gchar* 
+webkit_dom_test_obj_get_read_only_string_attr (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    gchar*  res = convertToUTF8String(item->readOnlyStringAttr());
+    return res;
+
+}
+
+WebKitDOMTestObj* 
+webkit_dom_test_obj_get_read_only_test_obj_attr (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->readOnlyTestObjAttr());
+    WebKitDOMTestObj*  res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+    return res;
+
+}
+
+glong
+webkit_dom_test_obj_get_int_attr (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    glong res = item->intAttr();
+    return res;
+
+}
+
+void
+webkit_dom_test_obj_set_int_attr (WebKitDOMTestObj *self, glong value)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->setIntAttr(value);
+
+}
+
+gchar* 
+webkit_dom_test_obj_get_string_attr (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    gchar*  res = convertToUTF8String(item->stringAttr());
+    return res;
+
+}
+
+void
+webkit_dom_test_obj_set_string_attr (WebKitDOMTestObj *self, gchar*  value)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    g_return_if_fail (value);
+    WebCore::String _g_value = WebCore::String::fromUTF8(value);
+    item->setStringAttr(_g_value);
+
+}
+
+WebKitDOMTestObj* 
+webkit_dom_test_obj_get_test_obj_attr (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->testObjAttr());
+    WebKitDOMTestObj*  res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+    return res;
+
+}
+
+void
+webkit_dom_test_obj_set_test_obj_attr (WebKitDOMTestObj *self, WebKitDOMTestObj*  value)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    g_return_if_fail (value);
+    WebCore::TestObj * _g_value = WebKit::core(value);
+    g_return_if_fail (_g_value);
+    item->setTestObjAttr(_g_value);
+
+}
+
+glong
+webkit_dom_test_obj_get_attr_with_exception (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    glong res = item->attrWithException();
+    return res;
+
+}
+
+void
+webkit_dom_test_obj_set_attr_with_exception (WebKitDOMTestObj *self, glong value)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->setAttrWithException(value);
+
+}
+
+glong
+webkit_dom_test_obj_get_attr_with_setter_exception (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    glong res = item->attrWithSetterException();
+    return res;
+
+}
+
+void
+webkit_dom_test_obj_set_attr_with_setter_exception (WebKitDOMTestObj *self, glong value)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->setAttrWithSetterException(value);
+
+}
+
+glong
+webkit_dom_test_obj_get_attr_with_getter_exception (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    glong res = item->attrWithGetterException();
+    return res;
+
+}
+
+void
+webkit_dom_test_obj_set_attr_with_getter_exception (WebKitDOMTestObj *self, glong value)
+{
+    g_return_if_fail (self);
+    WebCore::TestObj * item = WebKit::core(self);
+    item->setAttrWithGetterException(value);
+
+}
+
+
+G_DEFINE_TYPE(WebKitDOMTestObj, webkit_dom_test_obj, WEBKIT_TYPE_DOM_OBJECT)
+
+namespace WebKit {
+
+WebKitDOMTestObj* wrapTestObj(WebCore::TestObj* coreObject)
+{
+    g_return_val_if_fail(coreObject != 0, 0);
+    
+    WebKitDOMTestObj* wrapper = WEBKIT_DOM_TEST_OBJ(g_object_new(WEBKIT_TYPE_DOM_TEST_OBJ, NULL));
+    g_return_val_if_fail(wrapper != 0, 0);
+
+    /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
+     * in a C-allocated GObject structure.  See the finalize() code for the
+     * matching deref().
+     */
+
+    coreObject->ref();
+    WEBKIT_DOM_OBJECT(wrapper)->coreObject = coreObject;
+
+    return wrapper;
+}
+
+WebCore::TestObj* core(WebKitDOMTestObj* request)
+{
+    g_return_val_if_fail(request != 0, 0);
+    
+    WebCore::TestObj* coreObject = static_cast<WebCore::TestObj*>(WEBKIT_DOM_OBJECT(request)->coreObject);
+    g_return_val_if_fail(coreObject != 0, 0);
+    
+    return coreObject;
+}
+
+} // namespace WebKit
+enum {
+    PROP_0,
+    PROP_READ_ONLY_INT_ATTR,
+    PROP_READ_ONLY_STRING_ATTR,
+    PROP_READ_ONLY_TEST_OBJ_ATTR,
+    PROP_INT_ATTR,
+    PROP_STRING_ATTR,
+    PROP_TEST_OBJ_ATTR,
+    PROP_ATTR_WITH_EXCEPTION,
+    PROP_ATTR_WITH_SETTER_EXCEPTION,
+    PROP_ATTR_WITH_GETTER_EXCEPTION,
+    PROP_CUSTOM_ATTR,
+};
+
+
+static void webkit_dom_test_obj_finalize(GObject* object)
+{
+    WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
+    
+    if (dom_object->coreObject != NULL) {
+        WebCore::TestObj* coreObject = static_cast<WebCore::TestObj *>(dom_object->coreObject);
+
+        WebKit::DOMObjectCache::forget(coreObject);
+        coreObject->deref();
+
+        dom_object->coreObject = NULL;
+    }
+
+    G_OBJECT_CLASS(webkit_dom_test_obj_parent_class)->finalize(object);
+}
+
+static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+    WebKitDOMTestObj *self = WEBKIT_DOM_TEST_OBJ(object);
+    WebCore::TestObj* coreSelf = WebKit::core(self);
+
+    switch (prop_id) {
+    case PROP_INT_ATTR:
+    {
+         coreSelf->setIntAttr((g_value_get_long(value)) );
+         break;
+    }
+    case PROP_STRING_ATTR:
+    {
+         coreSelf->setStringAttr(WebCore::String::fromUTF8(g_value_get_string(value)) );
+         break;
+    }
+    case PROP_ATTR_WITH_EXCEPTION:
+    {
+         coreSelf->setAttrWithException((g_value_get_long(value)) );
+         break;
+    }
+    case PROP_ATTR_WITH_SETTER_EXCEPTION:
+    {
+         coreSelf->setAttrWithSetterException((g_value_get_long(value)) );
+         break;
+    }
+    case PROP_ATTR_WITH_GETTER_EXCEPTION:
+    {
+         coreSelf->setAttrWithGetterException((g_value_get_long(value)) );
+         break;
+    }
+    case PROP_CUSTOM_ATTR:
+    {
+         coreSelf->setCustomAttr((g_value_get_long(value)) );
+         break;
+    }
+     default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+
+
+static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+    WebKitDOMTestObj* self = WEBKIT_DOM_TEST_OBJ(object);
+    WebCore::TestObj* coreSelf = WebKit::core(self);
+
+    switch (prop_id) {
+    case PROP_READ_ONLY_INT_ATTR:
+    {
+         g_value_set_long(value, coreSelf->readOnlyIntAttr());
+         break;
+    }
+    case PROP_READ_ONLY_STRING_ATTR:
+    {
+         g_value_take_string(value, convertToUTF8String(coreSelf->readOnlyStringAttr()));
+         break;
+    }
+    case PROP_READ_ONLY_TEST_OBJ_ATTR:
+    {
+         RefPtr<WebCore::TestObj> ptr = coreSelf->readOnlyTestObjAttr();
+        g_value_set_object(value, WebKit::kit(ptr.get()));
+         break;
+    }
+    case PROP_INT_ATTR:
+    {
+         g_value_set_long(value, coreSelf->intAttr());
+         break;
+    }
+    case PROP_STRING_ATTR:
+    {
+         g_value_take_string(value, convertToUTF8String(coreSelf->stringAttr()));
+         break;
+    }
+    case PROP_TEST_OBJ_ATTR:
+    {
+         RefPtr<WebCore::TestObj> ptr = coreSelf->testObjAttr();
+        g_value_set_object(value, WebKit::kit(ptr.get()));
+         break;
+    }
+    case PROP_ATTR_WITH_EXCEPTION:
+    {
+         g_value_set_long(value, coreSelf->attrWithException());
+         break;
+    }
+    case PROP_ATTR_WITH_SETTER_EXCEPTION:
+    {
+         g_value_set_long(value, coreSelf->attrWithSetterException());
+         break;
+    }
+    case PROP_ATTR_WITH_GETTER_EXCEPTION:
+    {
+         g_value_set_long(value, coreSelf->attrWithGetterException());
+         break;
+    }
+    case PROP_CUSTOM_ATTR:
+    {
+         g_value_set_long(value, coreSelf->customAttr());
+         break;
+    }
+     default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+
+
+static void webkit_dom_test_obj_class_init(WebKitDOMTestObjClass* requestClass)
+{
+    GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
+    gobjectClass->finalize = webkit_dom_test_obj_finalize;
+    gobjectClass->set_property = webkit_dom_test_obj_set_property;
+    gobjectClass->get_property = webkit_dom_test_obj_get_property;
+
+    g_object_class_install_property(gobjectClass,
+                                    PROP_READ_ONLY_INT_ATTR,
+                                    g_param_spec_long("read-only-int-attr", /* name */
+                                                           "test_obj_read-only-int-attr", /* short description */
+                                                           "read-only  glong TestObj.read-only-int-attr", /* longer - could do with some extra doc stuff here */
+                                                           G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+                                                           WEBKIT_PARAM_READABLE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_READ_ONLY_STRING_ATTR,
+                                    g_param_spec_string("read-only-string-attr", /* name */
+                                                           "test_obj_read-only-string-attr", /* short description */
+                                                           "read-only  gchar*  TestObj.read-only-string-attr", /* longer - could do with some extra doc stuff here */
+                                                           "", /* default */
+                                                           WEBKIT_PARAM_READABLE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_READ_ONLY_TEST_OBJ_ATTR,
+                                    g_param_spec_object("read-only-test-obj-attr", /* name */
+                                                           "test_obj_read-only-test-obj-attr", /* short description */
+                                                           "read-only  WebKitDOMTestObj*  TestObj.read-only-test-obj-attr", /* longer - could do with some extra doc stuff here */
+                                                           WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
+                                                           WEBKIT_PARAM_READABLE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_INT_ATTR,
+                                    g_param_spec_long("int-attr", /* name */
+                                                           "test_obj_int-attr", /* short description */
+                                                           "read-write  glong TestObj.int-attr", /* longer - could do with some extra doc stuff here */
+                                                           G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+                                                           WEBKIT_PARAM_READWRITE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_STRING_ATTR,
+                                    g_param_spec_string("string-attr", /* name */
+                                                           "test_obj_string-attr", /* short description */
+                                                           "read-write  gchar*  TestObj.string-attr", /* longer - could do with some extra doc stuff here */
+                                                           "", /* default */
+                                                           WEBKIT_PARAM_READWRITE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_TEST_OBJ_ATTR,
+                                    g_param_spec_object("test-obj-attr", /* name */
+                                                           "test_obj_test-obj-attr", /* short description */
+                                                           "read-write  WebKitDOMTestObj*  TestObj.test-obj-attr", /* longer - could do with some extra doc stuff here */
+                                                           WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
+                                                           WEBKIT_PARAM_READWRITE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_ATTR_WITH_EXCEPTION,
+                                    g_param_spec_long("attr-with-exception", /* name */
+                                                           "test_obj_attr-with-exception", /* short description */
+                                                           "read-write  glong TestObj.attr-with-exception", /* longer - could do with some extra doc stuff here */
+                                                           G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+                                                           WEBKIT_PARAM_READWRITE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_ATTR_WITH_SETTER_EXCEPTION,
+                                    g_param_spec_long("attr-with-setter-exception", /* name */
+                                                           "test_obj_attr-with-setter-exception", /* short description */
+                                                           "read-write  glong TestObj.attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+                                                           G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+                                                           WEBKIT_PARAM_READWRITE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_ATTR_WITH_GETTER_EXCEPTION,
+                                    g_param_spec_long("attr-with-getter-exception", /* name */
+                                                           "test_obj_attr-with-getter-exception", /* short description */
+                                                           "read-write  glong TestObj.attr-with-getter-exception", /* longer - could do with some extra doc stuff here */
+                                                           G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+                                                           WEBKIT_PARAM_READWRITE));
+     g_object_class_install_property(gobjectClass,
+                                    PROP_CUSTOM_ATTR,
+                                    g_param_spec_long("custom-attr", /* name */
+                                                           "test_obj_custom-attr", /* short description */
+                                                           "read-write  glong TestObj.custom-attr", /* longer - could do with some extra doc stuff here */
+                                                           G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+                                                           WEBKIT_PARAM_READWRITE));
+
+
+
+}
+
+static void webkit_dom_test_obj_init(WebKitDOMTestObj* request)
+{
+}
+
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
new file mode 100644 (file)
index 0000000..aeb573a
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WebKitDOMTestObj_h
+#define WebKitDOMTestObj_h
+
+#include "webkit/webkitdomdefines.h"
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+#include "webkit/WebKitDOMObject.h"
+
+
+G_BEGIN_DECLS
+#define WEBKIT_TYPE_DOM_TEST_OBJ            (webkit_dom_test_obj_get_type())
+#define WEBKIT_DOM_TEST_OBJ(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_TEST_OBJ, WebKitDOMTestObj))
+#define WEBKIT_DOM_TEST_OBJ_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_DOM_TEST_OBJ, WebKitDOMTestObjClass)
+#define WEBKIT_DOM_IS_TEST_OBJ(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_TEST_OBJ))
+#define WEBKIT_DOM_IS_TEST_OBJ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_DOM_TEST_OBJ))
+#define WEBKIT_DOM_TEST_OBJ_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_DOM_TEST_OBJ, WebKitDOMTestObjClass))
+
+struct _WebKitDOMTestObj {
+    WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestObjClass {
+    WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_obj_get_type (void);
+
+WEBKIT_API void
+webkit_dom_test_obj_void_method (WebKitDOMTestObj *self);
+
+WEBKIT_API void
+webkit_dom_test_obj_void_method_with_args (WebKitDOMTestObj *self, glong int_arg, gchar*  str_arg, WebKitDOMTestObj*  obj_arg);
+
+WEBKIT_API glong
+webkit_dom_test_obj_int_method (WebKitDOMTestObj *self);
+
+WEBKIT_API glong
+webkit_dom_test_obj_int_method_with_args (WebKitDOMTestObj *self, glong int_arg, gchar*  str_arg, WebKitDOMTestObj*  obj_arg);
+
+WEBKIT_API WebKitDOMTestObj* 
+webkit_dom_test_obj_obj_method (WebKitDOMTestObj *self);
+
+WEBKIT_API WebKitDOMTestObj* 
+webkit_dom_test_obj_obj_method_with_args (WebKitDOMTestObj *self, glong int_arg, gchar*  str_arg, WebKitDOMTestObj*  obj_arg);
+
+WEBKIT_API void
+webkit_dom_test_obj_method_with_exception (WebKitDOMTestObj *self, GError **error);
+
+WEBKIT_API void
+webkit_dom_test_obj_method_with_optional_arg (WebKitDOMTestObj *self, glong opt);
+
+WEBKIT_API void
+webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg (WebKitDOMTestObj *self, glong non_opt, glong opt);
+
+WEBKIT_API void
+webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args (WebKitDOMTestObj *self, glong non_opt, glong opt1, glong opt2);
+
+WEBKIT_API glong
+webkit_dom_test_obj_get_read_only_int_attr (WebKitDOMTestObj *self);
+
+WEBKIT_API gchar* 
+webkit_dom_test_obj_get_read_only_string_attr (WebKitDOMTestObj *self);
+
+WEBKIT_API WebKitDOMTestObj* 
+webkit_dom_test_obj_get_read_only_test_obj_attr (WebKitDOMTestObj *self);
+
+WEBKIT_API glong
+webkit_dom_test_obj_get_int_attr (WebKitDOMTestObj *self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_int_attr (WebKitDOMTestObj *self, glong value);
+
+WEBKIT_API gchar* 
+webkit_dom_test_obj_get_string_attr (WebKitDOMTestObj *self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_string_attr (WebKitDOMTestObj *self, gchar*  value);
+
+WEBKIT_API WebKitDOMTestObj* 
+webkit_dom_test_obj_get_test_obj_attr (WebKitDOMTestObj *self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_test_obj_attr (WebKitDOMTestObj *self, WebKitDOMTestObj*  value);
+
+WEBKIT_API glong
+webkit_dom_test_obj_get_attr_with_exception (WebKitDOMTestObj *self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_attr_with_exception (WebKitDOMTestObj *self, glong value);
+
+WEBKIT_API glong
+webkit_dom_test_obj_get_attr_with_setter_exception (WebKitDOMTestObj *self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_attr_with_setter_exception (WebKitDOMTestObj *self, glong value);
+
+WEBKIT_API glong
+webkit_dom_test_obj_get_attr_with_getter_exception (WebKitDOMTestObj *self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_attr_with_getter_exception (WebKitDOMTestObj *self, glong value);
+
+G_END_DECLS
+
+#endif /* WebKitDOMTestObj_h */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObjPrivate.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObjPrivate.h
new file mode 100644 (file)
index 0000000..78cd87f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WEB_KIT_DOM_TEST_OBJ_PRIVATE_H
+#define WEB_KIT_DOM_TEST_OBJ_PRIVATE_H
+
+#include <glib-object.h>
+#include <webkit/WebKitDOMObject.h>
+#include "TestObj.h"
+namespace WebKit {
+    WebKitDOMTestObj *
+    wrapTestObj(WebCore::TestObj *coreObject);
+
+    WebCore::TestObj *
+    core(WebKitDOMTestObj *request);
+
+    gpointer
+    kit(WebCore::TestObj* node);
+
+} // namespace WebKit
+
+#endif /* WEB_KIT_DOM_TEST_OBJ_PRIVATE_H */
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
new file mode 100644 (file)
index 0000000..8be807b
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import <WebCore/DOMObject.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+@class DOMTestObj;
+@class NSString;
+
+@interface DOMTestObj : DOMObject
+- (int)readOnlyIntAttr;
+- (NSString *)readOnlyStringAttr;
+- (DOMTestObj *)readOnlyTestObjAttr;
+- (int)intAttr;
+- (void)setIntAttr:(int)newIntAttr;
+- (NSString *)stringAttr;
+- (void)setStringAttr:(NSString *)newStringAttr;
+- (DOMTestObj *)testObjAttr;
+- (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr;
+- (int)attrWithException;
+- (void)setAttrWithException:(int)newAttrWithException;
+- (int)attrWithSetterException;
+- (void)setAttrWithSetterException:(int)newAttrWithSetterException;
+- (int)attrWithGetterException;
+- (void)setAttrWithGetterException:(int)newAttrWithGetterException;
+- (int)customAttr;
+- (void)setCustomAttr:(int)newCustomAttr;
+- (void)voidMethod;
+- (void)voidMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
+- (int)intMethod;
+- (int)intMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
+- (DOMTestObj *)objMethod;
+- (DOMTestObj *)objMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
+- (void)methodWithException;
+- (void)customMethod;
+- (void)customMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
+- (void)methodWithOptionalArg:(int)opt;
+- (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt;
+- (void)methodWithNonOptionalArgAndTwoOptionalArgs:(int)nonOpt opt1:(int)opt1 opt2:(int)opt2;
+@end
+
+#endif
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
new file mode 100644 (file)
index 0000000..57a9ffa
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "config.h"
+#import "DOMInternal.h"
+
+#import "DOMTestObj.h"
+
+#import "DOMBlobInternal.h"
+#import "DOMCSSRuleInternal.h"
+#import "DOMCSSValueInternal.h"
+#import "DOMEventInternal.h"
+#import "DOMNodeInternal.h"
+#import "DOMStyleSheetInternal.h"
+#import "DOMTestObjInternal.h"
+#import "ExceptionHandlers.h"
+#import "KURL.h"
+#import "TestObj.h"
+#import "ThreadCheck.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestObj*>(_internal)
+
+@implementation DOMTestObj
+
+- (void)dealloc
+{
+    if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestObj class], self))
+        return;
+
+    if (_internal)
+        IMPL->deref();
+    [super dealloc];
+}
+
+- (void)finalize
+{
+    if (_internal)
+        IMPL->deref();
+    [super finalize];
+}
+
+- (int)readOnlyIntAttr
+{
+    return IMPL->readOnlyIntAttr();
+}
+
+- (NSString *)readOnlyStringAttr
+{
+    return IMPL->readOnlyStringAttr();
+}
+
+- (DOMTestObj *)readOnlyTestObjAttr
+{
+    return kit(WTF::getPtr(IMPL->readOnlyTestObjAttr()));
+}
+
+- (int)intAttr
+{
+    return IMPL->intAttr();
+}
+
+- (void)setIntAttr:(int)newIntAttr
+{
+    IMPL->setIntAttr(newIntAttr);
+}
+
+- (NSString *)stringAttr
+{
+    return IMPL->stringAttr();
+}
+
+- (void)setStringAttr:(NSString *)newStringAttr
+{
+    IMPL->setStringAttr(newStringAttr);
+}
+
+- (DOMTestObj *)testObjAttr
+{
+    return kit(WTF::getPtr(IMPL->testObjAttr()));
+}
+
+- (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr
+{
+    ASSERT(newTestObjAttr);
+
+    IMPL->setTestObjAttr(core(newTestObjAttr));
+}
+
+- (int)attrWithException
+{
+    return IMPL->attrWithException();
+}
+
+- (void)setAttrWithException:(int)newAttrWithException
+{
+    IMPL->setAttrWithException(newAttrWithException);
+}
+
+- (int)attrWithSetterException
+{
+    return IMPL->attrWithSetterException();
+}
+
+- (void)setAttrWithSetterException:(int)newAttrWithSetterException
+{
+    IMPL->setAttrWithSetterException(newAttrWithSetterException);
+}
+
+- (int)attrWithGetterException
+{
+    return IMPL->attrWithGetterException();
+}
+
+- (void)setAttrWithGetterException:(int)newAttrWithGetterException
+{
+    IMPL->setAttrWithGetterException(newAttrWithGetterException);
+}
+
+- (int)customAttr
+{
+    return IMPL->customAttr();
+}
+
+- (void)setCustomAttr:(int)newCustomAttr
+{
+    IMPL->setCustomAttr(newCustomAttr);
+}
+
+- (void)voidMethod
+{
+    IMPL->voidMethod();
+}
+
+- (void)voidMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
+{
+    IMPL->voidMethodWithArgs(intArg, strArg, core(objArg));
+}
+
+- (int)intMethod
+{
+    return IMPL->intMethod();
+}
+
+- (int)intMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
+{
+    return IMPL->intMethodWithArgs(intArg, strArg, core(objArg));
+}
+
+- (DOMTestObj *)objMethod
+{
+    return kit(WTF::getPtr(IMPL->objMethod()));
+}
+
+- (DOMTestObj *)objMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
+{
+    return kit(WTF::getPtr(IMPL->objMethodWithArgs(intArg, strArg, core(objArg))));
+}
+
+- (void)methodWithException
+{
+    WebCore::ExceptionCode ec = 0;
+    IMPL->methodWithException(ec);
+    WebCore::raiseOnDOMError(ec);
+}
+
+- (void)customMethod
+{
+    IMPL->customMethod();
+}
+
+- (void)customMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
+{
+    IMPL->customMethodWithArgs(intArg, strArg, core(objArg));
+}
+
+- (void)methodWithOptionalArg:(int)opt
+{
+    IMPL->methodWithOptionalArg(opt);
+}
+
+- (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt
+{
+    IMPL->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
+}
+
+- (void)methodWithNonOptionalArgAndTwoOptionalArgs:(int)nonOpt opt1:(int)opt1 opt2:(int)opt2
+{
+    IMPL->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
+}
+
+@end
+
+WebCore::TestObj* core(DOMTestObj *wrapper)
+{
+    return wrapper ? reinterpret_cast<WebCore::TestObj*>(wrapper->_internal) : 0;
+}
+
+DOMTestObj *kit(WebCore::TestObj* value)
+{
+    { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); };
+    if (!value)
+        return nil;
+    if (DOMTestObj *wrapper = getDOMWrapper(value))
+        return [[wrapper retain] autorelease];
+    DOMTestObj *wrapper = [[DOMTestObj alloc] _init];
+    wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+    value->ref();
+    addDOMWrapper(wrapper, value);
+    return [wrapper autorelease];
+}
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObjInternal.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObjInternal.h
new file mode 100644 (file)
index 0000000..c24ea84
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import <WebCore/DOMTestObj.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+namespace WebCore {
+    class TestObj;
+}
+
+WebCore::TestObj* core(DOMTestObj *);
+DOMTestObj *kit(WebCore::TestObj*);
+
+#endif
index b0124a9..325225a 100644 (file)
@@ -2,6 +2,15 @@
 
         Reviewed by Eric Seidel.
 
+        Add ObjC and GObject to run-bindings-test
+        https://bugs.webkit.org/show_bug.cgi?id=38168
+
+        * Scripts/run-bindings-tests:
+
+2010-04-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
         Add testing infrastructure for JSC bindings generator
         https://bugs.webkit.org/show_bug.cgi?id=38167
 
index f8d9783..ae174cf 100755 (executable)
@@ -114,7 +114,8 @@ def main(argv):
     generators = [
         'JS',
         'V8',
-        # FIXME: Add ObjC
+        'ObjC',
+        'GObject',
     ]
 
     for generator in generators: