2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #include <glib-object.h>
24 #if ENABLE(Condition1) || ENABLE(Condition2)
26 #include <wtf/GetPtr.h>
27 #include <wtf/RefPtr.h>
28 #include "DOMObjectCache.h"
29 #include "ExceptionCode.h"
30 #include "JSMainThreadExecState.h"
31 #include "SerializedScriptValue.h"
32 #include "TestSerializedScriptValueInterface.h"
33 #include "WebKitDOMBinding.h"
34 #include "gobject/ConvertToUTF8String.h"
35 #include "webkit/WebKitDOMSerializedScriptValue.h"
36 #include "webkit/WebKitDOMSerializedScriptValuePrivate.h"
37 #include "webkit/WebKitDOMTestSerializedScriptValueInterface.h"
38 #include "webkit/WebKitDOMTestSerializedScriptValueInterfacePrivate.h"
39 #include "webkitdefines.h"
40 #include "webkitglobalsprivate.h"
41 #include "webkitmarshal.h"
45 WebKitDOMTestSerializedScriptValueInterface* kit(WebCore::TestSerializedScriptValueInterface* obj)
47 g_return_val_if_fail(obj, 0);
49 if (gpointer ret = DOMObjectCache::get(obj))
50 return static_cast<WebKitDOMTestSerializedScriptValueInterface*>(ret);
52 return static_cast<WebKitDOMTestSerializedScriptValueInterface*>(DOMObjectCache::put(obj, WebKit::wrapTestSerializedScriptValueInterface(obj)));
55 } // namespace WebKit //
57 WebKitDOMSerializedScriptValue*
58 webkit_dom_test_serialized_script_value_interface_get_value(WebKitDOMTestSerializedScriptValueInterface* self)
60 g_return_val_if_fail(self, 0);
61 WebCore::JSMainThreadNullState state;
62 WebCore::TestSerializedScriptValueInterface * item = WebKit::core(self);
63 PassRefPtr<WebCore::SerializedScriptValue> g_res = WTF::getPtr(item->value());
64 WebKitDOMSerializedScriptValue* res = WebKit::kit(g_res.get());
69 G_DEFINE_TYPE(WebKitDOMTestSerializedScriptValueInterface, webkit_dom_test_serialized_script_value_interface, WEBKIT_TYPE_DOM_OBJECT)
73 WebCore::TestSerializedScriptValueInterface* core(WebKitDOMTestSerializedScriptValueInterface* request)
75 g_return_val_if_fail(request, 0);
77 WebCore::TestSerializedScriptValueInterface* coreObject = static_cast<WebCore::TestSerializedScriptValueInterface*>(WEBKIT_DOM_OBJECT(request)->coreObject);
78 g_return_val_if_fail(coreObject, 0);
90 static void webkit_dom_test_serialized_script_value_interface_finalize(GObject* object)
92 WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
94 if (dom_object->coreObject) {
95 WebCore::TestSerializedScriptValueInterface* coreObject = static_cast<WebCore::TestSerializedScriptValueInterface *>(dom_object->coreObject);
97 WebKit::DOMObjectCache::forget(coreObject);
100 dom_object->coreObject = NULL;
103 G_OBJECT_CLASS(webkit_dom_test_serialized_script_value_interface_parent_class)->finalize(object);
106 static void webkit_dom_test_serialized_script_value_interface_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
108 WebCore::JSMainThreadNullState state;
111 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
117 static void webkit_dom_test_serialized_script_value_interface_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
119 WebCore::JSMainThreadNullState state;
120 WebKitDOMTestSerializedScriptValueInterface* self = WEBKIT_DOM_TEST_SERIALIZED_SCRIPT_VALUE_INTERFACE(object);
121 WebCore::TestSerializedScriptValueInterface* coreSelf = WebKit::core(self);
125 RefPtr<WebCore::SerializedScriptValue> ptr = coreSelf->value();
126 g_value_set_object(value, WebKit::kit(ptr.get()));
130 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
136 static void webkit_dom_test_serialized_script_value_interface_constructed(GObject* object)
139 if (G_OBJECT_CLASS(webkit_dom_test_serialized_script_value_interface_parent_class)->constructed)
140 G_OBJECT_CLASS(webkit_dom_test_serialized_script_value_interface_parent_class)->constructed(object);
143 static void webkit_dom_test_serialized_script_value_interface_class_init(WebKitDOMTestSerializedScriptValueInterfaceClass* requestClass)
145 GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
146 gobjectClass->finalize = webkit_dom_test_serialized_script_value_interface_finalize;
147 gobjectClass->set_property = webkit_dom_test_serialized_script_value_interface_set_property;
148 gobjectClass->get_property = webkit_dom_test_serialized_script_value_interface_get_property;
149 gobjectClass->constructed = webkit_dom_test_serialized_script_value_interface_constructed;
151 g_object_class_install_property(gobjectClass,
153 g_param_spec_object("value", /* name */
154 "test_serialized_script_value_interface_value", /* short description */
155 "read-only WebKitDOMSerializedScriptValue* TestSerializedScriptValueInterface.value", /* longer - could do with some extra doc stuff here */
156 WEBKIT_TYPE_DOM_SERIALIZED_SCRIPT_VALUE, /* gobject type */
157 WEBKIT_PARAM_READABLE));
162 static void webkit_dom_test_serialized_script_value_interface_init(WebKitDOMTestSerializedScriptValueInterface* request)
167 WebKitDOMTestSerializedScriptValueInterface* wrapTestSerializedScriptValueInterface(WebCore::TestSerializedScriptValueInterface* coreObject)
169 g_return_val_if_fail(coreObject, 0);
171 /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
172 * in a C-allocated GObject structure. See the finalize() code for the
177 return WEBKIT_DOM_TEST_SERIALIZED_SCRIPT_VALUE_INTERFACE(g_object_new(WEBKIT_TYPE_DOM_TEST_SERIALIZED_SCRIPT_VALUE_INTERFACE,
178 "core-object", coreObject, NULL));
180 } // namespace WebKit
181 #endif /* ENABLE(Condition1) || ENABLE(Condition2) */