| 1 | /* |
| 2 | * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 | * Copyright (C) 2007 Eric Seidel <[email protected]> |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 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. |
| 13 | * |
| 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. |
| 25 | */ |
| 26 | |
| 27 | #ifndef JSCallbackObject_h |
| 28 | #define JSCallbackObject_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObject.h:28:9`! |
| 29 | |
| 30 | #include "JSObjectRef.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSObjectRef.h`/ |
| 31 | #include "JSValueRef.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSValueRef.h`/ |
| 32 | #include "JSObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h`/ |
| 33 | |
| 34 | namespace JSCcxx . . $ QTJSC/ { |
| 35 | |
| 36 | template <class Base> |
| 37 | class JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject# : public Base { |
| 38 | public: |
| 39 | JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#`JSCallbackObject<Base>`(499843c09a37f53c).(ExecStatecxx . . $ QTJSC/ExecState#*, NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#>, JSClassRefcxx . . $ JSClassRef#, void* data); |
| 40 | JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#`JSCallbackObject<Base>`(159998762f31489b).(JSClassRefcxx . . $ JSClassRef#); |
| 41 | virtual ~cxx . . $ QTJSC/JSCallbackObject#`~JSCallbackObject<Base>`(49f6e7a06ebc5aa8).JSCallbackObject(); |
| 42 | |
| 43 | void setPrivatecxx . . $ QTJSC/JSCallbackObject#setPrivate(5d22bdacc48458e8).(void* data); |
| 44 | void* getPrivatecxx . . $ QTJSC/JSCallbackObject#getPrivate(50c7df7de5344ebb).(); |
| 45 | |
| 46 | static const ClassInfocxx . . $ QTJSC/ClassInfo# infocxx . . $ QTJSC/JSCallbackObject#info.; |
| 47 | |
| 48 | JSClassRefcxx . . $ JSClassRef# classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).() const { return m_callbackObjectDatacxx . . $ QTJSC/JSCallbackObject#m_callbackObjectData.->jsClass; } |
| 49 | bool inheritscxx . . $ QTJSC/JSCallbackObject#inherits(e8c3c8616db7478f).(JSClassRefcxx . . $ JSClassRef#) const; |
| 50 | |
| 51 | static PassRefPtrcxx . . $ PassRefPtr#<Structurecxx . . $ QTJSC/Structure#> createStructurecxx . . $ QTJSC/JSCallbackObject#createStructure(da75fbe5e97e240f).(JSValuecxx . . $ QTJSC/JSValue# proto) |
| 52 | { |
| 53 | return Structure::create(proto, TypeInfocxx . . $ QTJSC/TypeInfo#TypeInfo(85e540a0e5560fef).(ObjectTypecxx . . $ QTJSC/ObjectType., StructureFlagscxx . . $ QTJSC/JSCallbackObject#StructureFlags.)); |
| 54 | } |
| 55 | |
| 56 | protected: |
| 57 | static const unsigned StructureFlagscxx . . $ QTJSC/JSCallbackObject#StructureFlags. = OverridesGetOwnPropertySlotcxx . . $ QTJSC/OverridesGetOwnPropertySlot. | ImplementsHasInstancecxx . . $ QTJSC/ImplementsHasInstance. | OverridesHasInstancecxx . . $ QTJSC/OverridesHasInstance. | OverridesMarkChildrencxx . . $ QTJSC/OverridesMarkChildren. | OverridesGetPropertyNamescxx . . $ QTJSC/OverridesGetPropertyNames. |cxx . . $ `operator|`(68626a7e09ca3b35). Base::StructureFlags; |
| 58 | |
| 59 | private: |
| 60 | virtual UStringcxx . . $ QTJSC/UString# classNamecxx . . $ QTJSC/JSCallbackObject#className(ba9ec689f7dd9231).() const; |
| 61 | |
| 62 | virtual bool getOwnPropertySlotcxx . . $ QTJSC/JSCallbackObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 63 | virtual bool getOwnPropertySlotcxx . . $ QTJSC/JSCallbackObject#getOwnPropertySlot(d57d1c8d4b24d235).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned, PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 64 | virtual bool getOwnPropertyDescriptorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyDescriptor(dce4ef7012294c32).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, PropertyDescriptorcxx . . $ QTJSC/PropertyDescriptor#&); |
| 65 | |
| 66 | virtual void putcxx . . $ QTJSC/JSCallbackObject#put(dfb3133dafbe9ff4).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, JSValuecxx . . $ QTJSC/JSValue#, PutPropertySlotcxx . . $ QTJSC/PutPropertySlot#&); |
| 67 | |
| 68 | virtual bool deletePropertycxx . . $ QTJSC/JSCallbackObject#deleteProperty(13154ef9bddc9416).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&); |
| 69 | virtual bool deletePropertycxx . . $ QTJSC/JSCallbackObject#deleteProperty(2f8cbeb04562a47b).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned); |
| 70 | |
| 71 | virtual bool hasInstancecxx . . $ QTJSC/JSCallbackObject#hasInstance(658e1865c47113e6).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# value, JSValuecxx . . $ QTJSC/JSValue# proto); |
| 72 | |
| 73 | virtual void getOwnPropertyNamescxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).(ExecStatecxx . . $ QTJSC/ExecState#*, PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#&, EnumerationModecxx . . $ QTJSC/EnumerationMode# mode = ExcludeDontEnumPropertiescxx . . $ QTJSC/ExcludeDontEnumProperties.); |
| 74 | |
| 75 | virtual double toNumbercxx . . $ QTJSC/JSCallbackObject#toNumber(1fd034e372fd1279).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 76 | virtual UStringcxx . . $ QTJSC/UString# toStringcxx . . $ QTJSC/JSCallbackObject#toString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 77 | |
| 78 | virtual ConstructTypecxx . . $ QTJSC/ConstructType# getConstructDatacxx . . $ QTJSC/JSCallbackObject#getConstructData(80014d68d6143eea).(ConstructDatacxx . . $ QTJSC/ConstructData#&); |
| 79 | virtual CallTypecxx . . $ QTJSC/CallType# getCallDatacxx . . $ QTJSC/JSCallbackObject#getCallData(9482040cf952d29d).(CallDatacxx . . $ QTJSC/CallData#&); |
| 80 | virtual const ClassInfocxx . . $ QTJSC/ClassInfo#* classInfocxx . . $ QTJSC/JSCallbackObject#classInfo(f90fb4cda7a7c2e2).() const { return &infocxx . . $ QTJSC/JSCallbackObject#info.; } |
| 81 | |
| 82 | void initcxx . . $ QTJSC/JSCallbackObject#init(d2cb180e190a9680).(ExecStatecxx . . $ QTJSC/ExecState#*); |
| 83 | |
| 84 | static JSCallbackObject* asCallbackObjectcxx . . $ QTJSC/JSCallbackObject#asCallbackObject(90e037006a47f0a).(JSValuecxx . . $ QTJSC/JSValue#); |
| 85 | |
| 86 | static JSValuecxx . . $ QTJSC/JSValue# JSC_HOST_CALLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:1060:9`! callcxx . . $ QTJSC/JSCallbackObject#call(cac2aec6ecb9506b).(ExecStatecxx . . $ QTJSC/ExecState#*, JSObjectcxx . . $ QTJSC/JSObject#* functionObject, JSValuecxx . . $ QTJSC/JSValue# thisValue, const ArgListcxx . . $ QTJSC/ArgList#&); |
| 87 | static JSObjectcxx . . $ QTJSC/JSObject#* constructcxx . . $ QTJSC/JSCallbackObject#construct(9a9a00b054b701a4).(ExecStatecxx . . $ QTJSC/ExecState#*, JSObjectcxx . . $ QTJSC/JSObject#* constructor, const ArgListcxx . . $ QTJSC/ArgList#&); |
| 88 | |
| 89 | static JSValuecxx . . $ QTJSC/JSValue# staticValueGettercxx . . $ QTJSC/JSCallbackObject#staticValueGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 90 | static JSValuecxx . . $ QTJSC/JSValue# staticFunctionGettercxx . . $ QTJSC/JSCallbackObject#staticFunctionGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 91 | static JSValuecxx . . $ QTJSC/JSValue# callbackGettercxx . . $ QTJSC/JSCallbackObject#callbackGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 92 | |
| 93 | struct JSCallbackObjectDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData# { |
| 94 | JSCallbackObjectDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#JSCallbackObjectData(9461ff65b991103).(void* privateData, JSClassRefcxx . . $ JSClassRef# jsClass) |
| 95 | : privateDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#privateData.(privateData) |
| 96 | , jsClasscxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#jsClass.(jsClass) |
| 97 | { |
| 98 | JSClassRetain(jsClass); |
| 99 | } |
| 100 | |
| 101 | ~cxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#`~JSCallbackObjectData`(49f6e7a06ebc5aa8).JSCallbackObjectDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#() |
| 102 | { |
| 103 | JSClassRelease(jsClasscxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#jsClass.); |
| 104 | } |
| 105 | |
| 106 | void* privateDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#privateData.; |
| 107 | JSClassRefcxx . . $ JSClassRef# jsClasscxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#jsClass.; |
| 108 | }; |
| 109 | |
| 110 | OwnPtrcxx . . $ OwnPtr#<JSCallbackObjectDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#> m_callbackObjectDatacxx . . $ QTJSC/JSCallbackObject#m_callbackObjectData.; |
| 111 | }; |
| 112 | |
| 113 | } // namespace JSC |
| 114 | |
| 115 | // include the actual template class implementation |
| 116 | #include "JSCallbackObjectFunctions.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObjectFunctions.h`/ |
| 117 | |
| 118 | #endif // JSCallbackObject_h |