diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp | 382 |
1 files changed, 0 insertions, 382 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp deleted file mode 100644 index 15d4c94..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp +++ /dev/null @@ -1,382 +0,0 @@ -/** - * @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 <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Attr.h" -#include "V8Element.h" -#include "V8Node.h" -#include "V8NodeList.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Element::Tmpl; - -v8::Handle<v8::Value> V8Element::tagNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getTagName().c_str()); -} - -v8::Handle<v8::Value> V8Element::getAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - std::string retVal = privData->nativeObj->getAttribute(*localName); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling getAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localName(args[0]); - v8::String::AsciiValue localValue(args[1]); - - privData->nativeObj->setAttribute(*localName, *localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::removeAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - privData->nativeObj->removeAttribute(*localName); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling removeAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getAttributeNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->getAttributeNode(*localName)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getAttributeNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Attr::hasInstance(args[0])) { - Arabica::DOM::Attr<std::string>* localNewAttr = V8DOM::toClassPtr<V8Attr::V8AttrPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->setAttributeNode(*localNewAttr)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling setAttributeNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::removeAttributeNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Attr::hasInstance(args[0])) { - Arabica::DOM::Attr<std::string>* localOldAttr = V8DOM::toClassPtr<V8Attr::V8AttrPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->removeAttributeNode(*localOldAttr)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling removeAttributeNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getElementsByTagNameCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagName(*localName)); - v8::Handle<v8::Function> retCtor = V8NodeList::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8NodeList::V8NodeListPrivate* retPrivData = new V8NodeList::V8NodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8NodeList::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getElementsByTagName"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - std::string retVal = privData->nativeObj->getAttributeNS(*localNamespaceURI, *localLocalName); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling getAttributeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsString() && - args[1]->IsString() && - args[2]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localQualifiedName(args[1]); - v8::String::AsciiValue localValue(args[2]); - - privData->nativeObj->setAttributeNS(*localNamespaceURI, *localQualifiedName, *localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setAttributeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::removeAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - privData->nativeObj->removeAttributeNS(*localNamespaceURI, *localLocalName); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling removeAttributeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getAttributeNodeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->getAttributeNodeNS(*localNamespaceURI, *localLocalName)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getAttributeNodeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeNodeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Attr::hasInstance(args[0])) { - Arabica::DOM::Attr<std::string>* localNewAttr = V8DOM::toClassPtr<V8Attr::V8AttrPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->setAttributeNodeNS(*localNewAttr)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling setAttributeNodeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getElementsByTagNameNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagNameNS(*localNamespaceURI, *localLocalName)); - v8::Handle<v8::Function> retCtor = V8NodeList::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8NodeList::V8NodeListPrivate* retPrivData = new V8NodeList::V8NodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8NodeList::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getElementsByTagNameNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::hasAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - bool retVal = privData->nativeObj->hasAttribute(*localName); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling hasAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::hasAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - bool retVal = privData->nativeObj->hasAttributeNS(*localNamespaceURI, *localLocalName); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling hasAttributeNS"); - return v8::Undefined(); -} -bool V8Element::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} |