1 /* 2 This file is part of the WebKit open source project. 3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! 4 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. 9 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. 14 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. 19 */ 20 21 #ifndef JSTextMetrics_h 22 #define JSTextMetrics_h 23 24 #include "JSDOMBinding.h" 25 #include <runtime/JSGlobalObject.h> 26 #include <runtime/JSObjectWithGlobalObject.h> 27 #include <runtime/ObjectPrototype.h> 28 29 namespace WebCore { 30 31 class TextMetrics; 32 33 class JSTextMetrics : public JSDOMWrapper { 34 typedef JSDOMWrapper Base; 35 public: 36 JSTextMetrics(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TextMetrics>); 37 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 38 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 39 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 40 static const JSC::ClassInfo s_info; 41 createStructure(JSC::JSGlobalData & globalData,JSC::JSValue prototype)42 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) 43 { 44 return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 45 } 46 47 static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); impl()48 TextMetrics* impl() const { return m_impl.get(); } 49 50 private: 51 RefPtr<TextMetrics> m_impl; 52 protected: 53 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; 54 }; 55 56 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TextMetrics*); 57 TextMetrics* toTextMetrics(JSC::JSValue); 58 59 class JSTextMetricsPrototype : public JSC::JSObjectWithGlobalObject { 60 typedef JSC::JSObjectWithGlobalObject Base; 61 public: 62 static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); 63 static const JSC::ClassInfo s_info; createStructure(JSC::JSGlobalData & globalData,JSC::JSValue prototype)64 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) 65 { 66 return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 67 } JSTextMetricsPrototype(JSC::JSGlobalData & globalData,JSC::JSGlobalObject * globalObject,JSC::Structure * structure)68 JSTextMetricsPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) : JSC::JSObjectWithGlobalObject(globalData, globalObject, structure) { } 69 protected: 70 static const unsigned StructureFlags = Base::StructureFlags; 71 }; 72 73 // Attributes 74 75 JSC::JSValue jsTextMetricsWidth(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); 76 JSC::JSValue jsTextMetricsConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); 77 78 } // namespace WebCore 79 80 #endif 81