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 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #import "DOMInternal.h"
30 #import "DOMTestObj.h"
32 #import "DOMBlobInternal.h"
33 #import "DOMCSSRuleInternal.h"
34 #import "DOMCSSValueInternal.h"
35 #import "DOMEventInternal.h"
36 #import "DOMNodeInternal.h"
37 #import "DOMStyleSheetInternal.h"
38 #import "DOMTestObjInternal.h"
39 #import "DOMlogInternal.h"
40 #import "EventListener.h"
41 #import "ExceptionHandlers.h"
43 #import "ObjCEventListener.h"
44 #import "SerializedScriptValue.h"
46 #import "ThreadCheck.h"
47 #import "WebCoreObjCExtras.h"
48 #import "WebScriptObjectPrivate.h"
50 #import <wtf/GetPtr.h>
52 #define IMPL reinterpret_cast<WebCore::TestObj*>(_internal)
54 @implementation DOMTestObj
58 if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestObj class], self))
73 - (int)readOnlyIntAttr
75 return IMPL->readOnlyIntAttr();
78 - (NSString *)readOnlyStringAttr
80 return IMPL->readOnlyStringAttr();
83 - (DOMTestObj *)readOnlyTestObjAttr
85 return kit(WTF::getPtr(IMPL->readOnlyTestObjAttr()));
90 return IMPL->intAttr();
93 - (void)setIntAttr:(int)newIntAttr
95 IMPL->setIntAttr(newIntAttr);
98 - (long long)longLongAttr
100 return IMPL->longLongAttr();
103 - (void)setLongLongAttr:(long long)newLongLongAttr
105 IMPL->setLongLongAttr(newLongLongAttr);
108 - (unsigned long long)unsignedLongLongAttr
110 return IMPL->unsignedLongLongAttr();
113 - (void)setUnsignedLongLongAttr:(unsigned long long)newUnsignedLongLongAttr
115 IMPL->setUnsignedLongLongAttr(newUnsignedLongLongAttr);
118 - (NSString *)stringAttr
120 return IMPL->stringAttr();
123 - (void)setStringAttr:(NSString *)newStringAttr
125 IMPL->setStringAttr(newStringAttr);
128 - (DOMTestObj *)testObjAttr
130 return kit(WTF::getPtr(IMPL->testObjAttr()));
133 - (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr
135 ASSERT(newTestObjAttr);
137 IMPL->setTestObjAttr(core(newTestObjAttr));
140 - (int)attrWithException
142 return IMPL->attrWithException();
145 - (void)setAttrWithException:(int)newAttrWithException
147 IMPL->setAttrWithException(newAttrWithException);
150 - (int)attrWithSetterException
152 return IMPL->attrWithSetterException();
155 - (void)setAttrWithSetterException:(int)newAttrWithSetterException
157 IMPL->setAttrWithSetterException(newAttrWithSetterException);
160 - (int)attrWithGetterException
162 return IMPL->attrWithGetterException();
165 - (void)setAttrWithGetterException:(int)newAttrWithGetterException
167 IMPL->setAttrWithGetterException(newAttrWithGetterException);
172 return IMPL->customAttr();
175 - (void)setCustomAttr:(int)newCustomAttr
177 IMPL->setCustomAttr(newCustomAttr);
180 - (NSString *)scriptStringAttr
182 return IMPL->scriptStringAttr();
190 - (void)voidMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
192 IMPL->voidMethodWithArgs(intArg, strArg, core(objArg));
197 return IMPL->intMethod();
200 - (int)intMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
202 return IMPL->intMethodWithArgs(intArg, strArg, core(objArg));
205 - (DOMTestObj *)objMethod
207 return kit(WTF::getPtr(IMPL->objMethod()));
210 - (DOMTestObj *)objMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
212 return kit(WTF::getPtr(IMPL->objMethodWithArgs(intArg, strArg, core(objArg))));
215 - (void)serializedValue:(NSString *)serializedArg
217 IMPL->serializedValue(WebCore::SerializedScriptValue::create(WebCore::String(serializedArg)));
220 - (void)methodWithException
222 WebCore::ExceptionCode ec = 0;
223 IMPL->methodWithException(ec);
224 WebCore::raiseOnDOMError(ec);
229 IMPL->customMethod();
232 - (void)customMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
234 IMPL->customMethodWithArgs(intArg, strArg, core(objArg));
237 - (void)customArgsAndException:(DOMlog *)intArg
239 WebCore::ExceptionCode ec = 0;
240 IMPL->customArgsAndException(core(intArg), ec);
241 WebCore::raiseOnDOMError(ec);
244 - (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
246 RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
247 IMPL->addEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
250 - (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
252 RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
253 IMPL->removeEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
256 - (void)withDynamicFrame
258 IMPL->withDynamicFrame();
261 - (void)withDynamicFrameAndArg:(int)intArg
263 IMPL->withDynamicFrameAndArg(intArg);
266 - (void)withDynamicFrameAndOptionalArg:(int)intArg optionalArg:(int)optionalArg
268 IMPL->withDynamicFrameAndOptionalArg(intArg, optionalArg);
271 - (void)withDynamicFrameAndUserGesture:(int)intArg
273 IMPL->withDynamicFrameAndUserGesture(intArg);
276 - (void)withDynamicFrameAndUserGestureASAD:(int)intArg optionalArg:(int)optionalArg
278 IMPL->withDynamicFrameAndUserGestureASAD(intArg, optionalArg);
281 - (void)withScriptStateVoid
283 IMPL->withScriptStateVoid();
286 - (DOMTestObj *)withScriptStateObj
288 return kit(WTF::getPtr(IMPL->withScriptStateObj()));
291 - (void)withScriptStateVoidException
293 WebCore::ExceptionCode ec = 0;
294 IMPL->withScriptStateVoidException(ec);
295 WebCore::raiseOnDOMError(ec);
298 - (DOMTestObj *)withScriptStateObjException
300 WebCore::ExceptionCode ec = 0;
301 DOMTestObj *result = kit(WTF::getPtr(IMPL->withScriptStateObjException(ec)));
302 WebCore::raiseOnDOMError(ec);
306 - (void)methodWithOptionalArg:(int)opt
308 IMPL->methodWithOptionalArg(opt);
311 - (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt
313 IMPL->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
316 - (void)methodWithNonOptionalArgAndTwoOptionalArgs:(int)nonOpt opt1:(int)opt1 opt2:(int)opt2
318 IMPL->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
323 WebCore::TestObj* core(DOMTestObj *wrapper)
325 return wrapper ? reinterpret_cast<WebCore::TestObj*>(wrapper->_internal) : 0;
328 DOMTestObj *kit(WebCore::TestObj* value)
330 { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); };
333 if (DOMTestObj *wrapper = getDOMWrapper(value))
334 return [[wrapper retain] autorelease];
335 DOMTestObj *wrapper = [[DOMTestObj alloc] _init];
336 wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
338 addDOMWrapper(wrapper, value);
339 return [wrapper autorelease];