/** * @file * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! * @copyright Simplified BSD * * @cond * This program is free software: you can redistribute it and/or modify * it under the terms of the FreeBSD license as published by the FreeBSD * project. * * This program 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. * * You should have received a copy of the FreeBSD license along with this * program. If not, see . * @endcond */ #include "JSCDocumentType.h" #include "JSCNamedNodeMap.h" #include "JSCNode.h" namespace Arabica { namespace DOM { JSClassRef JSCDocumentType::Tmpl; JSStaticValue JSCDocumentType::staticValues[] = { { "name", nameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "entities", entitiesAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "notations", notationsAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "publicId", publicIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "systemId", systemIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "internalSubset", internalSubsetAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { 0, 0, 0, 0 } }; JSStaticFunction JSCDocumentType::staticFunctions[] = { { 0, 0, 0 } }; JSValueRef JSCDocumentType::nameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getName().c_str()); JSValueRef retVal = JSValueMakeString(ctx, stringRef); JSStringRelease(stringRef); return retVal; } JSValueRef JSCDocumentType::entitiesAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); Arabica::DOM::NamedNodeMap* arabicaRet = new Arabica::DOM::NamedNodeMap(privData->nativeObj->getEntities()); JSClassRef arbaicaRetClass = JSCNamedNodeMap::getTmpl(); struct JSCNamedNodeMap::JSCNamedNodeMapPrivate* retPrivData = new JSCNamedNodeMap::JSCNamedNodeMapPrivate(); retPrivData->dom = privData->dom; retPrivData->nativeObj = arabicaRet; JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); return arbaicaRetObj; } JSValueRef JSCDocumentType::notationsAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); Arabica::DOM::NamedNodeMap* arabicaRet = new Arabica::DOM::NamedNodeMap(privData->nativeObj->getNotations()); JSClassRef arbaicaRetClass = JSCNamedNodeMap::getTmpl(); struct JSCNamedNodeMap::JSCNamedNodeMapPrivate* retPrivData = new JSCNamedNodeMap::JSCNamedNodeMapPrivate(); retPrivData->dom = privData->dom; retPrivData->nativeObj = arabicaRet; JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); return arbaicaRetObj; } JSValueRef JSCDocumentType::publicIdAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getPublicId().c_str()); JSValueRef retVal = JSValueMakeString(ctx, stringRef); JSStringRelease(stringRef); return retVal; } JSValueRef JSCDocumentType::systemIdAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getSystemId().c_str()); JSValueRef retVal = JSValueMakeString(ctx, stringRef); JSStringRelease(stringRef); return retVal; } JSValueRef JSCDocumentType::internalSubsetAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getInternalSubset().c_str()); JSValueRef retVal = JSValueMakeString(ctx, stringRef); JSStringRelease(stringRef); return retVal; } } }